cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: s/bool/int

From: Tor Arntsen <tor_at_spacetec.no>
Date: Wed, 26 May 2010 16:36:42 +0200

On Wed, May 26, 2010 at 16:12, Kamil Dudka <kdudka_at_redhat.com> wrote:
> On Wed May 26 2010 15:12:17 Tor Arntsen wrote:
>> Here is a tentative patch. Daniel should obviously chime in, as he was
>> already working on the major bool-replace.
>
> Looks good to me.  I am getting the following bool related warnings:
>
> $ make CC=cgcc 2>&1 | grep bool

> formdata.c:330:12:     int enum bool
> ftp.c:3966:37:     int enum bool

The enum-type detection on MIPSPro doesn't complain about the above,
apparently it feels it's ok to use an enum as part of an addition. I
think those should be fixed though - addtion should be done with
integers, not bool.

> ftp.c:3511:39:     int enum bool
Detected.

> url.c:772:25:     int enum bool
Detected.

> url.c:2466:31:     int enum bool
Detected.

> url.c:4175:33:     int enum bool
Detected.

> curl_fnmatch.c:172:31:     int enum bool
Detected. This is a case where 'bool something_found' is sometimes
assigned TRUE or FALSE, but in line 172 it's assigned '1'.

> ssh.c:2620:20:     int enum bool
> ssh.c:509:12:     int enum bool
My testbuild didn't build with SSH support, so I didn't get those -
but they're straight-forward = 0 assignments, so they would be caught
by MIPSPro if compiled with ssh support.

In addition to those above I also get these:
main.c:2409
main.c:2414
(both are assigment of '1 to bool)

and also a warning for every 'my_setopt' in main.c, as far as I can tell. E.g.

cc-1185 cc: WARNING File = main.c, Line = 4978
  An enumerated type is mixed with another type.

            my_setopt(curl, CURLOPT_TCP_NODELAY, 1);
            ^

There's possibly something we can do about that. For now we could live
with those warnings in some of the builds, I guess.

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