diff options
author | Hartmut Holzgraefe <hholzgra@php.net> | 2010-10-14 21:33:10 +0000 |
---|---|---|
committer | Hartmut Holzgraefe <hholzgra@php.net> | 2010-10-14 21:33:10 +0000 |
commit | aaa2f1c30b3ba3da3e0030804054ee9c70e80bc7 (patch) | |
tree | 384852c9b955d1fea39e52a1a2fcf7cfd57e657f /Zend/zend_operators.h | |
parent | 738be1a0030ae67b19095391e0ee508284a5ab41 (diff) | |
download | php-git-aaa2f1c30b3ba3da3e0030804054ee9c70e80bc7.tar.gz |
marked char pointer arguments as const in lots of
places where strings pointed to are not modified
to prevent compiler warnings about discarded qualifiers ...
Diffstat (limited to 'Zend/zend_operators.h')
-rw-r--r-- | Zend/zend_operators.h | 14 |
1 files changed, 7 insertions, 7 deletions
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; } } |