More warning fixes

This commit is contained in:
Nikita Popov 2015-07-17 20:48:42 +02:00
parent 36e49c702b
commit 42e32c33e2
5 changed files with 13 additions and 23 deletions

View file

@ -1446,8 +1446,8 @@ void *from_zval_run_conversions(const zval *container,
zend_llist **allocations /* out */, zend_llist **allocations /* out */,
struct err_s *err /* in/out */) struct err_s *err /* in/out */)
{ {
ser_context ctx = {{0}}; ser_context ctx;
char *structure = NULL; char *structure;
*allocations = NULL; *allocations = NULL;
@ -1455,6 +1455,7 @@ void *from_zval_run_conversions(const zval *container,
return NULL; return NULL;
} }
memset(&ctx, 0, sizeof(ctx));
zend_hash_init(&ctx.params, 8, NULL, NULL, 0); zend_hash_init(&ctx.params, 8, NULL, NULL, 0);
zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0); zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0);
zend_llist_init(&ctx.allocations, sizeof(void *), &free_from_zval_allocation, 0); zend_llist_init(&ctx.allocations, sizeof(void *), &free_from_zval_allocation, 0);
@ -1488,13 +1489,14 @@ zval *to_zval_run_conversions(const char *structure,
const struct key_value *key_value_pairs, const struct key_value *key_value_pairs,
struct err_s *err, zval *zv) struct err_s *err, zval *zv)
{ {
res_context ctx = {{0}, {0}}; res_context ctx;
const struct key_value *kv; const struct key_value *kv;
if (err->has_error) { if (err->has_error) {
return NULL; return NULL;
} }
memset(&ctx, 0, sizeof(ctx));
zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0); zend_llist_init(&ctx.keys, sizeof(const char *), NULL, 0);
zend_llist_add_element(&ctx.keys, &top_name); zend_llist_add_element(&ctx.keys, &top_name);

View file

@ -218,7 +218,6 @@ _crypt_extended_init(void)
uint32_t *p, *il, *ir, *fl, *fr; uint32_t *p, *il, *ir, *fl, *fr;
uint32_t *bits28, *bits24; uint32_t *bits28, *bits24;
u_char inv_key_perm[64]; u_char inv_key_perm[64];
u_char u_key_perm[56];
u_char inv_comp_perm[56]; u_char inv_comp_perm[56];
u_char init_perm[64], final_perm[64]; u_char init_perm[64], final_perm[64];
u_char u_sbox[8][64]; u_char u_sbox[8][64];
@ -260,7 +259,6 @@ _crypt_extended_init(void)
* compression permutation. * compression permutation.
*/ */
for (i = 0; i < 56; i++) { for (i = 0; i < 56; i++) {
u_key_perm[i] = key_perm[i] - 1;
inv_key_perm[key_perm[i] - 1] = i; inv_key_perm[key_perm[i] - 1] = i;
inv_comp_perm[i] = 255; inv_comp_perm[i] = 255;
} }
@ -633,7 +631,7 @@ _crypt_extended_r(const char *key, const char *setting,
if (*key) if (*key)
key++; key++;
} }
if (des_setkey((u_char *) keybuf, data)) if (des_setkey((char *) keybuf, data))
return(NULL); return(NULL);
if (*setting == _PASSWORD_EFMT1) { if (*setting == _PASSWORD_EFMT1) {
@ -662,7 +660,7 @@ _crypt_extended_r(const char *key, const char *setting,
/* /*
* Encrypt the key with itself. * Encrypt the key with itself.
*/ */
if (des_cipher((u_char *) keybuf, (u_char *) keybuf, if (des_cipher((char *) keybuf, (char *) keybuf,
0, 1, data)) 0, 1, data))
return(NULL); return(NULL);
/* /*
@ -672,7 +670,7 @@ _crypt_extended_r(const char *key, const char *setting,
while (q - (u_char *) keybuf < sizeof(keybuf) && *key) while (q - (u_char *) keybuf < sizeof(keybuf) && *key)
*q++ ^= *key++ << 1; *q++ ^= *key++ << 1;
if (des_setkey((u_char *) keybuf, data)) if (des_setkey((char *) keybuf, data))
return(NULL); return(NULL);
} }
memcpy(data->output, setting, 9); memcpy(data->output, setting, 9);

View file

@ -204,7 +204,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
unsigned long len=64, szlength; unsigned long len=64, szlength;
int factor = 1,maxfactor = 16; int factor = 1,maxfactor = 16;
int status = 0; int status = 0;
char *b, *buf = NULL; unsigned char *b, *buf = NULL;
zend_string *bufz; zend_string *bufz;
b = ecalloc(1, len + 1); b = ecalloc(1, len + 1);
@ -212,7 +212,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
if (php_stream_seek(stream, 5, SEEK_CUR)) if (php_stream_seek(stream, 5, SEEK_CUR))
return NULL; return NULL;
if (php_stream_read(stream, a, sizeof(a)) != sizeof(a)) if (php_stream_read(stream, (char *) a, sizeof(a)) != sizeof(a))
return NULL; return NULL;
if (uncompress(b, &len, a, sizeof(a)) != Z_OK) { if (uncompress(b, &len, a, sizeof(a)) != Z_OK) {
@ -232,8 +232,8 @@ static struct gfxinfo *php_handle_swc(php_stream * stream)
do { do {
szlength = ZSTR_LEN(bufz) * (1<<factor++); szlength = ZSTR_LEN(bufz) * (1<<factor++);
buf = (char *) erealloc(buf, szlength); buf = erealloc(buf, szlength);
status = uncompress(buf, &szlength, ZSTR_VAL(bufz), ZSTR_LEN(bufz)); status = uncompress(buf, &szlength, (unsigned char *) ZSTR_VAL(bufz), ZSTR_LEN(bufz));
} while ((status==Z_BUF_ERROR)&&(factor<maxfactor)); } while ((status==Z_BUF_ERROR)&&(factor<maxfactor));
if (bufz) { if (bufz) {

View file

@ -2966,15 +2966,6 @@ static zend_string *php_strtr_ex(zend_string *str, char *str_from, char *str_to,
} }
/* }}} */ /* }}} */
static int php_strtr_key_compare(const void *a, const void *b) /* {{{ */
{
Bucket *f = (Bucket *) a;
Bucket *s = (Bucket *) b;
return f->h > s->h ? -1 : 1;
}
/* }}} */
/* {{{ php_strtr_array */ /* {{{ php_strtr_array */
static void php_strtr_array(zval *return_value, zend_string *input, HashTable *pats) static void php_strtr_array(zval *return_value, zend_string *input, HashTable *pats)
{ {

View file

@ -991,10 +991,9 @@ static void php_tidy_create_node(INTERNAL_FUNCTION_PARAMETERS, tidy_base_nodetyp
static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options) static int _php_tidy_apply_config_array(TidyDoc doc, HashTable *ht_options)
{ {
zval *opt_val; zval *opt_val;
zend_ulong opt_indx;
zend_string *opt_name; zend_string *opt_name;
ZEND_HASH_FOREACH_KEY_VAL(ht_options, opt_indx, opt_name, opt_val) { ZEND_HASH_FOREACH_STR_KEY_VAL(ht_options, opt_name, opt_val) {
if (opt_name == NULL) { if (opt_name == NULL) {
continue; continue;
} }