From 20d930d8f374913e2d537e0d8aa80a561c605370 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 14 Nov 2017 17:07:09 +0100 Subject: [PATCH] Fix remaining signedness warnings --- ext/fileinfo/libmagic/softmagic.c | 2 +- ext/filter/logical_filters.c | 4 ++-- ext/opcache/zend_accelerator_blacklist.c | 6 +++--- ext/pgsql/pgsql.c | 4 ++-- ext/spl/spl_iterators.c | 2 +- ext/standard/browscap.c | 2 +- ext/zip/php_zip.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index b5e2b8d82f..dfc7a7bbb9 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 376726b41f..e70747177b 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 b6f5caf2b4..78df0e476d 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 e54580897f..69949d3f9c 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 2f85248bd7..da4af5a726 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 91db7fe2a7..26952c77ef 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 5bea9d934c..fdc3e90345 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) { -- 2.40.0