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

yamaken at freedesktop.org yamaken at freedesktop.org
Wed Jan 4 05:17:09 PST 2006


Author: yamaken
Date: 2006-01-04 05:17:04 -0800 (Wed, 04 Jan 2006)
New Revision: 2771

Modified:
   branches/r5rs/sigscheme/TODO
   branches/r5rs/sigscheme/operations-siod.c
Log:
* sigscheme/operations-siod.c
  - (scm_set_verbose_level): Fix broken nullport handling for verbose
    level 0
  - (scm_s_undefine): Fix invalid reference to the result of SET()
  - (null_port, saved_output_port, saved_error_port): Make
    uninitialized
  - (scm_p_verbose): Logical cleanup
  - (scm_p_eof_val): Cosmetic change
  - Include required files for future separate compilation
* sigscheme/TODO
  - Update


Modified: branches/r5rs/sigscheme/TODO
===================================================================
--- branches/r5rs/sigscheme/TODO	2006-01-04 12:52:04 UTC (rev 2770)
+++ branches/r5rs/sigscheme/TODO	2006-01-04 13:17:04 UTC (rev 2771)
@@ -13,7 +13,7 @@
 
 * Review and refactor all functions in syntax.c(listran, vectran,
   qquote_internal, scm_s_quasiquote, scm_s_do),
-  operations-{siod,r5rs-deepcadrs,srfi*}.c, encoding.[hc] and *port.[hc]
+  operations-{r5rs-deepcadrs,srfi*}.c, encoding.[hc] and *port.[hc]
   (other files had already been done except for the destructive exp on macros)
 
 * Investigate behavior of other Scheme implementations about constant vector

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2006-01-04 12:52:04 UTC (rev 2770)
+++ branches/r5rs/sigscheme/operations-siod.c	2006-01-04 13:17:04 UTC (rev 2771)
@@ -34,13 +34,14 @@
 /*=======================================
   System Include
 =======================================*/
-#include "sigscheme.h"
-#include "sigschemeinternal.h"
-#include "nullport.h"
+#include <stddef.h>
 
 /*=======================================
   Local Include
 =======================================*/
+#include "sigscheme.h"
+#include "sigschemeinternal.h"
+#include "nullport.h"
 
 /*=======================================
   File Local Struct Declarations
@@ -82,9 +83,9 @@
 };
 static long sscm_verbose_level = -1;
 
-static ScmObj null_port         = NULL;
-static ScmObj saved_output_port = NULL;
-static ScmObj saved_error_port  = NULL;
+static ScmObj null_port;
+static ScmObj saved_output_port;
+static ScmObj saved_error_port;
 
 /*=======================================
   File Local Function Declarations
@@ -93,11 +94,6 @@
 /*=======================================
   Function Implementations
 =======================================*/
-/*=======================================
-  SIOD compatible procedures
-
-  TODO : remove these functions!
-=======================================*/
 void
 scm_initialize_siod(void)
 {
@@ -200,12 +196,13 @@
 ScmObj
 scm_p_verbose(ScmObj args)
 {
+    ScmObj level;
     DECLARE_FUNCTION("verbose", procedure_variadic_0);
 
-    if (!NULLP(args)) {
-        ENSURE_INT(CAR(args));
+    if (level = POP_ARG(args), VALIDP(level)) {
+        ENSURE_INT(level);
 
-        scm_set_verbose_level(SCM_INT_VALUE(CAR(args)));
+        scm_set_verbose_level(SCM_INT_VALUE(level));
     }
 
     return MAKE_INT(sscm_verbose_level);
@@ -215,6 +212,7 @@
 scm_p_eof_val(void)
 {
     DECLARE_FUNCTION("eof-val", procedure_fixed_0);
+
     return SCM_EOF;
 }
 
@@ -228,10 +226,10 @@
 
     val = scm_lookup_environment(var, env);
     if (val != SCM_INVALID_REF)
-        return SET(val, SCM_UNBOUND);
+        SET(val, SCM_UNBOUND);
+    else
+        SCM_SYMBOL_SET_VCELL(var, SCM_UNBOUND);
 
-    SCM_SYMBOL_SET_VCELL(var, SCM_UNBOUND);
-
     return SCM_FALSE;
 }
 
@@ -259,18 +257,20 @@
 
     if (level >= 2)
         scm_set_debug_categories(scm_debug_categories()
-                                  | scm_predefined_debug_categories());
+                                 | scm_predefined_debug_categories());
 
     if (level == 0) {
-        saved_error_port = scm_err;
-        saved_output_port = scm_out;
+        if (!EQ(scm_err, null_port))
+            saved_error_port = scm_err;
+        if (!EQ(scm_out, null_port))
+            saved_output_port = scm_out;
 
         scm_err = null_port;
         scm_out = null_port;
     } else {
-        if (FALSEP(scm_err))
+        if (EQ(scm_err, null_port))
             scm_err = saved_error_port;
-        if (FALSEP(scm_out))
+        if (EQ(scm_out, null_port))
             scm_out = saved_output_port;
     }
 }



More information about the uim-commit mailing list