[AD] al_fread16le returns EOF

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


This is about fixing the flaw where al_fread16le, etc., may return
an error code EOF that clashes with a valid value (oops, again!)

It was suggested to change the prototype to:

    bool al_fread16le(ALLEGRO_FILE *f, int32_t *value);

or

    size_t al_fread16le(ALLEGRO_FILE *f, int32_t *value);

We would probably need four variants of each (signedness × endianness).

The current solution is this:

    int32_t al_fread32be(ALLEGRO_FILE *f, bool *ret_success)

Due to implicit conversions we don't need unsigned variants.

Which option would you prefer?

Peter

http://www.allegro.cc/forums/thread/602152




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