From 2be895e4fe97f42ae75ea266517e21576892d3c5 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 19 Oct 2014 11:10:13 +0200 Subject: [PATCH] more EOL fixes --- phpdbg.c | 10 +++++----- phpdbg_bp.c | 36 ++++++++++++++++++------------------ phpdbg_frame.c | 6 +++--- phpdbg_help.c | 6 +++--- phpdbg_prompt.c | 22 +++++++++++----------- phpdbg_watch.c | 4 ++-- 6 files changed, 42 insertions(+), 42 deletions(-) diff --git a/phpdbg.c b/phpdbg.c index e7a8f47a15..1366622759 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -742,10 +742,10 @@ static void phpdbg_welcome(zend_bool cleaning TSRMLS_DC) /* {{{ */ } phpdbg_write("cleaninfo", "classes=\"%d\" functions=\"%d\" constants=\"%d\" includes=\"%d\"", - "Classes %d\n" - "Functions %d\n" - "Constants %d\n" - "Includes %d\n", + "Classes %d" PHP_EOL + "Functions %d" PHP_EOL + "Constants %d" PHP_EOL + "Includes %d" PHP_EOL, zend_hash_num_elements(EG(class_table)), zend_hash_num_elements(EG(function_table)), zend_hash_num_elements(EG(zend_constants)), @@ -1212,7 +1212,7 @@ phpdbg_main: sapi_startup(phpdbg); phpdbg->startup(phpdbg); printf( - "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2014 The PHP Group\n%s", + "phpdbg %s (built: %s %s)" PHP_EOL "PHP %s, Copyright (c) 1997-2014 The PHP Group" PHP_EOL "%s", PHPDBG_VERSION, __DATE__, __TIME__, diff --git a/phpdbg_bp.c b/phpdbg_bp.c index 26e6ee2971..e7f313d6b8 100644 --- a/phpdbg_bp.c +++ b/phpdbg_bp.c @@ -1339,8 +1339,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position; phpdbg_breaksymbol_t *brake; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Function Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Function Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], &position); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], (void**) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], &position)) { @@ -1357,8 +1357,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ zend_uint class_len = 0; zend_ulong class_idx = 0L; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Method Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Method Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], &position[0]); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], (void**) &class_table, &position[0]) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], &position[0])) { @@ -1383,8 +1383,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position[2]; HashTable *points; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("File Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("File Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], &position[0]); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], (void**) &points, &position[0]) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], &position[0])) { @@ -1405,8 +1405,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position; phpdbg_breakline_t *brake; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Opline Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Opline Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (void**) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position)) { @@ -1436,8 +1436,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ zend_uint class_len = 0, method_len = 0; zend_ulong class_idx = 0L, method_idx = 0L; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Method opline Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Method opline Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], &position[0]); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], (void**) &class_table, &position[0]) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE], &position[0])) { @@ -1475,8 +1475,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ zend_uint function_len = 0; zend_ulong function_idx = 0L; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Function opline Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Function opline Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], &position[0]); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], (void**) &function_table, &position[0]) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE], &position[0])) { @@ -1505,8 +1505,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ zend_uint file_len = 0; zend_ulong file_idx = 0L; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("File opline Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("File opline Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], &position[0]); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], (void**) &file_table, &position[0]) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE], &position[0])) { @@ -1531,8 +1531,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position; phpdbg_breakcond_t *brake; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Conditional Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Conditional Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], (void**) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_COND], &position)) { @@ -1607,8 +1607,8 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */ HashPosition position; phpdbg_breakop_t *brake; - phpdbg_out(SEPARATE "\n"); - phpdbg_out("Opcode Breakpoints:\n"); + phpdbg_out(SEPARATE PHP_EOL); + phpdbg_out("Opcode Breakpoints:" PHP_EOL); for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position); zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], (void**) &brake, &position) == SUCCESS; zend_hash_move_forward_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], &position)) { diff --git a/phpdbg_frame.c b/phpdbg_frame.c index 8baaf77190..f4ab92392f 100644 --- a/phpdbg_frame.c +++ b/phpdbg_frame.c @@ -228,16 +228,16 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */ phpdbg_out("frame #%d: ", i++); phpdbg_xml(" "); phpdbg_xml(""); zval_dtor(&zbacktrace); diff --git a/phpdbg_help.c b/phpdbg_help.c index 2e8f527b53..f2c6486ae5 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -136,7 +136,7 @@ void pretty_print(char *text TSRMLS_DC) phpdbg_error("help", "overrun=\"%lu\"", "Output overrun of %lu bytes", ((q - new) - size)); } - phpdbg_out("%s\n", new); + phpdbg_out("%s" PHP_EOL, new); efree(new); } /* }}} */ @@ -144,7 +144,7 @@ void pretty_print(char *text TSRMLS_DC) void summary_print(phpdbg_command_t const * const cmd TSRMLS_DC) { char *summary; - spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**\n", cmd->name, cmd->alias, cmd->tip); + spprintf(&summary, 0, "Command: **%s** Alias: **%c** **%s**" PHP_EOL, cmd->name, cmd->alias, cmd->tip); pretty_print(summary TSRMLS_CC); efree(summary); } @@ -285,7 +285,7 @@ PHPDBG_HELP(aliases) /* {{{ */ /* Print out aliases for help as this one comes last, with the added text on how aliases are used */ get_command("h", 1, &c, phpdbg_prompt_commands TSRMLS_CC); - phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s\n", c->alias, c->name, c->tip); + phpdbg_writeln("aliasinfo", "alias=\"%c\" name=\"%s\" tip=\"%s\"", " %c %-20s %s" PHP_EOL, c->alias, c->name, c->tip); phpdbg_xml(""); diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 194c890ebe..cc2062b2b7 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -190,7 +190,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack TSRMLS_DC) /* {{{ * if (fretval) { zend_print_zval_r(fretval, 0 TSRMLS_CC); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); } zval_dtor(&fname); @@ -551,7 +551,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */ zend_call_function(&fci, NULL TSRMLS_CC); if (trace) { - phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!\n%.*s", Z_OBJCE(exception)->name, Z_STRLEN_P(trace), Z_STRVAL_P(trace)); + phpdbg_writeln("exception", "name=\"%s\" trace=\"%.*s\"", "Uncaught %s!" PHP_EOL "%.*s", Z_OBJCE(exception)->name, Z_STRLEN_P(trace), Z_STRVAL_P(trace)); zval_ptr_dtor(&trace); } else { @@ -674,7 +674,7 @@ int phpdbg_output_ev_variable(char *name, size_t len, char *keyname, size_t keyl phpdbg_xml(""); zend_print_zval_r(*zv, 0 TSRMLS_CC); phpdbg_xml(""); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); efree(name); efree(keyname); @@ -707,7 +707,7 @@ PHPDBG_COMMAND(ev) /* {{{ */ phpdbg_xml(""); zend_print_zval_r(&retval, 0 TSRMLS_CC); phpdbg_xml(""); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); zval_dtor(&retval); } } zend_end_try(); @@ -741,7 +741,7 @@ PHPDBG_COMMAND(back) /* {{{ */ PHPDBG_COMMAND(print) /* {{{ */ { - phpdbg_out("Execution Context Information\n\n"); + phpdbg_out("Execution Context Information" PHP_EOL PHP_EOL); phpdbg_xml(""); #ifdef HAVE_LIBREADLINE phpdbg_writeln("print", "readline=\"yes\"", "Readline yes"); @@ -855,12 +855,12 @@ PHPDBG_COMMAND(sh) /* {{{ */ } /* }}} */ static int add_module_info(zend_module_entry *module TSRMLS_DC) { - phpdbg_write("module", "name=\"%s\"", "%s\n", module->name); + phpdbg_write("module", "name=\"%s\"", "%s" PHP_EOL, module->name); return 0; } static int add_zendext_info(zend_extension *ext TSRMLS_DC) { - phpdbg_write("extension", "name=\"%s\"", "%s\n", ext->name); + phpdbg_write("extension", "name=\"%s\"", "%s" PHP_EOL, ext->name); return 0; } @@ -1012,7 +1012,7 @@ PHPDBG_COMMAND(dl) /* {{{ */ if (!param || param->type == EMPTY_PARAM) { phpdbg_notice("dl", "extensiontype=\"Zend extension\"", "Zend extensions"); zend_llist_apply(&zend_extensions, (llist_apply_func_t) add_zendext_info TSRMLS_CC); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); phpdbg_notice("dl", "extensiontype=\"module\"", "Modules"); zend_hash_apply(&module_registry, (apply_func_t) add_module_info TSRMLS_CC); } else switch (param->type) { @@ -1109,7 +1109,7 @@ PHPDBG_COMMAND(clean) /* {{{ */ return SUCCESS; } - phpdbg_out("Cleaning Execution Environment\n"); + phpdbg_out("Cleaning Execution Environment" PHP_EOL); phpdbg_xml(""); phpdbg_writeln("clean", "classes=\"%d\"", "Classes %d", zend_hash_num_elements(EG(class_table))); @@ -1126,7 +1126,7 @@ PHPDBG_COMMAND(clean) /* {{{ */ PHPDBG_COMMAND(clear) /* {{{ */ { - phpdbg_out("Clearing Breakpoints\n"); + phpdbg_out("Clearing Breakpoints" PHP_EOL); phpdbg_xml(""); phpdbg_writeln("clear", "files=\"%d\"", "File %d", zend_hash_num_elements(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE])); @@ -1479,7 +1479,7 @@ zend_vm_enter: if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { PHPDBG_G(flags) &= ~PHPDBG_IS_SIGNALED; - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); phpdbg_notice("signal", "type=\"SIGINT\"", "Program received signal SIGINT"); DO_INTERACTIVE(1); } diff --git a/phpdbg_watch.c b/phpdbg_watch.c index de6cddf5b3..3f07b70dcd 100644 --- a/phpdbg_watch.c +++ b/phpdbg_watch.c @@ -567,7 +567,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { phpdbg_xml(""); zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC); phpdbg_xml(""); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); } } if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS && (removed || show_ref)) { @@ -593,7 +593,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) { phpdbg_xml(""); zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC); phpdbg_xml(""); - phpdbg_out("\n"); + phpdbg_out(PHP_EOL); } if (PHPDBG_G(flags) & PHPDBG_SHOW_REFCOUNTS && show_ref) { phpdbg_writeln("watchrefcount", "type=\"new\" refcount=\"%d\" isref=\"%d\"", "New refcount: %d; New is_ref: %d", watch->addr.zv->refcount__gc, watch->addr.zv->is_ref__gc); -- 2.40.0