[uim-commit] r1899 - branches/r5rs/sigscheme

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Oct 30 01:52:45 PST 2005


Author: yamaken
Date: 2005-10-30 01:52:41 -0800 (Sun, 30 Oct 2005)
New Revision: 1899

Modified:
   branches/r5rs/sigscheme/baseport.h
   branches/r5rs/sigscheme/sbcport.c
   branches/r5rs/sigscheme/strport.c
Log:
* sigscheme/baseport.h
  - (SCM_CHARPORT_ERROR, SCM_BYTEPORT_ERROR): Add a comment
* sigscheme/sbcport.c
  - (basecport_encoding, basecport_put_char): Remove dummy return
* sigscheme/strport.c
  - (istrport_vprintf, istrport_puts, istrport_write, istrport_flush,
    ostrport_get_byte, ostrport_peek_byte, ostrport_byte_readyp): Add
    'NOTREACHED' comment


Modified: branches/r5rs/sigscheme/baseport.h
===================================================================
--- branches/r5rs/sigscheme/baseport.h	2005-10-30 09:35:36 UTC (rev 1898)
+++ branches/r5rs/sigscheme/baseport.h	2005-10-30 09:52:41 UTC (rev 1899)
@@ -53,7 +53,11 @@
 /*=======================================
   Macro Definitions
 =======================================*/
-/* define appropriate error handling such as exception to override these */
+/*
+ * Define appropriate error handling such as exception to override these. The
+ * macro MUST NOT return. The replacement expression should indicate that it
+ * will not return, in compiler specific way such as noreturn attribute of GCC.
+ */
 #ifndef SCM_CHARPORT_ERROR
 #define SCM_CHARPORT_ERROR(cport, msg) (exit(EXIT_FAILURE))
 #endif /* SCM_CHARPORT_ERROR */

Modified: branches/r5rs/sigscheme/sbcport.c
===================================================================
--- branches/r5rs/sigscheme/sbcport.c	2005-10-30 09:35:36 UTC (rev 1898)
+++ branches/r5rs/sigscheme/sbcport.c	2005-10-30 09:52:41 UTC (rev 1899)
@@ -42,7 +42,6 @@
   System Include
 =======================================*/
 #include <stdlib.h>
-#include <stdio.h>
 #include <stdarg.h>
 
 /*=======================================
@@ -127,9 +126,7 @@
 basecport_encoding(ScmBaseCharPort *port)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(CHAR, port, ScmBaseCharPort);
-
     /* NOTREACHED */
-    return NULL;
 }
 
 static int
@@ -160,9 +157,7 @@
 basecport_put_char(ScmBaseCharPort *port, int ch)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(CHAR, port, ScmBaseCharPort);
-
     /* NOTREACHED */
-    return EOF;
 }
 
 static int

Modified: branches/r5rs/sigscheme/strport.c
===================================================================
--- branches/r5rs/sigscheme/strport.c	2005-10-30 09:35:36 UTC (rev 1898)
+++ branches/r5rs/sigscheme/strport.c	2005-10-30 09:52:41 UTC (rev 1899)
@@ -233,24 +233,28 @@
 istrport_vprintf(ScmInputStrPort *port, const char *str, va_list args)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmInputStrPort);
+    /* NOTREACHED */
 }
 
 static int
 istrport_puts(ScmInputStrPort *port, const char *str)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmInputStrPort);
+    /* NOTREACHED */
 }
 
 static size_t
 istrport_write(ScmInputStrPort *port, size_t nbytes, const char *buf)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmInputStrPort);
+    /* NOTREACHED */
 }
 
 static int
 istrport_flush(ScmInputStrPort *port)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmInputStrPort);
+    /* NOTREACHED */
 }
 
 
@@ -319,18 +323,21 @@
 ostrport_get_byte(ScmOutputStrPort *port)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmOutputStrPort);
+    /* NOTREACHED */
 }
 
 static int
 ostrport_peek_byte(ScmOutputStrPort *port)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmOutputStrPort);
+    /* NOTREACHED */
 }
 
 static int
 ostrport_byte_readyp(ScmOutputStrPort *port)
 {
     SCM_PORT_ERROR_INVALID_OPERATION(BYTE, port, ScmOutputStrPort);
+    /* NOTREACHED */
 }
 
 static int



More information about the uim-commit mailing list