[uim-commit] r3033 - branches/r5rs/sigscheme/src

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Jan 29 20:17:52 PST 2006


Author: yamaken
Date: 2006-01-29 20:17:48 -0800 (Sun, 29 Jan 2006)
New Revision: 3033

Modified:
   branches/r5rs/sigscheme/src/error.c
Log:
* sigscheme/src/error.c
  - (SCM_BACKTRACE_HEADER, SCM_BACKTRACE_SEP): Remove trailing "\n"
  - (scm_show_backtrace):
    * Suppress headers if trace stack is empty
    * Print newline by scm_port_newline()


Modified: branches/r5rs/sigscheme/src/error.c
===================================================================
--- branches/r5rs/sigscheme/src/error.c	2006-01-30 04:08:48 UTC (rev 3032)
+++ branches/r5rs/sigscheme/src/error.c	2006-01-30 04:17:48 UTC (rev 3033)
@@ -55,8 +55,8 @@
 /*=======================================
   File Local Macro Declarations
 =======================================*/
-#define SCM_BACKTRACE_HEADER "**** BACKTRACE ****\n"
-#define SCM_BACKTRACE_SEP    "------------------------------\n"
+#define SCM_BACKTRACE_HEADER "**** BACKTRACE ****"
+#define SCM_BACKTRACE_SEP    "------------------------------"
 
 /*=======================================
   Variable Declarations
@@ -408,12 +408,17 @@
     ScmObj frame, env, obj, elm;
     DECLARE_INTERNAL_FUNCTION("scm_show_backtrace");
 
-    scm_port_printf(scm_err, SCM_BACKTRACE_HEADER);
+    if (NULLP(trace_stack))
+        return;
 
+    scm_port_puts(scm_err, SCM_BACKTRACE_HEADER);
+    scm_port_newline(scm_err);
+
     /* show each frame's obj */
     FOR_EACH (frame, trace_stack) {
 #if SCM_DEBUG_BACKTRACE_SEP
-        scm_port_printf(scm_err, SCM_BACKTRACE_SEP);
+        scm_port_puts(scm_err, SCM_BACKTRACE_SEP);
+        scm_port_newline(scm_err);
 #endif
 
         env = TRACE_FRAME_ENV(frame);
@@ -442,7 +447,8 @@
 #endif /* SCM_DEBUG_BACKTRACE_VAL */
     }
 #if SCM_DEBUG_BACKTRACE_SEP
-    scm_port_printf(scm_err, SCM_BACKTRACE_SEP);
+    scm_port_puts(scm_err, SCM_BACKTRACE_SEP);
+    scm_port_newline(scm_err);
 #endif /* SCM_DEBUG_BACKTRACE_SEP */
 #endif /* SCM_DEBUG */
 }



More information about the uim-commit mailing list