Skip to content

Use standard boolean type as zend_bool typedef #5624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ struct _zend_compiler_globals {

HashTable *auto_globals;

zend_bool parse_error;
/* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */
zend_uchar parse_error;
zend_bool in_compilation;
zend_bool short_tags;

Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "zend_portability.h"
#include "zend_long.h"
#include <stdbool.h>

#ifdef __SSE2__
# include <mmintrin.h>
Expand All @@ -46,7 +47,7 @@
# define ZEND_ENDIAN_LOHI_C_4(a, b, c, d) a, b, c, d
#endif

typedef unsigned char zend_bool;
typedef bool zend_bool;
typedef unsigned char zend_uchar;

typedef enum {
Expand Down
9 changes: 5 additions & 4 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ static PHP_INI_MH(OnUpdateTimeout)

/* {{{ php_get_display_errors_mode() helper function
*/
static int php_get_display_errors_mode(char *value, size_t value_length)
static zend_uchar php_get_display_errors_mode(char *value, size_t value_length)
{
int mode;
zend_uchar mode;

if (!value) {
return PHP_DISPLAY_ERRORS_STDOUT;
Expand Down Expand Up @@ -480,7 +480,7 @@ static int php_get_display_errors_mode(char *value, size_t value_length)
*/
static PHP_INI_MH(OnUpdateDisplayErrors)
{
PG(display_errors) = (zend_bool) php_get_display_errors_mode(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
PG(display_errors) = php_get_display_errors_mode(ZSTR_VAL(new_value), ZSTR_LEN(new_value));

return SUCCESS;
}
Expand All @@ -490,7 +490,8 @@ static PHP_INI_MH(OnUpdateDisplayErrors)
*/
static PHP_INI_DISP(display_errors_mode)
{
int mode, cgi_or_cli;
zend_uchar mode;
bool cgi_or_cli;
size_t tmp_value_length;
char *tmp_value;

Expand Down
2 changes: 1 addition & 1 deletion main/php_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct _php_core_globals {
zend_long memory_limit;
zend_long max_input_time;

zend_bool display_errors;
zend_uchar display_errors;
zend_bool display_startup_errors;
zend_bool log_errors;
zend_long log_errors_max_len;
Expand Down