[uim-commit] r2083 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 8 05:19:09 PST 2005
Author: yamaken
Date: 2005-11-08 05:19:04 -0800 (Tue, 08 Nov 2005)
New Revision: 2083
Modified:
branches/r5rs/sigscheme/debug.c
branches/r5rs/sigscheme/sigschemetype-compact.h
Log:
* sigscheme/sigschemetype-compact.h
- (SCM_FUNC_CFUNC, SCM_FUNC_SET_CFUNC, SCM_C_FUNCPOINTER_VALUE,
SCM_C_FUNCPOINTER_SET_VALUE): Fix invalid casting with
SCM_REINTERPRET_CAST()
* sigscheme/debug.c
- (print_ScmObj_internal): Revert the change of r2079 resolved by
above fix
Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c 2005-11-08 12:57:44 UTC (rev 2082)
+++ branches/r5rs/sigscheme/debug.c 2005-11-08 13:19:04 UTC (rev 2083)
@@ -283,15 +283,8 @@
SigScm_PortPrintf(port, "#<c_pointer %p>", SCM_C_POINTER_VALUE(obj));
break;
case ScmCFuncPointer:
-
- /* FIXME: This is a workaround for SCM_OBJ_COMPACT. Is there any proper solution? */
-#if SCM_OBJ_COMPACT
SigScm_PortPrintf(port, "#<c_func_pointer %p>",
- SCM_C_FUNCPOINTER_VALUE(obj));
-#else
- SigScm_PortPrintf(port, "#<c_func_pointer %p>",
SCM_REINTERPRET_CAST(void *, SCM_C_FUNCPOINTER_VALUE(obj)));
-#endif
break;
}
}
Modified: branches/r5rs/sigscheme/sigschemetype-compact.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype-compact.h 2005-11-08 12:57:44 UTC (rev 2082)
+++ branches/r5rs/sigscheme/sigschemetype-compact.h 2005-11-08 13:19:04 UTC (rev 2083)
@@ -462,9 +462,9 @@
#define SCM_VALUEPACKET_VALUES(a) (SCM_AS_VALUEPACKET(a)->car)
#define SCM_VALUEPACKET_SET_VALUES(a, v) (SCM_SET_VALUE_AS_OBJ(SCM_VALUEPACKET_VALUES(a), (v)))
-#define SCM_FUNC_CFUNC(a) ((ScmFuncType)(SCM_AS_FUNC(a)->car))
+#define SCM_FUNC_CFUNC(a) (SCM_REINTERPRET_CAST(ScmFuncType, (SCM_AS_FUNC(a)->car)))
#define SCM_FUNC_TYPECODE(a) ((enum ScmFuncTypeCode)SCM_GET_VALUE_AS_INT(SCM_AS_FUNC(a)->cdr, SCM_TAG_OTHERS_VALUE_OFFSET_FUNC))
-#define SCM_FUNC_SET_CFUNC(a, fptr) (SCM_AS_FUNC(a)->car = (ScmObj)(fptr))
+#define SCM_FUNC_SET_CFUNC(a, fptr) (SCM_AS_FUNC(a)->car = SCM_REINTERPRET_CAST(ScmObj, (fptr)))
#define SCM_FUNC_SET_TYPECODE(a, code) (SCM_SET_VALUE_AS_INT(SCM_AS_FUNC(a)->cdr, (code), SCM_TAG_OTHERS_VALUE_OFFSET_FUNC, SCM_TAG_OTHERS_FUNC))
#define SCM_SYNTAXP(a) (SCM_FUNCP(a) \
&& (SCM_FUNC_TYPECODE(a) & SCM_FUNCTYPE_SYNTAX))
@@ -488,8 +488,8 @@
#define SCM_C_POINTER_VALUE(a) ((void*)SCM_AS_C_POINTER(a)->car)
#define SCM_C_POINTER_SET_VALUE(a, val) (SCM_AS_C_POINTER(a)->car = (ScmObj)(val))
-#define SCM_C_FUNCPOINTER_VALUE(a) ((void*)SCM_AS_C_FUNCPOINTER(a)->car)
-#define SCM_C_FUNCPOINTER_SET_VALUE(a, val) (SCM_AS_C_FUNCPOINTER(a)->car = (ScmObj)(val))
+#define SCM_C_FUNCPOINTER_VALUE(a) (SCM_REINTERPRET_CAST(ScmCFunc, SCM_AS_C_FUNCPOINTER(a)->car))
+#define SCM_C_FUNCPOINTER_SET_VALUE(a, val) (SCM_AS_C_FUNCPOINTER(a)->car = SCM_REINTERPRET_CAST(ScmObj, (val)))
#define SCM_INT_VALUE(a) (SCM_GET_VALUE_AS_INT((a), SCM_TAG_IMM_VALUE_OFFSET_INT))
#define SCM_INT_SET_VALUE(a, val) (SCM_SET_VALUE_AS_INT((a), (val), SCM_TAG_IMM_VALUE_OFFSET_INT, SCM_TAG_IMM_INT))
More information about the uim-commit
mailing list