summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2013-08-14 20:43:25 -0700
committerChristopher Jones <sixd@php.net>2013-08-14 20:43:25 -0700
commit39612afc72623e89a2bc595c9be4be497568d1be (patch)
treeba336742c4b5ad3d4c8933748b91332f7436aa66
parent8c61758dc772345636e436e3f69bef7323f8b339 (diff)
parent9ad97cd48903ea5454853960f2c14de326e0f624 (diff)
downloadphp-git-39612afc72623e89a2bc595c9be4be497568d1be.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings. Conflicts: ext/dba/libinifile/inifile.c
-rw-r--r--ext/date/php_date.c6
-rw-r--r--ext/dom/xpath.c2
-rw-r--r--ext/gmp/gmp.c2
-rw-r--r--ext/intl/grapheme/grapheme_util.c2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c4
-rw-r--r--ext/openssl/openssl.c2
-rw-r--r--ext/openssl/xp_ssl.c2
-rw-r--r--ext/session/session.c2
-rw-r--r--ext/simplexml/simplexml.c2
-rw-r--r--ext/snmp/snmp.c2
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_dllist.c2
-rw-r--r--ext/standard/array.c9
-rw-r--r--ext/standard/html.c6
-rw-r--r--ext/standard/string.c4
-rw-r--r--ext/standard/url_scanner_ex.re2
-rw-r--r--ext/xsl/xsltprocessor.c2
-rw-r--r--ext/zip/php_zip.c2
-rw-r--r--main/php_variables.c2
-rw-r--r--main/rfc1867.c2
-rw-r--r--sapi/cli/php_cli_server.c2
21 files changed, 30 insertions, 31 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 013f3910c9..f0c9525e56 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1041,7 +1041,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d)
static char *date_format(char *format, int format_len, timelib_time *t, int localtime)
{
smart_str string = {0};
- int i, length;
+ int i, length = 0;
char buffer[97];
timelib_time_offset *offset = NULL;
timelib_sll isoweek, isoyear;
@@ -2538,8 +2538,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_time *now;
timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
- int type = TIMELIB_ZONETYPE_ID, new_dst;
- char *new_abbr;
+ int type = TIMELIB_ZONETYPE_ID, new_dst = 0;
+ char *new_abbr = NULL;
timelib_sll new_offset;
if (dateobj->time) {
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index cf556a3505..d12ef30323 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -74,7 +74,7 @@ const zend_function_entry php_dom_xpath_class_functions[] = {
static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
{
- zval **args;
+ zval **args = NULL;
zval *retval;
int result, i, ret;
int error = 0;
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index f8c3a0773b..e3a3563aac 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -1069,7 +1069,7 @@ ZEND_FUNCTION(gmp_powm)
zval **base_arg, **exp_arg, **mod_arg;
mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result;
int use_ui = 0;
- int temp_base, temp_exp, temp_mod;
+ int temp_base = 0, temp_exp = 0, temp_mod;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ", &base_arg, &exp_arg, &mod_arg) == FAILURE){
return;
diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c
index 883fa0391a..c752b02372 100644
--- a/ext/intl/grapheme/grapheme_util.c
+++ b/ext/intl/grapheme/grapheme_util.c
@@ -130,7 +130,7 @@ void grapheme_substr_ascii(char *str, int str_len, int f, int l, int argc, char
/* {{{ grapheme_strpos_utf16 - strrpos using utf16*/
int grapheme_strpos_utf16(unsigned char *haystack, int32_t haystack_len, unsigned char*needle, int32_t needle_len, int32_t offset, int32_t *puchar_pos, int f_ignore_case, int last TSRMLS_DC)
{
- UChar *uhaystack = NULL, *puhaystack, *uneedle = NULL;
+ UChar *uhaystack = NULL, *uneedle = NULL;
int32_t uhaystack_len = 0, uneedle_len = 0, char_pos, ret_pos, offset_pos = 0;
unsigned char u_break_iterator_buffer[U_BRK_SAFECLONE_BUFFERSIZE];
UBreakIterator* bi = NULL;
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index db46bf5b16..9c369bdecc 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -161,8 +161,8 @@ PHP_FUNCTION( resourcebundle_create )
/* {{{ resourcebundle_array_fetch */
static void resourcebundle_array_fetch(zval *object, zval *offset, zval *return_value, int fallback TSRMLS_DC)
{
- int32_t meindex;
- char * mekey;
+ int32_t meindex = 0;
+ char * mekey = NULL;
long mekeylen;
zend_bool is_numeric = 0;
char *pbuf;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 05e1e790e1..4c3b2ec39e 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -591,7 +591,7 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
for (i = 0; i < X509_NAME_entry_count(name); i++) {
unsigned char *to_add;
- int to_add_len;
+ int to_add_len = 0;
ne = X509_NAME_get_entry(name, i);
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index e9a72e3f3e..a1a7ffc3f4 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -472,7 +472,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
do {
struct timeval cur_time,
- elapsed_time;
+ elapsed_time = {0};
if (sslsock->is_client) {
n = SSL_connect(sslsock->ssl_handle);
diff --git a/ext/session/session.c b/ext/session/session.c
index 5fdb42b04b..7c6672de52 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -286,7 +286,7 @@ PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS) /* {{{ */
PHP_MD5_CTX md5_context;
PHP_SHA1_CTX sha1_context;
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
- void *hash_context;
+ void *hash_context = NULL;
#endif
unsigned char *digest;
int digest_len;
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index e7c2f29844..eba46b9091 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1070,7 +1070,7 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{
int namelen;
int test;
char use_iter;
- zval *iter_data;
+ zval *iter_data = NULL;
use_iter = 0;
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 186aeb5cdd..4e2510afc8 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -514,7 +514,7 @@ static zend_object_value php_snmp_object_new(zend_class_entry *class_type TSRMLS
static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, const char *format, ...)
{
va_list args;
- php_snmp_object *snmp_object;
+ php_snmp_object *snmp_object = NULL;
if (object) {
snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC);
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 9ca681688b..ca8076a957 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -166,7 +166,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object,
/* {{{ spl_array_object_new_ex */
static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, spl_array_object **obj, zval *orig, int clone_orig TSRMLS_DC)
{
- zend_object_value retval;
+ zend_object_value retval = {0};
spl_array_object *intern;
zval *tmp;
zend_class_entry * parent = class_type;
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index aa462dfd76..273bc7506a 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -368,7 +368,7 @@ zend_object_iterator *spl_dllist_get_iterator(zend_class_entry *ce, zval *object
static zend_object_value spl_dllist_object_new_ex(zend_class_entry *class_type, spl_dllist_object **obj, zval *orig, int clone_orig TSRMLS_DC) /* {{{ */
{
- zend_object_value retval;
+ zend_object_value retval = {0};
spl_dllist_object *intern;
zend_class_entry *parent = class_type;
int inherited = 0;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 22873862f7..51972033ee 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -3030,8 +3030,8 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
- zend_fcall_info *fci_key, *fci_data;
- zend_fcall_info_cache *fci_key_cache, *fci_data_cache;
+ zend_fcall_info *fci_key = NULL, *fci_data;
+ zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
int (*intersect_key_compare_func)(const void *, const void * TSRMLS_DC);
@@ -3448,8 +3448,8 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
char *param_spec;
zend_fcall_info fci1, fci2;
zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
- zend_fcall_info *fci_key, *fci_data;
- zend_fcall_info_cache *fci_key_cache, *fci_data_cache;
+ zend_fcall_info *fci_key = NULL, *fci_data;
+ zend_fcall_info_cache *fci_key_cache = NULL, *fci_data_cache;
PHP_ARRAY_CMP_FUNC_VARS;
int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC);
@@ -4053,7 +4053,6 @@ PHP_FUNCTION(array_sum)
**entry,
entry_n;
HashPosition pos;
- double dval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &input) == FAILURE) {
return;
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 414fa65c91..b4d9ba109d 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -1221,8 +1221,8 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, size_t oldlen, size
const enc_to_uni *to_uni_table = NULL;
const entity_ht *inv_map = NULL; /* used for !double_encode */
/* only used if flags includes ENT_HTML_IGNORE_ERRORS or ENT_HTML_SUBSTITUTE_DISALLOWED_CHARS */
- const unsigned char *replacement;
- size_t replacement_len;
+ const unsigned char *replacement = NULL;
+ size_t replacement_len = 0;
if (all) { /* replace with all named entities */
if (CHARSET_PARTIAL_SUPPORT(charset)) {
@@ -1596,7 +1596,7 @@ PHP_FUNCTION(get_html_translation_table)
flags = ENT_COMPAT;
int doctype;
entity_table_opt entity_table;
- const enc_to_uni *to_uni_table;
+ const enc_to_uni *to_uni_table = NULL;
char *charset_hint = NULL;
int charset_hint_len;
enum entity_charset charset;
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 6a67efbd7e..b9d7427eb9 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3204,7 +3204,7 @@ static void php_similar_str(const char *txt1, int len1, const char *txt2, int le
static int php_similar_char(const char *txt1, int len1, const char *txt2, int len2)
{
int sum;
- int pos1, pos2, max;
+ int pos1 = 0, pos2 = 0, max;
php_similar_str(txt1, len1, txt2, len2, &pos1, &pos2, &max);
if ((sum = max)) {
@@ -4564,7 +4564,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow,
char *tbuf, *buf, *p, *tp, *rp, c, lc;
int br, i=0, depth=0, in_q = 0;
int state = 0, pos;
- char *allow_free;
+ char *allow_free = NULL;
if (stateptr)
state = *stateptr;
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index f0dee8ebc1..ecacb76f94 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -463,7 +463,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
{
- char *encoded;
+ char *encoded = NULL;
int encoded_len;
smart_str val;
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 1785519c15..af11104a2e 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -476,7 +476,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp TSRMLS_DC) /* {{{ */
{
- xmlDocPtr newdocp;
+ xmlDocPtr newdocp = NULL;
xmlDocPtr doc = NULL;
xmlNodePtr node = NULL;
xsltTransformContextPtr ctxt;
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 37a0cdea19..7297523aaa 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1654,7 +1654,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
char *path = NULL;
char *remove_path = NULL;
char *add_path = NULL;
- int pattern_len, add_path_len, remove_path_len, path_len = 0;
+ int pattern_len, add_path_len = 0, remove_path_len = 0, path_len = 0;
long remove_all_path = 0;
long flags = 0;
zval *options = NULL;
diff --git a/main/php_variables.c b/main/php_variables.c
index fd52f311d1..7018eae57b 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -55,7 +55,7 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva
PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC)
{
char *p = NULL;
- char *ip; /* index pointer */
+ char *ip = NULL; /* index pointer */
char *index;
char *var, *var_orig;
int var_len, index_len;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index ed7ce9c0c1..7c208c368c 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -398,7 +398,7 @@ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC)
static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC)
{
char *line;
- mime_header_entry prev_entry, entry;
+ mime_header_entry prev_entry = {0}, entry;
int prev_len, cur_len;
/* didn't find boundary, abort */
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index a1bae67e74..cbe9c7bd66 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1335,7 +1335,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
static const char *index_files[] = { "index.php", "index.html", NULL };
char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1);
char *p = buf, *prev_path = NULL, *q, *vpath;
- size_t prev_path_len;
+ size_t prev_path_len = 0;
int is_static_file = 0;
if (!buf) {