[uim-commit] r2357 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sun Dec 4 06:31:29 PST 2005
Author: yamaken
Date: 2005-12-04 06:31:24 -0800 (Sun, 04 Dec 2005)
New Revision: 2357
Modified:
branches/r5rs/sigscheme/sigschemeinternal.h
branches/r5rs/sigscheme/sigschemetype-compact.h
branches/r5rs/sigscheme/sigschemetype.h
Log:
* sigscheme/sigschemetype.h
- (SCM_DEREF): Reject lvalue use
* sigscheme/sigschemetype-compact.h
- (SCM_DEREF): Ditto
* sigscheme/sigschemeinternal.h
- (SCM_QUEUE_APPEND, SCM_QUEUE_SLOPPY_APPEND): Fix DEREF() as lvalue
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-12-04 14:09:32 UTC (rev 2356)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-12-04 14:31:24 UTC (rev 2357)
@@ -330,12 +330,12 @@
(_q) = REF_CDR(DEREF(_q)))
#define SCM_QUEUE_APPEND(_q, _lst) \
do { \
- DEREF(_q) = (_lst); \
+ SET((_q), (_lst)); \
while (CONSP(DEREF(_q))) \
(_q) = REF_CDR(DEREF(_q)); \
} while (/* CONSTCOND */ 0)
#define SCM_QUEUE_TERMINATOR(_q) (DEREF(_q))
-#define SCM_QUEUE_SLOPPY_APPEND(_q, _lst) (DEREF(_q) = (_lst))
+#define SCM_QUEUE_SLOPPY_APPEND(_q, _lst) (SET((_q), (_lst)))
/*=======================================
Local Buffer Allocator
Modified: branches/r5rs/sigscheme/sigschemetype-compact.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype-compact.h 2005-12-04 14:09:32 UTC (rev 2356)
+++ branches/r5rs/sigscheme/sigschemetype-compact.h 2005-12-04 14:31:24 UTC (rev 2357)
@@ -724,7 +724,13 @@
#define SCM_REF_CAR(cons) (&SCM_GET_DIRECT_CAR(cons))
#define SCM_REF_CDR(cons) (&SCM_GET_DIRECT_CDR(cons))
#define SCM_REF_OFF_HEAP(obj) (&(obj))
+
+/* SCM_DEREF(ref) is not permitted to be used as lvalue */
+#if SCM_DEBUG
+#define SCM_DEREF(ref) (*(ref) + 0)
+#else /* SCM_DEBUG */
#define SCM_DEREF(ref) (*(ref))
+#endif /* SCM_DEBUG */
/* RFC: Is there a better name? */
#define SCM_SET(ref, obj) (*(ref) = (ScmObj)((SCM_CAST_UINT(*(ref)) & SCM_GCBIT_MASK) | SCM_CAST_UINT(obj)))
Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h 2005-12-04 14:09:32 UTC (rev 2356)
+++ branches/r5rs/sigscheme/sigschemetype.h 2005-12-04 14:31:24 UTC (rev 2357)
@@ -412,7 +412,14 @@
#define SCM_REF_CAR(cons) (&SCM_CAR(cons))
#define SCM_REF_CDR(cons) (&SCM_CDR(cons))
#define SCM_REF_OFF_HEAP(obj) (&(obj))
+
+/* SCM_DEREF(ref) is not permitted to be used as lvalue */
+#if SCM_DEBUG
+#define SCM_DEREF(ref) (*(ref) + 0)
+#else /* SCM_DEBUG */
#define SCM_DEREF(ref) (*(ref))
+#endif /* SCM_DEBUG */
+
/* RFC: Is there a better name? */
#define SCM_SET(ref, obj) (*(ref) = (obj))
More information about the uim-commit
mailing list