summaryrefslogtreecommitdiff
path: root/main
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 /main
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 'main')
-rw-r--r--main/SAPI.c2
-rw-r--r--main/SAPI.h10
-rw-r--r--main/fopen_wrappers.c2
-rw-r--r--main/main.c8
-rw-r--r--main/output.c4
-rw-r--r--main/php_globals.h54
-rw-r--r--main/php_ini.c2
-rw-r--r--main/php_variables.c22
-rw-r--r--main/rfc1867.c12
-rw-r--r--main/spprintf.c2
-rw-r--r--main/streams/userspace.c2
-rw-r--r--main/streams/xp_socket.c2
12 files changed, 61 insertions, 61 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 0a7f219e84..79d9610a53 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -606,7 +606,7 @@ static void sapi_remove_header(zend_llist *l, char *name, size_t len) {
}
}
-SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace)
+SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace)
{
sapi_header_line ctr = {0};
int r;
diff --git a/main/SAPI.h b/main/SAPI.h
index b0d2928369..4de2189a6d 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -83,9 +83,9 @@ typedef struct {
const char *content_type;
- zend_bool headers_only;
- zend_bool no_headers;
- zend_bool headers_read;
+ bool headers_only;
+ bool no_headers;
+ bool headers_read;
sapi_post_entry *post_entry;
@@ -122,7 +122,7 @@ typedef struct _sapi_globals_struct {
HashTable *rfc1867_uploaded_files;
zend_long post_max_size;
int options;
- zend_bool sapi_started;
+ bool sapi_started;
double global_request_time;
HashTable known_post_content_types;
zval callback_func;
@@ -177,7 +177,7 @@ BEGIN_EXTERN_C()
SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg);
/* Deprecated functions. Use sapi_header_op instead. */
-SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, zend_bool duplicate, zend_bool replace);
+SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len, bool duplicate, bool replace);
#define sapi_add_header(a, b, c) sapi_add_header_ex((a),(b),(c),1)
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 88519bc726..633c5e3b2b 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -342,7 +342,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
char *filename = NULL;
zend_string *resolved_path = NULL;
size_t length;
- zend_bool orig_display_errors;
+ bool orig_display_errors;
path_info = SG(request_info).request_uri;
#if HAVE_PWD_H
diff --git a/main/main.c b/main/main.c
index 8ab7c55067..b5115663b8 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1138,7 +1138,7 @@ static void clear_last_error() {
static void report_zend_debug_error_notify_cb(int type, const char *error_filename, uint32_t error_lineno, zend_string *message)
{
if (PG(report_zend_debug)) {
- zend_bool trigger_break;
+ bool trigger_break;
switch (type) {
case E_ERROR:
@@ -1162,7 +1162,7 @@ static void report_zend_debug_error_notify_cb(int type, const char *error_filena
extended error handling function */
static ZEND_COLD void php_error_cb(int orig_type, const char *error_filename, const uint32_t error_lineno, zend_string *message)
{
- zend_bool display;
+ bool display;
int type = orig_type & E_ALL;
/* check for repeated errors to be ignored */
@@ -1727,7 +1727,7 @@ int php_request_startup(void)
/* {{{ php_request_shutdown */
void php_request_shutdown(void *dummy)
{
- zend_bool report_memleaks;
+ bool report_memleaks;
EG(flags) |= EG_FLAGS_IN_SHUTDOWN;
@@ -1757,7 +1757,7 @@ void php_request_shutdown(void *dummy)
/* 3. Flush all output buffers */
zend_try {
- zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1;
+ bool send_buffer = SG(request_info).headers_only ? 0 : 1;
if (CG(unclean_shutdown) && PG(last_error_type) == E_ERROR &&
(size_t)PG(memory_limit) < zend_memory_usage(1)
diff --git a/main/output.c b/main/output.c
index eef8ad3bfc..ec844973c5 100644
--- a/main/output.c
+++ b/main/output.c
@@ -807,7 +807,7 @@ static inline void php_output_context_reset(php_output_context *context)
/* {{{ static void php_output_context_feed(php_output_context *context, char *, size_t, size_t)
* Feed output contexts input buffer */
-static inline void php_output_context_feed(php_output_context *context, char *data, size_t size, size_t used, zend_bool free)
+static inline void php_output_context_feed(php_output_context *context, char *data, size_t size, size_t used, bool free)
{
if (context->in.free && context->in.data) {
efree(context->in.data);
@@ -1491,7 +1491,7 @@ PHP_FUNCTION(ob_list_handlers)
/* {{{ Return the status of the active or all output buffers */
PHP_FUNCTION(ob_get_status)
{
- zend_bool full_status = 0;
+ bool full_status = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_status) == FAILURE) {
RETURN_THROWS();
diff --git a/main/php_globals.h b/main/php_globals.h
index e079866645..e619694d18 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -51,11 +51,11 @@ typedef struct _arg_separators {
} arg_separators;
struct _php_core_globals {
- zend_bool implicit_flush;
+ bool implicit_flush;
zend_long output_buffering;
- zend_bool enable_dl;
+ bool enable_dl;
char *output_handler;
@@ -66,12 +66,12 @@ struct _php_core_globals {
zend_long max_input_time;
zend_uchar display_errors;
- zend_bool display_startup_errors;
- zend_bool log_errors;
+ bool display_startup_errors;
+ bool log_errors;
zend_long log_errors_max_len;
- zend_bool ignore_repeated_errors;
- zend_bool ignore_repeated_source;
- zend_bool report_memleaks;
+ bool ignore_repeated_errors;
+ bool ignore_repeated_source;
+ bool report_memleaks;
char *error_log;
char *doc_root;
@@ -102,7 +102,7 @@ struct _php_core_globals {
HashTable rfc1867_protected_variables;
short connection_status;
- zend_bool ignore_user_abort;
+ bool ignore_user_abort;
unsigned char header_is_being_sent;
@@ -110,27 +110,27 @@ struct _php_core_globals {
zval http_globals[6];
- zend_bool expose_php;
+ bool expose_php;
- zend_bool register_argc_argv;
- zend_bool auto_globals_jit;
+ bool register_argc_argv;
+ bool auto_globals_jit;
char *docref_root;
char *docref_ext;
- zend_bool html_errors;
- zend_bool xmlrpc_errors;
+ bool html_errors;
+ bool xmlrpc_errors;
zend_long xmlrpc_error_number;
- zend_bool activated_auto_globals[8];
+ bool activated_auto_globals[8];
- zend_bool modules_activated;
- zend_bool file_uploads;
- zend_bool during_request_startup;
- zend_bool allow_url_fopen;
- zend_bool enable_post_data_reading;
- zend_bool report_zend_debug;
+ bool modules_activated;
+ bool file_uploads;
+ bool during_request_startup;
+ bool allow_url_fopen;
+ bool enable_post_data_reading;
+ bool report_zend_debug;
int last_error_type;
zend_string *last_error_message;
@@ -140,31 +140,31 @@ struct _php_core_globals {
char *php_sys_temp_dir;
char *disable_classes;
- zend_bool allow_url_include;
+ bool allow_url_include;
#ifdef PHP_WIN32
- zend_bool com_initialized;
+ bool com_initialized;
#endif
zend_long max_input_nesting_level;
zend_long max_input_vars;
- zend_bool in_user_include;
+ bool in_user_include;
char *user_ini_filename;
zend_long user_ini_cache_ttl;
char *request_order;
- zend_bool mail_x_header;
+ bool mail_x_header;
char *mail_log;
- zend_bool in_error_log;
+ bool in_error_log;
#ifdef PHP_WIN32
- zend_bool windows_show_crt_warning;
+ bool windows_show_crt_warning;
#endif
zend_long syslog_facility;
char *syslog_ident;
- zend_bool have_called_openlog;
+ bool have_called_openlog;
zend_long syslog_filter;
};
diff --git a/main/php_ini.c b/main/php_ini.c
index 52e3a20ebf..0fa3a33365 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -117,7 +117,7 @@ PHPAPI ZEND_COLD void display_ini_entries(zend_module_entry *module)
{
int module_number;
zend_ini_entry *ini_entry;
- zend_bool first = 1;
+ bool first = 1;
if (module) {
module_number = module->module_number;
diff --git a/main/php_variables.c b/main/php_variables.c
index 312c22ef07..4c284cacfb 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -62,7 +62,7 @@ PHPAPI void php_register_variable_ex(const char *var_name, zval *val, zval *trac
char *var, *var_orig;
size_t var_len, index_len;
zval gpc_element, *gpc_element_p;
- zend_bool is_array = 0;
+ bool is_array = 0;
HashTable *symtable1 = NULL;
ALLOCA_FLAG(use_heap)
@@ -276,7 +276,7 @@ typedef struct post_var_data {
size_t already_scanned;
} post_var_data_t;
-static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
+static bool add_post_var(zval *arr, post_var_data_t *var, bool eof)
{
char *start, *ksep, *vsep, *val;
size_t klen, vlen;
@@ -327,7 +327,7 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof)
return 1;
}
-static inline int add_post_vars(zval *arr, post_var_data_t *vars, zend_bool eof)
+static inline int add_post_vars(zval *arr, post_var_data_t *vars, bool eof)
{
uint64_t max_vars = PG(max_input_vars);
@@ -581,7 +581,7 @@ void _php_import_environment_variables(zval *array_ptr)
tsrm_env_unlock();
}
-zend_bool php_std_auto_global_callback(char *name, uint32_t name_len)
+bool php_std_auto_global_callback(char *name, uint32_t name_len)
{
zend_printf("%s\n", name);
return 0; /* don't rearm */
@@ -727,7 +727,7 @@ PHPAPI int php_hash_environment(void)
}
/* }}} */
-static zend_bool php_auto_globals_create_get(zend_string *name)
+static bool php_auto_globals_create_get(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'G') || strchr(PG(variables_order),'g'))) {
sapi_module.treat_data(PARSE_GET, NULL, NULL);
@@ -742,7 +742,7 @@ static zend_bool php_auto_globals_create_get(zend_string *name)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_post(zend_string *name)
+static bool php_auto_globals_create_post(zend_string *name)
{
if (PG(variables_order) &&
(strchr(PG(variables_order),'P') || strchr(PG(variables_order),'p')) &&
@@ -761,7 +761,7 @@ static zend_bool php_auto_globals_create_post(zend_string *name)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_cookie(zend_string *name)
+static bool php_auto_globals_create_cookie(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'C') || strchr(PG(variables_order),'c'))) {
sapi_module.treat_data(PARSE_COOKIE, NULL, NULL);
@@ -776,7 +776,7 @@ static zend_bool php_auto_globals_create_cookie(zend_string *name)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_files(zend_string *name)
+static bool php_auto_globals_create_files(zend_string *name)
{
if (Z_TYPE(PG(http_globals)[TRACK_VARS_FILES]) == IS_UNDEF) {
array_init(&PG(http_globals)[TRACK_VARS_FILES]);
@@ -804,7 +804,7 @@ static void check_http_proxy(HashTable *var_table)
}
}
-static zend_bool php_auto_globals_create_server(zend_string *name)
+static bool php_auto_globals_create_server(zend_string *name)
{
if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
php_register_server_variables();
@@ -841,7 +841,7 @@ static zend_bool php_auto_globals_create_server(zend_string *name)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_env(zend_string *name)
+static bool php_auto_globals_create_env(zend_string *name)
{
zval_ptr_dtor_nogc(&PG(http_globals)[TRACK_VARS_ENV]);
array_init(&PG(http_globals)[TRACK_VARS_ENV]);
@@ -857,7 +857,7 @@ static zend_bool php_auto_globals_create_env(zend_string *name)
return 0; /* don't rearm */
}
-static zend_bool php_auto_globals_create_request(zend_string *name)
+static bool php_auto_globals_create_request(zend_string *name)
{
zval form_variables;
unsigned char _gpc_flags[3] = {0, 0, 0};
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 8ef83f443d..6e96c3ea19 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -52,7 +52,7 @@ static php_rfc1867_basename_t php_rfc1867_basename = NULL;
PHPAPI int (*php_rfc1867_callback)(unsigned int event, void *event_data, void **extra) = NULL;
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection);
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, bool override_protection);
/* The longest property name we use in an uploaded file array */
#define MAX_SIZE_OF_INDEX sizeof("[tmp_name]")
@@ -148,14 +148,14 @@ static void add_protected_variable(char *varname) /* {{{ */
}
/* }}} */
-static zend_bool is_protected_variable(char *varname) /* {{{ */
+static bool is_protected_variable(char *varname) /* {{{ */
{
normalize_protected_variable(varname);
return zend_hash_str_exists(&PG(rfc1867_protected_variables), varname, strlen(varname));
}
/* }}} */
-static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, zend_bool override_protection) /* {{{ */
+static void safe_php_register_variable(char *var, char *strval, size_t val_len, zval *track_vars_array, bool override_protection) /* {{{ */
{
if (override_protection || !is_protected_variable(var)) {
php_register_variable_safe(var, strval, val_len, track_vars_array);
@@ -163,7 +163,7 @@ static void safe_php_register_variable(char *var, char *strval, size_t val_len,
}
/* }}} */
-static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, zend_bool override_protection) /* {{{ */
+static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars_array, bool override_protection) /* {{{ */
{
if (override_protection || !is_protected_variable(var)) {
php_register_variable_ex(var, val, track_vars_array);
@@ -171,13 +171,13 @@ static void safe_php_register_variable_ex(char *var, zval *val, zval *track_vars
}
/* }}} */
-static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
+static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, bool override_protection) /* {{{ */
{
safe_php_register_variable(strvar, val, strlen(val), http_post_files, override_protection);
}
/* }}} */
-static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection) /* {{{ */
+static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, bool override_protection) /* {{{ */
{
safe_php_register_variable_ex(var, val, http_post_files, override_protection);
}
diff --git a/main/spprintf.c b/main/spprintf.c
index 768a27470c..980294ea23 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -185,7 +185,7 @@ static size_t strnlen(const char *s, size_t maxlen) {
/*
* Do format conversion placing the output in buffer
*/
-static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt, va_list ap) /* {{{ */
+static void xbuf_format_converter(void *xbuf, bool is_char, const char *fmt, va_list ap) /* {{{ */
{
char *s = NULL;
size_t s_len;
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index 0e9059a99e..d9e864594c 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -310,7 +310,7 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
zval args[4];
int call_result;
php_stream *stream = NULL;
- zend_bool old_in_user_include;
+ bool old_in_user_include;
/* Try to catch bad usage without preventing flexibility */
if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) {
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 34dc4f2037..e3ff3fe2ec 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -816,7 +816,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
php_stream_xport_param *xparam STREAMS_DC)
{
int clisock;
- zend_bool nodelay = 0;
+ bool nodelay = 0;
zval *tmpzval = NULL;
xparam->outputs.client = NULL;