Re: [AD] al_fread16le returns EOF

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-02-03, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> 
> We never need unsigned variants as far as I can see. al_fread16le(&x) seems
> to work without warning when x is unsigned.

It does with -Wall.

> and with simply doing it like this:
> 
> int w = al_fread16le(f); if (feof(f)) break;
> int h = al_fread16le(f); if (feof(f)) break;
> 
> Basically, I find the last version the most readable - especially when I'm
> not checking for end-of-file after each read item. So I'd say we should
> simply remove the extra parameter from the 32 bit versions again.

The second parameter is supposed to remind the user to check for
failure.  But most people will simply pass NULL (including all uses in
the image addon), so, okay.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/