summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-15 12:30:54 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-15 12:33:06 +0100
commit3e01f5afb1b52fe26a956190296de0192eedeec1 (patch)
tree77531ec93e3f3cef9891c77b5ca553eb8487f121 /ext/pcre/php_pcre.c
parente2c8ab7c33ac5328485c43db5080c5bf4911ce38 (diff)
downloadphp-git-3e01f5afb1b52fe26a956190296de0192eedeec1.tar.gz
Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index fae3eb0e76..e9d8f6869d 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -67,7 +67,7 @@ ZEND_TLS pcre2_general_context *gctx = NULL;
ZEND_TLS pcre2_compile_context *cctx = NULL;
ZEND_TLS pcre2_match_context *mctx = NULL;
ZEND_TLS pcre2_match_data *mdata = NULL;
-ZEND_TLS zend_bool mdata_used = 0;
+ZEND_TLS bool mdata_used = 0;
ZEND_TLS uint8_t pcre2_init_ok = 0;
#if defined(ZTS) && defined(HAVE_PCRE_JIT_SUPPORT)
static MUTEX_T pcre_mt = NULL;
@@ -999,7 +999,7 @@ static inline void populate_match_value(
}
static inline void add_named(
- zval *subpats, zend_string *name, zval *val, zend_bool unmatched) {
+ zval *subpats, zend_string *name, zval *val, bool unmatched) {
/* If the DUPNAMES option is used, multiple subpatterns might have the same name.
* In this case we want to preserve the one that actually has a value. */
if (!unmatched) {
@@ -1049,8 +1049,8 @@ static inline void add_offset_pair(
static void populate_subpat_array(
zval *subpats, const char *subject, PCRE2_SIZE *offsets, zend_string **subpat_names,
uint32_t num_subpats, int count, const PCRE2_SPTR mark, zend_long flags) {
- zend_bool offset_capture = (flags & PREG_OFFSET_CAPTURE) != 0;
- zend_bool unmatched_as_null = (flags & PREG_UNMATCHED_AS_NULL) != 0;
+ bool offset_capture = (flags & PREG_OFFSET_CAPTURE) != 0;
+ bool unmatched_as_null = (flags & PREG_UNMATCHED_AS_NULL) != 0;
zval val;
int i;
if (subpat_names) {
@@ -1145,7 +1145,7 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
}
/* }}} */
-static zend_always_inline zend_bool is_known_valid_utf8(
+static zend_always_inline bool is_known_valid_utf8(
zend_string *subject_str, PCRE2_SIZE start_offset) {
if (!(GC_FLAGS(subject_str) & IS_STR_VALID_UTF8)) {
/* We don't know whether the string is valid UTF-8 or not. */
@@ -1659,7 +1659,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
piece = subject + last_end_offset;
if (count >= 0 && limit > 0) {
- zend_bool simple_string;
+ bool simple_string;
/* Check for too many substrings condition. */
if (UNEXPECTED(count == 0)) {
@@ -1858,7 +1858,7 @@ static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_strin
zend_string *result; /* Result of replacement */
zend_string *eval_result; /* Result of custom function */
pcre2_match_data *match_data;
- zend_bool old_mdata_used;
+ bool old_mdata_used;
/* Calculate the size of the offsets array, and allocate memory for it. */
num_subpats = pce->capture_count + 1;
@@ -2881,7 +2881,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
uint32_t options; /* Execution options */
zend_string *string_key;
zend_ulong num_key;
- zend_bool invert; /* Whether to return non-matching
+ bool invert; /* Whether to return non-matching
entries */
pcre2_match_data *match_data;
invert = flags & PREG_GREP_INVERT ? 1 : 0;