Fix remaining signedness warnings

This commit is contained in:
Anatol Belski 2017-11-14 17:07:09 +01:00
parent 13696d7aae
commit 20d930d8f3
7 changed files with 11 additions and 11 deletions

View 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);
}
}

View 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 */

View 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);

View 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);

View 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;

View 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

View 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) {