On Mon, Aug 07, 2006 at 09:54:20PM +0100, Andrew Talbot wrote:
would like to submit a patch that, for example, changes strchrW() to:
extern inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch ) { WCHAR *ret = NULL; do { if (*str == ch) ret = (WCHAR *)(size_t)str; } while (*str++); return ret; }
why not just have:
extern inline void *__deconst(const void *v) { return (char *)0 + ((const char *)v - (const char *)0)); }
Then the code above could be: extern inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch ) { do { if (*str == ch) return __deconst(str); } while (*str++); return 0; }
David