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

kzk at freedesktop.org kzk at freedesktop.org
Sat Dec 3 09:49:38 PST 2005


Author: kzk
Date: 2005-12-03 09:49:33 -0800 (Sat, 03 Dec 2005)
New Revision: 2327

Modified:
   branches/r5rs/sigscheme/sigschemetype-compact.h
   branches/r5rs/sigscheme/test-compact.c
Log:
* SCM_OBJ_COMPACT
  - change to int based char

* sigscheme/sigschemetype-compact.h
  - (SCM_CHAR_VALUE, SCM_CHAR_SET_VALUE): fix wrong parameter
* sigscheme/test-compact.c
  - (Scm_CheckChar): change to int based char
  - (Scm_CheckString): disabled temporally



Modified: branches/r5rs/sigscheme/sigschemetype-compact.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype-compact.h	2005-12-03 14:40:18 UTC (rev 2326)
+++ branches/r5rs/sigscheme/sigschemetype-compact.h	2005-12-03 17:49:33 UTC (rev 2327)
@@ -273,7 +273,6 @@
 #define SCM_TAG_IMM_VALUE_OFFSET_INT             (SCM_GCBIT_WIDTH + SCM_TAG_WIDTH + 1)
 #define SCM_TAG_IMM_VALUE_OFFSET_CHAR            (SCM_GCBIT_WIDTH + SCM_TAG_WIDTH + 2)
 
-
 /*=======================================
    Getter & Setter
 =======================================*/
@@ -530,8 +529,8 @@
 #define SCM_C_FUNCPOINTER_VALUE(a)          (SCM_WORD_CAST(ScmCFunc, SCM_CAR_GET_VALUE_AS_PTR(a)))
 #define SCM_C_FUNCPOINTER_SET_VALUE(a, val) (SCM_CAR_SET_VALUE_AS_PTR((a), SCM_WORD_CAST(ScmObj, (val))))
 
-#define SCM_CHAR_VALUE(a)         (SCM_PRIMARY_GET_VALUE_AS_INT((a), ~SCM_TAG_IMM_MASK_CHAR))
-#define SCM_CHAR_SET_VALUE(a, ch) (SCM_PRIMARY_SET_VALUE_AS_INT((a), (ch), SCM_TAG_IMM_CHAR))
+#define SCM_CHAR_VALUE(a)         (SCM_PRIMARY_GET_VALUE_AS_INT((a), SCM_TAG_IMM_VALUE_OFFSET_CHAR))
+#define SCM_CHAR_SET_VALUE(a, ch) (SCM_PRIMARY_SET_VALUE_AS_INT((a), (ch), SCM_TAG_IMM_VALUE_OFFSET_CHAR, SCM_TAG_IMM_CHAR))
 
 /*
  * Integer need to preserve 'singed' or 'unsigned', so need special accessor.

Modified: branches/r5rs/sigscheme/test-compact.c
===================================================================
--- branches/r5rs/sigscheme/test-compact.c	2005-12-03 14:40:18 UTC (rev 2326)
+++ branches/r5rs/sigscheme/test-compact.c	2005-12-03 17:49:33 UTC (rev 2327)
@@ -296,30 +296,27 @@
     return obj;
 }
 
-/* FIXME: follow int-based char */
 ScmObj Scm_CheckChar(char *ch)
 {
-#define SCM_MB_MAX_LEN 4
-
     ScmObj obj;
-    char *val = aligned_strdup(ch);
-
     PRINT_SECTION("Char");
 
-    SCM_ASSERT(strlen(ch) <= SCM_MB_MAX_LEN);
-
     /* entyping */
     SCM_ENTYPE_CHAR(obj);
     check_type(ScmChar, obj);
 
-    SCM_CHAR_SET_VALUE(obj, val);
+    SCM_CHAR_SET_VALUE(obj, 0);
     check_type(ScmChar, obj);
-    SCM_ASSERT(SCM_CHAR_VALUE(obj) == val);
-    SCM_ASSERT(strcmp(SCM_CHAR_VALUE(obj), ch) == 0);
+    SCM_ASSERT(SCM_CHAR_VALUE(obj) == 0);
 
+    SCM_CHAR_SET_VALUE(obj, 255);
+    check_type(ScmChar, obj);
+    SCM_ASSERT(SCM_CHAR_VALUE(obj) == 255);
+
     return obj;
 }
 
+#if 0
 ScmObj Scm_CheckStringCopying(char *str)
 {
     ScmObj obj = (ScmObj)malloc(sizeof(ScmCell));
@@ -358,6 +355,7 @@
 
     return obj;
 }
+#endif
 
 ScmObj Scm_CheckFunc()
 {
@@ -732,7 +730,9 @@
     Scm_CheckCons();
     Scm_CheckSymbol("aiueo");
     Scm_CheckChar("a");
+#if 0
     Scm_CheckStringCopying("aiueo");
+#endif
     Scm_CheckClosure();
     Scm_CheckFunc();
     Scm_CheckVector(5);



More information about the uim-commit mailing list