cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: s/bool/int

From: Dima Tisnek <dimaqq_at_gmail.com>
Date: Tue, 25 May 2010 23:55:50 +0300

My 2 cents:

1. int's are better than bool's in general, as per typedef argument and
hidden data size argument

2. bool however carries a certain semantic weight, because if something
returns int, whoever reads the code has to figure out what values that int
could have, and there are many options:
1: ok, 0: bad (bool)
-1,-2,1,2: ok, 0: bad (C if semantics)
0: ok, -1,-2,-3: different error codes (system calls)
0: bad, 1,2,3: number of successful operations
-1: bad, 1,2,3: number of successful operations (sscanf)
1,2,3: ok, 0,-1,-2,-3: bad

Regards,
Dima Tisnek

On 25 May 2010 22:35, Kamil Dudka <kdudka_at_redhat.com> wrote:

> On Tuesday 25 of May 2010 06:58:29 Michael Schuster wrote:
> > PS: it's been a very busy two weeks for me, so I've been skimming over
> all
> > but work-related stuff: can you provide a pointer to the issue you're
> > referring to for my better understanding? thx
>
> http://github.com/bagder/curl/commit/606b933
>
> Kamil
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-26