Hi
in the function above: Could anybody tell me what the red statements are for? They should have absolutely no effect to the program logic.Code:static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; if (nsize == 0) { free(ptr); return NULL; } else return realloc(ptr, nsize); }
The only thing I can think of is that the compiler is used to check something about the condition of the passed arguments.
But why casting a void* to void? I didn't even know that this is legal in C/C++.
Thank you!



LinkBack URL
About LinkBacks



