From e6f90ecc27f5d305a0e755da67db75da786f4568 Mon Sep 17 00:00:00 2001 From: Anthony Ferrara Date: Tue, 2 Jul 2013 09:46:30 -0400 Subject: It compiles. Sort-of. In a way. Yeah. But nothing works. Sigh --- sapi/cli/php_cli.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 9f3fc4b5b7..164986f633 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - size_t ret; + zend_str_size ret; #endif if (cli_shell_callbacks.cli_shell_write) { - size_t shell_wrote; + zend_str_size shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS } /* }}} */ -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - uint remaining = str_length; + zend_str_size remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ } if (cli_shell_callbacks.cli_shell_ub_write) { - int ub_wrote; + zend_str_size ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - unsigned int len; + zend_str_size len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -619,7 +619,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st /* {{{ cli_seek_file_begin */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) +static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, zend_str_size_int *lineno TSRMLS_DC) { int c; @@ -670,7 +670,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ char *arg_free=NULL, **arg_excp=&arg_free; char *script_file=NULL, *translated_path = NULL; int interactive=0; - int lineno = 0; + zend_str_size lineno = 0; const char *param_error=NULL; int hide_argv = 0; @@ -1059,7 +1059,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } ALLOC_ZVAL(argn); Z_TYPE_P(argn) = IS_STRING; - Z_STRLEN_P(argn) = ++len; + Z_STRSIZE_P(argn) = ++len; Z_STRVAL_P(argn) = estrndup(input, len); INIT_PZVAL(argn); zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); @@ -1214,7 +1214,7 @@ int main(int argc, char *argv[]) int php_optind = 1, use_extended_info = 0; char *ini_path_override = NULL; char *ini_entries = NULL; - int ini_entries_len = 0; + zend_str_size ini_entries_len = 0; int ini_ignore = 0; sapi_module_struct *sapi_module = &cli_sapi_module; @@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) break; case 'd': { /* define ini entries on command line */ - int len = strlen(php_optarg); + zend_str_size len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { -- cgit v1.2.1 From 010b8114cc7d71c0957ff0a77e9d2c1cfe16e9f3 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 29 Jul 2013 02:39:44 -0700 Subject: more for cli sapi --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 164986f633..c343f5496e 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1143,7 +1143,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } case PHP_MODE_REFLECTION_EXT_INFO: { - int len = strlen(reflection_what); + zend_str_size_int len = strlen(reflection_what); char *lcname = zend_str_tolower_dup(reflection_what, len); zend_module_entry *module; -- cgit v1.2.1 From b1abe4ca21e10b04a8bae2d00e8113f4b2b02567 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 18 Dec 2013 14:46:44 -0800 Subject: mass replacement for zend_size_t/php_size_t --- sapi/cli/php_cli.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 4cc91d6772..8f6522a71d 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - zend_str_size ret; + php_size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { - zend_str_size shell_wrote; + php_size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API zend_str_size_size_t sapi_cli_single_write(const char *str, zend_str } /* }}} */ -static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint str_length TSRMLS_DC) /* {{{ */ +static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - zend_str_size remaining = str_length; + php_size_t remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static zend_str_size_int sapi_cli_ub_write(const char *str, zend_str_size_uint s } if (cli_shell_callbacks.cli_shell_ub_write) { - zend_str_size ub_wrote; + php_size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - zend_str_size len; + php_size_t len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -619,7 +619,7 @@ static const char *param_mode_conflict = "Either execute direct code, process st /* {{{ cli_seek_file_begin */ -static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, zend_str_size_int *lineno TSRMLS_DC) +static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, php_size_t *lineno TSRMLS_DC) { int c; @@ -670,7 +670,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ char *arg_free=NULL, **arg_excp=&arg_free; char *script_file=NULL, *translated_path = NULL; int interactive=0; - zend_str_size lineno = 0; + php_size_t lineno = 0; const char *param_error=NULL; int hide_argv = 0; @@ -1143,7 +1143,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } case PHP_MODE_REFLECTION_EXT_INFO: { - zend_str_size_int len = strlen(reflection_what); + php_size_t len = strlen(reflection_what); char *lcname = zend_str_tolower_dup(reflection_what, len); zend_module_entry *module; @@ -1214,7 +1214,7 @@ int main(int argc, char *argv[]) int php_optind = 1, use_extended_info = 0; char *ini_path_override = NULL; char *ini_entries = NULL; - zend_str_size ini_entries_len = 0; + php_size_t ini_entries_len = 0; int ini_ignore = 0; sapi_module_struct *sapi_module = &cli_sapi_module; @@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) break; case 'd': { /* define ini entries on command line */ - zend_str_size len = strlen(php_optarg); + php_size_t len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { -- cgit v1.2.1 From f58d0b35edf25a8f39fad6bd5e0e4eeb5cdfe9a7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 19 Dec 2013 05:07:37 -0800 Subject: massive update semantical LONG vs INT replacements --- sapi/cli/php_cli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 8f6522a71d..f4bd529127 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1048,8 +1048,8 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ exit_status=254; } ALLOC_ZVAL(argi); - Z_TYPE_P(argi) = IS_LONG; - Z_LVAL_P(argi) = index; + Z_TYPE_P(argi) = IS_INT; + Z_IVAL_P(argi) = index; INIT_PZVAL(argi); zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { @@ -1063,7 +1063,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ Z_STRVAL_P(argn) = estrndup(input, len); INIT_PZVAL(argn); zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); - Z_LVAL_P(argi) = ++index; + Z_IVAL_P(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; -- cgit v1.2.1 From cb25136f4ef1042295650475b2c20ace81e2b9b7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 16 Aug 2014 11:37:14 +0200 Subject: fix macros in the 5 basic extensions --- sapi/cli/php_cli.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index ec76f37715..92ec58b25f 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,16 +252,16 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else - size_t ret; + php_size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { - size_t shell_wrote; + php_size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; @@ -285,10 +285,10 @@ PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS } /* }}} */ -static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ +static php_size_t sapi_cli_ub_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; - uint remaining = str_length; + php_size_t remaining = str_length; size_t ret; if (!str_length) { @@ -296,7 +296,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ } if (cli_shell_callbacks.cli_shell_ub_write) { - int ub_wrote; + php_size_t ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; @@ -338,7 +338,7 @@ static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { - unsigned int len; + php_size_t len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server @@ -1033,7 +1033,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } - ZVAL_LONG(&argi, index); + ZVAL_INT(&argi, index); zend_hash_str_update(&EG(symbol_table).ht, "argi", sizeof("argi")-1, &argi); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); @@ -1042,7 +1042,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ } ZVAL_STRINGL(&argn, input, len); zend_hash_str_update(&EG(symbol_table).ht, "argn", sizeof("argn")-1, &argn); - Z_LVAL(argi) = ++index; + Z_IVAL(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; -- cgit v1.2.1 From 41115d3d9dc1f7116ac2d1bb7087a24098885a03 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 17 Aug 2014 21:05:20 +0200 Subject: regenerated parser files --- sapi/cli/php_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 92ec58b25f..bdc4629c08 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -252,10 +252,10 @@ static inline int sapi_cli_select(int fd TSRMLS_DC) return ret != -1; } -PHP_CLI_API php_size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ +PHP_CLI_API size_t sapi_cli_single_write(const char *str, php_size_t str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT - long ret; + php_int_t ret; #else php_size_t ret; #endif -- cgit v1.2.1