Skip to content

Commit ceb6fa6

Browse files
patrickallaertGirgias
authored andcommitted
Convert some recently introduced zend_bool to bool
As well as `scripts/dev/check_parameters.php` utility. Cfr. 3e01f5a
1 parent be369de commit ceb6fa6

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

Zend/Optimizer/dce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static bool try_remove_var_def(context *ctx, int free_var, int use_chain, zend_o
387387
return 0;
388388
}
389389

390-
static zend_always_inline zend_bool may_be_refcounted(uint32_t type) {
390+
static zend_always_inline bool may_be_refcounted(uint32_t type) {
391391
return (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) != 0;
392392
}
393393

Zend/zend_gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,8 +1431,8 @@ static void zend_get_gc_buffer_release(void);
14311431
ZEND_API int zend_gc_collect_cycles(void)
14321432
{
14331433
int count = 0;
1434-
zend_bool should_rerun_gc = 0;
1435-
zend_bool did_rerun_gc = 0;
1434+
bool should_rerun_gc = 0;
1435+
bool did_rerun_gc = 0;
14361436

14371437
rerun_gc:
14381438
if (GC_G(num_roots)) {

Zend/zend_hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
12171217
} while (0)
12181218

12191219
/* Check if an array is a list */
1220-
static zend_always_inline zend_bool zend_array_is_list(zend_array *array)
1220+
static zend_always_inline bool zend_array_is_list(zend_array *array)
12211221
{
12221222
zend_long expected_idx = 0;
12231223
zend_long num_idx;

Zend/zend_inheritance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void ZEND_COLD emit_incompatible_method_error(
5555
const zend_function *parent, zend_class_entry *parent_scope,
5656
inheritance_status status);
5757

58-
static void zend_type_copy_ctor(zend_type *type, zend_bool persistent) {
58+
static void zend_type_copy_ctor(zend_type *type, bool persistent) {
5959
if (ZEND_TYPE_HAS_LIST(*type)) {
6060
zend_type_list *old_list = ZEND_TYPE_LIST(*type);
6161
size_t size = ZEND_TYPE_LIST_SIZE(old_list->num_types);

ext/imap/php_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3025,7 +3025,7 @@ PHP_FUNCTION(imap_fetch_overview)
30253025
}
30263026
/* }}} */
30273027

3028-
static zend_bool header_injection(zend_string *str, zend_bool adrlist)
3028+
static bool header_injection(zend_string *str, bool adrlist)
30293029
{
30303030
char *p = ZSTR_VAL(str);
30313031

scripts/dev/check_parameters.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
$API_params = array(
3232
'a' => array('zval**'), // array
3333
'A' => array('zval**'), // array or object
34-
'b' => array('zend_bool*'), // boolean
34+
'b' => array('bool*'), // boolean
3535
'd' => array('double*'), // double
3636
'f' => array('zend_fcall_info*', 'zend_fcall_info_cache*'), // function
3737
'h' => array('HashTable**'), // array as an HashTable*
@@ -238,7 +238,7 @@ function check_function($name, $txt, $offset)
238238
// nullable arguments
239239
case '!':
240240
if (in_array($last_char, array('l', 'L', 'd', 'b'))) {
241-
check_param($params, ++$j, 'zend_bool*', $optional);
241+
check_param($params, ++$j, 'bool*', $optional);
242242
}
243243
break;
244244

win32/sendmail.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ PHPAPI char *GetSMErrorText(int index)
336336
/* strtok_r like, but recognizes quoted-strings */
337337
static char *find_address(char *list, char **state)
338338
{
339-
zend_bool in_quotes = 0;
339+
bool in_quotes = 0;
340340
char *p = list;
341341

342342
if (list == NULL) {
@@ -1013,7 +1013,7 @@ static unsigned long GetAddr(LPSTR szHost)
10131013
/* returns the contents of an angle-addr (caller needs to efree) or NULL */
10141014
static char *get_angle_addr(char *address)
10151015
{
1016-
zend_bool in_quotes = 0;
1016+
bool in_quotes = 0;
10171017
char *p1 = address, *p2;
10181018

10191019
while ((p1 = strpbrk(p1, "<\"\\")) != NULL) {

0 commit comments

Comments
 (0)