From 9ae8d5fc71a4b61ec826d58f03f7b543755fb1d4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 25 Mar 2011 16:34:03 -0400 Subject: fix all implicit conversion between signed/unsigned pointers sadly the C language does not specify any such implicit conversion, so this is not a matter of just fixing warnings (as gcc treats it) but actual errors. i would like to revisit a number of these changes and possibly revise the types used to reduce the number of casts required. --- src/string/strstr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/string/strstr.c') diff --git a/src/string/strstr.c b/src/string/strstr.c index 4d536a73..683cdd01 100644 --- a/src/string/strstr.c +++ b/src/string/strstr.c @@ -109,7 +109,7 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) if (z-h < l) { /* Fast estimate for MIN(l,63) */ size_t grow = l | 63; - const char *z2 = memchr(z, 0, grow); + const unsigned char *z2 = memchr(z, 0, grow); if (z2) { z = z2; if (z-h < l) return 0; @@ -156,11 +156,11 @@ char *strstr(const char *h, const char *n) h = strchr(h, *n); if (!h || !n[1]) return (char *)h; if (!h[1]) return 0; - if (!n[2]) return twobyte_strstr(h, n); + if (!n[2]) return twobyte_strstr((void *)h, (void *)n); if (!h[2]) return 0; - if (!n[3]) return threebyte_strstr(h, n); + if (!n[3]) return threebyte_strstr((void *)h, (void *)n); if (!h[3]) return 0; - if (!n[4]) return fourbyte_strstr(h, n); + if (!n[4]) return fourbyte_strstr((void *)h, (void *)n); - return twoway_strstr(h, n); + return twoway_strstr((void *)h, (void *)n); } -- cgit v1.2.1