]> granicus.if.org Git - php/commitdiff
more EOL fixes
authorAnatol Belski <ab@php.net>
Sun, 19 Oct 2014 09:10:13 +0000 (11:10 +0200)
committerAnatol Belski <ab@php.net>
Sun, 19 Oct 2014 09:10:13 +0000 (11:10 +0200)
phpdbg.c
phpdbg_bp.c
phpdbg_frame.c
phpdbg_help.c
phpdbg_prompt.c
phpdbg_watch.c

index e7a8f47a15162d8b6b46d18848fa8239e49cd501..136662275904a8ffc1dd5e01d4f7e6ed653982a2 100644 (file)
--- 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__,
index 26e6ee297135f0d53ab8350b0b53576a3acf6b8e..e7f313d6b87da8f1ec6ea7cb5c5acd13daa3784e 100644 (file)
@@ -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)) {
index 8baaf771906eb09730db3f7d55556420d7f2d4ea..f4ab92392f15dc5984f7a2832a002081b328c338 100644 (file)
@@ -228,16 +228,16 @@ void phpdbg_dump_backtrace(size_t num TSRMLS_DC) /* {{{ */
                        phpdbg_out("frame #%d: ", i++);
                        phpdbg_xml("<frame %r id=\"%d\" file=\"%s\" line=\"%d\"", i, Z_STRVAL_PP(file), Z_LVAL_PP(line));
                        phpdbg_dump_prototype(tmp TSRMLS_CC);
-                       phpdbg_out(" at %s:%ld\n", Z_STRVAL_PP(file), Z_LVAL_PP(line));
+                       phpdbg_out(" at %s:%ld" PHP_EOL, Z_STRVAL_PP(file), Z_LVAL_PP(line));
                } else {
                        phpdbg_out(" => ");
                        phpdbg_xml("<frame %r id=\"%d\" internal=\"internal\"", i);
                        phpdbg_dump_prototype(tmp TSRMLS_CC);
-                       phpdbg_out(" (internal function)\n");
+                       phpdbg_out(" (internal function)" PHP_EOL);
                }
        }
 
-       phpdbg_out("\n");
+       phpdbg_out(PHP_EOL);
        phpdbg_xml("</backtrace>");
 
        zval_dtor(&zbacktrace);
index 2e8f527b53116584730c35291a72a3f6c94d2602..f2c6486ae5e69ab8f5a2de69c7f8327d045073fa 100644 (file)
@@ -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("<helpaliases>");
 
index 194c890ebe6b15163ae5851f9b6119f023624300..cc2062b2b7e39f30ed29859cf1163128131823f4 100644 (file)
@@ -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("<eval %r>");
        zend_print_zval_r(*zv, 0 TSRMLS_CC);
        phpdbg_xml("</eval>");
-       phpdbg_out("\n");
+       phpdbg_out(PHP_EOL);
 
        efree(name);
        efree(keyname);
@@ -707,7 +707,7 @@ PHPDBG_COMMAND(ev) /* {{{ */
                        phpdbg_xml("<eval %r>");
                        zend_print_zval_r(&retval, 0 TSRMLS_CC);
                        phpdbg_xml("</eval>");
-                       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("<printinfo %r>");
 #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("<cleaninfo %r>");
 
        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("<clearinfo %r>");
 
        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);
                }
index de6cddf5b3cb016160ed88606f94857218147ea8..3f07b70dcd5b16809a658eacac0c1943117c8cd3 100644 (file)
@@ -567,7 +567,7 @@ static void phpdbg_print_changed_zval(phpdbg_watch_memdump *dump TSRMLS_DC) {
                                                        phpdbg_xml("<watchvalue %r type=\"old\">");
                                                        zend_print_flat_zval_r((zval *) oldPtr TSRMLS_CC);
                                                        phpdbg_xml("</watchvalue>");
-                                                       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("<watchvalue %r type=\"new\">");
                                                zend_print_flat_zval_r(watch->addr.zv TSRMLS_CC);
                                                phpdbg_xml("</watchvalue>");
-                                               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);