]> granicus.if.org Git - php/commitdiff
fix signed/unsigned mismatch
authorAnatol Belski <ab@php.net>
Tue, 16 Sep 2014 19:06:22 +0000 (21:06 +0200)
committerAnatol Belski <ab@php.net>
Tue, 16 Sep 2014 19:17:27 +0000 (21:17 +0200)
ext/standard/array.c

index 09aaddfbf58249172f1a18682ceea168768fb336..a417925528e9d81948f66a2e275ee012eacbec87 100644 (file)
@@ -1528,7 +1528,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
 PHP_FUNCTION(compact)
 {
        zval *args = NULL;      /* function arguments array */
-       int num_args, i;
+       uint32_t num_args, i;
        zend_array *symbol_table;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &num_args) == FAILURE) {
@@ -2085,7 +2085,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end)
                                zend_hash_rehash(Z_ARRVAL_P(stack));
                        }
                }
-       } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
+       } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) {
                Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1;
        }
 
@@ -3174,7 +3174,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
        int arr_argc, i, c = 0;
        uint idx;
        Bucket **lists, *list, **ptrs, *p;
-       int req_args;
+       uint32_t req_args;
        char *param_spec;
        zend_fcall_info fci1, fci2;
        zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
@@ -3598,7 +3598,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
        int arr_argc, i, c;
        uint idx;
        Bucket **lists, *list, **ptrs, *p;
-       int req_args;
+       uint32_t req_args;
        char *param_spec;
        zend_fcall_info fci1, fci2;
        zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache;
@@ -4423,7 +4423,8 @@ PHP_FUNCTION(array_map)
        zval result;
        zend_fcall_info fci = empty_fcall_info;
        zend_fcall_info_cache fci_cache = empty_fcall_info_cache;
-       int i, k, maxlen = 0;
+       int i;
+       uint32_t k, maxlen = 0;
 
 #ifndef FAST_ZPP
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {