]> granicus.if.org Git - php/commitdiff
Fixed compilation warnings
authorDmitry Stogov <dmitry@zend.com>
Thu, 23 Jun 2016 09:47:06 +0000 (12:47 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 23 Jun 2016 09:47:06 +0000 (12:47 +0300)
36 files changed:
ext/mysqlnd/mysqlnd_connection.c
ext/mysqlnd/mysqlnd_plugin.c
ext/mysqlnd/mysqlnd_ps_codec.c
ext/mysqlnd/mysqlnd_wireprotocol.c
ext/pgsql/pgsql.c
ext/phar/phar.c
ext/shmop/shmop.c
ext/snmp/snmp.c
ext/soap/php_sdl.c
ext/soap/php_sdl.h
ext/soap/soap.c
ext/sockets/conversions.c
ext/sockets/multicast.c
ext/sockets/sendrecvmsg.c
ext/sockets/sockaddr_conv.c
ext/sockets/sockets.c
ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/browscap.c
ext/standard/crypt_freesec.c
ext/standard/dir.c
ext/standard/exec.c
ext/standard/file.c
ext/standard/ftp_fopen_wrapper.c
ext/standard/http_fopen_wrapper.c
ext/standard/iptc.c
ext/standard/metaphone.c
ext/standard/pack.c
ext/standard/password.c
ext/standard/php_fopen_wrapper.c
ext/standard/php_incomplete_class.h
ext/standard/string.c
ext/standard/type.c
ext/standard/user_filters.c
ext/sysvshm/sysvshm.c
ext/xml/xml.c

index bb582dbf6ac9129036fb3b1054022a5e6055eb89..701bc282e11bedc5f557e1e7e2e5336fb9cfcd92 100644 (file)
@@ -620,7 +620,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 
        DBG_INF_FMT("host=%s user=%s db=%s port=%u flags=%u persistent=%u state=%u",
                                hostname.s?hostname.s:"", username.s?username.s:"", database.s?database.s:"", port, mysql_flags,
-                               conn? conn->persistent:0, conn? GET_CONNECTION_STATE(&conn->state):-1);
+                               conn? conn->persistent:0, conn? (int)GET_CONNECTION_STATE(&conn->state):-1);
 
        if (GET_CONNECTION_STATE(&conn->state) > CONN_ALLOCED) {
                DBG_INF("Connecting on a connected handle.");
index b90081a0efc5aeacac02c9a1c4c9358fcd3e5eca..7e1e37857870e8360d70f96ae28c744c8634a1df 100644 (file)
@@ -60,6 +60,7 @@ static struct st_mysqlnd_typeii_plugin_example mysqlnd_example_plugin =
                }
        },
        NULL,   /* methods */
+       0
 };
 
 
index d989101060c1ae8d9559e28359e79892fe71926a..086866d1aec2983f81804508d02b49d41f9c079e 100644 (file)
@@ -184,7 +184,7 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, const unsigned int
 # define NOT_FIXED_DEC 31
 #endif
 
-       dval = mysql_float_to_double(fval, (field->decimals >= NOT_FIXED_DEC) ? -1 : field->decimals);
+       dval = mysql_float_to_double(fval, (field->decimals >= NOT_FIXED_DEC) ? -1 : (int)field->decimals);
 
        ZVAL_DOUBLE(zv, dval);
        DBG_VOID_RETURN;
index 825c56feaed3bb4fc832c4c03d9b7cf7941ee603..48b64c19f04f09b2358a2cfc5b14639d1fbee0ef 100644 (file)
@@ -1611,7 +1611,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv
                MYSQLND_INC_CONN_STATISTIC_W_VALUE2(stats, statistic, 1,
                                                                                STAT_BYTES_RECEIVED_PURE_DATA_PS,
                                                                                (Z_TYPE_P(current_field) == IS_STRING)?
-                                                                                       Z_STRLEN_P(current_field) : (p - orig_p));
+                                                                                       Z_STRLEN_P(current_field) : (size_t)(p - orig_p));
 
                if (!((bit<<=1) & 255)) {
                        bit = 1;        /* to the following byte */
index c4dfe2ed9d60a168342cbef7583b5ae9b85534c3..4ae0ae63ea69f7dc77a49fa8f2b59b88ae931394 100644 (file)
@@ -6528,7 +6528,7 @@ PHP_FUNCTION(pg_convert)
 }
 /* }}} */
 
-static int do_exec(smart_str *querystr, int expect, PGconn *pg_link, zend_ulong opt) /* {{{ */
+static int do_exec(smart_str *querystr, ExecStatusType expect, PGconn *pg_link, zend_ulong opt) /* {{{ */
 {
        if (opt & PGSQL_DML_ASYNC) {
                if (PQsendQuery(pg_link, ZSTR_VAL(querystr->s))) {
index 66da7c81c96cf38276b3dc273dd878034771dfa4..81596423ffe39dd3d0a0432acb536431a8ece4a7 100644 (file)
@@ -1030,7 +1030,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
                        PHAR_GET_32(buffer, len);
                }
        }
-       if(len > endbuffer - buffer) {
+       if(len > (size_t)(endbuffer - buffer)) {
                MAPPHAR_FAIL("internal corruption of phar \"%s\" (trying to read past buffer end)");
        }
        if (phar_parse_metadata(&buffer, &mydata->metadata, len) == FAILURE) {
@@ -1071,7 +1071,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
                        entry.manifest_pos = manifest_index;
                }
 
-               if (entry.filename_len + 20 > endbuffer - buffer) {
+               if (entry.filename_len + 20 > (size_t)(endbuffer - buffer)) {
                        MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
                }
 
@@ -1113,7 +1113,7 @@ static int phar_parse_pharfile(php_stream *fp, char *fname, int fname_len, char
                } else {
                        entry.metadata_len = 0;
                }
-               if (len > endbuffer - buffer) {
+               if (len > (size_t)(endbuffer - buffer)) {
                        pefree(entry.filename, entry.is_persistent);
                        MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
                }
index d647790aa06f8b6070ff1e795e2d0fa102828ec6..e65df7f790de23726669a31c262ff14d6ab807a0 100644 (file)
@@ -305,7 +305,7 @@ PHP_FUNCTION(shmop_size)
 PHP_FUNCTION(shmop_write)
 {
        struct php_shmop *shmop;
-       int writesize;
+       zend_long writesize;
        zend_long offset;
        zend_string *data;
        zval *shmid;
@@ -328,7 +328,7 @@ PHP_FUNCTION(shmop_write)
                RETURN_FALSE;
        }
 
-       writesize = (ZSTR_LEN(data) < shmop->size - offset) ? ZSTR_LEN(data) : shmop->size - offset;
+       writesize = ((zend_long)ZSTR_LEN(data) < shmop->size - offset) ? (zend_long)ZSTR_LEN(data) : shmop->size - offset;
        memcpy(shmop->addr + offset, ZSTR_VAL(data), writesize);
 
        RETURN_LONG(writesize);
index 7c4faa6cf32c93d6e5555414ceed91c98da9d8fb..cb48a0da222d9fb7156796bd4ca492de9e51de63 100644 (file)
@@ -2077,12 +2077,11 @@ static HashTable *php_snmp_get_properties(zval *object)
        HashTable *props;
        zval rv;
        zend_string *key;
-       zend_ulong num_key;
 
        obj = Z_SNMP_P(object);
        props = zend_std_get_properties(object);
 
-       ZEND_HASH_FOREACH_KEY_PTR(&php_snmp_properties, num_key, key, hnd) {
+       ZEND_HASH_FOREACH_STR_KEY_PTR(&php_snmp_properties, key, hnd) {
                if (!hnd->read_func || hnd->read_func(obj, &rv) != SUCCESS) {
                        ZVAL_NULL(&rv);
                }
index fdbd6d19af283dede02eed209dd0d23cc9fe46dc..f3d3aa88db847ceeb003a9ef2f444bca28207c5c 100644 (file)
@@ -177,7 +177,7 @@ encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len)
        return NULL;
 }
 
-sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type)
+sdlBindingPtr get_binding_from_type(sdlPtr sdl, sdlBindingType type)
 {
        sdlBindingPtr binding;
 
@@ -227,7 +227,7 @@ static int is_wsdl_element(xmlNodePtr node)
 void sdl_set_uri_credentials(sdlCtx *ctx, char *uri)
 {
        char *s;
-       int l1, l2;
+       size_t l1, l2;
        zval context;
        zval *header = NULL;
 
@@ -235,11 +235,11 @@ void sdl_set_uri_credentials(sdlCtx *ctx, char *uri)
        s = strstr(ctx->sdl->source, "://");
        if (!s) return;
        s = strchr(s+3, '/');
-       l1 = s ? (s - ctx->sdl->source) : strlen(ctx->sdl->source);
+       l1 = s ? (size_t)(s - ctx->sdl->source) : strlen(ctx->sdl->source);
        s = strstr((char*)uri, "://");
        if (!s) return;
        s = strchr(s+3, '/');
-       l2 = s ? (s - (char*)uri) : strlen((char*)uri);
+       l2 = s ? (size_t)(s - (char*)uri) : strlen((char*)uri);
        if (l1 != l2) {
                /* check for http://...:80/ */
                if (l1 > 11 &&
@@ -3156,7 +3156,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
        char  fn[MAXPATHLEN];
        sdlPtr sdl = NULL;
        char* old_error_code = SOAP_GLOBAL(error_code);
-       int uri_len = 0;
+       size_t uri_len = 0;
        php_stream_context *context=NULL;
        zval *tmp, *proxy_host, *proxy_port, orig_context, new_context;
        smart_str headers = {0};
@@ -3329,7 +3329,7 @@ cache_in_memory:
                                SOAP_GLOBAL(mem_cache) = malloc(sizeof(HashTable));
                                zend_hash_init(SOAP_GLOBAL(mem_cache), 0, NULL, delete_psdl, 1);
                        } else if (SOAP_GLOBAL(cache_limit) > 0 &&
-                                  SOAP_GLOBAL(cache_limit) <= zend_hash_num_elements(SOAP_GLOBAL(mem_cache))) {
+                                  SOAP_GLOBAL(cache_limit) <= (zend_long)zend_hash_num_elements(SOAP_GLOBAL(mem_cache))) {
                                /* in-memory cache overflow */
                                sdl_cache_bucket *q;
                                time_t latest = t;
index f905b508cdf219beab686f117578069951417261..26ca5c7d176172acc07b60841580f3085c15ab68 100644 (file)
@@ -260,7 +260,7 @@ encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *ty
 encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
 encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
 
-sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
+sdlBindingPtr get_binding_from_type(sdlPtr sdl, sdlBindingType type);
 sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
 
 void delete_sdl(void *handle);
index 885116e2e9bbb04e4b69ea7f3a2ccba1c6dcd7ce..23bbfb6e84c560dd718a37c09ef8d1764a7a7eae 100644 (file)
@@ -2157,7 +2157,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
                        zval fault;
                        char* code = SOAP_GLOBAL(error_code);
                        char buffer[1024];
-                       int buffer_len;
+                       size_t buffer_len;
 #ifdef va_copy
                        va_list argcopy;
 #endif
@@ -2172,7 +2172,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
                        buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, args);
 #endif
                        buffer[sizeof(buffer)-1]=0;
-                       if (buffer_len > sizeof(buffer) - 1 || buffer_len < 0) {
+                       if (buffer_len > sizeof(buffer) - 1 || buffer_len == (size_t)-1) {
                                buffer_len = sizeof(buffer) - 1;
                        }
 
@@ -2238,7 +2238,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
                                !service->send_errors) {
                                strcpy(buffer, "Internal Error");
                        } else {
-                               int buffer_len;
+                               size_t buffer_len;
                                zval outbuflen;
 
 #ifdef va_copy
@@ -2249,7 +2249,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
                                buffer_len = vslprintf(buffer, sizeof(buffer)-1, format, args);
 #endif
                                buffer[sizeof(buffer)-1]=0;
-                               if (buffer_len > sizeof(buffer) - 1 || buffer_len < 0) {
+                               if (buffer_len > sizeof(buffer) - 1 || buffer_len == (size_t)-1) {
                                        buffer_len = sizeof(buffer) - 1;
                                }
 
index 892442a88fd33c0d924c237ed3f27d4e6d5f769c..46286a468d7b4459b17aa00610b96dfb6485b990 100644 (file)
@@ -225,7 +225,7 @@ static unsigned from_array_iterate(const zval *arr,
        /* Note i starts at 1, not 0! */
        i = 1;
        ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(arr), elem) {
-               if (snprintf(buf, sizeof(buf), "element #%u", i) >= sizeof(buf)) {
+               if ((size_t)snprintf(buf, sizeof(buf), "element #%u", i) >= sizeof(buf)) {
                        memcpy(buf, "element", sizeof("element"));
                }
                zend_llist_add_element(&ctx->keys, &bufp);
@@ -937,7 +937,7 @@ static void from_zval_write_control_array(const zval *arr, char *msghdr_c, ser_c
                        break;
                }
 
-               if (snprintf(buf, sizeof(buf), "element #%u", (unsigned)i++) >= sizeof(buf)) {
+               if ((size_t)snprintf(buf, sizeof(buf), "element #%u", (unsigned)i++) >= sizeof(buf)) {
                        memcpy(buf, "element", sizeof("element"));
                }
                zend_llist_add_element(&ctx->keys, &bufp);
@@ -1019,7 +1019,7 @@ static void to_zval_read_control_array(const char *msghdr_c, zval *zv, res_conte
                ZVAL_NULL(&tmp);
                elem = zend_hash_next_index_insert(Z_ARRVAL_P(zv), &tmp);
 
-               if (snprintf(buf, sizeof(buf), "element #%u", (unsigned)i++) >= sizeof(buf)) {
+               if ((size_t)snprintf(buf, sizeof(buf), "element #%u", (unsigned)i++) >= sizeof(buf)) {
                        memcpy(buf, "element", sizeof("element"));
                }
                zend_llist_add_element(&ctx->keys, &bufp);
@@ -1061,7 +1061,7 @@ static void from_zval_write_msghdr_buffer_size(const zval *elem, char *msghdr_c,
                return;
        }
 
-       if (lval < 0 || lval > MAX_USER_BUFF_SIZE) {
+       if (lval < 0 || (zend_ulong)lval > MAX_USER_BUFF_SIZE) {
                do_from_zval_err(ctx, "the buffer size must be between 1 and " ZEND_LONG_FMT "; "
                                "given " ZEND_LONG_FMT, (zend_long)MAX_USER_BUFF_SIZE, lval);
                return;
@@ -1236,7 +1236,7 @@ static void from_zval_write_ifindex(const zval *zv, char *uinteger, ser_context
        unsigned ret = 0;
 
        if (Z_TYPE_P(zv) == IS_LONG) {
-               if (Z_LVAL_P(zv) < 0 || Z_LVAL_P(zv) > UINT_MAX) { /* allow 0 (unspecified interface) */
+               if (Z_LVAL_P(zv) < 0 || (zend_ulong)Z_LVAL_P(zv) > UINT_MAX) { /* allow 0 (unspecified interface) */
                        do_from_zval_err(ctx, "the interface index cannot be negative or "
                                        "larger than %u; given " ZEND_LONG_FMT, UINT_MAX, Z_LVAL_P(zv));
                } else {
index 75984ec3233b8639007b28c2ad4fa4b3f4fc3510..fec762adf6b3be5de5f695657f36ca30f15b5f8f 100644 (file)
@@ -90,7 +90,7 @@ static int php_get_if_index_from_zval(zval *val, unsigned *out)
        int ret;
 
        if (Z_TYPE_P(val) == IS_LONG) {
-               if (Z_LVAL_P(val) < 0 || Z_LVAL_P(val) > UINT_MAX) {
+               if (Z_LVAL_P(val) < 0 || (zend_ulong)Z_LVAL_P(val) > UINT_MAX) {
                        php_error_docref(NULL, E_WARNING,
                                "the interface index cannot be negative or larger than %u;"
                                " given " ZEND_LONG_FMT, UINT_MAX, Z_LVAL_P(val));
index 72d8cfc47e4c7f2c257cbbe41cc63485127dd743..330645598dd534ecc17c5df74570f3c449290823 100644 (file)
@@ -304,8 +304,8 @@ PHP_FUNCTION(socket_cmsg_space)
                return;
        }
 
-       if (entry->var_el_size > 0 && n > (ZEND_LONG_MAX - (zend_long)entry->size -
-                       (zend_long)CMSG_SPACE(0) - 15L) / entry->var_el_size) {
+       if (entry->var_el_size > 0 && n > (zend_long)((ZEND_LONG_MAX - entry->size -
+                       CMSG_SPACE(0) - 15L) / entry->var_el_size)) {
                /* the -15 is to account for any padding CMSG_SPACE may add after the data */
                php_error_docref0(NULL, E_WARNING, "The value for the "
                                "third argument (" ZEND_LONG_FMT ") is too large", n);
index 1ce109ee8c06cfa2766126d1ef8402fc87ebd6c1..57996612d2d7ebc02f96bc914cd30d83e52073fc 100644 (file)
@@ -66,7 +66,7 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_
                unsigned scope_id = 0;
 
                if (IS_LONG == is_numeric_string(scope, strlen(scope), &lval, &dval, 0)) {
-                       if (lval > 0 && lval <= UINT_MAX) {
+                       if (lval > 0 && (zend_ulong)lval <= UINT_MAX) {
                                scope_id = lval;
                        }
                } else {
index c289b0f9a3ed97a45ef33d3ee05ccdbf135ae62c..c23f984720c4f931164625c5a41ac5e0e718c770 100644 (file)
@@ -1659,9 +1659,9 @@ PHP_FUNCTION(socket_send)
                RETURN_FALSE;
        }
 
-       retval = send(php_sock->bsd_socket, buf, (buf_len < len ? buf_len : len), flags);
+       retval = send(php_sock->bsd_socket, buf, (buf_len < (size_t)len ? buf_len : (size_t)len), flags);
 
-       if (retval == -1) {
+       if (retval == (size_t)-1) {
                PHP_SOCKET_ERROR(php_sock, "unable to write to socket", errno);
                RETURN_FALSE;
        }
@@ -1827,7 +1827,7 @@ PHP_FUNCTION(socket_sendto)
                        s_un.sun_family = AF_UNIX;
                        snprintf(s_un.sun_path, 108, "%s", addr);
 
-                       retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len,     flags, (struct sockaddr *) &s_un, SUN_LEN(&s_un));
+                       retval = sendto(php_sock->bsd_socket, buf, ((size_t)len > buf_len) ? buf_len : (size_t)len,     flags, (struct sockaddr *) &s_un, SUN_LEN(&s_un));
                        break;
 
                case AF_INET:
@@ -1843,7 +1843,7 @@ PHP_FUNCTION(socket_sendto)
                                RETURN_FALSE;
                        }
 
-                       retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len, flags, (struct sockaddr *) &sin, sizeof(sin));
+                       retval = sendto(php_sock->bsd_socket, buf, ((size_t)len > buf_len) ? buf_len : (size_t)len, flags, (struct sockaddr *) &sin, sizeof(sin));
                        break;
 #if HAVE_IPV6
                case AF_INET6:
@@ -1859,7 +1859,7 @@ PHP_FUNCTION(socket_sendto)
                                RETURN_FALSE;
                        }
 
-                       retval = sendto(php_sock->bsd_socket, buf, (len > buf_len) ? buf_len : len, flags, (struct sockaddr *) &sin6, sizeof(sin6));
+                       retval = sendto(php_sock->bsd_socket, buf, ((size_t)len > buf_len) ? buf_len : (size_t)len, flags, (struct sockaddr *) &sin6, sizeof(sin6));
                        break;
 #endif
                default:
index 4dba1a15f34ef5b47bc6c4c4a2eea12f0611f46c..dd18f07ba63ada5f567e7647005583721d1c6581 100644 (file)
@@ -2286,7 +2286,7 @@ long_str:
 
                Z_TYPE_INFO(tmp) = IS_LONG;
                if (low > high) {               /* Negative steps */
-                       if (low - high < lstep) {
+                       if ((zend_ulong)(low - high) < lstep) {
                                err = 1;
                                goto err;
                        }
@@ -2300,7 +2300,7 @@ long_str:
                                }
                        } ZEND_HASH_FILL_END();
                } else if (high > low) {        /* Positive steps */
-                       if (high - low < lstep) {
+                       if ((zend_ulong)(high - low) < lstep) {
                                err = 1;
                                goto err;
                        }
@@ -2336,7 +2336,7 @@ static void php_array_data_shuffle(zval *array) /* {{{ */
        Bucket *p, temp;
        HashTable *hash;
        zend_long rnd_idx;
-       uint32_t n_left;
+       zend_long n_left;
 
        n_elems = zend_hash_num_elements(Z_ARRVAL_P(array));
 
@@ -2429,12 +2429,12 @@ PHP_FUNCTION(shuffle)
 }
 /* }}} */
 
-static void php_splice(HashTable *in_hash, int offset, int length, HashTable *replace, HashTable *removed) /* {{{ */
+static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, HashTable *replace, HashTable *removed) /* {{{ */
 {
        HashTable        out_hash;                      /* Output hashtable */
-       int                      num_in,                        /* Number of entries in the input hashtable */
-                                pos;                           /* Current position in the hashtable */
-       uint         idx;
+       zend_long        num_in;                        /* Number of entries in the input hashtable */
+       zend_long        pos;                           /* Current position in the hashtable */
+       uint32_t     idx;
        Bucket          *p;                                     /* Pointer to hash bucket */
        zval            *entry;                         /* Hash entry */
        uint32_t    iter_pos = zend_hash_iterators_lower_pos(in_hash, 0);
@@ -2473,7 +2473,7 @@ static void php_splice(HashTable *in_hash, int offset, int length, HashTable *re
                        zend_hash_add_new(&out_hash, p->key, entry);
                }
                if (idx == iter_pos) {
-                       if (idx != pos) {
+                       if ((zend_long)idx != pos) {
                                zend_hash_iterators_update(in_hash, idx, pos);
                        }
                        iter_pos = zend_hash_iterators_lower_pos(in_hash, iter_pos + 1);
@@ -2543,7 +2543,7 @@ static void php_splice(HashTable *in_hash, int offset, int length, HashTable *re
                        zend_hash_add_new(&out_hash, p->key, entry);
                }
                if (idx == iter_pos) {
-                       if (idx != pos) {
+                       if ((zend_long)idx != pos) {
                                zend_hash_iterators_update(in_hash, idx, pos);
                        }
                        iter_pos = zend_hash_iterators_lower_pos(in_hash, iter_pos + 1);
@@ -2902,7 +2902,7 @@ PHP_FUNCTION(array_splice)
        }
 
        /* Perform splice */
-       php_splice(Z_ARRVAL_P(array), (int)offset, (int)length, repl_array ? Z_ARRVAL_P(repl_array) : NULL, rem_hash);
+       php_splice(Z_ARRVAL_P(array), offset, length, repl_array ? Z_ARRVAL_P(repl_array) : NULL, rem_hash);
 }
 /* }}} */
 
@@ -3047,7 +3047,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
                                        convert_to_array_ex(dest_zval);
                                        add_next_index_null(dest_zval);
                                } else if (Z_TYPE_P(dest_zval) == IS_ARRAY) {
-                                       if (UNEXPECTED(Z_ARRVAL_P(dest_zval)->nNextFreeElement > Z_ARRVAL_P(dest_zval)->nNumUsed)) {
+                                       if (UNEXPECTED(Z_ARRVAL_P(dest_zval)->nNextFreeElement > (zend_long)Z_ARRVAL_P(dest_zval)->nNumUsed)) {
                                                Z_ARRVAL_P(dest_zval)->nNextFreeElement = Z_ARRVAL_P(dest_zval)->nNumUsed;
                                        }
                                } else {
@@ -4954,7 +4954,7 @@ PHP_FUNCTION(array_multisort)
        /* Make sure the arrays are of the same size. */
        array_size = zend_hash_num_elements(Z_ARRVAL_P(arrays[0]));
        for (i = 0; i < num_arrays; i++) {
-               if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != array_size) {
+               if (zend_hash_num_elements(Z_ARRVAL_P(arrays[i])) != (uint32_t)array_size) {
                        php_error_docref(NULL, E_WARNING, "Array sizes are inconsistent");
                        MULTISORT_ABORT;
                }
index 5a0d0a5d78b4dd3283be76a439a7fb3e84ead542..439c0fdbae1b904a72118d78f650f705c83a05a8 100644 (file)
@@ -5138,7 +5138,8 @@ ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highl
 PHP_FUNCTION(highlight_file)
 {
        char *filename;
-       size_t filename_len, ret;
+       size_t filename_len;
+       int ret;
        zend_syntax_highlighter_ini syntax_highlighter_ini;
        zend_bool i = 0;
 
@@ -5181,7 +5182,7 @@ PHP_FUNCTION(php_strip_whitespace)
        char *filename;
        size_t filename_len;
        zend_lex_state original_lex_state;
-       zend_file_handle file_handle = {{0}};
+       zend_file_handle file_handle;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
                RETURN_FALSE;
@@ -5189,6 +5190,7 @@ PHP_FUNCTION(php_strip_whitespace)
 
        php_output_start_default();
 
+       memset(&file_handle, 0, sizeof(file_handle));
        file_handle.type = ZEND_HANDLE_FILENAME;
        file_handle.filename = filename;
        file_handle.free_filename = 0;
index f47478a2415c97608567a40de4f454f5a4ae9180..c283ebc6b965cf4b0b8c923c637d4f5d986c6ef8 100644 (file)
@@ -73,7 +73,7 @@ static void browscap_entry_dtor_persistent(zval *zvalue) /* {{{ */ {
 
 static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */
 {
-       int i, j=0;
+       size_t i, j=0;
        char *t;
        zend_string *res;
        char *lc_pattern;
@@ -216,7 +216,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
 
 static int browscap_read_file(char *filename, browser_data *browdata, int persistent) /* {{{ */
 {
-       zend_file_handle fh = {{0}};
+       zend_file_handle fh;
 
        if (filename == NULL || filename[0] == '\0') {
                return FAILURE;
@@ -232,6 +232,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis
                                                                         :browscap_entry_dtor_request),
                        persistent, 0);
 
+       memset(&fh, 0, sizeof(fh));
        fh.handle.fp = VCWD_FOPEN(filename, "r");
        fh.opened_path = NULL;
        fh.free_filename = 0;
index dddab62a616d8cb7944673dcc854ce83f63277ac..ba11bf98e8c3c23db4226008a1bb0e689d3bc864 100644 (file)
@@ -626,7 +626,7 @@ _crypt_extended_r(const char *key, const char *setting,
         * and padding with zeros.
         */
        q = (u_char *) keybuf;
-       while (q - (u_char *) keybuf < sizeof(keybuf)) {
+       while ((size_t)(q - (u_char *) keybuf) < sizeof(keybuf)) {
                *q++ = *key << 1;
                if (*key)
                        key++;
@@ -667,7 +667,7 @@ _crypt_extended_r(const char *key, const char *setting,
                         * And XOR with the next 8 characters of the key.
                         */
                        q = (u_char *) keybuf;
-                       while (q - (u_char *) keybuf < sizeof(keybuf) && *key)
+                       while ((size_t)(q - (u_char *) keybuf) < sizeof(keybuf) && *key)
                                *q++ ^= *key++ << 1;
 
                        if (des_setkey((char *) keybuf, data))
index 8e0766127dfd7e97b1c3af467c2061fca5c8b9f0..222c993c657711cc4beff47770f549d1c6ab9705 100644 (file)
@@ -439,7 +439,7 @@ PHP_FUNCTION(glob)
        size_t pattern_len;
        zend_long flags = 0;
        glob_t globbuf;
-       int n;
+       size_t n;
        int ret;
        zend_bool basedir_limit = 0;
 
index a73d0b4e6e017f2a8165d207efc1c316f5ecc0e5..6436a292783512c03e70f3655a1e00c6b5ea7185 100644 (file)
 #include <limits.h>
 #endif
 
-static int cmd_max_len;
+static size_t cmd_max_len;
 
 /* {{{ PHP_MINIT_FUNCTION(exec) */
 PHP_MINIT_FUNCTION(exec)
 {
 #ifdef _SC_ARG_MAX
        cmd_max_len = sysconf(_SC_ARG_MAX);
-       if (-1 == cmd_max_len) {
+       if ((size_t)-1 == cmd_max_len) {
 #ifdef _POSIX_ARG_MAX
                cmd_max_len = _POSIX_ARG_MAX;
 #else
@@ -278,7 +278,7 @@ PHP_FUNCTION(passthru)
 */
 PHPAPI zend_string *php_escape_shell_cmd(char *str)
 {
-       register int x, y;
+       register size_t x, y;
        size_t l = strlen(str);
        uint64_t estimate = (2 * (uint64_t)l) + 1;
        zend_string *cmd;
@@ -385,7 +385,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
  */
 PHPAPI zend_string *php_escape_shell_arg(char *str)
 {
-       int x, y = 0;
+       size_t x, y = 0;
        size_t l = strlen(str);
        zend_string *cmd;
        uint64_t estimate = (4 * (uint64_t)l) + 3;
index dcd13fa9a3a27aeb8a0224526f18f7305518597b..d89093ffd13630d34aa231f6c39a096fa45a8053 100644 (file)
@@ -576,7 +576,7 @@ PHP_FUNCTION(file_put_contents)
        char *filename;
        size_t filename_len;
        zval *data;
-       zend_long numbytes = 0;
+       size_t numbytes = 0;
        zend_long flags = 0;
        zval *zcontext = NULL;
        php_stream_context *context = NULL;
@@ -695,7 +695,7 @@ PHP_FUNCTION(file_put_contents)
        }
        php_stream_close(stream);
 
-       if (numbytes < 0) {
+       if (numbytes == (size_t)-1) {
                RETURN_FALSE;
        }
 
index c85a506d973fcd5e8c863149e08cbe8169d411b3..41bed54658f788712ba04fb9d57e6f4243d59616 100644 (file)
@@ -828,11 +828,11 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
                struct tm tm, tmbuf, *gmt;
                time_t stamp;
 
-               while (p - tmp_line < sizeof(tmp_line) && !isdigit(*p)) {
+               while ((size_t)(p - tmp_line) < sizeof(tmp_line) && !isdigit(*p)) {
                        p++;
                }
 
-               if (p - tmp_line > sizeof(tmp_line)) {
+               if ((size_t)(p - tmp_line) > sizeof(tmp_line)) {
                        goto mdtm_error;
                }
 
@@ -1177,7 +1177,8 @@ static php_stream_wrapper_ops ftp_stream_wops = {
        php_stream_ftp_unlink, /* unlink */
        php_stream_ftp_rename, /* rename */
        php_stream_ftp_mkdir,  /* mkdir */
-       php_stream_ftp_rmdir   /* rmdir */
+       php_stream_ftp_rmdir,  /* rmdir */
+       NULL
 };
 
 PHPAPI php_stream_wrapper php_stream_ftp_wrapper =     {
index fd996d1763f47775e7ee0084d3856003f27949d7..ec57cab2b6847523395ba8efdd968c89c6332334 100644 (file)
@@ -969,7 +969,8 @@ static php_stream_wrapper_ops http_stream_wops = {
        NULL, /* unlink */
        NULL, /* rename */
        NULL, /* mkdir */
-       NULL  /* rmdir */
+       NULL, /* rmdir */
+       NULL
 };
 
 PHPAPI php_stream_wrapper php_stream_http_wrapper = {
index 7e5a8987b4cb91475c74f059cd979e5aff3615f9..04e51b00c1912b2be945f4606e2a9d5410c89ced 100644 (file)
@@ -191,7 +191,7 @@ PHP_FUNCTION(iptcembed)
        zend_long spool = 0;
        FILE *fp;
        unsigned int marker, done = 0;
-       int inx;
+       size_t inx;
        zend_string *spoolbuf = NULL;
        unsigned char *poi = NULL;
        zend_stat_t sb;
@@ -314,7 +314,7 @@ PHP_FUNCTION(iptcembed)
    Parse binary IPTC-data into associative array */
 PHP_FUNCTION(iptcparse)
 {
-       int inx = 0, len;
+       size_t inx = 0, len;
        unsigned int tagsfound = 0;
        unsigned char *buffer, recnum, dataset;
        char *str, key[16];
@@ -358,7 +358,7 @@ PHP_FUNCTION(iptcparse)
                        inx += 2;
                }
 
-               if ((len < 0) || (len > str_len) || (inx + len) > str_len) {
+               if ((len > str_len) || (inx + len) > str_len) {
                        break;
                }
 
index 73290e9d70fce20492ab48630851681d0a03caa7..11968a6fb6dfad09383a370e562092e5cd38140b 100644 (file)
@@ -168,7 +168,7 @@ static char Lookahead(char *word, int how_far)
 static int metaphone(unsigned char *word, size_t word_len, zend_long max_phonemes, zend_string **phoned_word, int traditional)
 {
        int w_idx = 0;                          /* point in the phonization we're at. */
-       int p_idx = 0;                          /* end of the phoned phrase */
+       size_t p_idx = 0;                               /* end of the phoned phrase */
        size_t max_buffer_len = 0;              /* maximum length of the destination buffer */
 
 /*-- Parameter checks --*/
@@ -265,7 +265,7 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme
 
        /* On to the metaphoning */
        for (; Curr_Letter != '\0' &&
-                (max_phonemes == 0 || Phone_Len < max_phonemes);
+                (max_phonemes == 0 || Phone_Len < (size_t)max_phonemes);
                 w_idx++) {
                /* How many letters to skip because an eariler encoding handled
                 * multiple letters */
index 1d353d1743d5f2f6369c2abfd43a547f400c046c..1252f4286f83a1c352abfaad3a4db51e295e333c 100644 (file)
@@ -92,7 +92,7 @@ static int little_endian_longlong_map[8];
  */
 static void php_pack(zval *val, size_t size, int *map, char *output)
 {
-       int i;
+       size_t i;
        char *v;
 
        convert_to_long_ex(val);
@@ -112,13 +112,14 @@ static void php_pack(zval *val, size_t size, int *map, char *output)
 PHP_FUNCTION(pack)
 {
        zval *argv = NULL;
-       int num_args = 0, i;
+       int num_args = 0;
+       size_t i;
        int currentarg;
        char *format;
        size_t formatlen;
        char *formatcodes;
        int *formatargs;
-       int formatcount = 0;
+       size_t formatcount = 0;
        int outputpos = 0, outputsize = 0;
        zend_string *output;
 
@@ -334,7 +335,7 @@ PHP_FUNCTION(pack)
                        case 'a':
                        case 'A':
                        case 'Z': {
-                               int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
+                               size_t arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
 
                                zend_string *str = zval_get_string(&argv[currentarg++]);
 
@@ -356,7 +357,7 @@ PHP_FUNCTION(pack)
                                char *v = ZSTR_VAL(str);
 
                                outputpos--;
-                               if(arg > ZSTR_LEN(str)) {
+                               if ((size_t)arg > ZSTR_LEN(str)) {
                                        php_error_docref(NULL, E_WARNING, "Type %c: not enough characters in string", code);
                                        arg = ZSTR_LEN(str);
                                }
@@ -519,7 +520,7 @@ static zend_long php_unpack(char *data, size_t size, int issigned, int *map)
 {
        zend_long result;
        char *cresult = (char *) &result;
-       int i;
+       size_t i;
 
        result = issigned ? -1 : 0;
 
@@ -726,7 +727,7 @@ PHP_FUNCTION(unpack)
                                switch ((int) type) {
                                        case 'a': {
                                                /* a will not strip any trailing whitespace or null padding */
-                                               size_t len = inputlen - inputpos;       /* Remaining string */
+                                               zend_long len = inputlen - inputpos;    /* Remaining string */
 
                                                /* If size was given take minimum of len and size */
                                                if ((size >= 0) && (len > size)) {
@@ -768,7 +769,7 @@ PHP_FUNCTION(unpack)
                                        case 'Z': {
                                                /* Z will strip everything after the first null character */
                                                char pad = '\0';
-                                               size_t   s,
+                                               zend_long s,
                                                         len = inputlen - inputpos;     /* Remaining string */
 
                                                /* If size was given take minimum of len and size */
@@ -792,11 +793,11 @@ PHP_FUNCTION(unpack)
 
                                        case 'h':
                                        case 'H': {
-                                               size_t len = (inputlen - inputpos) * 2; /* Remaining */
+                                               zend_long len = (inputlen - inputpos) * 2;      /* Remaining */
                                                int nibbleshift = (type == 'h') ? 0 : 4;
                                                int first = 1;
                                                char *buf;
-                                               size_t ipos, opos;
+                                               zend_long ipos, opos;
 
                                                /* If size was given take minimum of len and size */
                                                if (size >= 0 && len > (size * 2)) {
index 2a5cec3e93b33387ad3c478108647d2ccacf68a4..d01ddb0563c6add5f599244f61d16f6d98b9f363 100644 (file)
@@ -194,7 +194,7 @@ PHP_FUNCTION(password_needs_rehash)
 
        algo = php_password_determine_algo(hash, (size_t) hash_len);
 
-       if (algo != new_algo) {
+       if ((zend_long)algo != new_algo) {
                RETURN_TRUE;
        }
 
@@ -224,8 +224,8 @@ PHP_FUNCTION(password_needs_rehash)
 Verify a hash created using crypt() or password_hash() */
 PHP_FUNCTION(password_verify)
 {
-       int status = 0, i;
-       size_t password_len, hash_len;
+       int status = 0;
+       size_t i, password_len, hash_len;
        char *password, *hash;
        zend_string *ret;
 
index 759a4f6a3327ba598e87ffffbb3ae61ff671e0b8..dbd0a3fba1d2ae0aedbd12051bc5e8821f144bb5 100644 (file)
@@ -437,7 +437,8 @@ static php_stream_wrapper_ops php_stdio_wops = {
        NULL, /* unlink */
        NULL, /* rename */
        NULL, /* mkdir */
-       NULL  /* rmdir */
+       NULL, /* rmdir */
+       NULL
 };
 
 PHPAPI php_stream_wrapper php_stream_php_wrapper =     {
index ab5b3a3fd7454b53efb00a5d7921e347aaba89a5..da262e8b58a912a9b0705049b36e623e386595e5 100644 (file)
@@ -43,7 +43,7 @@
 
 #define PHP_CLASS_ATTRIBUTES                                                                                   \
        zend_string *class_name;                                                                                        \
-       zend_bool incomplete_class = 0
+       zend_bool incomplete_class ZEND_ATTRIBUTE_UNUSED = 0
 
 #define INCOMPLETE_CLASS "__PHP_Incomplete_Class"
 #define MAGIC_MEMBER "__PHP_Incomplete_Class_Name"
index f5f0a245683a9d086052c47fdd1f0b7d77b3009b..1efb266c82f9434d31bf95a7d6aecb89cef4323c 100644 (file)
@@ -978,7 +978,7 @@ PHP_FUNCTION(wordwrap)
                newtext = zend_string_init(ZSTR_VAL(text), ZSTR_LEN(text), 0);
 
                laststart = lastspace = 0;
-               for (current = 0; current < ZSTR_LEN(text); current++) {
+               for (current = 0; current < (zend_long)ZSTR_LEN(text); current++) {
                        if (ZSTR_VAL(text)[current] == breakchar[0]) {
                                laststart = lastspace = current + 1;
                        } else if (ZSTR_VAL(text)[current] == ' ') {
@@ -1010,7 +1010,7 @@ PHP_FUNCTION(wordwrap)
                newtextlen = 0;
 
                laststart = lastspace = 0;
-               for (current = 0; current < ZSTR_LEN(text); current++) {
+               for (current = 0; current < (zend_long)ZSTR_LEN(text); current++) {
                        if (chk <= 0) {
                                alloced += (size_t) (((ZSTR_LEN(text) - current + 1)/linelength + 1) * breakchar_len) + 1;
                                newtext = zend_string_extend(newtext, alloced, 0);
@@ -1754,7 +1754,7 @@ PHP_FUNCTION(pathinfo)
 
                p = zend_memrchr(ZSTR_VAL(ret), '.', ZSTR_LEN(ret));
 
-               idx = p ? (p - ZSTR_VAL(ret)) : ZSTR_LEN(ret);
+               idx = p ? (p - ZSTR_VAL(ret)) : (ptrdiff_t)ZSTR_LEN(ret);
                add_assoc_stringl(&tmp, "filename", ZSTR_VAL(ret), idx);
        }
 
@@ -2131,7 +2131,7 @@ PHP_FUNCTION(strrpos)
                        RETURN_FALSE;
                }
                p = ZSTR_VAL(haystack);
-               if (-offset < needle_len) {
+               if ((size_t)-offset < needle_len) {
                        e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack);
                } else {
                        e = ZSTR_VAL(haystack) + ZSTR_LEN(haystack) + offset + needle_len;
@@ -2232,7 +2232,7 @@ PHP_FUNCTION(strripos)
                        RETURN_FALSE;
                }
                p = ZSTR_VAL(haystack_dup);
-               if (-offset < ZSTR_LEN(needle)) {
+               if ((size_t)-offset < ZSTR_LEN(needle)) {
                        e = ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack);
                } else {
                        e = ZSTR_VAL(haystack_dup) + ZSTR_LEN(haystack) + offset + ZSTR_LEN(needle);
@@ -2412,7 +2412,7 @@ PHP_FUNCTION(substr)
 
        if (f > (zend_long)ZSTR_LEN(str)) {
                RETURN_FALSE;
-       } else if (f < 0 && -f > ZSTR_LEN(str)) {
+       } else if (f < 0 && (size_t)-f > ZSTR_LEN(str)) {
                f = 0;
        }
 
@@ -2518,7 +2518,7 @@ PHP_FUNCTION(substr_replace)
                                if (f < 0) {
                                        f = 0;
                                }
-                       } else if (f > Z_STRLEN_P(str)) {
+                       } else if ((size_t)f > Z_STRLEN_P(str)) {
                                f = Z_STRLEN_P(str);
                        }
                        /* if "length" position is negative, set it to the length
@@ -2531,7 +2531,7 @@ PHP_FUNCTION(substr_replace)
                                }
                        }
 
-                       if (l > Z_STRLEN_P(str) || (l < 0 && (size_t)(-l) > Z_STRLEN_P(str))) {
+                       if ((size_t)l > Z_STRLEN_P(str) || (l < 0 && (size_t)(-l) > Z_STRLEN_P(str))) {
                                l = Z_STRLEN_P(str);
                        }
 
@@ -4212,8 +4212,8 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines)
        char *str;
        char *heb_str, *tmp, *target;
        size_t block_start, block_end, block_type, block_length, i;
-       zend_long max_chars=0;
-       size_t begin, end, char_count, orig_begin;
+       zend_long max_chars=0, char_count;
+       size_t begin, end, orig_begin;
        size_t str_len;
        zend_string *broken_str;
 
@@ -5324,7 +5324,7 @@ PHP_FUNCTION(substr_count)
                if (length <= 0) {
                        length += (haystack_len - offset);
                }
-               if ((length <= 0) || (length > (haystack_len - offset))) {
+               if ((length <= 0) || ((size_t)length > (haystack_len - offset))) {
                        php_error_docref(NULL, E_WARNING, "Invalid length value");
                        RETURN_FALSE;
                }
@@ -5746,7 +5746,7 @@ PHP_FUNCTION(substr_compare)
                RETURN_FALSE;
        }
 
-       cmp_len = (size_t) (len ? len : MAX(ZSTR_LEN(s2), (ZSTR_LEN(s1) - offset)));
+       cmp_len = len ? (size_t)len : MAX(ZSTR_LEN(s2), (ZSTR_LEN(s1) - offset));
 
        if (!cs) {
                RETURN_LONG(zend_binary_strncmp(ZSTR_VAL(s1) + offset, (ZSTR_LEN(s1) - offset), ZSTR_VAL(s2), ZSTR_LEN(s2), cmp_len));
index 529d666d02db5cf1090a334a14ea732198f3d350..5350e13ec5e7863caddd79924c2943c8af8c2967 100644 (file)
@@ -416,7 +416,7 @@ PHP_FUNCTION(is_callable)
                retval = zend_is_callable_ex(var, NULL, check_flags, &name, NULL, &error);
                zval_dtor(callable_name);
                //??? is it necessary to be consistent with old PHP ("\0" support)
-               if (UNEXPECTED(ZSTR_LEN(name)) != strlen(ZSTR_VAL(name))) {
+               if (UNEXPECTED(ZSTR_LEN(name) != strlen(ZSTR_VAL(name)))) {
                        ZVAL_STRINGL(callable_name, ZSTR_VAL(name), strlen(ZSTR_VAL(name)));
                        zend_string_release(name);
                } else {
index 4434fd1f0d2f74ccd4794dab7c7c2d207b5becf8..b31235b4f1318e5a6958e28d11d8e4b03282b9a9 100644 (file)
@@ -452,7 +452,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
                if (!bucket->own_buf) {
                        bucket = php_stream_bucket_make_writeable(bucket);
                }
-               if ((int)bucket->buflen != Z_STRLEN_P(pzdata)) {
+               if (bucket->buflen != Z_STRLEN_P(pzdata)) {
                        bucket->buf = perealloc(bucket->buf, Z_STRLEN_P(pzdata), bucket->is_persistent);
                        bucket->buflen = Z_STRLEN_P(pzdata);
                }
index 55381dbbed258739d0fea1367c107daece234658..a0a2f039b236e0698e81a102c4fac112f7020b31 100644 (file)
@@ -169,7 +169,7 @@ PHP_FUNCTION(shm_attach)
 
        /* get the id from a specified key or create new shared memory */
        if ((shm_id = shmget(shm_key, 0, 0)) < 0) {
-               if (shm_size < sizeof(sysvshm_chunk_head)) {
+               if (shm_size < (zend_long)sizeof(sysvshm_chunk_head)) {
                        php_error_docref(NULL, E_WARNING, "failed for key 0x" ZEND_XLONG_FMT ": memorysize too small", shm_key);
                        efree(shm_list_ptr);
                        RETURN_FALSE;
index fe29f2891d10669bfacce2a9f9f21986273258d4..bf497b2d7c143a07b7741793d39793e90ede993d 100644 (file)
@@ -638,7 +638,7 @@ PHP_XML_API zend_string *xml_utf8_decode(const XML_Char *s, size_t len, const XM
                        c = '?';
                }
 
-               ZSTR_VAL(str)[ZSTR_LEN(str)++] = decoder ? decoder(c) : c;
+               ZSTR_VAL(str)[ZSTR_LEN(str)++] = decoder ? (unsigned int)decoder(c) : c;
        }
        ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
        if (ZSTR_LEN(str) < len) {
@@ -864,7 +864,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
                } 
 
                if (!Z_ISUNDEF(parser->data)) {
-                       int i;
+                       size_t i;
                        int doprint = 0;
                        zend_string *decoded_value;