From: Nuno Lopes Date: Tue, 23 Sep 2008 15:22:05 +0000 (+0000) Subject: MFB: clean some dead code X-Git-Tag: BEFORE_HEAD_NS_CHANGE~338 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c4901075671616d0a91f98044703db432b370b5;p=php MFB: clean some dead code --- diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index ae267a5b43..a617adcc7c 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -458,7 +458,6 @@ ZEND_API int zend_u_get_constant_ex(zend_uchar type, zstr name, uint name_len, z name = constant_name; name_len = const_name_len; efree(class_name.v); - retval = 1; return zend_u_get_constant(type, name, name_len, result TSRMLS_CC); } if ((flags & ZEND_FETCH_CLASS_SILENT) == 0) { diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index f3b38f9339..2c41037c3f 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1357,7 +1357,6 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn char_cnt -= 3; } } - prev_in_left = in_left; smart_str_appendl(pretval, "?=", sizeof("?=") - 1); char_cnt -= 2; diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index aa59fd4c67..e03ffb3ad5 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1023,7 +1023,6 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, } else { esc_match = ""; esc_match_len = 0; - match_len = 0; } smart_str_appendl(&code, esc_match, esc_match_len); diff --git a/ext/standard/array.c b/ext/standard/array.c index 443d94e56d..b5fefb72c2 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3574,7 +3574,6 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } else if (behavior & DIFF_ASSOC) { /* triggered also if DIFF_KEY */ /* DIFF_KEY is subset of DIFF_ASSOC. When having the former * no comparison of the data is done (part of DIFF_ASSOC) */ - diff_key_compare_func = php_array_key_compare; if (data_compare_type == DIFF_COMP_DATA_INTERNAL && key_compare_type == DIFF_COMP_KEY_INTERNAL) { /* array_diff_assoc() or array_diff_key() */ diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 5c7c639f7a..f29ae75e02 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -190,7 +190,7 @@ PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, case 2: k++; case 3: - result[k++] = 0; + result[k] = 0; } } if(ret_length) { diff --git a/ext/standard/image.c b/ext/standard/image.c index a83b9669c2..5b4caa5017 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -653,7 +653,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC) } /* Collect bit depth info */ - highest_bit_depth = bit_depth = 0; + highest_bit_depth = 0; for (i = 0; i < result->channels; i++) { bit_depth = php_stream_getc(stream); /* Ssiz[i] */ bit_depth++; diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 10d4d30e40..1ccc20a787 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -45,7 +45,7 @@ php_canonicalize_version(const char *version) p = version; q = buf; *q++ = lp = *p++; - lq = '\0'; + while (*p) { /* s/[-_+]/./g; * s/([^\d\.])([^\D\.])/$1.$2/g; @@ -55,22 +55,22 @@ php_canonicalize_version(const char *version) #define isndig(x) (!isdigit(x)&&(x)!='.') #define isspecialver(x) ((x)=='-'||(x)=='_'||(x)=='+') - lq = *(q - 1); + lq = *(q - 1); if (isspecialver(*p)) { if (lq != '.') { - lq = *q++ = '.'; + *q++ = '.'; } } else if ((isndig(lp) && isdig(*p)) || (isdig(lp) && isndig(*p))) { if (lq != '.') { *q++ = '.'; } - lq = *q++ = *p; + *q++ = *p; } else if (!isalnum(*p)) { if (lq != '.') { - lq = *q++ = '.'; + *q++ = '.'; } } else { - lq = *q++ = *p; + *q++ = *p; } lp = *p++; } diff --git a/main/rfc1867.c b/main/rfc1867.c index 25a813951a..5df37f44a1 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -189,7 +189,8 @@ static void normalize_protected_variable(char *varname TSRMLS_DC) index = NULL; } } - *s++='\0'; + + *s = '\0'; } @@ -784,7 +785,7 @@ static char *substring_conf(char *start, int len, char quote TSRMLS_DC) } } - *resp++ = '\0'; + *resp = '\0'; return result; } diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index afc4e128e8..48974d841d 100755 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -209,7 +209,7 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, char *pat int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { glob_s_t *pglob; - int ret, path_len; + int ret; char *tmp, *pos; if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { @@ -218,12 +218,9 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, char *pat if (!strncmp(path, "glob://", sizeof("glob://")-1)) { path += sizeof("glob://")-1; - path_len = strlen(path); if (opened_path) { - *opened_path = estrndup(path, path_len); + *opened_path = estrdup(path); } - } else { - path_len = strlen(path); } pglob = ecalloc(sizeof(*pglob), 1);