See a gcc manual on void ptr arithmetic:
http://egcs.cygnus.com/onlinedocs/gcc_4.html#SEC78
> void *memchr(const void *s, int c, size_t n)
> {
> register char *p = (char *) s;
> while(n--)
> if(c == *p++)
> return (void *) (--p);
> return NULL;
> }
Isn't declaring something a 'register char' a really bad idea these
days? Something about taking away a register for the compiler to
optimize with. A smart compiler should also make 'p' completely
disappear...
Jeff
-- My, my, this here Anakin guy Maybe Vader someday later, now he's just a small fry He left his home and kissed his mommy goodbye Saying "Soon I'm gonna be a Jedi"...- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/