diff options
| author | Dmitry Stogov <dmitry@php.net> | 2011-09-13 13:29:35 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2011-09-13 13:29:35 +0000 |
| commit | 4a25a7740d62c9ec0318001c3f6d6b3ae01d96ad (patch) | |
| tree | 3e5041ac2a54ff635c9e77d97e2a14a2f1c860c6 /ext/standard | |
| parent | 3a3c2942d254be88b82fc871ef4fa9698e921ac7 (diff) | |
| download | php-git-4a25a7740d62c9ec0318001c3f6d6b3ae01d96ad.tar.gz | |
Fixed ZE specific compile warnings (Bug #55629)
Diffstat (limited to 'ext/standard')
| -rw-r--r-- | ext/standard/array.c | 4 | ||||
| -rw-r--r-- | ext/standard/assert.c | 2 | ||||
| -rw-r--r-- | ext/standard/head.c | 2 | ||||
| -rw-r--r-- | ext/standard/http.c | 10 | ||||
| -rw-r--r-- | ext/standard/mail.c | 2 | ||||
| -rw-r--r-- | ext/standard/php_string.h | 4 | ||||
| -rw-r--r-- | ext/standard/string.c | 12 | ||||
| -rw-r--r-- | ext/standard/user_filters.c | 3 | ||||
| -rw-r--r-- | ext/standard/var.c | 22 |
9 files changed, 32 insertions, 29 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index d189c7faef..dd23c95c5f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -186,7 +186,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ Z_LVAL(first) = f->h; } else { Z_TYPE(first) = IS_STRING; - Z_STRVAL(first) = f->arKey; + Z_STRVAL(first) = (char*)f->arKey; Z_STRLEN(first) = f->nKeyLength - 1; } @@ -195,7 +195,7 @@ static int php_array_key_compare(const void *a, const void *b TSRMLS_DC) /* {{{ Z_LVAL(second) = s->h; } else { Z_TYPE(second) = IS_STRING; - Z_STRVAL(second) = s->arKey; + Z_STRVAL(second) = (char*)s->arKey; Z_STRLEN(second) = s->nKeyLength - 1; } diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 9fd1104928..e163d5fee1 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -200,7 +200,7 @@ PHP_FUNCTION(assert) zval *retval; int i; uint lineno = zend_get_executed_lineno(TSRMLS_C); - char *filename = zend_get_executed_filename(TSRMLS_C); + const char *filename = zend_get_executed_filename(TSRMLS_C); MAKE_STD_ZVAL(args[0]); MAKE_STD_ZVAL(args[1]); diff --git a/ext/standard/head.c b/ext/standard/head.c index 05f5fb4e5a..75035b30b0 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -220,7 +220,7 @@ PHP_FUNCTION(setrawcookie) PHP_FUNCTION(headers_sent) { zval *arg1 = NULL, *arg2 = NULL; - char *file=""; + const char *file=""; int line=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zz", &arg1, &arg2) == FAILURE) diff --git a/ext/standard/http.c b/ext/standard/http.c index 352119d972..1891146142 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -31,8 +31,10 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *key_suffix, int key_suffix_len, zval *type, char *arg_sep, int enc_type TSRMLS_DC) { - char *key = NULL, *ekey, *newprefix, *p; - int arg_sep_len, key_len, ekey_len, key_type, newprefix_len; + char *key = NULL; + char *ekey, *newprefix, *p; + int arg_sep_len, ekey_len, key_type, newprefix_len; + uint key_len; ulong idx; zval **zdata = NULL, *copyzval; @@ -64,14 +66,14 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, /* handling for private & protected object properties */ if (key && *key == '\0' && type != NULL) { - char *tmp; + const char *tmp; zend_object *zobj = zend_objects_get_address(type TSRMLS_CC); if (zend_check_property_access(zobj, key, key_len-1 TSRMLS_CC) != SUCCESS) { /* private or protected property access outside of the class */ continue; } - zend_unmangle_property_name(key, key_len-1, &tmp, &key); + zend_unmangle_property_name(key, key_len-1, &tmp, (const char**)&key); key_len = strlen(key); } diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 936371b21f..0540a82514 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -232,7 +232,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char efree(tmp); } if (PG(mail_x_header)) { - char *tmp = zend_get_executed_filename(TSRMLS_C); + const char *tmp = zend_get_executed_filename(TSRMLS_C); char *f; size_t f_len; diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 8284204c89..495b8f07aa 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -122,10 +122,10 @@ PHPAPI char *php_strtoupper(char *s, size_t len); PHPAPI char *php_strtolower(char *s, size_t len); PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen); PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC); -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC); +PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int freeit, char *what, int wlength TSRMLS_DC); PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC); PHPAPI void php_stripcslashes(char *str, int *len); -PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC); +PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC); PHPAPI size_t php_dirname(char *str, size_t len); PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len); PHPAPI char *php_str_to_str_ex(char *haystack, int length, char *needle, diff --git a/ext/standard/string.c b/ext/standard/string.c index dd43665525..e79df5b5d5 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1400,13 +1400,13 @@ PHP_FUNCTION(strtolower) /* {{{ php_basename */ -PHPAPI void php_basename(char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC) +PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen, char **p_ret, size_t *p_len TSRMLS_DC) { char *ret = NULL, *c, *comp, *cend; size_t inc_len, cnt; int state; - c = comp = cend = s; + c = comp = cend = (char*)s; cnt = len; state = 0; while (cnt > 0) { @@ -3214,7 +3214,7 @@ PHPAPI void php_stripcslashes(char *str, int *len) /* {{{ php_addcslashes */ -PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC) +PHPAPI char *php_addcslashes(const char *str, int length, int *new_length, int should_free, char *what, int wlength TSRMLS_DC) { char flags[256]; char *new_str = safe_emalloc(4, (length?length:(length=strlen(str))), 1); @@ -3229,7 +3229,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_ php_charmask((unsigned char *)what, wlength, flags TSRMLS_CC); - for (source = str, end = source + length, target = new_str; source < end; source++) { + for (source = (char*)str, end = source + length, target = new_str; source < end; source++) { c = *source; if (flags[(unsigned char)c]) { if ((unsigned char) c < 32 || (unsigned char) c > 126) { @@ -3259,7 +3259,7 @@ PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int should_ *new_length = newlen; } if (should_free) { - STR_FREE(str); + STR_FREE((char*)str); } return new_str; } @@ -4747,7 +4747,7 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */ { zval op1_copy, op2_copy; - int use_copy1 = 0, use_copy2 = 0, sort_result; + int use_copy1 = 0, use_copy2 = 0; if (Z_TYPE_P(op1) != IS_STRING) { zend_make_printable_zval(op1, &op1_copy, &use_copy1); diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 9afc4f1568..251ef3db48 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -544,7 +544,8 @@ PHP_FUNCTION(stream_bucket_new) PHP_FUNCTION(stream_get_filters) { char *filter_name; - int key_flags, filter_name_len = 0; + int key_flags; + uint filter_name_len = 0; HashTable *filters_hash; ulong num_key; diff --git a/ext/standard/var.c b/ext/standard/var.c index 404504a1f3..a70438bc7f 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -56,7 +56,7 @@ static int php_array_element_dump(zval **zv TSRMLS_DC, int num_args, va_list arg static int php_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { int level; - char *prop_name, *class_name; + const char *prop_name, *class_name; level = va_arg(args, int); @@ -87,7 +87,7 @@ static int php_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list a PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) /* {{{ */ { HashTable *myht; - char *class_name; + const char *class_name; zend_uint class_name_len; int (*php_element_dump_func)(zval** TSRMLS_DC, int, va_list, zend_hash_key*); int is_temp; @@ -136,7 +136,7 @@ PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC) /* {{{ */ if (Z_OBJ_HANDLER(**struc, get_class_name)) { Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0); - efree(class_name); + efree((char*)class_name); } else { php_printf("%sobject(unknown class)#%d (%d) {\n", COMMON, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0); } @@ -213,7 +213,7 @@ static int zval_array_element_dump(zval **zv TSRMLS_DC, int num_args, va_list ar static int zval_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { int level; - char *prop_name, *class_name; + const char *prop_name, *class_name; level = va_arg(args, int); @@ -242,7 +242,7 @@ static int zval_object_property_dump(zval **zv TSRMLS_DC, int num_args, va_list PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC) /* {{{ */ { HashTable *myht = NULL; - char *class_name; + const char *class_name; zend_uint class_name_len; int (*zval_element_dump_func)(zval** TSRMLS_DC, int, va_list, zend_hash_key*); int is_temp = 0; @@ -286,7 +286,7 @@ PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC) /* {{{ */ } Z_OBJ_HANDLER_PP(struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC); php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0, Z_REFCOUNT_PP(struc)); - efree(class_name); + efree((char*)class_name); zval_element_dump_func = zval_object_property_dump; head_done: if (myht) { @@ -388,9 +388,9 @@ static int php_object_element_export(zval **zv TSRMLS_DC, int num_args, va_list buffer_append_spaces(buf, level + 2); if (hash_key->nKeyLength != 0) { - char *class_name, /* ignored, but must be passed to unmangle */ - *pname, - *pname_esc; + const char *class_name; /* ignored, but must be passed to unmangle */ + const char *pname; + char *pname_esc; int pname_esc_len; zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength - 1, @@ -418,7 +418,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC) HashTable *myht; char *tmp_str, *tmp_str2; int tmp_len, tmp_len2; - char *class_name; + const char *class_name; zend_uint class_name_len; switch (Z_TYPE_PP(struc)) { @@ -478,7 +478,7 @@ PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC) smart_str_appendl(buf, class_name, class_name_len); smart_str_appendl(buf, "::__set_state(array(\n", 21); - efree(class_name); + efree((char*)class_name); if (myht) { zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_object_element_export, 1, level, buf); } |
