diff options
| author | Nuno Lopes <nlopess@php.net> | 2008-09-23 15:18:26 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2008-09-23 15:18:26 +0000 |
| commit | 8a77e55566f13cd9d17909aac705ab79e9d35953 (patch) | |
| tree | f1530fd6df61524be5dbce319b2fd782240283a2 | |
| parent | a1d2b4d9407e654e085b2dfae30de9caf82b8715 (diff) | |
| download | php-git-8a77e55566f13cd9d17909aac705ab79e9d35953.tar.gz | |
clean some dead code (with static analysis help)
| -rw-r--r-- | Zend/zend_constants.c | 1 | ||||
| -rw-r--r-- | ext/iconv/iconv.c | 1 | ||||
| -rw-r--r-- | ext/pcre/php_pcre.c | 1 | ||||
| -rw-r--r-- | ext/standard/array.c | 1 | ||||
| -rw-r--r-- | ext/standard/base64.c | 2 | ||||
| -rw-r--r-- | ext/standard/image.c | 2 | ||||
| -rw-r--r-- | ext/standard/versioning.c | 12 | ||||
| -rw-r--r-- | main/rfc1867.c | 5 | ||||
| -rwxr-xr-x | main/streams/glob_wrapper.c | 7 |
9 files changed, 13 insertions, 19 deletions
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index f215a885ba..0b76ab28ad 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -379,7 +379,6 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, name = constant_name; name_len = const_name_len; efree(class_name); - retval = 1; return zend_get_constant(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 4f11d74d59..dbe9afbd9a 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1295,7 +1295,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 12f94800bd..4f1d856ad7 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -894,7 +894,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 9b12c27b14..e4d72a8acf 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3347,7 +3347,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 88fe8fa7eb..faf2cae055 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 c2f640ed45..d21a91b8b6 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 4160fc6359..719c56b76a 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 af58ba4b75..a32abfc298 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -203,7 +203,8 @@ static void normalize_protected_variable(char *varname TSRMLS_DC) index = NULL; } } - *s++='\0'; + + *s = '\0'; } @@ -610,7 +611,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); |
