[uim-commit] r1630 - branches/r5rs/sigscheme
kzk at freedesktop.org
kzk at freedesktop.org
Tue Sep 27 21:52:34 PDT 2005
Author: kzk
Date: 2005-09-27 21:52:32 -0700 (Tue, 27 Sep 2005)
New Revision: 1630
Modified:
branches/r5rs/sigscheme/datas.c
branches/r5rs/sigscheme/debug.c
branches/r5rs/sigscheme/encoding.c
branches/r5rs/sigscheme/error.c
branches/r5rs/sigscheme/eval.c
branches/r5rs/sigscheme/io.c
branches/r5rs/sigscheme/main.c
branches/r5rs/sigscheme/operations-siod.c
branches/r5rs/sigscheme/operations-srfi1.c
branches/r5rs/sigscheme/operations-srfi23.c
branches/r5rs/sigscheme/operations-srfi38.c
branches/r5rs/sigscheme/operations-srfi60.c
branches/r5rs/sigscheme/operations.c
branches/r5rs/sigscheme/read.c
Log:
* SigScm_Error: always append "\n"
- command to search modification part is
$ grep "SigScm_Error(" *.c *.h | grep "\\\\n"
* sigscheme/debug.c
- (SigScm_Error): always append "\n"
* sigscheme/io.c
* sigscheme/read.c
* sigscheme/operations.c
* sigscheme/encoding.c
* sigscheme/error.c
* sigscheme/datas.c
* sigscheme/operations-srfi38.c
* sigscheme/operations-srfi1.c
* sigscheme/operations-siod.c
* sigscheme/main.c
* sigscheme/eval.c
* sigscheme/operations-srfi23.c
* sigscheme/operations-srfi60.c
- remove unncessary "\n" used in the argument of SigScm_Error
Modified: branches/r5rs/sigscheme/datas.c
===================================================================
--- branches/r5rs/sigscheme/datas.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/datas.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -639,7 +639,7 @@
/* check length */
if (SigScm_default_encoding_strlen(ch) != 1) {
- SigScm_Error("Scm_NewChar : invalid character ch = [%s], len = %d\n",
+ SigScm_Error("Scm_NewChar : invalid character ch = [%s], len = %d",
ch, SigScm_default_encoding_strlen(ch));
}
Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/debug.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -277,7 +277,7 @@
print_etc(f, obj, otype);
break;
case ScmFreeCell:
- SigScm_Error("You cannot print ScmFreeCell, may be GC bug.\n");
+ SigScm_Error("You cannot print ScmFreeCell, may be GC bug.");
break;
case ScmCPointer:
fprintf(f, "#<c_pointer %p>", SCM_C_POINTER_VALUE(obj));
@@ -311,7 +311,7 @@
fprintf(f, "%s", SCM_CHAR_VALUE(obj));
break;
default:
- SigScm_Error("print_char : unknown output type\n");
+ SigScm_Error("print_char : unknown output type");
break;
}
}
@@ -350,7 +350,7 @@
fprintf(f, "%s", SCM_STRING_STR(obj));
break;
default:
- SigScm_Error("print_string : unknown output type\n");
+ SigScm_Error("print_string : unknown output type");
break;
}
}
Modified: branches/r5rs/sigscheme/encoding.c
===================================================================
--- branches/r5rs/sigscheme/encoding.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/encoding.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -140,6 +140,6 @@
if (len == k + 1)
return (const char *)cur;
- SigScm_Error("eucjp_str_startpos : unreachable point\n");
+ SigScm_Error("eucjp_str_startpos : unreachable point");
return NULL;
}
Modified: branches/r5rs/sigscheme/error.c
===================================================================
--- branches/r5rs/sigscheme/error.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/error.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -93,15 +93,8 @@
va_start(va, msg);
vfprintf(SCM_PORTINFO_FILE(scm_current_error_port), msg, va);
va_end(va);
-#if 0
- /*
- * FIXME: this function should always append "\n" to ensure that an
- * error message forms a line message, instead of delegating the
- * responsibility to caller. Otherwise subsequent error messages may be
- * broken.
- */
+
fprintf(SCM_PORTINFO_FILE(scm_current_error_port), "\n");
-#endif
}
if (SigScm_DebugCategories() & SCM_DBG_BACKTRACE)
Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/eval.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -131,7 +131,7 @@
else if (CONSP(env))
env = CONS(frame, env);
else
- SigScm_Error("broken environment.\n");
+ SigScm_Error("broken environment.");
return env;
}
@@ -393,7 +393,7 @@
SigScm_Error("Corrupted function: typecode=0x%x", type);
for (i=0; i < mand_count; i++) {
if (NULLP(args))
- SigScm_Error("%d or more argument(s) required but got only %d\n",
+ SigScm_Error("%d or more argument(s) required but got only %d",
mand_count, i);
SCM_SHIFT_RAW(argbuf[i], args);
if (!suppress_eval)
@@ -973,7 +973,7 @@
data = CAR(clause);
exps = CDR(clause);
if (NULLP(clause) || NULLP(data) || NULLP(exps))
- SigScm_Error("case : syntax error\n");
+ SigScm_Error("case : syntax error");
/* check "else" symbol */
if (NULLP(CDR(arg)) && !CONSP(data) && NFALSEP(SCM_SYMBOL_VCELL(data)))
@@ -1053,7 +1053,7 @@
/* sanity check */
if CHECK_2_ARGS(arg)
- SigScm_Error("let : syntax error\n");
+ SigScm_Error("let : syntax error");
/* guess whether syntax is "Named let" */
if (SYMBOLP(CAR(arg)))
@@ -1137,7 +1137,7 @@
/* sanity check */
if CHECK_2_ARGS(arg)
- SigScm_Error("let* : syntax error\n");
+ SigScm_Error("let* : syntax error");
/* get bindings and body */
bindings = CAR(arg);
@@ -1201,7 +1201,7 @@
/* sanity check */
if (NULLP(arg) || NULLP(CDR(arg)))
- SigScm_Error("letrec : syntax error\n");
+ SigScm_Error("letrec : syntax error");
/* get bindings and body */
bindings = CAR(arg);
@@ -1255,7 +1255,7 @@
return ScmExp_begin(body, eval_state);
}
- SigScm_Error("letrec : syntax error\n");
+ SigScm_Error("letrec : syntax error");
return SCM_UNDEF;
}
@@ -1311,7 +1311,7 @@
/* sanity check */
if (SCM_INT_VALUE(ScmOp_length(arg)) < 2)
- SigScm_Error("do : syntax error\n");
+ SigScm_Error("do : syntax error");
/* construct Environment and steps */
for (; !NULLP(bindings); bindings = CDR(bindings)) {
@@ -1368,7 +1368,7 @@
if (!NULLP(obj)) {
SET_CAR(obj, CAR(vals));
} else {
- SigScm_Error("do : broken env\n");
+ SigScm_Error("do : broken env");
}
}
}
@@ -1435,7 +1435,7 @@
========================================================================*/
if (SYMBOLP(var)) {
if (!NULLP(SCM_SHIFT_RAW_1(exp, rest)))
- SigScm_Error("define : missing expression\n");
+ SigScm_Error("define : missing expression");
if (NULLP(env)) {
/* given top-level environment */
@@ -1464,7 +1464,7 @@
body = rest;
if (NULLP(body))
- SigScm_Error("define : missing function body\n");
+ SigScm_Error("define : missing function body");
if (!SYMBOLP(procname))
SigScm_ErrorObj("define : symbol required but got ", procname);
Modified: branches/r5rs/sigscheme/io.c
===================================================================
--- branches/r5rs/sigscheme/io.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/io.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -327,7 +327,7 @@
ScmObj port = SCM_NULL;
if CHECK_1_ARG(arg)
- SigScm_Error("write : invalid parameter\n");
+ SigScm_Error("write : invalid parameter");
/* get obj */
obj = CAR(arg);
@@ -348,7 +348,7 @@
ScmObj port = SCM_NULL;
if CHECK_1_ARG(arg)
- SigScm_Error("display : invalid parameter\n");
+ SigScm_Error("display : invalid parameter");
/* get obj */
obj = CAR(arg);
@@ -385,7 +385,7 @@
ScmObj port = SCM_NULL;
if CHECK_1_ARG(arg)
- SigScm_Error("write-char : invalid parameter\n");
+ SigScm_Error("write-char : invalid parameter");
/* get obj */
obj = CAR(arg);
@@ -440,7 +440,7 @@
/* sanity check */
if (!c_filepath)
- SigScm_Error("SigScm_load_internal : file \"%s\" not found\n",
+ SigScm_Error("SigScm_load_internal : file \"%s\" not found",
c_filename);
filepath = Scm_NewString(c_filepath);
Modified: branches/r5rs/sigscheme/main.c
===================================================================
--- branches/r5rs/sigscheme/main.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/main.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -131,7 +131,7 @@
#else
repl();
#endif
- /* SigScm_Error("usage : sscm <filename>\n"); */
+ /* SigScm_Error("usage : sscm <filename>"); */
} else {
SigScm_load(filename);
}
Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations-siod.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -184,7 +184,7 @@
void SigScm_SetVerboseLevel(long level)
{
if (level < 0)
- SigScm_Error("SigScm_SetVerboseLevel : negative value has been given\n");
+ SigScm_Error("SigScm_SetVerboseLevel : negative value has been given");
sscm_verbose_level = level;
Modified: branches/r5rs/sigscheme/operations-srfi1.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi1.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations-srfi1.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -97,7 +97,7 @@
/* sanity check */
if CHECK_1_ARG(args)
- SigScm_Error("make-llist : require at least 1 arg\n");
+ SigScm_Error("make-llist : require at least 1 arg");
if (FALSEP(ScmOp_numberp(CAR(args))))
SigScm_ErrorObj("make-list : number required but got ", CAR(args));
@@ -211,7 +211,7 @@
/* sanity check */
if CHECK_1_ARG(args)
- SigScm_Error("iota : required at least 1 arg\n");
+ SigScm_Error("iota : required at least 1 arg");
/* get params */
scm_count = CAR(args);
@@ -317,7 +317,7 @@
ScmObj first_lst = SCM_NULL;
if CHECK_1_ARG(args)
- SigScm_Error("list= : required at least 1 arg\n");
+ SigScm_Error("list= : required at least 1 arg");
eqproc = CAR(args);
lsts = CDR(args);
Modified: branches/r5rs/sigscheme/operations-srfi23.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi23.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations-srfi23.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -66,7 +66,7 @@
ScmObj ScmOp_SRFI23_error(ScmObj args, ScmObj env)
{
if (NULLP(args))
- SigScm_Error("error : at least 1 argument required\n");
+ SigScm_Error("error : at least 1 argument required");
if (!STRINGP(CAR(args)))
SigScm_ErrorObj("error : first argument should be string but got ",
Modified: branches/r5rs/sigscheme/operations-srfi38.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi38.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations-srfi38.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -70,7 +70,7 @@
ScmObj port = SCM_NULL;
if CHECK_1_ARG(arg)
- SigScm_Error("write : invalid parameter\n");
+ SigScm_Error("write : invalid parameter");
/* get obj */
obj = CAR(arg);
Modified: branches/r5rs/sigscheme/operations-srfi60.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi60.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations-srfi60.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -66,7 +66,7 @@
result = (SCM_INT_VALUE(left) op SCM_INT_VALUE(right)); \
break; \
default: \
- SigScm_Error(opstr " : (internal error) unrecognized state specifier: %d\n", *state); \
+ SigScm_Error(opstr " : (internal error) unrecognized state specifier: %d", *state); \
} \
return Scm_NewInt(result); \
} while (/* CONSTCOND */ 0)
Modified: branches/r5rs/sigscheme/operations.c
===================================================================
--- branches/r5rs/sigscheme/operations.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/operations.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -106,7 +106,7 @@
break;
case ScmFreeCell:
- SigScm_Error("eqv? : cannnot compare freecell, gc broken?\n");
+ SigScm_Error("eqv? : cannnot compare freecell, gc broken?");
break;
case ScmCPointer:
@@ -226,7 +226,7 @@
break;
case ScmFreeCell:
- SigScm_Error("equal? : cannnot compare freecell, gc broken?\n");
+ SigScm_Error("equal? : cannnot compare freecell, gc broken?");
break;
case ScmCPointer:
@@ -269,7 +269,7 @@
case SCM_REDUCE_0:
break;
default:
- SigScm_Error("+ : (internal error) unrecognized state specifier: ", *state);
+ SigScm_Error("+ : (internal error) unrecognized state specifier: %d", *state);
}
return Scm_NewInt(result);
@@ -293,7 +293,7 @@
case SCM_REDUCE_0:
break;
default:
- SigScm_Error("* : (internal error) unrecognized state specifier: ", *state);
+ SigScm_Error("* : (internal error) unrecognized state specifier: %d", *state);
}
return Scm_NewInt(result);
@@ -316,9 +316,9 @@
break;
case SCM_REDUCE_0:
- SigScm_Error("- : at least 1 argument required\n");
+ SigScm_Error("- : at least 1 argument required");
default:
- SigScm_Error("- : (internal error) unrecognized state specifier: ", *state);
+ SigScm_Error("- : (internal error) unrecognized state specifier: %d", *state);
}
return Scm_NewInt(result);
}
@@ -337,11 +337,11 @@
if (!INTP(right))
SigScm_ErrorObj("/ : integer required but got ", right);
if (SCM_INT_VALUE(right) == 0)
- SigScm_Error("/ : division by zero\n");
+ SigScm_Error("/ : division by zero");
result /= SCM_INT_VALUE(right);
break;
case SCM_REDUCE_0:
- SigScm_Error("/ : at least 1 argument required\n");
+ SigScm_Error("/ : at least 1 argument required");
default:
SigScm_Error("/ : (internal error) unrecognized state specifier: ", *state);
}
@@ -360,7 +360,7 @@
switch (*state) { \
case SCM_REDUCE_0: \
case SCM_REDUCE_1: \
- SigScm_Error(opstr " : at least 2 arguments required\n"); \
+ SigScm_Error(opstr " : at least 2 arguments required"); \
case SCM_REDUCE_PARTWAY: \
case SCM_REDUCE_LAST: \
if (!INTP(left)) \
@@ -443,7 +443,7 @@
ScmObj ScmOp_max(ScmObj left, ScmObj right, enum ScmReductionState *state)
{
if (*state == SCM_REDUCE_0)
- SigScm_Error("max : at least 1 argument required\n");
+ SigScm_Error("max : at least 1 argument required");
if (!INTP(left))
SigScm_Error("max : integer required but got ", left);
if (!INTP(right))
@@ -455,7 +455,7 @@
ScmObj ScmOp_min(ScmObj left, ScmObj right, enum ScmReductionState *state)
{
if (*state == SCM_REDUCE_0)
- SigScm_Error("min : at least 1 argument required\n");
+ SigScm_Error("min : at least 1 argument required");
if (!INTP(left))
SigScm_Error("min : integer required but got ", left);
if (!INTP(right))
@@ -487,7 +487,7 @@
if (FALSEP(ScmOp_numberp(scm_n2)))
SigScm_ErrorObj("quotient : number required but got ", scm_n2);
if (NFALSEP(ScmOp_zerop(scm_n2)))
- SigScm_Error("quotient : divide by zero\n");
+ SigScm_Error("quotient : divide by zero");
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -506,7 +506,7 @@
if (FALSEP(ScmOp_numberp(scm_n2)))
SigScm_ErrorObj("modulo : number required but got ", scm_n2);
if (NFALSEP(ScmOp_zerop(scm_n2)))
- SigScm_Error("modulo : divide by zero\n");
+ SigScm_Error("modulo : divide by zero");
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -531,7 +531,7 @@
if (FALSEP(ScmOp_numberp(scm_n2)))
SigScm_ErrorObj("remainder : number required but got ", scm_n2);
if (NFALSEP(ScmOp_zerop(scm_n2)))
- SigScm_Error("remainder : divide by zero\n");
+ SigScm_Error("remainder : divide by zero");
n1 = SCM_INT_VALUE(scm_n1);
n2 = SCM_INT_VALUE(scm_n2);
@@ -1235,7 +1235,7 @@
/* sanity check */
if (argc != 1 && argc != 2)
- SigScm_Error("make-string : invalid use\n");
+ SigScm_Error("make-string : invalid use");
if (!INTP(CAR(arg)))
SigScm_ErrorObj("make-string : integer required but got ", CAR(arg));
if (argc == 2 && !CHARP(CADR(arg)))
@@ -1732,7 +1732,7 @@
/* arglen check */
if (arg_len < 2)
- SigScm_Error("map : Wrong number of arguments\n");
+ SigScm_Error("map : Wrong number of arguments");
/* 1proc and 1arg case */
if (arg_len == 2) {
@@ -1770,7 +1770,7 @@
}
/* never reaches here */
- SigScm_Error("map bug?\n");
+ SigScm_Error("map bug?");
return SCM_NULL;
}
@@ -1784,9 +1784,9 @@
ScmObj ScmOp_force(ScmObj arg, ScmObj env)
{
if (SCM_INT_VALUE(ScmOp_length(arg)) != 1)
- SigScm_Error("force : Wrong number of arguments\n");
+ SigScm_Error("force : Wrong number of arguments");
if (!CLOSUREP(CAR(arg)))
- SigScm_Error("force : not proper delayed object\n");
+ SigScm_Error("force : not proper delayed object");
/* the caller's already wrapped arg in a list for us */
return EVAL(arg, env);
Modified: branches/r5rs/sigscheme/read.c
===================================================================
--- branches/r5rs/sigscheme/read.c 2005-09-28 04:18:59 UTC (rev 1629)
+++ branches/r5rs/sigscheme/read.c 2005-09-28 04:52:32 UTC (rev 1630)
@@ -188,7 +188,7 @@
case ',':
SCM_PORT_GETC(port, c1);
if (c1 == EOF) {
- SigScm_Error("EOF in unquote\n");
+ SigScm_Error("EOF in unquote");
} else if (c1 == '@') {
return read_quote(port, SCM_UNQUOTE_SPLICING);
} else {
@@ -211,14 +211,14 @@
SCM_PORT_UNGETC(port, c1);
return parse_number(port);
case EOF:
- SigScm_Error("end in #\n");
+ SigScm_Error("end in #");
default:
- SigScm_Error("Unsupported # : %c\n", c1);
+ SigScm_Error("Unsupported # : %c", c1);
}
break;
/* Error sequence */
case ')':
- SigScm_Error("invalid close parenthesis\n");
+ SigScm_Error("invalid close parenthesis");
break;
case EOF:
return SCM_EOF;
@@ -249,9 +249,9 @@
if (c == EOF) {
if (SCM_PORTINFO_PORTTYPE(port) == PORT_FILE)
- SigScm_Error("EOF inside list. (starting from line %d)\n", line + 1);
+ SigScm_Error("EOF inside list. (starting from line %d)", line + 1);
else
- SigScm_Error("EOF inside list.\n");
+ SigScm_Error("EOF inside list.");
} else if (c == closeParen) {
return list_head;
} else if (c == '.') {
@@ -261,11 +261,11 @@
if (isspace(c2) || c2 == '(' || c2 == '"' || c2 == ';') {
cdr = read_sexpression(port);
if (NULLP(list_tail))
- SigScm_Error(".(dot) at the start of the list.\n");
+ SigScm_Error(".(dot) at the start of the list.");
c = skip_comment_and_space(port);
if (c != ')')
- SigScm_Error("bad dot syntax\n");
+ SigScm_Error("bad dot syntax");
SET_CDR(list_tail, cdr);
return list_head;
@@ -342,7 +342,7 @@
switch (c) {
case EOF:
stringbuf[stringlen] = '\0';
- SigScm_Error("EOF in the string : str = %s\n", stringbuf);
+ SigScm_Error("EOF in the string : str = %s", stringbuf);
break;
case '\"':
@@ -460,7 +460,7 @@
switch (c) {
case EOF:
stringbuf[stringlen] = '\0';
- SigScm_Error("EOF in the char sequence : char = %s\n", stringbuf);
+ SigScm_Error("EOF in the char sequence : char = %s", stringbuf);
break;
case ' ': case '\"': case '\'':
@@ -503,13 +503,13 @@
case 'd': radix = 10; break;
case 'x': radix = 16; break;
default:
- SigScm_Error("ill-formatted number: #%s\n", numstr);
+ SigScm_Error("ill-formatted number: #%s", numstr);
}
/* get num */
number = (int)strtol(numstr+1, &first_nondigit, radix);
if (*first_nondigit)
- SigScm_Error("ill-formatted number: #%s\n", numstr);
+ SigScm_Error("ill-formatted number: #%s", numstr);
/* free str */
free(numstr);
More information about the uim-commit
mailing list