On Mon, Aug 20, 2012 at 10:10:39AM +0200, Marc Espie wrote:
> since you have -Werror in your CFLAGS, sndio fails a build with 
> WARNINGS=Yes...
> 
> The following patch fixes things.
> - hex constants are unsigned.

OK, sure

> - prototypes for everything.

Why, aren't forward declaration good enough ?

> - don't shadow libc rindex.
> 

Ok, and I prefer the shorter name you suggest as well :)

But does this mean we start avoiding local variables that shadow
functions? This means that div, pause, time, and many other common
names are to be avoided as well, doesn't it?

> Index: lib/libsndio/sio_aucat.c
> ===================================================================
> RCS file: /cvs/src/lib/libsndio/sio_aucat.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 sio_aucat.c
> --- lib/libsndio/sio_aucat.c  11 Apr 2012 06:05:43 -0000      1.10
> +++ lib/libsndio/sio_aucat.c  20 Aug 2012 08:07:42 -0000
> @@ -380,17 +380,17 @@ sio_aucat_getcap(struct sio_hdl *sh, str
>               return 0;
> -     if (len > hdl->maxwrite)
> +     if (len > (size_t)hdl->maxwrite)
>               len = hdl->maxwrite;
>       n = aucat_wdata(&hdl->aucat, buf, len, hdl->wbpf, &hdl->sio.eof);
>       hdl->maxwrite -= n;

isn't what integer promotion is already supposed to do (convert
hdl->maxwrite, an int, to size_t) ?

-- Alexandre

Reply via email to