[uim-commit] r3032 - branches/r5rs/sigscheme/src

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Jan 29 20:08:55 PST 2006


Author: yamaken
Date: 2006-01-29 20:08:48 -0800 (Sun, 29 Jan 2006)
New Revision: 3032

Modified:
   branches/r5rs/sigscheme/src/alloc.c
   branches/r5rs/sigscheme/src/error.c
   branches/r5rs/sigscheme/src/eval.c
   branches/r5rs/sigscheme/src/load.c
   branches/r5rs/sigscheme/src/main.c
   branches/r5rs/sigscheme/src/module-siod.c
   branches/r5rs/sigscheme/src/module-srfi1.c
   branches/r5rs/sigscheme/src/procedure.c
   branches/r5rs/sigscheme/src/read.c
   branches/r5rs/sigscheme/src/sigscheme.h
   branches/r5rs/sigscheme/src/sigschemeinternal.h
   branches/r5rs/sigscheme/src/storage-continuation.c
   branches/r5rs/sigscheme/src/string.c
   branches/r5rs/sigscheme/src/syntax.c
   branches/r5rs/sigscheme/src/write.c
Log:
* This commmit make ERR() current function-aware. Use PLAIN_ERR() for
  function name-less error

* sigscheme/src/sigscheme.h
  - (scm_error): Add 'func_name' as first arg
  - (scm_plain_error): New function decl
* sigscheme/src/sigschemeinternal.h
  - (PLAIN_ERR): New macro
  - (ERR):
    * Prepend function name implicitly
    * Support C99 and GNU variadic macros if available (not used yet)
  - (scm_error_with_implicit_func): New function decl
  - (scm_err_funcname): New variable decl
  - (ENSURE_STATEFUL_CODEC, ENSURE_STATELESS_CODEC): Follow the spec
    change of ERR()
* sigscheme/src/error.c
  - (scm_err_funcname): New variable
  - (scm_error_internal): New static function
  - (scm_init_error): Add initialization for scm_err_funcname
  - (scm_plain_error, scm_error_with_implicit_func, ): New function
  - (scm_error):
    * Add 'func_name' as first arg
    * Simplify with scm_err_internal()
  - (scm_error_obj): Simplify with scm_err_internal()
* sigscheme/src/alloc.c
  - (scm_malloc_aligned, scm_lbuf_extend): Replace ERR() with PLAIN_ERR()
* sigscheme/src/string.c
  - (scm_p_make_string, scm_p_string_ref, scm_p_string_setd,
    scm_p_list2string, scm_p_string_filld): Rearrange ERR() with the
    new spec
* sigscheme/src/module-srfi1.c
  - (scm_p_srfi1_list_copy): Ditto
* sigscheme/src/storage-continuation.c
  - (unwind_dynamic_extent, scm_call_continuation): Ditto
* sigscheme/src/load.c
  - (scm_load_internal, parse_script_prelude): Ditto
* sigscheme/src/module-siod.c
  - (scm_set_verbose_level): Ditto
* sigscheme/src/main.c
  - (repl_loop): Ditto
* sigscheme/src/syntax.c
  - (scm_s_cond_internal, scm_s_let, define_internal): Ditto
* sigscheme/src/eval.c
  - (call_continuation, scm_eval, scm_p_scheme_report_environment,
    scm_p_null_environment): Ditto
* sigscheme/src/procedure.c
  - (scm_p_map): Ditto
* sigscheme/src/write.c
  - (write_char, write_string, write_errobj): Replace ERR() with false
    assertion
* sigscheme/src/read.c
  - (read_sequence, read_token, read_sexpression, read_list,
    parse_unicode_sequence, read_char, read_string,
    read_number_or_symbol, parse_number, read_number): Add
    DECLARE_INTERNAL_FUNCTION() to follow the spec change of ERR()


Modified: branches/r5rs/sigscheme/src/alloc.c
===================================================================
--- branches/r5rs/sigscheme/src/alloc.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/alloc.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -97,7 +97,7 @@
     if ((size_t)getpagesize() <= size || size <= sizeof(void *))
         p = scm_malloc(size);
     else
-        ERR("cannot ensure memory alignment");
+        PLAIN_ERR("cannot ensure memory alignment");
 #elif defined(__APPLE__)
     /*
      * malloc in Mac OS X guarantees 16 byte alignment.  And large
@@ -111,7 +111,7 @@
         || (ALIGN_CELL % 4 == 0) || (ALIGN_CELL % 2 == 0))
         p = malloc(size);
     else
-        ERR("cannot ensure memory alignment");
+        PLAIN_ERR("cannot ensure memory alignment");
 #else
 #error "This platform is not supported yet"
 #endif
@@ -221,7 +221,7 @@
     if (lbuf->size < least_size) {
         new_size = (*f)(lbuf);
         if (new_size < lbuf->size)
-            ERR("local buffer exceeded");
+            PLAIN_ERR("local buffer exceeded");
         if (new_size < least_size)
             new_size = least_size;
         scm_lbuf_realloc(lbuf, new_size);

Modified: branches/r5rs/sigscheme/src/error.c
===================================================================
--- branches/r5rs/sigscheme/src/error.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/error.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -61,6 +61,10 @@
 /*=======================================
   Variable Declarations
 =======================================*/
+#if (!HAVE_C99_VARIADIC_MACRO && !HAVE_GNU_VARIADIC_MACRO)
+const char *scm_err_funcname;
+#endif
+
 static int debug_mask;
 static scm_bool srfi34_is_provided, fatal_error_looped;
 static void (*cb_fatal_error)(void);
@@ -71,6 +75,8 @@
   File Local Function Declarations
 =======================================*/
 static scm_bool srfi34_providedp(void);
+static void scm_error_internal(const char *func_name, ScmObj obj,
+                               const char *msg, va_list args) SCM_NORETURN;
 #if (SCM_DEBUG && SCM_DEBUG_BACKTRACE_VAL)
 static void show_arg(ScmObj arg, ScmObj env);
 #endif
@@ -90,6 +96,10 @@
     cb_fatal_error = NULL;
     fatal_error_looped = scm_false;
 
+#if (!HAVE_C99_VARIADIC_MACRO && !HAVE_GNU_VARIADIC_MACRO)
+    scm_err_funcname = NULL;
+#endif
+
     SCM_REGISTER_FUNC_TABLE(scm_error_func_info_table);
 }
 
@@ -305,40 +315,74 @@
     /* NOTREACHED */
 }
 
-void
-scm_error(const char *msg, ...)
+static void
+scm_error_internal(const char *func_name, ScmObj obj,
+                   const char *msg, va_list args)
 {
-    va_list va;
-    char *reason;
+    char *fmt, *reason;
     ScmObj err_obj;
 
-    va_start(va, msg);
-    vasprintf(&reason, msg, va);
-    va_end(va);
+    if (func_name) {
+        asprintf(&fmt, "in %s: %s", func_name, msg);
+        ENSURE_ALLOCATED(fmt);
+    } else {
+        fmt = (char *)msg;
+    }
+    vasprintf(&reason, fmt, args);
     ENSURE_ALLOCATED(reason);
+    if (func_name)
+        free(fmt);
 
     err_obj = scm_make_error_obj(MAKE_IMMUTABLE_STRING(reason, STRLEN_UNKNOWN),
-                                 SCM_NULL);
+                                 LIST_1(obj));
     scm_raise_error(err_obj);
     /* NOTREACHED */
 }
 
-/* This function obsoletes scm_error_obj(). */
 void
-scm_error_obj(const char *func_name, const char *msg, ScmObj obj)
+scm_plain_error(const char *msg, ...)
 {
-    char *reason;
-    ScmObj err_obj;
+    va_list va;
 
-    asprintf(&reason, "in %s: %s", func_name, msg);
-    ENSURE_ALLOCATED(reason);
+    va_start(va, msg);
+    scm_error_internal(NULL, SCM_NULL, msg, va);
+    /* va_end(va); */
+    /* NOTREACHED */
+}
 
-    err_obj = scm_make_error_obj(MAKE_IMMUTABLE_STRING(reason, STRLEN_UNKNOWN),
-                                 LIST_1(obj));
-    scm_raise_error(err_obj);
+#if (!HAVE_C99_VARIADIC_MACRO && !HAVE_GNU_VARIADIC_MACRO)
+void
+scm_error_with_implicit_func(const char *msg, ...)
+{
+    va_list va;
+
+    va_start(va, msg);
+    scm_error_internal(scm_err_funcname, SCM_NULL, msg, va);
+    /* va_end(va); */
     /* NOTREACHED */
 }
+#endif /* (!HAVE_C99_VARIADIC_MACRO && !HAVE_GNU_VARIADIC_MACRO) */
 
+void
+scm_error(const char *func_name, const char *msg, ...)
+{
+    va_list va;
+
+    va_start(va, msg);
+    scm_error_internal(func_name, SCM_NULL, msg, va);
+    /* va_end(va); */
+    /* NOTREACHED */
+}
+
+void
+scm_error_obj(const char *func_name, const char *msg, ScmObj obj)
+{
+    va_list dummy_va;
+
+    scm_error_internal(func_name, obj, msg, dummy_va);
+    /* NOTREACHED */
+}
+
 #if (SCM_DEBUG && SCM_DEBUG_BACKTRACE_VAL)
 static void
 show_arg(ScmObj arg, ScmObj env)

Modified: branches/r5rs/sigscheme/src/eval.c
===================================================================
--- branches/r5rs/sigscheme/src/eval.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/eval.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -180,7 +180,7 @@
     DECLARE_INTERNAL_FUNCTION("call_continuation");
 
     if (!LIST_1_P(args))
-        ERR("continuation takes exactly one argument");
+        ERR_OBJ("continuation takes exactly one argument but got", args);
     ret = CAR(args);
     if (need_eval)
         ret = EVAL(ret, eval_state->env);
@@ -415,11 +415,11 @@
 #if SCM_STRICT_NULL_FORM
     /* () is allowed by default for efficiency */
     else if (NULLP(obj))
-        ERR("eval: () is not a valid R5RS form. use '() instead");
+        PLAIN_ERR("eval: () is not a valid R5RS form. use '() instead");
 #endif
 #if SCM_STRICT_VECTOR_FORM
     else if (VECTORP(obj))
-        ERR("eval: #() is not a valid R5RS form. use '#() instead");
+        PLAIN_ERR("eval: #() is not a valid R5RS form. use '#() instead");
 #endif
 
 #if SCM_DEBUG
@@ -499,7 +499,7 @@
         ERR_OBJ("version must be 5 but got", version);
 
 #if SCM_STRICT_R5RS
-    ERR("scheme-report-environment:" SCM_ERRMSG_NON_R5RS_ENV);
+    ERR(SCM_ERRMSG_NON_R5RS_ENV);
 #else
     CDBG((SCM_DBG_COMPAT,
           "scheme-report-environment: warning:" SCM_ERRMSG_NON_R5RS_ENV));
@@ -518,7 +518,7 @@
         ERR_OBJ("version must be 5 but got", version);
 
 #if SCM_STRICT_R5RS
-    ERR("null-environment:" SCM_ERRMSG_NON_R5RS_ENV);
+    ERR(SCM_ERRMSG_NON_R5RS_ENV);
 #else
     CDBG((SCM_DBG_COMPAT,
           "null-environment: warning:" SCM_ERRMSG_NON_R5RS_ENV));

Modified: branches/r5rs/sigscheme/src/load.c
===================================================================
--- branches/r5rs/sigscheme/src/load.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/load.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -112,12 +112,13 @@
     ScmObj path, port, sexp;
     char *c_path;
     ScmCharCodec *saved_codec;
+    DECLARE_INTERNAL_FUNCTION("load");
 
     CDBG((SCM_DBG_FILE, "loading %s", filename));
 
     c_path = find_path(filename);
     if (!c_path)
-        ERR("scm_load_internal: file \"%s\" not found", filename);
+        ERR("file \"%s\" not found", filename);
 
     path = MAKE_IMMUTABLE_STRING(c_path, STRLEN_UNKNOWN);
     port = scm_p_open_input_file(path);
@@ -216,12 +217,11 @@
     int argc, c, len, line_len;
     char **argv, *arg, *p;
     char line[SCRIPT_PRELUDE_MAXLEN];
-    DECLARE_INTERNAL_FUNCTION("parse_script_prelude");
 
     for (p = line; p < &line[SCRIPT_PRELUDE_MAXLEN]; p++) {
         c = scm_port_get_char(port);
         if (!isascii(c))
-            ERR("non-ASCII char appeared in UNIX script prelude");
+            PLAIN_ERR("non-ASCII char appeared in UNIX script prelude");
         if (c == SCM_NEWLINE_STR[0]) {
             *p = '\0';
             break;
@@ -229,17 +229,17 @@
         *p = c;
     }
     if (*p)
-        ERR("too long UNIX script prelude (max 64)");
+        PLAIN_ERR("too long UNIX script prelude (max 64)");
     line_len = p - line;
 
     if (line[0] != '#' || line[1] != '!') {
-        ERR("Invalid UNIX script prelude");
+        PLAIN_ERR("Invalid UNIX script prelude");
     }
 #if 1
     /* strict check */
     if (line[2] != ' ') {
-        ERR("Invalid UNIX script prelude: "
-            "SRFI-22 requires a space after hash-bang sequence");
+        PLAIN_ERR("Invalid UNIX script prelude: "
+                  "SRFI-22 requires a space after hash-bang sequence");
     }
 #endif
 

Modified: branches/r5rs/sigscheme/src/main.c
===================================================================
--- branches/r5rs/sigscheme/src/main.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/main.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -149,7 +149,7 @@
                     SCM_BYTEPORT_GET_BYTE(bport);
                 continue;
             }
-            ERR("unrecoverable parse error");
+            PLAIN_ERR("unrecoverable parse error");
         }
 
         /*

Modified: branches/r5rs/sigscheme/src/module-siod.c
===================================================================
--- branches/r5rs/sigscheme/src/module-siod.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/module-siod.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -247,9 +247,10 @@
 void
 scm_set_verbose_level(long level)
 {
+    DECLARE_INTERNAL_FUNCTION("scm_set_verbose_level");
+
     if (level < 0)
-        ERR("scm_set_verbose_level: positive value required but got: %d",
-            (int)level);
+        ERR("positive value required but got: %d", (int)level);
 
     if (sscm_verbose_level == level)
         return;

Modified: branches/r5rs/sigscheme/src/module-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/src/module-srfi1.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/module-srfi1.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -168,13 +168,13 @@
 ScmObj
 scm_p_srfi1_list_copy(ScmObj lst)
 {
-    /* broken */
-#if 0
     ScmObj head = SCM_NULL;
     ScmObj tail = SCM_FALSE;
     ScmObj obj  = SCM_FALSE;
     DECLARE_FUNCTION("list-copy", procedure_fixed_1);
 
+    /* broken */
+#if 0
     if (FALSEP(scm_p_listp(lst)))
         ERR_OBJ("list required but got", lst);
 
@@ -198,7 +198,7 @@
 
     return head;
 #endif
-    ERR("list-copy: bug: broken implementation");
+    ERR("bug: broken implementation");
 }
 
 ScmObj

Modified: branches/r5rs/sigscheme/src/procedure.c
===================================================================
--- branches/r5rs/sigscheme/src/procedure.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/procedure.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -268,7 +268,7 @@
     DECLARE_FUNCTION("map", procedure_variadic_1);
 
     if (NULLP(args))
-        ERR("map: wrong number of arguments");
+        ERR("wrong number of arguments");
 
     /* fast path for single arg case */
     if (NULLP(CDR(args)))

Modified: branches/r5rs/sigscheme/src/read.c
===================================================================
--- branches/r5rs/sigscheme/src/read.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/read.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -167,6 +167,7 @@
 {
     scm_ichar_t c;
     char *p;
+    DECLARE_INTERNAL_FUNCTION("read");
 
     for (p = buf; p < &buf[len]; p++) {
         c = scm_port_get_char(port);
@@ -187,6 +188,7 @@
     scm_ichar_t c;
     size_t len;
     char *p;
+    DECLARE_INTERNAL_FUNCTION("read");
 
     for (p = buf;;) {
         c = scm_port_peek_char(port);
@@ -238,6 +240,7 @@
 {
     ScmObj ret;
     scm_ichar_t c;
+    DECLARE_INTERNAL_FUNCTION("read");
 
     CDBG((SCM_DBG_PARSER, "read_sexpression"));
 
@@ -333,6 +336,7 @@
     scm_ichar_t c;
     int err, start_line, cur_line;
     char dot_buf[sizeof("...")];
+    DECLARE_INTERNAL_FUNCTION("read");
 
     CDBG((SCM_DBG_PARSER, "read_list"));
     basecport = SCM_PORT_TRY_DYNAMIC_CAST(ScmBaseCharPort,
@@ -411,6 +415,7 @@
 {
     scm_ichar_t c;
     char *end;
+    DECLARE_INTERNAL_FUNCTION("read");
 
     /* reject ordinary char literal and invalid signed hexadecimal */
     if (len < 3 || !isxdigit(seq[1]))
@@ -480,7 +485,7 @@
 #endif
     int err;
     char buf[CHAR_LITERAL_LEN_MAX + sizeof("")];
-    DECLARE_INTERNAL_FUNCTION("read_char");
+    DECLARE_INTERNAL_FUNCTION("read");
 
     /* plain char (multibyte-ready) */
     c = scm_port_get_char(port);
@@ -533,7 +538,7 @@
     size_t offset;
     ScmLBuf(char) lbuf;
     char init_buf[SCM_INITIAL_STRING_BUF_SIZE];
-    DECLARE_INTERNAL_FUNCTION("read_string");
+    DECLARE_INTERNAL_FUNCTION("read");
 
     CDBG((SCM_DBG_PARSER, "read_string"));
 
@@ -648,8 +653,9 @@
     int err;
     size_t len;
     char buf[INT_LITERAL_LEN_MAX + sizeof("")];
+    DECLARE_INTERNAL_FUNCTION("read");
 
-    CDBG((SCM_DBG_PARSER, "read_number_or_symbol"));
+    CDBG((SCM_DBG_PARSER, "read"));
 
     c = scm_port_peek_char(port);
 
@@ -698,6 +704,7 @@
     scm_int_t number;
     int radix;
     char *end;
+    DECLARE_INTERNAL_FUNCTION("read");
 
     switch (prefix) {
     case 'b': radix = 2;  break;
@@ -724,6 +731,7 @@
     int err;
     size_t len;
     char buf[INT_LITERAL_LEN_MAX + sizeof("")];
+    DECLARE_INTERNAL_FUNCTION("read");
 
     len = read_token(port, &err, buf, sizeof(buf), DELIMITER_CHARS);
     if (err == TOKEN_BUF_EXCEEDED)

Modified: branches/r5rs/sigscheme/src/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/src/sigscheme.h	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/sigscheme.h	2006-01-30 04:08:48 UTC (rev 3032)
@@ -212,8 +212,8 @@
 /*
  * Port I/O Handling macros
  */
-#define SCM_CHARPORT_ERROR(cport, msg) (scm_error(msg))
-#define SCM_BYTEPORT_ERROR(bport, msg) (scm_error(msg))
+#define SCM_CHARPORT_ERROR(cport, msg) (scm_plain_error(msg))
+#define SCM_BYTEPORT_ERROR(bport, msg) (scm_plain_error(msg))
 #define SCM_PORT_MALLOC(size)          (scm_malloc(size))
 #define SCM_PORT_CALLOC(number, size)  (scm_calloc(number, size))
 #define SCM_PORT_REALLOC(ptr, size)    (scm_realloc(ptr, size))
@@ -1395,7 +1395,8 @@
 void scm_categorized_debug(int category, const char *msg, ...);
 void scm_debug(const char *msg, ...);
 void scm_die(const char *msg, const char *filename, int line) SCM_NORETURN;
-void scm_error(const char *msg, ...) SCM_NORETURN;
+void scm_plain_error(const char *msg, ...) SCM_NORETURN;
+void scm_error(const char *funcname, const char *msg, ...) SCM_NORETURN;
 void scm_error_obj(const char *funcname, const char *msg,
                    ScmObj obj) SCM_NORETURN;
 void scm_show_backtrace(ScmObj trace_stack);

Modified: branches/r5rs/sigscheme/src/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/sigschemeinternal.h	2006-01-30 04:08:48 UTC (rev 3032)
@@ -266,10 +266,24 @@
  * FIXME: is there a better name? */
 #define DECLARE_INTERNAL_FUNCTION(name) DECLARE_FUNCTION((name), ignored)
 
+/* Signals an error without function name. The message is formatted by
+ * vfprintf(). */
+#define PLAIN_ERR scm_plain_error
+
 /* Signals an error.  The current function name and the message are
    sent to the error port.  The message is formatted by vfprintf(). */
-#define ERR scm_error
+/* FIXME: check variadic macro availability with autoconf */
+#if HAVE_C99_VARIADIC_MACRO
+#define ERR(fmt, ...)     (scm_error(SCM_MANGLE(name), fmt, __VA_ARGS__))
+#elif HAVE_GNU_VARIADIC_MACRO
+#define ERR(fmt, args...) (scm_error(SCM_MANGLE(name), fmt, args))
+#else
+extern const char *scm_err_funcname;
+void scm_error_with_implicit_func(const char *msg, ...) SCM_NORETURN;
+#define ERR (scm_err_funcname = SCM_MANGLE(name)), scm_error_with_implicit_func
+#endif
 
+
 /* Signals an error that occured on an object.  The current function
  * name, the message, then the object, are written (with `write') to
  * the error port. */
@@ -363,12 +377,12 @@
 
 #define ENSURE_STATEFUL_CODEC(codec)                                         \
     (SCM_CHARCODEC_STATEFULP(codec)                                          \
-     || (ERR("%s: stateful character codec required but got: %s",            \
-             SCM_MANGLE(name), SCM_CHARCODEC_ENCODING(codec)), 0))
+     || (ERR("stateful character codec required but got: %s",                \
+             SCM_CHARCODEC_ENCODING(codec)), 0))
 #define ENSURE_STATELESS_CODEC(codec)                                        \
     (!SCM_CHARCODEC_STATEFULP(codec)                                         \
-     || (ERR("%s: stateless character codec required but got: %s",           \
-             SCM_MANGLE(name), SCM_CHARCODEC_ENCODING(codec)), 0))
+     || (ERR("stateless character codec required but got: %s",               \
+             SCM_CHARCODEC_ENCODING(codec)), 0))
 
 #define ENSURE_ALLOCATED SCM_ENSURE_ALLOCATED
 

Modified: branches/r5rs/sigscheme/src/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/src/storage-continuation.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/storage-continuation.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -147,7 +147,7 @@
 unwind_dynamic_extent(void)
 {
     if (NULLP(current_dynamic_extent))
-        ERR("corrupted dynamic extent");
+        PLAIN_ERR("corrupted dynamic extent");
 
     current_dynamic_extent = CDR(current_dynamic_extent);
 }
@@ -348,7 +348,7 @@
         longjmp(frame->c_env, 1);
         /* NOTREACHED */
     } else {
-        ERR("scm_call_continuation: called expired continuation");
+        ERR("called expired continuation");
     }
 }
 

Modified: branches/r5rs/sigscheme/src/string.c
===================================================================
--- branches/r5rs/sigscheme/src/string.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/string.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -395,14 +395,14 @@
     }
 #if !SCM_USE_NULL_CAPABLE_STRING
     if (filler_val == '\0')
-        ERR("make-string: " SCM_ERRMSG_NULL_IN_STRING);
+        ERR(SCM_ERRMSG_NULL_IN_STRING);
 #endif
 
 #if SCM_USE_MULTIBYTE_CHAR
     next = SCM_CHARCODEC_INT2STR(scm_current_char_codec, ch_str, filler_val,
                                  SCM_MB_STATELESS);
     if (!next)
-        ERR("make-string: invalid char 0x%x for encoding %s",
+        ERR("invalid char 0x%x for encoding %s",
             (int)filler_val, SCM_CHARCODEC_ENCODING(scm_current_char_codec));
 
     str = scm_malloc(ch_len * len + sizeof(""));
@@ -468,7 +468,7 @@
     ch = SCM_CHARCODEC_STR2INT(scm_current_char_codec, SCM_MBS_GET_STR(mbs),
                                SCM_MBS_GET_SIZE(mbs), SCM_MBS_GET_STATE(mbs));
     if (ch == EOF)
-        ERR("string-ref: invalid char sequence");
+        ERR("invalid char sequence");
 #else
     ch = ((unsigned char *)SCM_STRING_STR(str))[idx];
 #endif
@@ -515,7 +515,7 @@
     ch_end = SCM_CHARCODEC_INT2STR(scm_current_char_codec, ch_buf, ch_val,
                                    SCM_MB_STATELESS);
     if (!ch_end)
-        ERR("string-set!: invalid char 0x%x for encoding %s",
+        ERR("invalid char 0x%x for encoding %s",
             (int)ch_val, SCM_CHARCODEC_ENCODING(scm_current_char_codec));
     ch_len = ch_end - ch_buf;
 
@@ -900,7 +900,7 @@
     FOR_EACH (ch, lst) {
 #if !SCM_USE_NULL_CAPABLE_STRING
         if (ch == '\0')
-            ERR("list->string: " SCM_ERRMSG_NULL_IN_STRING);
+            ERR(SCM_ERRMSG_NULL_IN_STRING);
 #endif
 #if SCM_USE_MULTIBYTE_CHAR
         dst = SCM_CHARCODEC_INT2STR(scm_current_char_codec, dst,
@@ -960,7 +960,7 @@
     next = SCM_CHARCODEC_INT2STR(scm_current_char_codec, ch_str,
                                  SCM_CHAR_VALUE(ch), SCM_MB_STATELESS);
     if (!next)
-        ERR("string-fill!: invalid char 0x%x for encoding %s",
+        ERR("invalid char 0x%x for encoding %s",
             (int)SCM_CHAR_VALUE(ch),
             SCM_CHARCODEC_ENCODING(scm_current_char_codec));
 

Modified: branches/r5rs/sigscheme/src/syntax.c
===================================================================
--- branches/r5rs/sigscheme/src/syntax.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/syntax.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -522,7 +522,7 @@
         SCM_MANGLE(name) = "case";
 
     if (NO_MORE_ARG(args))
-        ERR("cond: syntax error: at least one clause required");
+        ERR("syntax error: at least one clause required");
 
     /* looping in each clause */
     FOR_EACH (clause, args) {
@@ -826,7 +826,7 @@
     =======================================================================*/
 
     if (!CONSP(args))
-        ERR("let: invalid form");
+        ERR("invalid form");
     bindings = POP(args);
 
     /* named let */
@@ -834,7 +834,7 @@
         named_let_sym = bindings;
 
         if (!CONSP(args))
-            ERR("let: invalid named let form");
+            ERR("invalid named let form");
         bindings = POP(args);
     }
 
@@ -1268,7 +1268,7 @@
 #if SCM_STRICT_DEFINE_PLACEMENT
         /* internal definitions are handled as a virtual letrec in
          * scm_s_body() */
-        ERR(ERRMSG_BAD_DEFINE_PLACEMENT);
+        PLAIN_ERR(ERRMSG_BAD_DEFINE_PLACEMENT);
 #else
         env = scm_add_environment(var, val, env);
 #endif

Modified: branches/r5rs/sigscheme/src/write.c
===================================================================
--- branches/r5rs/sigscheme/src/write.c	2006-01-30 01:53:11 UTC (rev 3031)
+++ branches/r5rs/sigscheme/src/write.c	2006-01-30 04:08:48 UTC (rev 3032)
@@ -280,8 +280,7 @@
         break;
 
     default:
-        ERR("write_char: unknown output type");
-        break;
+        SCM_ASSERT(scm_false);
     }
 }
 
@@ -294,7 +293,7 @@
     const char *str;
     size_t len;
     scm_ichar_t c;
-    DECLARE_INTERNAL_FUNCTION("write_string");
+    DECLARE_INTERNAL_FUNCTION("write");
 
     str = SCM_STRING_STR(obj);
     len = strlen(str);
@@ -332,8 +331,7 @@
         break;
 
     default:
-        ERR("write_string: unknown output type");
-        break;
+        SCM_ASSERT(scm_false);
     }
 }
 
@@ -474,7 +472,7 @@
 write_errobj(ScmObj port, ScmObj obj, enum  OutputType otype)
 {
     ScmObj err_obj_tag, reason, objs, trace_stack, elm;
-    DECLARE_INTERNAL_FUNCTION("write_errobj");
+    DECLARE_INTERNAL_FUNCTION("write");
 
     err_obj_tag = MUST_POP_ARG(obj);
     reason      = MUST_POP_ARG(obj);
@@ -495,8 +493,7 @@
         break;
 
     default:
-        ERR("write_errobj: unknown output type");
-        break;
+        SCM_ASSERT(scm_false);
     }
 
     FOR_EACH(elm, objs) {



More information about the uim-commit mailing list