]> granicus.if.org Git - php/commitdiff
Fix remaining signedness warnings
authorAnatol Belski <ab@php.net>
Tue, 14 Nov 2017 16:07:09 +0000 (17:07 +0100)
committerAnatol Belski <ab@php.net>
Tue, 14 Nov 2017 16:07:09 +0000 (17:07 +0100)
ext/fileinfo/libmagic/softmagic.c
ext/filter/logical_filters.c
ext/opcache/zend_accelerator_blacklist.c
ext/pgsql/pgsql.c
ext/spl/spl_iterators.c
ext/standard/browscap.c
ext/zip/php_zip.c

index b5e2b8d82fb16cd19b696479faebdf6a3dafe408..dfc7a7bbb93400894789dbb999949d4862953bfd 100644 (file)
@@ -427,7 +427,7 @@ check_fmt(struct magic_set *ms, struct magic *m)
        } else {
                pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
                if (match_data) {
-                       rv = pcre2_match(pce, m->desc, strlen(m->desc), 0, re_options, match_data, php_pcre_mctx()) > 0;
+                       rv = pcre2_match(pce, (PCRE2_SPTR)m->desc, strlen(m->desc), 0, re_options, match_data, php_pcre_mctx()) > 0;
                        php_pcre_free_match_data(match_data);
                }
        }
index 376726b41f94b8a5a483ef8a80747969be356c36..e70747177bf99f3a98a183bda14bf941b2212489 100644 (file)
@@ -449,7 +449,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
        if (!match_data) {
                RETURN_VALIDATION_FAILED
        }
-       rc = pcre2_match(re, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
+       rc = pcre2_match(re, (PCRE2_SPTR)Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
        php_pcre_free_match_data(match_data);
 
        /* 0 means that the vector is too small to hold all the captured substring offsets */
@@ -637,7 +637,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
        if (!match_data) {
                RETURN_VALIDATION_FAILED
        }
-       rc = pcre2_match(re, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
+       rc = pcre2_match(re, (PCRE2_SPTR)Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
        php_pcre_free_match_data(match_data);
 
        /* 0 means that the vector is too small to hold all the captured substring offsets */
index b6f5caf2b4ef96fe912e71ef24bc17b8982d5da0..78df0e476dc3ab3737fb4c1c975597740ee3482a 100644 (file)
@@ -179,10 +179,10 @@ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist)
                        }
                        it->next = NULL;
 
-                       if ((it->re = pcre2_compile(regexp, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) {
+                       if ((it->re = pcre2_compile((PCRE2_SPTR)regexp, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) {
                                free(it);
                                pcre2_get_error_message(errnumber, pcre_error, sizeof(pcre_error));
-                               blacklist_report_regexp_error(pcre_error, pcre_error_offset);
+                               blacklist_report_regexp_error((char *)pcre_error, pcre_error_offset);
                                return;
                        }
                        /* prepare for the next iteration */
@@ -352,7 +352,7 @@ zend_bool zend_accel_blacklist_is_blacklisted(zend_blacklist *blacklist, char *v
                        /* Alloc failed, but next one could still come through and match. */
                        continue;
                }
-               int rc = pcre2_match(regexp_list_it->re, verify_path, strlen(verify_path), 0, 0, match_data, mctx);
+               int rc = pcre2_match(regexp_list_it->re, (PCRE2_SPTR)verify_path, strlen(verify_path), 0, 0, match_data, mctx);
                if (rc >= 0) {
                        ret = 1;
                        php_pcre_free_match_data(match_data);
index e54580897f63b0ad516774c94a5b5724db1b3b77..69949d3f9c18b32241afa9184f07c34465f9f67e 100644 (file)
@@ -5783,7 +5783,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
                options |= PCRE2_CASELESS;
        }
 
-       re = pcre2_compile(regex, PCRE2_ZERO_TERMINATED, options, &errnumber, &err_offset, php_pcre_cctx());
+       re = pcre2_compile((PCRE2_SPTR)regex, PCRE2_ZERO_TERMINATED, options, &errnumber, &err_offset, php_pcre_cctx());
        if (NULL == re) {
                pcre2_get_error_message(errnumber, err_msg, sizeof(err_msg));
                php_error_docref(NULL, E_WARNING, "Cannot compile regex: '%s'", err_msg);
@@ -5796,7 +5796,7 @@ static int php_pgsql_convert_match(const char *str, size_t str_len, const char *
                php_error_docref(NULL, E_WARNING, "Cannot allocate match data");
                return FAILURE;
        }
-       res = pcre2_match(re, str, str_len, 0, 0, match_data, php_pcre_mctx());
+       res = pcre2_match(re, (PCRE2_SPTR)str, str_len, 0, 0, match_data, php_pcre_mctx());
        php_pcre_free_match_data(match_data);
        pcre2_code_free(re);
 
index 2f85248bd785b35939e43dec3611b1bfbfe757f0..da4af5a726cd649216c13225b9c36e1b3eca9da6 100644 (file)
@@ -2065,7 +2065,7 @@ SPL_METHOD(RegexIterator, accept)
                        if (!match_data) {
                                RETURN_FALSE;
                        }
-                       rc = pcre2_match(re, ZSTR_VAL(subject), ZSTR_LEN(subject), 0, 0, match_data, php_pcre_mctx());
+                       rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(subject), ZSTR_LEN(subject), 0, 0, match_data, php_pcre_mctx());
                        RETVAL_BOOL(rc >= 0);
                        php_pcre_free_match_data(match_data);
                        break;
index 91db7fe2a7860184777ed7b59cc9f1ec90dcd2da..26952c77efebce0f624d20315c73e18fd21a2c4e 100644 (file)
@@ -635,7 +635,7 @@ static int browser_reg_compare(
                zend_string_release(regex);
                return 0;
        }
-       rc = pcre2_match(re, ZSTR_VAL(agent_name), ZSTR_LEN(agent_name), 0, re_options, match_data, php_pcre_mctx());
+       rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(agent_name), ZSTR_LEN(agent_name), 0, re_options, match_data, php_pcre_mctx());
        php_pcre_free_match_data(match_data);
        if (PCRE2_ERROR_NOMATCH != rc) {
                /* If we've found a possible browser, we need to do a comparison of the
index 5bea9d934c2e28230a99504abafa6bd1c8a9f1ae..fdc3e9034519d21e992624283af83c5d5d2b5ed4 100644 (file)
@@ -703,7 +703,7 @@ int php_zip_pcre(zend_string *regexp, char *path, int path_len, zval *return_val
                                zend_string_release(namelist[i]);
                                continue;
                        }
-                       rc = pcre2_match(re, ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, preg_options, match_data, mctx);
+                       rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, preg_options, match_data, mctx);
                        php_pcre_free_match_data(match_data);
                        /* 0 means that the vector is too small to hold all the captured substring offsets */
                        if (rc < 0) {