com php-src: Fix remaining signedness warnings: ext/fileinfo/libmagic/softmagic.c ext/filter/logical_filters .c
ext/opcache/zend_accelerator_blacklist.c ext/pgs ql/pgsql.c ext/spl/spl_iterators.c ext/standard/brows cap.c ext/zip/php_zip.c

From: Date: Tue, 14 Nov 2017 16:07:09 +0000
Subject: com php-src: Fix remaining signedness warnings: ext/fileinfo/libmagic/softmagic.c ext/filter/logical_filters .c
ext/opcache/zend_accelerator_blacklist.c ext/pgs ql/pgsql.c ext/spl/spl_iterators.c ext/standard/brows cap.c ext/zip/php_zip.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100232@lists.php.net to get a copy of this message
Commit: 20d930d8f374913e2d537e0d8aa80a561c605370 Author: Anatol Belski <ab@php.net> Tue, 14 Nov 2017 17:07:09 +0100 Parents: 13696d7aae264d132bd91dd9e2ba0d53b6b4cc5c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=20d930d8f374913e2d537e0d8aa80a561c605370 Log: Fix remaining signedness warnings Changed paths: M ext/fileinfo/libmagic/softmagic.c M ext/filter/logical_filters.c M ext/opcache/zend_accelerator_blacklist.c M ext/pgsql/pgsql.c M ext/spl/spl_iterators.c M ext/standard/browscap.c M ext/zip/php_zip.c Diff: diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index b5e2b8d..dfc7a7b 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -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); } } diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 376726b..e707471 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -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 */ diff --git a/ext/opcache/zend_accelerator_blacklist.c b/ext/opcache/zend_accelerator_blacklist.c index b6f5caf..78df0e4 100644 --- a/ext/opcache/zend_accelerator_blacklist.c +++ b/ext/opcache/zend_accelerator_blacklist.c @@ -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); diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index e545808..69949d3 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -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); diff --git a/ext/spl/spl_iterators..c b/ext/spl/spl_iterators.c index 2f85248..da4af5a 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -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; diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 91db7fe...26952c7 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -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 diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 5bea9d9..fdc3e90 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -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) {

« previous php.cvs (#100232) next »