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

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Jan 2 23:02:08 PST 2006


Author: yamaken
Date: 2006-01-02 23:02:05 -0800 (Mon, 02 Jan 2006)
New Revision: 2745

Modified:
   branches/r5rs/sigscheme/io.c
   branches/r5rs/sigscheme/operations-srfi60.c
   branches/r5rs/sigscheme/operations.c
   branches/r5rs/sigscheme/sigschemeinternal.h
Log:
* sigscheme/sigschemeinternal.h
  - (ENSURE_ALLOCATED): Move code position
* sigscheme/operations.c
  - (COMPARATOR_BODY): Move code position to avoid confusion about
    pseudo scope for the name. Since the macro is used from other than
    scm_p_equal(), it should be defined outside of the function to
    indicate the scope
* sigscheme/io.c
  - (PREPARE_PORT): Cosmetic change
* sigscheme/operations-srfi60.c
  - (BITWISE_OPERATION_BODY): Ditto


Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2006-01-03 06:52:00 UTC (rev 2744)
+++ branches/r5rs/sigscheme/io.c	2006-01-03 07:02:05 UTC (rev 2745)
@@ -425,7 +425,7 @@
         port = POP_ARG(args);                                                \
         if (!VALIDP(port))                                                   \
             port = default_port;                                             \
-        ENSURE_PORT(port);                                                  \
+        ENSURE_PORT(port);                                                   \
         ASSERT_NO_MORE_ARG(args);                                            \
     } while (/* CONSTCOND */ 0)
 

Modified: branches/r5rs/sigscheme/operations-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi60.c	2006-01-03 06:52:00 UTC (rev 2744)
+++ branches/r5rs/sigscheme/operations-srfi60.c	2006-01-03 07:02:05 UTC (rev 2745)
@@ -55,18 +55,18 @@
         case SCM_REDUCE_0:                                                   \
             break;                                                           \
         case SCM_REDUCE_1:                                                   \
-            ENSURE_INT(left);                                               \
+            ENSURE_INT(left);                                                \
             return right;                                                    \
         case SCM_REDUCE_PARTWAY:                                             \
         case SCM_REDUCE_LAST:                                                \
             /* left is already ensured as int by previous loop */            \
-            ENSURE_INT(right);                                              \
+            ENSURE_INT(right);                                               \
             result = (SCM_INT_VALUE(left) op SCM_INT_VALUE(right));          \
             break;                                                           \
         default:                                                             \
             ERR(opstr ": (internal error) unrecognized state specifier: %d", *state); \
         }                                                                    \
-        return MAKE_INT(result);                                           \
+        return MAKE_INT(result);                                             \
     } while (/* CONSTCOND */ 0)
 
 /*=======================================

Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2006-01-03 06:52:00 UTC (rev 2744)
+++ branches/r5rs/sigscheme/operations.c	2006-01-03 07:02:05 UTC (rev 2745)
@@ -313,28 +313,28 @@
     return MAKE_BOOL(INTP(obj));
 }
 
+#define COMPARATOR_BODY(op)                                                  \
+    switch (*state) {                                                        \
+    case SCM_REDUCE_0:                                                       \
+    case SCM_REDUCE_1:                                                       \
+        ERR("at least 2 arguments required");                                \
+    case SCM_REDUCE_PARTWAY:                                                 \
+    case SCM_REDUCE_LAST:                                                    \
+        ENSURE_INT(left);                                                    \
+        ENSURE_INT(right);                                                   \
+        if (SCM_INT_VALUE(left) op SCM_INT_VALUE(right))                     \
+            return *state == SCM_REDUCE_LAST ? SCM_TRUE : right;             \
+        *state = SCM_REDUCE_STOP;                                            \
+        return SCM_FALSE;                                                    \
+    default:                                                                 \
+        ERR("(internal error) unrecognized state specifier: %d", *state);    \
+    }                                                                        \
+    return SCM_INVALID
+
 ScmObj
 scm_p_equal(ScmObj left, ScmObj right, enum ScmReductionState *state)
 {
     DECLARE_FUNCTION("=", reduction_operator);
-#define COMPARATOR_BODY(op) \
-    switch (*state) { \
-    case SCM_REDUCE_0: \
-    case SCM_REDUCE_1: \
-        ERR("at least 2 arguments required"); \
-    case SCM_REDUCE_PARTWAY: \
-    case SCM_REDUCE_LAST: \
-        ENSURE_INT(left); \
-        ENSURE_INT(right); \
-        if (SCM_INT_VALUE(left) op SCM_INT_VALUE(right)) \
-            return *state == SCM_REDUCE_LAST ? SCM_TRUE : right; \
-        *state = SCM_REDUCE_STOP; \
-        return SCM_FALSE; \
-    default: \
-        ERR("(internal error) unrecognized state specifier: %d", *state); \
-    } \
-    return SCM_INVALID
-
     COMPARATOR_BODY(==);
 }
 

Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h	2006-01-03 06:52:00 UTC (rev 2744)
+++ branches/r5rs/sigscheme/sigschemeinternal.h	2006-01-03 07:02:05 UTC (rev 2745)
@@ -353,6 +353,8 @@
      || (ERR("%s: stateless character codec required but got: %s",           \
              SCM_MANGLE(name), SCM_CHARCODEC_ENCODING(codec)), 0))
 
+#define ENSURE_ALLOCATED SCM_ENSURE_ALLOCATED
+
 /* Macros For Handling Continuation Object */
 #define INVALID_CONTINUATION_OPAQUE  NULL
 
@@ -362,8 +364,6 @@
 /* error handlings */
 #define SCM_ERR_HEADER "Error: "
 
-#define ENSURE_ALLOCATED SCM_ENSURE_ALLOCATED
-
 /*=======================================
    List Constructor
 =======================================*/



More information about the uim-commit mailing list