From aaa2f1c30b3ba3da3e0030804054ee9c70e80bc7 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Thu, 14 Oct 2010 21:33:10 +0000 Subject: marked char pointer arguments as const in lots of places where strings pointed to are not modified to prevent compiler warnings about discarded qualifiers ... --- Zend/zend_operators.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Zend/zend_operators.h') diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index eee6e546ac..1506f8c8df 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -167,7 +167,7 @@ check_digits: } } else if (!(digits < SIZEOF_LONG * 2 || (digits == SIZEOF_LONG * 2 && ptr[-digits] <= '7'))) { if (dval) { - local_dval = zend_hex_strtod(str, (char **)&ptr); + local_dval = zend_hex_strtod(str, &ptr); } type = IS_DOUBLE; } @@ -178,7 +178,7 @@ process_double: /* If there's a dval, do the conversion; else continue checking * the digits if we need to check for a full match */ if (dval) { - local_dval = zend_strtod(str, (char **)&ptr); + local_dval = zend_strtod(str, &ptr); } else if (allow_errors != 1 && dp_or_e != -1) { dp_or_e = (*ptr++ == '.') ? 1 : 2; goto check_digits; @@ -256,17 +256,17 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end) return NULL; } -static inline void *zend_memrchr(const void *s, int c, size_t n) +static inline const void *zend_memrchr(const void *s, int c, size_t n) { - register unsigned char *e; + register const unsigned char *e; if (n <= 0) { return NULL; } - for (e = (unsigned char *)s + n - 1; e >= (unsigned char *)s; e--) { - if (*e == (unsigned char)c) { - return (void *)e; + for (e = (const unsigned char *)s + n - 1; e >= (const unsigned char *)s; e--) { + if (*e == (const unsigned char)c) { + return (const void *)e; } } -- cgit v1.2.1