[uim-commit] r1409 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sun Sep 4 10:15:16 PDT 2005
Author: yamaken
Date: 2005-09-04 10:15:13 -0700 (Sun, 04 Sep 2005)
New Revision: 1409
Modified:
branches/r5rs/sigscheme/datas.c
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/sigschemeinternal.h
branches/r5rs/sigscheme/sigschemetype.h
Log:
* sigscheme/sigscheme.h
- (sigassert): Rename to SCM_ASSERT since:
* the naming convention does not look like a macro
* it does not have a SCM prefix
- (SCM_ASSERT): Renamed from sigassert
* sigscheme/datas.c
- (gc_sweep): Follow the renaming
* sigscheme/sigschemetype.h
- (SCM_ASSERT_TYPE): New macro
- (SCM_AS_INT, SCM_AS_CONS, SCM_AS_SYMBOL, SCM_AS_CHAR,
SCM_AS_STRING, SCM_AS_FUNC, SCM_AS_CLOSURE, SCM_AS_VECTOR,
SCM_AS_PORT, SCM_AS_CONTINUATION, SCM_AS_VALUEPACKET,
SCM_AS_C_POINTER, SCM_AS_C_FUNCPOINTER): Simplify with SCM_ASSERT_TYPE
* sigscheme/sigschemeinternal.h
- (SCM_AS_FREECELL): Ditto
Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c 2005-09-04 16:53:27 UTC (rev 1408)
+++ branches/r5rs/sigscheme/datas.c 2005-09-04 17:15:13 UTC (rev 1409)
@@ -548,7 +548,7 @@
/* iterate in heap */
for (j = 0; j < SCM_HEAP_SIZE; j++) {
obj = &scm_heaps[i][j];
- sigassert (!SCM_MARK_CORRUPT (obj));
+ SCM_ASSERT(!SCM_MARK_CORRUPT(obj));
if (!SCM_IS_MARKED(obj)) {
sweep_obj(obj);
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-09-04 16:53:27 UTC (rev 1408)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-09-04 17:15:13 UTC (rev 1409)
@@ -78,7 +78,7 @@
#define SCM_ACCESSOR_ASSERT 0 /* enable strict type check with accessor */
int SigScm_Die(const char *msg, const char *filename, int line); /* error.c */
-#define sigassert(cond) \
+#define SCM_ASSERT(cond) \
(cond ? 0 : SigScm_Die("assertion failed.", __FILE__, __LINE__))
/*=======================================
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-09-04 16:53:27 UTC (rev 1408)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-09-04 17:15:13 UTC (rev 1409)
@@ -81,7 +81,7 @@
/* FreeCell Handling Macros */
#define SCM_FREECELLP(a) (SCM_TYPE(a) == ScmFreeCell)
-#define SCM_AS_FREECELL(a) (sigassert(SCM_FREECELLP(a)), (a))
+#define SCM_AS_FREECELL(a) (SCM_ASSERT_TYPE(SCM_FREECELLP(a), (a)))
#define SCM_FREECELL_CAR(a) (SCM_AS_FREECELL(a)->obj.cons.car)
#define SCM_FREECELL_CDR(a) (SCM_AS_FREECELL(a)->obj.cons.cdr)
#define SCM_ENTYPE_FREECELL(a) (SCM_ENTYPE((a), ScmFreeCell))
Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h 2005-09-04 16:53:27 UTC (rev 1408)
+++ branches/r5rs/sigscheme/sigschemetype.h 2005-09-04 17:15:13 UTC (rev 1409)
@@ -286,34 +286,23 @@
/* Type Confirmation */
#if SCM_ACCESSOR_ASSERT
-#define SCM_AS_INT(a) (sigassert(SCM_INTP(a)), (a))
-#define SCM_AS_CONS(a) (sigassert(SCM_CONSP(a)), (a))
-#define SCM_AS_SYMBOL(a) (sigassert(SCM_SYMBOLP(a)), (a))
-#define SCM_AS_CHAR(a) (sigassert(SCM_CHARP(a)), (a))
-#define SCM_AS_STRING(a) (sigassert(SCM_STRINGP(a)), (a))
-#define SCM_AS_FUNC(a) (sigassert(SCM_FUNCP(a)), (a))
-#define SCM_AS_CLOSURE(a) (sigassert(SCM_CLOSUREP(a)), (a))
-#define SCM_AS_VECTOR(a) (sigassert(SCM_VECTORP(a)), (a))
-#define SCM_AS_PORT(a) (sigassert(SCM_PORTP(a)), (a))
-#define SCM_AS_CONTINUATION(a) (sigassert(SCM_CONTINUATIONP(a)), (a))
-#define SCM_AS_VALUEPACKET(a) (sigassert(SCM_VALUEPACKETP(a)), (a))
-#define SCM_AS_C_POINTER(a) (sigassert(SCM_C_POINTERP(a)), (a))
-#define SCM_AS_C_FUNCPOINTER(a) (sigassert(SCM_C_FUNCPOINTERP(a)), (a))
+#define SCM_ASSERT_TYPE(cond, x) (SCM_ASSERT(cond), (x))
#else
-#define SCM_AS_INT(a) (a)
-#define SCM_AS_CONS(a) (a)
-#define SCM_AS_SYMBOL(a) (a)
-#define SCM_AS_CHAR(a) (a)
-#define SCM_AS_STRING(a) (a)
-#define SCM_AS_FUNC(a) (a)
-#define SCM_AS_CLOSURE(a) (a)
-#define SCM_AS_VECTOR(a) (a)
-#define SCM_AS_PORT(a) (a)
-#define SCM_AS_CONTINUATION(a) (a)
-#define SCM_AS_VALUEPACKET(a) (a)
-#define SCM_AS_C_POINTER(a) (a)
-#define SCM_AS_C_FUNCPOINTER(a) (a)
+#define SCM_ASSERT_TYPE(cond, x) (x)
#endif /* SCM_ACCESSOR_ASSERT */
+#define SCM_AS_INT(a) (SCM_ASSERT_TYPE(SCM_INTP(a), (a)))
+#define SCM_AS_CONS(a) (SCM_ASSERT_TYPE(SCM_CONSP(a), (a)))
+#define SCM_AS_SYMBOL(a) (SCM_ASSERT_TYPE(SCM_SYMBOLP(a), (a)))
+#define SCM_AS_CHAR(a) (SCM_ASSERT_TYPE(SCM_CHARP(a), (a)))
+#define SCM_AS_STRING(a) (SCM_ASSERT_TYPE(SCM_STRINGP(a), (a)))
+#define SCM_AS_FUNC(a) (SCM_ASSERT_TYPE(SCM_FUNCP(a), (a)))
+#define SCM_AS_CLOSURE(a) (SCM_ASSERT_TYPE(SCM_CLOSUREP(a), (a)))
+#define SCM_AS_VECTOR(a) (SCM_ASSERT_TYPE(SCM_VECTORP(a), (a)))
+#define SCM_AS_PORT(a) (SCM_ASSERT_TYPE(SCM_PORTP(a), (a)))
+#define SCM_AS_CONTINUATION(a) (SCM_ASSERT_TYPE(SCM_CONTINUATIONP(a), (a)))
+#define SCM_AS_VALUEPACKET(a) (SCM_ASSERT_TYPE(SCM_VALUEPACKETP(a), (a)))
+#define SCM_AS_C_POINTER(a) (SCM_ASSERT_TYPE(SCM_C_POINTERP(a), (a)))
+#define SCM_AS_C_FUNCPOINTER(a) (SCM_ASSERT_TYPE(SCM_C_FUNCPOINTERP(a), (a)))
/* Real Accessors */
#define SCM_INTP(a) (SCM_TYPE(a) == ScmInt)
More information about the uim-commit
mailing list