[uim-commit] r1915 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Oct 31 21:51:04 PST 2005
Author: yamaken
Date: 2005-10-31 21:51:00 -0800 (Mon, 31 Oct 2005)
New Revision: 1915
Modified:
branches/r5rs/sigscheme/baseport.h
Log:
* sigscheme/baseport.h
- (SCM_PORT_CREATOR_BODY, SCM_BYTEPORT_CREATOR_BODY,
SCM_CHARPORT_CREATOR_BODY): Removed due to design error
- (SCM_PORT_ALLOC): New macro
Modified: branches/r5rs/sigscheme/baseport.h
===================================================================
--- branches/r5rs/sigscheme/baseport.h 2005-11-01 05:28:25 UTC (rev 1914)
+++ branches/r5rs/sigscheme/baseport.h 2005-11-01 05:51:00 UTC (rev 1915)
@@ -72,25 +72,13 @@
#define SCM_PORT_ERROR_NOMEM(klass, port, type) \
SCM_##klass##PORT_ERROR(port, #type ": Out of memory")
-#define SCM_PORT_CREATOR_BODY(macro_klass, abstract_type, concrete_type, bport) \
+#define SCM_PORT_ALLOC(klass, port, type) \
do { \
- concrete_type *port; \
- \
- port = malloc(sizeof(concrete_type)); \
+ port = malloc(sizeof(type)); \
if (!port) \
- SCM_PORT_ERROR_NOMEM(macro_klass, port, concrete_type); \
- \
- concrete_type##_construct(port, concrete_type##_vptr, bport); \
- \
- return (abstract_type *)port; \
+ SCM_PORT_ERROR_NOMEM(klass, port, type); \
} while (/* CONSTCOND */ 0)
-#define SCM_BYTEPORT_CREATOR_BODY(concrete_type, bport) \
- SCM_PORT_CREATOR_BODY(BYTE, ScmBytePort, concrete_type, bport)
-
-#define SCM_CHARPORT_CREATOR_BODY(concrete_type, bport) \
- SCM_PORT_CREATOR_BODY(CHAR, ScmCharPort, concrete_type, bport)
-
/*
* To allow safe method invocation (contains from subclasses), all non-standard
* method must call SCM_PORT_DYNAMIC_CAST() explicitly.
More information about the uim-commit
mailing list