6 #define ALIGN (sizeof(size_t)-1)
7 #define ONES ((size_t)-1/UCHAR_MAX)
8 #define HIGHS (ONES * (UCHAR_MAX/2+1))
9 #define HASZERO(x) ((x)-ONES & ~(x) & HIGHS)
11 char *strchr(const char *s, int c)
14 if (!c) return (char *)s + strlen(s);
15 for (; ((uintptr_t)s & ALIGN) && *s && *s != c; s++);
19 for (w = (const void *)s; !HASZERO(*w) && !HASZERO(*w^k); w++);
20 for (s = (const void *)w; *s && *s != c; s++);
22 return *s ? (char *)s : 0;