]> granicus.if.org Git - php/commitdiff
Fixed compilation warnings
authorDmitry Stogov <dmitry@zend.com>
Tue, 21 Jun 2016 17:12:29 +0000 (20:12 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 21 Jun 2016 17:12:29 +0000 (20:12 +0300)
20 files changed:
Zend/zend_API.h
ext/opcache/Optimizer/compact_literals.c
ext/opcache/Optimizer/zend_cfg.c
ext/opcache/Optimizer/zend_dfg.c
ext/opcache/Optimizer/zend_dump.c
ext/opcache/Optimizer/zend_func_info.c
ext/opcache/Optimizer/zend_inference.c
ext/opcache/ZendAccelerator.c
ext/opcache/zend_accelerator_module.c
ext/opcache/zend_persist.c
ext/opcache/zend_persist_calc.c
main/getopt.c
main/rfc1867.c
main/snprintf.c
main/spprintf.c
main/streams/glob_wrapper.c
main/streams/memory.c
main/streams/streams.c
main/streams/transports.c
sapi/fpm/fpm/fpm_conf.c

index 85ae8b91d467002afd47a0f01c13080c69d310c8..34612f879f274c8639defbed4a3aa7d8fab6efa9 100644 (file)
@@ -567,7 +567,7 @@ END_EXTERN_C()
 #endif
 
 #define CHECK_ZVAL_NULL_PATH(p) (Z_STRLEN_P(p) != strlen(Z_STRVAL_P(p)))
-#define CHECK_NULL_PATH(p, l) (strlen(p) != l)
+#define CHECK_NULL_PATH(p, l) (strlen(p) != (size_t)(l))
 
 #define ZVAL_STRINGL(z, s, l) do {                             \
                ZVAL_NEW_STR(z, zend_string_init(s, l, 0));             \
index 68178f58733849308606263b8c2c14ed5f1750af..445b579f592452e81392782ab09344d1de0dd4a9 100644 (file)
@@ -283,7 +283,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
                                        break;
                                case ZEND_RECV_INIT:
                                        LITERAL_INFO(opline->op2.constant, LITERAL_VALUE, 0, 0, 1);
-                                       if (Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) != -1) {
+                                       if (Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) != (uint32_t)-1) {
                                                Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = cache_size;
                                                cache_size += sizeof(void *);
                                        }
@@ -297,7 +297,7 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
                                case ZEND_RECV:
                                case ZEND_RECV_VARIADIC:
                                case ZEND_VERIFY_RETURN_TYPE:
-                                       if (opline->op2.num != -1) {
+                                       if (opline->op2.num != (uint32_t)-1) {
                                                opline->op2.num = cache_size;
                                                cache_size += sizeof(void *);
                                        }
index e986ac0c20cc6f7b5bbfafcdf5fc800d59bd24b3..335ad75827a0540018cf596f05e4890ab9b7fac6 100644 (file)
@@ -112,7 +112,7 @@ static void zend_mark_reachable_blocks(const zend_op_array *op_array, zend_cfg *
                                                b->start++;
                                                b->len--;
                                        }
-                                       if (b->len == 0 && b->successors[0] == block_map[live_range->end]) {
+                                       if (b->len == 0 && (uint32_t)b->successors[0] == block_map[live_range->end]) {
                                                /* mark as removed (empty live range) */
                                                live_range->var = (uint32_t)-1;
                                                continue;
index 97fc846d3c824713673a55979ef127f1b4c3ba69..1fc42e8fe81c84c53af6e4f9a33337960dff6b94 100644 (file)
@@ -26,7 +26,8 @@ int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg
        zend_basic_block *blocks = cfg->blocks;
        int blocks_count = cfg->blocks_count;
        zend_bitset tmp, def, use, in, out;
-       uint32_t k, var_num;
+       int k;
+       uint32_t var_num;
        int j;
 
        set_size = dfg->size;
index a2eeb886ee824667787362947256e696804d13bb..a611b55cd5bb83826859eba4a420582125ed6cd5 100644 (file)
@@ -887,10 +887,12 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons
        fprintf(stderr, "    ; %s:%u-%u\n", op_array->filename->val, op_array->line_start, op_array->line_end);
 
        if (func_info && func_info->num_args > 0) {
-               for (i = 0; i < MIN(op_array->num_args, func_info->num_args ); i++) {
-                       fprintf(stderr, "    ; arg %d ", i);
-                       zend_dump_type_info(func_info->arg_info[i].info.type, func_info->arg_info[i].info.ce, func_info->arg_info[i].info.is_instanceof, dump_flags);
-                       zend_dump_range(&func_info->arg_info[i].info.range);
+               uint32_t j;
+
+               for (j = 0; j < MIN(op_array->num_args, func_info->num_args ); j++) {
+                       fprintf(stderr, "    ; arg %d ", j);
+                       zend_dump_type_info(func_info->arg_info[j].info.type, func_info->arg_info[j].info.ce, func_info->arg_info[j].info.is_instanceof, dump_flags);
+                       zend_dump_range(&func_info->arg_info[j].info.range);
                        fprintf(stderr, "\n");
                }
        }
index 9a1a9e25d447dde676e070472c3d20b2e04d961c..c53e042e9f73c021d505d9af2c3a49be85ec5f01 100644 (file)
@@ -53,7 +53,7 @@ typedef struct _func_info_t {
 
 static uint32_t zend_strlen_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 1) {
 
                uint32_t tmp = MAY_BE_RC1;
@@ -83,7 +83,7 @@ static uint32_t zend_strlen_info(const zend_call_info *call_info, const zend_ssa
 
 static uint32_t zend_dechex_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 1) {
                return MAY_BE_RC1 | MAY_BE_STRING;
        } else {
@@ -94,7 +94,7 @@ static uint32_t zend_dechex_info(const zend_call_info *call_info, const zend_ssa
 
 static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            (call_info->num_args == 2 || call_info->num_args == 3)) {
 
                uint32_t t1 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
@@ -130,7 +130,7 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
 
 static uint32_t zend_is_type_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 1) {
                return MAY_BE_RC1 | MAY_BE_FALSE | MAY_BE_TRUE | FUNC_MAY_INLINE;
        } else {
@@ -140,7 +140,7 @@ static uint32_t zend_is_type_info(const zend_call_info *call_info, const zend_ss
 
 static uint32_t zend_l_ss_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 2) {
 
                uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
@@ -165,7 +165,7 @@ static uint32_t zend_l_ss_info(const zend_call_info *call_info, const zend_ssa *
 
 static uint32_t zend_lb_ssn_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 3) {
                uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
                uint32_t arg2_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
@@ -192,7 +192,7 @@ static uint32_t zend_lb_ssn_info(const zend_call_info *call_info, const zend_ssa
 
 static uint32_t zend_b_s_info(const zend_call_info *call_info, const zend_ssa *ssa)
 {
-       if (call_info->caller_init_opline->extended_value == call_info->num_args &&
+       if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
            call_info->num_args == 1) {
 
                uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
@@ -1251,7 +1251,7 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
 int zend_func_info_startup(void)
 {
        zend_extension dummy;
-       int i;
+       size_t i;
 
        if (zend_func_info_rid == -1) {
                zend_func_info_rid = zend_get_resource_handle(&dummy);
index ee14e49b5c3055df70dc7a0aa1f98ff70bc15996..1e6e50b3ef28f0963bde88cf5acb55cc352c8114 100644 (file)
@@ -85,7 +85,7 @@
                        if (ssa->ops[line-1].result_def >= 0) { \
                                MACRO(ssa->ops[line-1].result_def); \
                        } \
-               } else if (line+1 < op_array->last && \
+               } else if ((uint32_t)line+1 < op_array->last && \
                           op_array->opcodes[line+1].opcode == ZEND_OP_DATA) { \
                        if (ssa->ops[line+1].op1_def >= 0) { \
                                MACRO(ssa->ops[line+1].op1_def); \
@@ -3437,8 +3437,7 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
        zend_ssa_var *ssa_vars = ssa->vars;
        zend_ssa_var_info *ssa_var_info = ssa->var_info;
        int ssa_vars_count = ssa->vars_count;
-       uint i;
-       int j;
+       int i, j;
        uint32_t tmp;
 
        while (!zend_bitset_empty(worklist, zend_bitset_len(ssa_vars_count))) {
@@ -3674,8 +3673,7 @@ static int zend_type_narrowing(const zend_op_array *op_array, const zend_script
        ALLOCA_FLAG(use_heap);
        zend_bitset visited = ZEND_BITSET_ALLOCA(2 * bitset_len, use_heap);
        zend_bitset worklist = visited + bitset_len;
-       int i;
-       uint32_t v;
+       int i, v;
        zend_op *opline;
        zend_bool narrowed = 0;
 
index be8a57c3410346c1694f774436400063de91b2e3..bd141d52158f941eaf88d0519a58d12718bbe88f 100644 (file)
@@ -1427,7 +1427,7 @@ static void zend_accel_init_auto_globals(void)
        }
 }
 
-static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handle, int type, char *key, unsigned int key_length, zend_op_array **op_array_p)
+static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handle, int type, char *key, zend_op_array **op_array_p)
 {
        zend_persistent_script *new_persistent_script;
        zend_op_array *orig_active_op_array;
@@ -1440,12 +1440,7 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
 
     /* Try to open file */
     if (file_handle->type == ZEND_HANDLE_FILENAME) {
-        if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) == SUCCESS) {
-               /* key may be changed by zend_stream_open_function() */
-               if (key == ZCG(key)) {
-                       key_length = ZCG(key_len);
-               }
-        } else {
+        if (accelerator_orig_zend_stream_open_function(file_handle->filename, file_handle) != SUCCESS) {
                        *op_array_p = NULL;
                        if (type == ZEND_REQUIRE) {
                                zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
@@ -1484,7 +1479,7 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
 
                /* check if file is too new (may be it's not written completely yet) */
                if (ZCG(accel_directives).file_update_protection &&
-                   (ZCG(request_time) - ZCG(accel_directives).file_update_protection < timestamp)) {
+                   ((accel_time_t)(ZCG(request_time) - ZCG(accel_directives).file_update_protection) < timestamp)) {
                        *op_array_p = accelerator_orig_compile_file(file_handle, type);
                        return NULL;
                }
@@ -1637,7 +1632,7 @@ zend_op_array *file_cache_compile_file(zend_file_handle *file_handle, int type)
                return zend_accel_load_script(persistent_script, 1);
        }
 
-       persistent_script = opcache_compile_file(file_handle, type, NULL, 0, &op_array);
+       persistent_script = opcache_compile_file(file_handle, type, NULL, &op_array);
 
        if (persistent_script) {
                from_memory = 0;
@@ -1834,7 +1829,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
          * If it isn't compile_and_cache_file() changes the flag to 0
          */
                from_shared_memory = 0;
-               persistent_script = opcache_compile_file(file_handle, type, key, key ? key_length : 0, &op_array);
+               persistent_script = opcache_compile_file(file_handle, type, key, &op_array);
                if (persistent_script) {
                        persistent_script = cache_script_in_shared_memory(persistent_script, key, key ? key_length : 0, &from_shared_memory);
                }
@@ -2060,7 +2055,7 @@ static void accel_activate(void)
        ZCG(include_path_check) = 1;
 
        /* check if ZCG(function_table) wasn't somehow polluted on the way */
-       if (ZCG(internal_functions_count) != zend_hash_num_elements(&ZCG(function_table))) {
+       if (ZCG(internal_functions_count) != (zend_long)zend_hash_num_elements(&ZCG(function_table))) {
                zend_accel_error(ACCEL_LOG_WARNING, "Internal functions count changed - was %d, now %d", ZCG(internal_functions_count), zend_hash_num_elements(&ZCG(function_table)));
        }
 
index 0e1069836c51e0a1700009e06b59b1739a3220e5..b8a34108957c96a22fd4695a7e8ab2377d79b100 100644 (file)
@@ -80,13 +80,13 @@ static zend_function_entry accel_functions[] = {
        /* Private functions */
        ZEND_FE(opcache_get_configuration,              arginfo_opcache_none)
        ZEND_FE(opcache_get_status,                             arginfo_opcache_get_status)
-       { NULL, NULL, NULL, 0, 0 }
+       ZEND_FE_END
 };
 
 static int validate_api_restriction(void)
 {
        if (ZCG(accel_directives).restrict_api && *ZCG(accel_directives).restrict_api) {
-               int len = strlen(ZCG(accel_directives).restrict_api);
+               size_t len = strlen(ZCG(accel_directives).restrict_api);
 
                if (!SG(request_info).path_translated ||
                    strlen(SG(request_info).path_translated) < len ||
index 25a504575d2640ed192a2bd3d5ad6ddba6cf5d4d..24a3d21ca279952f20f524d5d02d862d67b7573e 100644 (file)
@@ -89,21 +89,21 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement
                void *data = HT_GET_DATA_ADDR(ht);
                zend_accel_store(data, HT_USED_SIZE(ht));
                HT_SET_DATA_ADDR(ht, data);
-       } else if (ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
+       } else if (ht->nNumUsed < (uint32_t)(-(int32_t)ht->nTableMask) / 2) {
                /* compact table */
                void *old_data = HT_GET_DATA_ADDR(ht);
                Bucket *old_buckets = ht->arData;
-               int32_t hash_size;
+               uint32_t hash_size;
 
                if (ht->nNumUsed <= HT_MIN_SIZE) {
                        hash_size = HT_MIN_SIZE;
                } else {
-                       hash_size = -(int32_t)ht->nTableMask;
+                       hash_size = (uint32_t)(-(int32_t)ht->nTableMask);
                        while (hash_size >> 1 > ht->nNumUsed) {
                                hash_size >>= 1;
                        }
                }
-               ht->nTableMask = -hash_size;
+               ht->nTableMask = (uint32_t)(-(int32_t)hash_size);
                ZEND_ASSERT(((zend_uintptr_t)ZCG(mem) & 0x7) == 0); /* should be 8 byte aligned */
                HT_SET_DATA_ADDR(ht, ZCG(mem));
                ZCG(mem) = (void*)((char*)ZCG(mem) + ZEND_ALIGNED_SIZE((hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket))));
@@ -171,21 +171,21 @@ static void zend_hash_persist_immutable(HashTable *ht)
        }
        if (ht->u.flags & HASH_FLAG_PACKED) {
                HT_SET_DATA_ADDR(ht, zend_accel_memdup(HT_GET_DATA_ADDR(ht), HT_USED_SIZE(ht)));
-       } else if (ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
+       } else if (ht->nNumUsed < (uint32_t)(-(int32_t)ht->nTableMask) / 2) {
                /* compact table */
                void *old_data = HT_GET_DATA_ADDR(ht);
                Bucket *old_buckets = ht->arData;
-               int32_t hash_size;
+               uint32_t hash_size;
 
                if (ht->nNumUsed <= HT_MIN_SIZE) {
                        hash_size = HT_MIN_SIZE;
                } else {
-                       hash_size = -(int32_t)ht->nTableMask;
+                       hash_size = (uint32_t)(-(int32_t)ht->nTableMask);
                        while (hash_size >> 1 > ht->nNumUsed) {
                                hash_size >>= 1;
                        }
                }
-               ht->nTableMask = -hash_size;
+               ht->nTableMask = (uint32_t)(-(int32_t)hash_size);
                ZEND_ASSERT(((zend_uintptr_t)ZCG(mem) & 0x7) == 0); /* should be 8 byte aligned */
                HT_SET_DATA_ADDR(ht, ZCG(mem));
                ZCG(mem) = (void*)((char*)ZCG(mem) + (hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket)));
index 22e74d6b36f12420746cb8571c428f319fba0731..84cd417204c9275e3db097713ad42e837c75f383 100644 (file)
@@ -60,14 +60,14 @@ static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *
                return;
        }
 
-       if (!(ht->u.flags & HASH_FLAG_PACKED) && ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
+       if (!(ht->u.flags & HASH_FLAG_PACKED) && ht->nNumUsed < (uint32_t)(-(int32_t)ht->nTableMask) / 2) {
                /* compact table */
-               int32_t hash_size;
+               uint32_t hash_size;
 
                if (ht->nNumUsed <= HT_MIN_SIZE) {
                        hash_size = HT_MIN_SIZE;
                } else {
-                       hash_size = -(int32_t)ht->nTableMask;
+                       hash_size = (uint32_t)(-(int32_t)ht->nTableMask);
                        while (hash_size >> 1 > ht->nNumUsed) {
                                hash_size >>= 1;
                        }
index cc88bd100a9babff0ad6101c3e346ac82332f4f4..57b6a3b49c3fd8deb62ff0d0c017d6876b386b93 100644 (file)
@@ -89,7 +89,7 @@ PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char
        }
        if ((argv[*optind][0] == '-') && (argv[*optind][1] == '-')) {
                const char *pos;
-               int arg_end = (int)strlen(argv[*optind])-1;
+               size_t arg_end = strlen(argv[*optind])-1;
 
                /* '--' indicates end of args if not followed by a known long option name */
                if (argv[*optind][2] == '\0') {
index d8d141fdd682854e1a58cde7a2bbb16bf702b085..754386860522fe7e4a98358e674b760b61eb8aa6 100644 (file)
@@ -620,7 +620,7 @@ static int multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes
        char *bound;
 
        /* fill buffer if needed */
-       if (bytes > self->bytes_in_buffer) {
+       if (bytes > (size_t)self->bytes_in_buffer) {
                fill_buffer(self);
        }
 
@@ -1058,7 +1058,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
                                        wlen = write(fd, buff, blen);
 #endif
 
-                                       if (wlen == -1) {
+                                       if (wlen == (size_t)-1) {
                                                /* write failed */
 #if DEBUG_FILE_UPLOAD
                                                sapi_module.sapi_error(E_NOTICE, "write() failed - %s", strerror(errno));
index 261293ccbedeba0bb31103624b4063bdad56d0ac..9e86d72221182dd31b62f729a33e70801cdb215f 100644 (file)
@@ -555,11 +555,11 @@ typedef struct buf_area buffy;
  * to be printed.
  */
 #define FIX_PRECISION( adjust, precision, s, s_len )   \
-    if ( adjust )                                      \
-       while ( s_len < precision )                     \
-       {                                               \
-           *--s = '0' ;                                \
-           s_len++ ;                                   \
+    if ( adjust )                                              \
+       while ( s_len < (size_t)precision )     \
+       {                                                                       \
+           *--s = '0' ;                                        \
+           s_len++ ;                                           \
        }
 
 /*
@@ -796,14 +796,14 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
                         */
                        switch (*fmt) {
                                case 'Z': {
-                                                                   zvp = (zval*) va_arg(ap, zval*);
+                                       zvp = (zval*) va_arg(ap, zval*);
                                        free_zcopy = zend_make_printable_zval(zvp, &zcopy);
                                        if (free_zcopy) {
                                                zvp = &zcopy;
                                        }
                                        s_len = Z_STRLEN_P(zvp);
                                        s = Z_STRVAL_P(zvp);
-                                       if (adjust_precision && precision < s_len) {
+                                       if (adjust_precision && (size_t)precision < s_len) {
                                                s_len = precision;
                                        }
                                        break;
@@ -991,7 +991,7 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
                                        s = va_arg(ap, char *);
                                        if (s != NULL) {
                                                s_len = strlen(s);
-                                               if (adjust_precision && precision < s_len) {
+                                               if (adjust_precision && (size_t)precision < s_len) {
                                                        s_len = precision;
                                                }
                                        } else {
@@ -1190,14 +1190,14 @@ fmt_error:
                                *--s = prefix_char;
                                s_len++;
                        }
-                       if (adjust_width && adjust == RIGHT && min_width > s_len) {
+                       if (adjust_width && adjust == RIGHT && (size_t)min_width > s_len) {
                                if (pad_char == '0' && prefix_char != NUL) {
                                        INS_CHAR(*s, sp, bep, cc)
                                                s++;
                                        s_len--;
                                        min_width--;
                                }
-                               PAD(min_width, s_len, pad_char);
+                               PAD((size_t)min_width, s_len, pad_char);
                        }
                        /*
                         * Print the string s.
@@ -1207,8 +1207,8 @@ fmt_error:
                                s++;
                        }
 
-                       if (adjust_width && adjust == LEFT && min_width > s_len)
-                               PAD(min_width, s_len, pad_char);
+                       if (adjust_width && adjust == LEFT && (size_t)min_width > s_len)
+                               PAD((size_t)min_width, s_len, pad_char);
                        if (free_zcopy) {
                                zval_dtor(&zcopy);
                        }
@@ -1263,7 +1263,7 @@ PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) /* {{{
        va_start(ap, format);
        strx_printv(&cc, buf, len, format, ap);
        va_end(ap);
-       if (cc >= len) {
+       if ((size_t)cc >= len) {
                cc = (int)len -1;
                buf[cc] = '\0';
        }
@@ -1276,7 +1276,7 @@ PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list a
        int cc;
 
        strx_printv(&cc, buf, len, format, ap);
-       if (cc >= len) {
+       if ((size_t)cc >= len) {
                cc = (int)len -1;
                buf[cc] = '\0';
        }
index ab8117d3be91ef8be81fb279242dc824ddffd4fa..30c27c6e74cb05ce36b1bafa1b38e3eed7a9b486 100644 (file)
  */
 #define FIX_PRECISION(adjust, precision, s, s_len) do {        \
     if (adjust)                                                                \
-               while (s_len < precision) {                     \
+               while (s_len < (size_t)precision) {                             \
                        *--s = '0';                                     \
                        s_len++;                                        \
                }                                                                                               \
@@ -417,7 +417,7 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
                                        }
                                        s_len = Z_STRLEN_P(zvp);
                                        s = Z_STRVAL_P(zvp);
-                                       if (adjust_precision && precision < s_len) {
+                                       if (adjust_precision && (size_t)precision < s_len) {
                                                s_len = precision;
                                        }
                                        break;
@@ -803,7 +803,7 @@ fmt_error:
                                *--s = prefix_char;
                                s_len++;
                        }
-                       if (adjust_width && adjust == RIGHT && min_width > s_len) {
+                       if (adjust_width && adjust == RIGHT && (size_t)min_width > s_len) {
                                if (pad_char == '0' && prefix_char != NUL) {
                                        INS_CHAR(xbuf, *s, is_char);
                                        s++;
@@ -817,7 +817,7 @@ fmt_error:
                         */
                        INS_STRING(xbuf, s, s_len, is_char);
 
-                       if (adjust_width && adjust == LEFT && min_width > s_len) {
+                       if (adjust_width && adjust == LEFT && (size_t)min_width > s_len) {
                                PAD_CHAR(xbuf, pad_char, min_width - s_len, is_char);
                        }
 
index 85395107d52f1c7997bfe84c78cfc398402e5e7b..d542e336e3d48b001f261285cf05e0378d4f42a9 100644 (file)
@@ -271,6 +271,7 @@ static php_stream_wrapper_ops  php_glob_stream_wrapper_ops = {
        NULL,
        NULL,
        NULL,
+       NULL,
        NULL
 };
 
index 56ffe344aa8feb90e588446c1e9d7c45b3b969bd..afa45c3968559a420f676c660158efa204be2cb1 100644 (file)
@@ -695,7 +695,7 @@ static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, con
                        }
                        /* found parameter ... the heart of cs ppl lies in +1/-1 or was it +2 this time? */
                        plen = sep - path;
-                       vlen = (semi ? semi - sep : mlen - plen) - 1 /* '=' */;
+                       vlen = (semi ? (size_t)(semi - sep) : (mlen - plen)) - 1 /* '=' */;
                        key = estrndup(path, plen);
                        if (plen != sizeof("mediatype")-1 || memcmp(key, "mediatype", sizeof("mediatype")-1)) {
                                add_assoc_stringl_ex(&meta, key, plen, sep + 1, vlen);
@@ -770,7 +770,8 @@ PHPAPI php_stream_wrapper_ops php_stream_rfc2397_wops = {
        NULL, /* unlink */
        NULL, /* rename */
        NULL, /* mkdir */
-       NULL  /* rmdir */
+       NULL, /* rmdir */
+       NULL, /* stream_metadata */
 };
 
 PHPAPI php_stream_wrapper php_stream_rfc2397_wrapper = {
index d64d5caa6a546de42b19881c1c0ea0eeda2bf038..1ae27841dfe96457e4a6db191c0445c81973dca2 100644 (file)
@@ -1753,7 +1753,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
        HashTable *wrapper_hash = (FG(stream_wrappers) ? FG(stream_wrappers) : &url_stream_wrappers_hash);
        php_stream_wrapper *wrapper = NULL;
        const char *p, *protocol = NULL;
-       int n = 0;
+       size_t n = 0;
 
        if (path_for_open) {
                *path_for_open = (char*)path;
index feaa099c8cfd491f0d9caecf3b826085baf6981f..795e2e8a4493a455f1c7662e8d317e73eff5925e 100644 (file)
@@ -60,7 +60,8 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
        php_stream *stream = NULL;
        php_stream_transport_factory factory = NULL;
        const char *p, *protocol = NULL;
-       int n = 0, failed = 0;
+       size_t n = 0;
+       int failed = 0;
        zend_string *error_text = NULL;
        struct timeval default_timeout = { 0, 0 };
 
index 8aa76f0e1cd66a0c62e76d447132c4d638546544..dddabb794d7ecee184efd9c524eff1f1d0d05fea 100644 (file)
@@ -1271,7 +1271,7 @@ static void fpm_conf_ini_parser_include(char *inc, void *arg) /* {{{ */
                                return;
                        }
 #endif /* GLOB_NOMATCH */
-                       zlog(ZLOG_ERROR, "Unable to globalize '%s' (ret=%d) from %s at line %d.", inc, i, filename, ini_lineno);
+                       zlog(ZLOG_ERROR, "Unable to globalize '%s' (ret=%zd) from %s at line %d.", inc, i, filename, ini_lineno);
                        *error = 1;
                        efree(filename);
                        return;