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

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Dec 18 18:45:48 PST 2005


Author: yamaken
Date: 2005-12-18 18:45:44 -0800 (Sun, 18 Dec 2005)
New Revision: 2650

Modified:
   branches/r5rs/sigscheme/io.c
   branches/r5rs/sigscheme/mbcport.c
   branches/r5rs/sigscheme/operations.c
   branches/r5rs/sigscheme/read.c
   branches/r5rs/sigscheme/strport.c
Log:
* sigscheme/mbcport.c
  - (struct ScmMultiByteCharPort_, mbcport_put_char): Replace
    sizeof((char)'\0') with sizeof("")
* sigscheme/read.c
  - (MB_MAX_SIZE, CHAR_LITERAL_LEN_MAX, INT_LITERAL_LEN_MAX,
    read_token, read_char, read_number_or_symbol, read_number): Ditto
* sigscheme/strport.c
  - (ostrport_append): Ditto
* sigscheme/io.c
  - (find_path): Ditto
* sigscheme/operations.c
  - (scm_p_integer2char, scm_p_string_setd, scm_p_string_filld): Ditto


Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c	2005-12-19 02:37:12 UTC (rev 2649)
+++ branches/r5rs/sigscheme/io.c	2005-12-19 02:45:44 UTC (rev 2650)
@@ -614,7 +614,7 @@
     if (scm_lib_path) {
         lib_path_len = scm_lib_path ? strlen(scm_lib_path) : 0;
         filename_len = strlen(filename);
-        path_len = lib_path_len + sizeof((char)'/') + filename_len + sizeof((char)'\0');
+        path_len = lib_path_len + sizeof((char)'/') + filename_len + sizeof("");
 
         path = scm_malloc(path_len);
         snprintf(path, path_len, "%s/%s", scm_lib_path, filename);

Modified: branches/r5rs/sigscheme/mbcport.c
===================================================================
--- branches/r5rs/sigscheme/mbcport.c	2005-12-19 02:37:12 UTC (rev 2649)
+++ branches/r5rs/sigscheme/mbcport.c	2005-12-19 02:45:44 UTC (rev 2650)
@@ -74,7 +74,7 @@
 
     ScmCharCodec *codec;
     ScmMultibyteState state;
-    char rbuf[SCM_MB_MAX_LEN + sizeof((char)'\0')];
+    char rbuf[SCM_MB_MAX_LEN + sizeof("")];
 };
 
 /*=======================================
@@ -227,7 +227,7 @@
 static int
 mbcport_put_char(ScmMultiByteCharPort *port, int ch)
 {
-    char wbuf[SCM_MB_MAX_LEN + sizeof((char)'\0')];
+    char wbuf[SCM_MB_MAX_LEN + sizeof("")];
     char *end;
 
     /* FIXME: set updated state to port->state */

Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c	2005-12-19 02:37:12 UTC (rev 2649)
+++ branches/r5rs/sigscheme/operations.c	2005-12-19 02:45:44 UTC (rev 2650)
@@ -1144,7 +1144,7 @@
 scm_p_integer2char(ScmObj obj)
 {
     int val;
-    char buf[SCM_MB_MAX_LEN + sizeof((char)'\0')];
+    char buf[SCM_MB_MAX_LEN + sizeof("")];
     DECLARE_FUNCTION("integer->char", procedure_fixed_1);
 
     ASSERT_INTP(obj);
@@ -1285,7 +1285,7 @@
     char *new_str  = NULL;
     ScmMultibyteString mbs;
     const char *string_str   = NULL;
-    char new_ch_str[SCM_MB_MAX_LEN + sizeof((char)'\0')];
+    char new_ch_str[SCM_MB_MAX_LEN + sizeof("")];
     const char *next;
     DECLARE_FUNCTION("string-set!", procedure_fixed_3);
 
@@ -1504,7 +1504,7 @@
     int  str_len   = 0;
     char *new_str  = NULL;
     char *p        = NULL;
-    char ch_str[SCM_MB_MAX_LEN + sizeof((char)'\0')];
+    char ch_str[SCM_MB_MAX_LEN + sizeof("")];
     const char *next;
     DECLARE_FUNCTION("string-fill!", procedure_fixed_2);
 

Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c	2005-12-19 02:37:12 UTC (rev 2649)
+++ branches/r5rs/sigscheme/read.c	2005-12-19 02:45:44 UTC (rev 2650)
@@ -61,13 +61,13 @@
 #define OK 0
 #define TOKEN_BUF_EXCEEDED -1
 
-#define MB_MAX_SIZE (SCM_MB_MAX_LEN + sizeof((char)'\0'))
+#define MB_MAX_SIZE (SCM_MB_MAX_LEN + sizeof(""))
 
 /* can accept "backspace" of R5RS and "U0010FFFF" of SRFI-75 */
-#define CHAR_LITERAL_LEN_MAX (sizeof("backspace") - sizeof((char)'\0'))
+#define CHAR_LITERAL_LEN_MAX (sizeof("backspace") - sizeof(""))
 
 /* #b-010101... */
-#define INT_LITERAL_LEN_MAX  (sizeof("-") + sizeof(int) * CHAR_BIT - sizeof((char)'\0'))
+#define INT_LITERAL_LEN_MAX  (sizeof("-") + sizeof(int) * CHAR_BIT - sizeof(""))
 
 #define WHITESPACE_CHARS " \t\n\r\v\f"
 #define DELIMITER_CHARS  "()\";" WHITESPACE_CHARS
@@ -232,7 +232,7 @@
         }
 
         if (isascii(c)) {
-            if (p == &buf[buf_size - sizeof((char)'\0')]) {
+            if (p == &buf[buf_size - sizeof("")]) {
                 *err = TOKEN_BUF_EXCEEDED;
                 break;
             }
@@ -484,7 +484,7 @@
 #endif
     const ScmSpecialCharInfo *info;
     size_t len;
-    char buf[CHAR_LITERAL_LEN_MAX + sizeof((char)'\0')];
+    char buf[CHAR_LITERAL_LEN_MAX + sizeof("")];
 
     /* plain char (multibyte-ready) */
     c = scm_port_get_char(port);
@@ -631,7 +631,7 @@
 {
     int c, err;
     size_t len;
-    char buf[INT_LITERAL_LEN_MAX + sizeof((char)'\0')];
+    char buf[INT_LITERAL_LEN_MAX + sizeof("")];
 
     CDBG((SCM_DBG_PARSER, "read_number_or_symbol"));
 
@@ -706,7 +706,7 @@
 {
     int err;
     size_t len;
-    char buf[INT_LITERAL_LEN_MAX + sizeof((char)'\0')];
+    char buf[INT_LITERAL_LEN_MAX + sizeof("")];
 
     len = read_token(port, &err, buf, sizeof(buf), DELIMITER_CHARS);
     if (err == TOKEN_BUF_EXCEEDED)

Modified: branches/r5rs/sigscheme/strport.c
===================================================================
--- branches/r5rs/sigscheme/strport.c	2005-12-19 02:37:12 UTC (rev 2649)
+++ branches/r5rs/sigscheme/strport.c	2005-12-19 02:45:44 UTC (rev 2650)
@@ -414,9 +414,9 @@
 ostrport_append(ScmOutputStrPort *port, size_t len, const char *str)
 {
     /* extend the buffer */
-    if (port->buf_size - port->cur < len + sizeof((char)'\0')) {
+    if (port->buf_size - port->cur < len + sizeof("")) {
         if (!port->buf_size)
-            port->buf_size = sizeof((char)'\0');
+            port->buf_size = sizeof("");
 
         port->buf_size += len;
         port->str = SCM_PORT_REALLOC(port->str, port->buf_size);
@@ -426,5 +426,5 @@
     port->cur += len;
     port->str[port->cur] = '\0';
 
-    return len + sizeof((char)'\0');
+    return len + sizeof("");
 }



More information about the uim-commit mailing list