cvs: ZendEngine2(PHP_5_3) / zend_constants.c php-src/ext/iconv iconv.c php-src/ext/pcre php_pcre.c php-src/ext/standard array.c base64.c image.c versioning.c php-src/main rfc1867.c php-src/main/streams glob_wrapper.c
[email protected] ("Nuno Lopes")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsnlopess1222183106@cvsserver> |
nlopess Tue Sep 23 15:18:26 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/iconv iconv.c
/php-src/ext/pcre php_pcre.c
/php-src/ext/standard array.c base64.c image.c versioning.c
/php-src/main rfc1867.c
/php-src/main/streams glob_wrapper.c
/ZendEngine2 zend_constants.c
Log:
clean some dead code (with static analysis help)
nlopess-20080923151826.txt
(text/plain, 8.9 KB)
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.20.2.7&r2=1.124.2.8.2.20.2.8&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.7 php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.8
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.20.2.7 Wed May 21 15:03:20 2008
+++ php-src/ext/iconv/iconv.c Tue Sep 23 15:18:26 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iconv.c,v 1.124.2.8.2.20.2.7 2008/05/21 15:03:20 tony2001 Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.20.2.8 2008/09/23 15:18:26 nlopess Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1295,7 +1295,6 @@
char_cnt -= 3;
}
}
- prev_in_left = in_left;
smart_str_appendl(pretval, "?=", sizeof("?=") - 1);
char_cnt -= 2;
http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.21.2.23&r2=1.168.2.9.2.21.2.24&diff_format=u
Index: php-src/ext/pcre/php_pcre.c
diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.23 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.24
--- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21.2.23 Tue Sep 2 19:10:38 2008
+++ php-src/ext/pcre/php_pcre.c Tue Sep 23 15:18:26 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.23 2008/09/02 19:10:38 nlopess Exp $ */
+/* $Id: php_pcre.c,v 1.168.2.9.2.21.2.24 2008/09/23 15:18:26 nlopess Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -894,7 +894,6 @@
} else {
esc_match = "";
esc_match_len = 0;
- match_len = 0;
}
smart_str_appendl(&code, esc_match, esc_match_len);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.43&r2=1.308.2.21.2.37.2.44&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.43 php-src/ext/standard/array.c:1.308.2.21.2.37.2.44
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.43 Fri Aug 29 03:05:42 2008
+++ php-src/ext/standard/array.c Tue Sep 23 15:18:26 2008
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.308.2.21.2.37.2.43 2008/08/29 03:05:42 felipe Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.44 2008/09/23 15:18:26 nlopess Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -3347,7 +3347,6 @@
} 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() */
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/base64.c?r1=1.43.2.2.2.3.2.2&r2=1.43.2.2.2.3.2.3&diff_format=u
Index: php-src/ext/standard/base64.c
diff -u php-src/ext/standard/base64.c:1.43.2.2.2.3.2.2 php-src/ext/standard/base64.c:1.43.2.2.2.3.2.3
--- php-src/ext/standard/base64.c:1.43.2.2.2.3.2.2 Mon Dec 31 07:17:14 2007
+++ php-src/ext/standard/base64.c Tue Sep 23 15:18:26 2008
@@ -15,7 +15,7 @@
| Author: Jim Winstead <[email protected]> |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.43.2.2.2.3.2.2 2007/12/31 07:17:14 sebastian Exp $ */
+/* $Id: base64.c,v 1.43.2.2.2.3.2.3 2008/09/23 15:18:26 nlopess Exp $ */
#include <string.h>
@@ -190,7 +190,7 @@
case 2:
k++;
case 3:
- result[k++] = 0;
+ result[k] = 0;
}
}
if(ret_length) {
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/image.c?r1=1.114.2.2.2.5.2.5&r2=1.114.2.2.2.5.2.6&diff_format=u
Index: php-src/ext/standard/image.c
diff -u php-src/ext/standard/image.c:1.114.2.2.2.5.2.5 php-src/ext/standard/image.c:1.114.2.2.2.5.2.6
--- php-src/ext/standard/image.c:1.114.2.2.2.5.2.5 Fri Jun 20 14:53:57 2008
+++ php-src/ext/standard/image.c Tue Sep 23 15:18:26 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: image.c,v 1.114.2.2.2.5.2.5 2008/06/20 14:53:57 felipe Exp $ */
+/* $Id: image.c,v 1.114.2.2.2.5.2.6 2008/09/23 15:18:26 nlopess Exp $ */
#include "php.h"
#include <stdio.h>
@@ -653,7 +653,7 @@
}
/* 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++;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/versioning.c?r1=1.19.2.1.2.3.2.1&r2=1.19.2.1.2.3.2.2&diff_format=u
Index: php-src/ext/standard/versioning.c
diff -u php-src/ext/standard/versioning.c:1.19.2.1.2.3.2.1 php-src/ext/standard/versioning.c:1.19.2.1.2.3.2.2
--- php-src/ext/standard/versioning.c:1.19.2.1.2.3.2.1 Mon Dec 31 07:17:15 2007
+++ php-src/ext/standard/versioning.c Tue Sep 23 15:18:26 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: versioning.c,v 1.19.2.1.2.3.2.1 2007/12/31 07:17:15 sebastian Exp $ */
+/* $Id: versioning.c,v 1.19.2.1.2.3.2.2 2008/09/23 15:18:26 nlopess Exp $ */
#include <stdio.h>
#include <sys/types.h>
@@ -45,7 +45,7 @@
p = version;
q = buf;
*q++ = lp = *p++;
- lq = '\0';
+
while (*p) {
/* s/[-_+]/./g;
* s/([^\d\.])([^\D\.])/$1.$2/g;
@@ -55,22 +55,22 @@
#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++;
}
http://cvs.php.net/viewvc.cgi/php-src/main/rfc1867.c?r1=1.173.2.1.2.9.2.4&r2=1.173.2.1.2.9.2.5&diff_format=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.173.2.1.2.9.2.4 php-src/main/rfc1867.c:1.173.2.1.2.9.2.5
--- php-src/main/rfc1867.c:1.173.2.1.2.9.2.4 Sun Sep 7 14:17:47 2008
+++ php-src/main/rfc1867.c Tue Sep 23 15:18:26 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.173.2.1.2.9.2.4 2008/09/07 14:17:47 lbarnaud Exp $ */
+/* $Id: rfc1867.c,v 1.173.2.1.2.9.2.5 2008/09/23 15:18:26 nlopess Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -203,7 +203,8 @@
index = NULL;
}
}
- *s++='\0';
+
+ *s = '\0';
}
@@ -610,7 +611,7 @@
}
}
- *resp++ = '\0';
+ *resp = '\0';
return result;
}
http://cvs.php.net/viewvc.cgi/php-src/main/streams/glob_wrapper.c?r1=1.6.2.4&r2=1.6.2.5&diff_format=u
Index: php-src/main/streams/glob_wrapper.c
diff -u php-src/main/streams/glob_wrapper.c:1.6.2.4 php-src/main/streams/glob_wrapper.c:1.6.2.5
--- php-src/main/streams/glob_wrapper.c:1.6.2.4 Wed Jan 30 23:43:13 2008
+++ php-src/main/streams/glob_wrapper.c Tue Sep 23 15:18:26 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: glob_wrapper.c,v 1.6.2.4 2008/01/30 23:43:13 helly Exp $ */
+/* $Id: glob_wrapper.c,v 1.6.2.5 2008/09/23 15:18:26 nlopess Exp $ */
#include "php.h"
#include "php_streams_int.h"
@@ -209,7 +209,7 @@
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 @@
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);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_constants.c?r1=1.71.2.5.2.7.2.12&r2=1.71.2.5.2.7.2.13&diff_format=u
Index: ZendEngine2/zend_constants.c
diff -u ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.12 ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.13
--- ZendEngine2/zend_constants.c:1.71.2.5.2.7.2.12 Tue Aug 12 17:20:24 2008
+++ ZendEngine2/zend_constants.c Tue Sep 23 15:18:26 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_constants.c,v 1.71.2.5.2.7.2.12 2008/08/12 17:20:24 felipe Exp $ */
+/* $Id: zend_constants.c,v 1.71.2.5.2.7.2.13 2008/09/23 15:18:26 nlopess Exp $ */
#include "zend.h"
#include "zend_constants.h"
@@ -379,7 +379,6 @@
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) {