[uim-commit] r1648 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Sep 28 04:43:07 PDT 2005


Author: yamaken
Date: 2005-09-28 04:42:53 -0700 (Wed, 28 Sep 2005)
New Revision: 1648

Modified:
   branches/r5rs/sigscheme/error.c
   branches/r5rs/sigscheme/eval.c
Log:
* sigscheme/eval.c
  - (ScmOp_eval): Enclose trace_frame handlings into #if SCM_DEBUG
* sigscheme/error.c
  - (SCM_BACKTRACE_HEADER): New macro
  - (SigScm_ShowBacktrace):
    * Enclose the code into #if SCM_DEBUG
    * Rewrite with SCM_BACKTRACE_HEADER


Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c	2005-09-28 11:23:50 UTC (rev 1647)
+++ branches/r5rs/sigscheme/error.c	2005-09-28 11:42:53 UTC (rev 1648)
@@ -52,6 +52,7 @@
   File Local Macro Declarations
 =======================================*/
 #define SCM_ERR_HEADER "Error: "
+#define SCM_BACKTRACE_HEADER "**** BACKTRACE ****\n"
 
 /*=======================================
   Variable Declarations
@@ -126,10 +127,11 @@
 
 void SigScm_ShowBacktrace(void)
 {
+#if SCM_DEBUG
     struct trace_frame *f;
 
-    /* show title */
-    fprintf(SCM_PORTINFO_FILE(scm_current_error_port), "**** BACKTRACE ****\n");
+    /* show header */
+    fprintf(SCM_PORTINFO_FILE(scm_current_error_port), SCM_BACKTRACE_HEADER);
 
     /* show each frame's obj */
     for (f = scm_trace_root; f; f = f->prev) {
@@ -137,6 +139,7 @@
         
         fprintf(SCM_PORTINFO_FILE(scm_current_error_port), "\n");
     }
+#endif
 }
 
 void SigScm_ShowErrorHeader(void)

Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2005-09-28 11:23:50 UTC (rev 1647)
+++ branches/r5rs/sigscheme/eval.c	2005-09-28 11:42:53 UTC (rev 1648)
@@ -457,17 +457,17 @@
 /*===========================================================================
   S-Expression Evaluation
 ===========================================================================*/
-/* TODO: Enclose debugging features into #if SCM_DEBUG* */
 ScmObj ScmOp_eval(ScmObj obj, ScmObj env)
 {
     ScmObj ret  = SCM_NULL;
     ScmEvalState state = {0};
 
-    /* for debugging */
+#if SCM_DEBUG
     struct trace_frame frame;
     frame.prev = scm_trace_root;
     frame.obj  = obj;
     scm_trace_root = &frame;
+#endif
 
     state.env = env;
     state.ret_type = SCM_RETTYPE_AS_IS;
@@ -492,7 +492,9 @@
         break;
     }
 
+#if SCM_DEBUG
     scm_trace_root = frame.prev;
+#endif
     return ret;
 }
 



More information about the uim-commit mailing list