Skip to content

Commit 3e01f5a

Browse files
committed
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.
1 parent e2c8ab7 commit 3e01f5a

File tree

368 files changed

+2001
-2001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+2001
-2001
lines changed

Zend/zend.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ZEND_TSRMLS_CACHE_DEFINE()
6060
#endif
6161

6262
ZEND_API zend_utility_values zend_uv;
63-
ZEND_API zend_bool zend_dtrace_enabled;
63+
ZEND_API bool zend_dtrace_enabled;
6464

6565
/* version information */
6666
static char *zend_version_info;
@@ -92,7 +92,7 @@ static void (*zend_message_dispatcher_p)(zend_long message, const void *data);
9292
static zval *(*zend_get_configuration_directive_p)(zend_string *name);
9393

9494
#if ZEND_RC_DEBUG
95-
ZEND_API zend_bool zend_rc_debug = 0;
95+
ZEND_API bool zend_rc_debug = 0;
9696
#endif
9797

9898
static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
@@ -108,7 +108,7 @@ static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */
108108

109109
static ZEND_INI_MH(OnUpdateGCEnabled) /* {{{ */
110110
{
111-
zend_bool val;
111+
bool val;
112112

113113
val = zend_ini_parse_bool(new_value);
114114
gc_enable(val);
@@ -290,7 +290,7 @@ ZEND_API zend_string *zend_strpprintf_unchecked(size_t max_len, const char *form
290290

291291
static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent);
292292

293-
static void print_hash(smart_str *buf, HashTable *ht, int indent, zend_bool is_object) /* {{{ */
293+
static void print_hash(smart_str *buf, HashTable *ht, int indent, bool is_object) /* {{{ */
294294
{
295295
zval *tmp;
296296
zend_string *string_key;
@@ -524,7 +524,7 @@ static FILE *zend_fopen_wrapper(const char *filename, zend_string **opened_path)
524524
/* }}} */
525525

526526
#ifdef ZTS
527-
static zend_bool short_tags_default = 1;
527+
static bool short_tags_default = 1;
528528
static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;
529529
#else
530530
# define short_tags_default 1
@@ -784,7 +784,7 @@ static void module_destructor_zval(zval *zv) /* {{{ */
784784
}
785785
/* }}} */
786786

787-
static zend_bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
787+
static bool php_auto_globals_create_globals(zend_string *name) /* {{{ */
788788
{
789789
/* While we keep registering $GLOBALS as an auto-global, we do not create an
790790
* actual variable for it. Access to it handled specially by the compiler. */
@@ -1287,7 +1287,7 @@ static ZEND_COLD void zend_error_impl(
12871287
zval params[4];
12881288
zval retval;
12891289
zval orig_user_error_handler;
1290-
zend_bool in_compilation;
1290+
bool in_compilation;
12911291
zend_class_entry *saved_class_entry;
12921292
zend_stack loop_var_stack;
12931293
zend_stack delayed_oplines_stack;
@@ -1591,7 +1591,7 @@ ZEND_API ZEND_COLD void zend_value_error(const char *format, ...) /* {{{ */
15911591
va_end(va);
15921592
} /* }}} */
15931593

1594-
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
1594+
ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) /* {{{ */
15951595
{
15961596
#if ZEND_DEBUG
15971597
va_list args;

Zend/zend.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ typedef struct _zend_utility_functions {
203203
} zend_utility_functions;
204204

205205
typedef struct _zend_utility_values {
206-
zend_bool html_errors;
206+
bool html_errors;
207207
} zend_utility_values;
208208

209209
typedef size_t (*zend_write_func_t)(const char *str, size_t str_length);
@@ -255,7 +255,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr);
255255
#define zend_print_variable(var) \
256256
zend_print_zval((var), 0)
257257

258-
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
258+
ZEND_API ZEND_COLD void zend_output_debug_string(bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
259259

260260
ZEND_API void zend_activate(void);
261261
ZEND_API void zend_deactivate(void);
@@ -316,7 +316,7 @@ extern ZEND_API zend_class_entry *zend_standard_class_def;
316316
extern ZEND_API zend_utility_values zend_uv;
317317

318318
/* If DTrace is available and enabled */
319-
extern ZEND_API zend_bool zend_dtrace_enabled;
319+
extern ZEND_API bool zend_dtrace_enabled;
320320
END_EXTERN_C()
321321

322322
#define ZEND_UV(name) (zend_uv.name)

Zend/zend_API.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **p
426426
}
427427
/* }}} */
428428

429-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
429+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest) /* {{{ */
430430
{
431431
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
432432
*dest = zend_is_true(arg);
@@ -437,7 +437,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest)
437437
}
438438
/* }}} */
439439

440-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest) /* {{{ */
440+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest) /* {{{ */
441441
{
442442
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
443443
return 0;
@@ -644,10 +644,10 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
644644
case 'l':
645645
{
646646
zend_long *p = va_arg(*va, zend_long *);
647-
zend_bool *is_null = NULL;
647+
bool *is_null = NULL;
648648

649649
if (check_null) {
650-
is_null = va_arg(*va, zend_bool *);
650+
is_null = va_arg(*va, bool *);
651651
}
652652

653653
if (!zend_parse_arg_long(arg, p, is_null, check_null)) {
@@ -659,10 +659,10 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
659659
case 'd':
660660
{
661661
double *p = va_arg(*va, double *);
662-
zend_bool *is_null = NULL;
662+
bool *is_null = NULL;
663663

664664
if (check_null) {
665-
is_null = va_arg(*va, zend_bool *);
665+
is_null = va_arg(*va, bool *);
666666
}
667667

668668
if (!zend_parse_arg_double(arg, p, is_null, check_null)) {
@@ -731,11 +731,11 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec
731731

732732
case 'b':
733733
{
734-
zend_bool *p = va_arg(*va, zend_bool *);
735-
zend_bool *is_null = NULL;
734+
bool *p = va_arg(*va, bool *);
735+
bool *is_null = NULL;
736736

737737
if (check_null) {
738-
is_null = va_arg(*va, zend_bool *);
738+
is_null = va_arg(*va, bool *);
739739
}
740740

741741
if (!zend_parse_arg_bool(arg, p, is_null, check_null)) {
@@ -956,8 +956,8 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec,
956956
uint32_t max_num_args = 0;
957957
uint32_t post_varargs = 0;
958958
zval *arg;
959-
zend_bool have_varargs = 0;
960-
zend_bool have_optional_args = 0;
959+
bool have_varargs = 0;
960+
bool have_optional_args = 0;
961961
zval **varargs = NULL;
962962
int *n_varargs = NULL;
963963

@@ -1130,7 +1130,7 @@ ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_
11301130
* Z_OBJ(EG(This)) to NULL when calling an internal function with common.scope == NULL.
11311131
* In that case EG(This) would still be the $this from the calling code and we'd take the
11321132
* wrong branch here. */
1133-
zend_bool is_method = EG(current_execute_data)->func->common.scope != NULL;
1133+
bool is_method = EG(current_execute_data)->func->common.scope != NULL;
11341134

11351135
if (!is_method || !this_ptr || Z_TYPE_P(this_ptr) != IS_OBJECT) {
11361136
va_start(va, type_spec);
@@ -1681,7 +1681,7 @@ ZEND_API zend_result add_next_index_null(zval *arg) /* {{{ */
16811681
}
16821682
/* }}} */
16831683

1684-
ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b) /* {{{ */
1684+
ZEND_API zend_result add_next_index_bool(zval *arg, bool b) /* {{{ */
16851685
{
16861686
zval tmp;
16871687

@@ -2949,7 +2949,7 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_
29492949
/* }}} */
29502950

29512951
// TODO num_symbol_tables as unsigned int?
2952-
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...) /* {{{ */
2952+
ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...) /* {{{ */
29532953
{
29542954
HashTable *symbol_table;
29552955
va_list symbol_table_list;
@@ -3448,11 +3448,11 @@ ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
34483448
}
34493449
/* }}} */
34503450

3451-
ZEND_API zend_bool zend_is_callable_at_frame(
3451+
ZEND_API bool zend_is_callable_at_frame(
34523452
zval *callable, zend_object *object, zend_execute_data *frame,
34533453
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error) /* {{{ */
34543454
{
3455-
zend_bool ret;
3455+
bool ret;
34563456
zend_fcall_info_cache fcc_local;
34573457
bool strict_class = 0;
34583458

@@ -3569,28 +3569,28 @@ ZEND_API zend_bool zend_is_callable_at_frame(
35693569
}
35703570
/* }}} */
35713571

3572-
ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
3572+
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
35733573
{
35743574
/* Determine callability at the first parent user frame. */
35753575
zend_execute_data *frame = EG(current_execute_data);
35763576
while (frame && (!frame->func || !ZEND_USER_CODE(frame->func->type))) {
35773577
frame = frame->prev_execute_data;
35783578
}
35793579

3580-
zend_bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
3580+
bool ret = zend_is_callable_at_frame(callable, object, frame, check_flags, fcc, error);
35813581
if (callable_name) {
35823582
*callable_name = zend_get_callable_name_ex(callable, object);
35833583
}
35843584
return ret;
35853585
}
35863586

3587-
ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
3587+
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
35883588
{
35893589
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
35903590
}
35913591
/* }}} */
35923592

3593-
ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
3593+
ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name) /* {{{ */
35943594
{
35953595
zend_fcall_info_cache fcc;
35963596

@@ -3790,7 +3790,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
37903790
return Z_STR_P(zv);
37913791
}
37923792

3793-
static zend_always_inline zend_bool is_persistent_class(zend_class_entry *ce) {
3793+
static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
37943794
return (ce->type & ZEND_INTERNAL_CLASS)
37953795
&& ce->info.internal.module->type == MODULE_PERSISTENT;
37963796
}
@@ -3898,7 +3898,7 @@ ZEND_API zend_property_info *zend_declare_typed_property(zend_class_entry *ce, z
38983898
}
38993899
/* }}} */
39003900

3901-
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, zend_bool strict) /* {{{ */
3901+
ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *val, bool strict) /* {{{ */
39023902
{
39033903
if (UNEXPECTED(!zend_verify_ref_assignable_zval(ref, val, strict))) {
39043904
zval_ptr_dtor(val);
@@ -3926,7 +3926,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref) /* {{{
39263926
}
39273927
/* }}} */
39283928

3929-
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val) /* {{{ */
3929+
ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val) /* {{{ */
39303930
{
39313931
zval tmp;
39323932

@@ -4016,7 +4016,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *z
40164016
}
40174017
/* }}} */
40184018

4019-
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict) /* {{{ */
4019+
ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict) /* {{{ */
40204020
{
40214021
zval tmp;
40224022

@@ -4167,7 +4167,7 @@ ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char
41674167
}
41684168
/* }}} */
41694169

4170-
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value) /* {{{ */
4170+
ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value) /* {{{ */
41714171
{
41724172
zval constant;
41734173

@@ -4408,7 +4408,7 @@ ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope
44084408
}
44094409
/* }}} */
44104410

4411-
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv) /* {{{ */
4411+
ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv) /* {{{ */
44124412
{
44134413
zval *value;
44144414
zend_class_entry *old_scope = EG(fake_scope);
@@ -4422,7 +4422,7 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *objec
44224422
}
44234423
/* }}} */
44244424

4425-
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv) /* {{{ */
4425+
ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv) /* {{{ */
44264426
{
44274427
zval *value;
44284428
zend_string *str;
@@ -4434,7 +4434,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object,
44344434
}
44354435
/* }}} */
44364436

4437-
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */
4437+
ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent) /* {{{ */
44384438
{
44394439
zval *property;
44404440
zend_class_entry *old_scope = EG(fake_scope);
@@ -4447,7 +4447,7 @@ ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string
44474447
}
44484448
/* }}} */
44494449

4450-
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */
4450+
ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent) /* {{{ */
44514451
{
44524452
zend_string *key = zend_string_init(name, name_length, 0);
44534453
zval *property = zend_read_static_property_ex(scope, key, silent);
@@ -4493,7 +4493,7 @@ ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce)
44934493
}
44944494
/* }}} */
44954495

4496-
ZEND_API zend_bool zend_is_iterable(zval *iterable) /* {{{ */
4496+
ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
44974497
{
44984498
switch (Z_TYPE_P(iterable)) {
44994499
case IS_ARRAY:
@@ -4506,7 +4506,7 @@ ZEND_API zend_bool zend_is_iterable(zval *iterable) /* {{{ */
45064506
}
45074507
/* }}} */
45084508

4509-
ZEND_API zend_bool zend_is_countable(zval *countable) /* {{{ */
4509+
ZEND_API bool zend_is_countable(zval *countable) /* {{{ */
45104510
{
45114511
switch (Z_TYPE_P(countable)) {
45124512
case IS_ARRAY:

0 commit comments

Comments
 (0)