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_string.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zend/zend_string.c') diff --git a/Zend/zend_string.c b/Zend/zend_string.c index 99b24f64e9..3aad3b1919 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -29,11 +29,11 @@ # include #endif -ZEND_API char *(*zend_new_interned_string)(char *str, int len, int free_src TSRMLS_DC); +ZEND_API const char *(*zend_new_interned_string)(const char *str, int len, int free_src TSRMLS_DC); ZEND_API void (*zend_interned_strings_snapshot)(TSRMLS_D); ZEND_API void (*zend_interned_strings_restore)(TSRMLS_D); -static char *zend_new_interned_string_int(char *str, int len, int free_src TSRMLS_DC); +static const char *zend_new_interned_string_int(const char *str, int len, int free_src TSRMLS_DC); static void zend_interned_strings_snapshot_int(TSRMLS_D); static void zend_interned_strings_restore_int(TSRMLS_D); @@ -79,7 +79,7 @@ void zend_interned_strings_dtor(TSRMLS_D) #endif } -static char *zend_new_interned_string_int(char *arKey, int nKeyLength, int free_src TSRMLS_DC) +static const char *zend_new_interned_string_int(const char *arKey, int nKeyLength, int free_src TSRMLS_DC) { #ifndef ZTS ulong h; @@ -97,7 +97,7 @@ static char *zend_new_interned_string_int(char *arKey, int nKeyLength, int free_ if ((p->h == h) && (p->nKeyLength == nKeyLength)) { if (!memcmp(p->arKey, arKey, nKeyLength)) { if (free_src) { - efree(arKey); + efree((void *)arKey); } return p->arKey; } @@ -121,7 +121,7 @@ static char *zend_new_interned_string_int(char *arKey, int nKeyLength, int free_ p->arKey = (char*)(p+1); memcpy(p->arKey, arKey, nKeyLength); if (free_src) { - efree(arKey); + efree((void *)arKey); } p->nKeyLength = nKeyLength; p->h = h; -- cgit v1.2.1