Re: [AD] al_fread16le returns EOF |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Wednesday 03 February 2010 7:21:04 am Elias Pschernig wrote:
> We never need unsigned variants as far as I can see. al_fread16le(&x) seems
> to work without warning when x is unsigned.
I've seen GCC give warnings if the pointer types differ in signedness. I'm not
sure what warning level it's enabled on (perhaps with -Wextra), but I have
seen it.
> 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.
Me too, personally. Letting an error state persist though multiple calls so it
can be checked once after a stream of commands is nicer than checking each one
individually. You just need to make sure EOF isn't set when the pointer simply
reaches the end of the file, but only when an attempt is made to read from
there (C's FILE* works this way, IIRC, though I'm not sure about C++'s
std::ifstream).