[uim-commit] r1921 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Tue Nov 1 00:59:59 PST 2005
Author: yamaken
Date: 2005-11-01 00:59:55 -0800 (Tue, 01 Nov 2005)
New Revision: 1921
Modified:
branches/r5rs/sigscheme/baseport.h
branches/r5rs/sigscheme/sbcport.c
Log:
* sigscheme/baseport.h
- (SCM_PORT_ALLOC, SCM_PORT_DYNAMIC_CAST, SCM_CHARPORT_CLOSE,
SCM_CHARPORT_ENCODING, SCM_CHARPORT_INSPECT,
SCM_CHARPORT_GET_CHAR, SCM_CHARPORT_PEEK_CHAR,
SCM_CHARPORT_CHAR_READYP, SCM_CHARPORT_VPRINTF, SCM_CHARPORT_PUTS,
SCM_CHARPORT_PUT_CHAR, SCM_CHARPORT_FLUSH, SCM_BYTEPORT_CLOSE,
SCM_BYTEPORT_INSPECT, SCM_BYTEPORT_GET_BYTE,
SCM_BYTEPORT_PEEK_BYTE, SCM_BYTEPORT_BYTE_READYP,
SCM_BYTEPORT_VPRINTF, SCM_BYTEPORT_PUTS, SCM_BYTEPORT_WRITE,
SCM_BYTEPORT_FLUSH): Fix operator precedence problem
* sigscheme/sbcport.c
- (ScmBaseCharPort_inspect, sbcport_inspect): Cast appropriately
Modified: branches/r5rs/sigscheme/baseport.h
===================================================================
--- branches/r5rs/sigscheme/baseport.h 2005-11-01 08:00:47 UTC (rev 1920)
+++ branches/r5rs/sigscheme/baseport.h 2005-11-01 08:59:55 UTC (rev 1921)
@@ -78,8 +78,8 @@
#define SCM_PORT_ALLOC(klass, port, type) \
do { \
- port = malloc(sizeof(type)); \
- if (!port) \
+ (port) = malloc(sizeof(type)); \
+ if (!(port)) \
SCM_PORT_ERROR_NOMEM(klass, NULL, type); \
} while (/* CONSTCOND */ 0)
@@ -88,31 +88,32 @@
* method must call SCM_PORT_DYNAMIC_CAST() explicitly.
*/
#define SCM_PORT_DYNAMIC_CAST(type, obj) \
- ((type *)(*obj->vptr->dyn_cast)(obj, type##_vptr))
+ ((type *)(*(obj)->vptr->dyn_cast)((obj), type##_vptr))
-#define SCM_CHARPORT_CLOSE(cport) ((*cport->vptr->close)(cport))
-#define SCM_CHARPORT_ENCODING(cport) ((*cport->vptr->encoding)(cport))
-#define SCM_CHARPORT_INSPECT(cport) ((*cport->vptr->inspect)(cport))
-#define SCM_CHARPORT_GET_CHAR(cport) ((*cport->vptr->get_char)(cport))
-#define SCM_CHARPORT_PEEK_CHAR(cport) ((*cport->vptr->peek_char)(cport))
-#define SCM_CHARPORT_CHAR_READYP(cport) ((*cport->vptr->char_readyp)(cport))
+#define SCM_CHARPORT_CLOSE(cport) ((*(cport)->vptr->close)(cport))
+#define SCM_CHARPORT_ENCODING(cport) ((*(cport)->vptr->encoding)(cport))
+#define SCM_CHARPORT_INSPECT(cport) ((*(cport)->vptr->inspect)(cport))
+#define SCM_CHARPORT_GET_CHAR(cport) ((*(cport)->vptr->get_char)(cport))
+#define SCM_CHARPORT_PEEK_CHAR(cport) ((*(cport)->vptr->peek_char)(cport))
+#define SCM_CHARPORT_CHAR_READYP(cport) ((*(cport)->vptr->char_readyp)(cport))
#define SCM_CHARPORT_VPRINTF(cport, str, args) \
- ((*cport->vptr->vprintf)(cport, str, args))
-#define SCM_CHARPORT_PUTS(cport, str) ((*cport->vptr->puts)(cport, str))
-#define SCM_CHARPORT_PUT_CHAR(cport, ch) ((*cport->vptr->put_char)(cport, ch))
-#define SCM_CHARPORT_FLUSH(cport) ((*cport->vptr->flush)(cport))
+ ((*(cport)->vptr->vprintf)(cport, str, args))
+#define SCM_CHARPORT_PUTS(cport, str) ((*(cport)->vptr->puts)(cport, str))
+#define SCM_CHARPORT_PUT_CHAR(cport, ch) \
+ ((*(cport)->vptr->put_char)(cport, ch))
+#define SCM_CHARPORT_FLUSH(cport) ((*(cport)->vptr->flush)(cport))
-#define SCM_BYTEPORT_CLOSE(bport) ((*bport->vptr->close)(bport))
-#define SCM_BYTEPORT_INSPECT(bport) ((*bport->vptr->inspect)(bport))
-#define SCM_BYTEPORT_GET_BYTE(bport) ((*bport->vptr->get_byte)(bport))
-#define SCM_BYTEPORT_PEEK_BYTE(bport) ((*bport->vptr->peek_byte)(bport))
-#define SCM_BYTEPORT_BYTE_READYP(bport) ((*bport->vptr->byte_readyp)(bport))
+#define SCM_BYTEPORT_CLOSE(bport) ((*(bport)->vptr->close)(bport))
+#define SCM_BYTEPORT_INSPECT(bport) ((*(bport)->vptr->inspect)(bport))
+#define SCM_BYTEPORT_GET_BYTE(bport) ((*(bport)->vptr->get_byte)(bport))
+#define SCM_BYTEPORT_PEEK_BYTE(bport) ((*(bport)->vptr->peek_byte)(bport))
+#define SCM_BYTEPORT_BYTE_READYP(bport) ((*(bport)->vptr->byte_readyp)(bport))
#define SCM_BYTEPORT_VPRINTF(bport, str, args) \
- ((*bport->vptr->vprintf)(bport, str, args))
-#define SCM_BYTEPORT_PUTS(bport, str) ((*bport->vptr->puts)(bport, str))
+ ((*(bport)->vptr->vprintf)(bport, str, args))
+#define SCM_BYTEPORT_PUTS(bport, str) ((*(bport)->vptr->puts)(bport, str))
#define SCM_BYTEPORT_WRITE(bport, nbytes, buf) \
- ((*bport->vptr->write)(bport, nbytes, buf))
-#define SCM_BYTEPORT_FLUSH(bport) ((*bport->vptr->flush)(bport))
+ ((*(bport)->vptr->write)(bport, nbytes, buf))
+#define SCM_BYTEPORT_FLUSH(bport) ((*(bport)->vptr->flush)(bport))
/*=======================================
Type Definitions
Modified: branches/r5rs/sigscheme/sbcport.c
===================================================================
--- branches/r5rs/sigscheme/sbcport.c 2005-11-01 08:00:47 UTC (rev 1920)
+++ branches/r5rs/sigscheme/sbcport.c 2005-11-01 08:59:55 UTC (rev 1921)
@@ -130,8 +130,8 @@
char *bport_part, *combined;
size_t size;
- encoding = SCM_CHARPORT_ENCODING(port);
- bport_part = SCM_BYTEPORT_INSPECT(port->bport);
+ encoding = SCM_CHARPORT_ENCODING((ScmCharPort *)port);
+ bport_part = SCM_BYTEPORT_INSPECT((ScmBytePort *)port->bport);
size = strlen(header) + strlen(encoding) + strlen(bport_part)
+ sizeof(" ");
combined = malloc(size);
@@ -275,7 +275,7 @@
static char *
sbcport_inspect(ScmSingleByteCharPort *port)
{
- return ScmBaseCharPort_inspect(port, "sb");
+ return ScmBaseCharPort_inspect((ScmBaseCharPort *)port, "sb");
}
static int
More information about the uim-commit
mailing list