mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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
This commit is contained in:
commit
39612afc72
21 changed files with 30 additions and 31 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue