diff --git a/c/argcount.h b/c/argcount.h index aebb8cb..7dad18c 100644 --- a/c/argcount.h +++ b/c/argcount.h @@ -1,4 +1,4 @@ -static void argcount(char *fname, uint32_t nargs, uint32_t c) +static void argcount(const char *fname, uint32_t nargs, uint32_t c) { if (__unlikely(nargs != c)) lerrorf(ArgError, "%s: too %s arguments", fname, diff --git a/c/error_dmc.h b/c/error_dmc.h index 9510883..4254407 100644 --- a/c/error_dmc.h +++ b/c/error_dmc.h @@ -1,7 +1,7 @@ extern void DivideByZeroError(void); #pragma noreturn(DivideByZeroError) -extern void lerrorf(value_t e, char *format, ...); +extern void lerrorf(value_t e, const char *format, ...); #pragma noreturn(lerrorf) extern void lerror(value_t e, const char *msg); @@ -10,8 +10,8 @@ extern void lerror(value_t e, const char *msg); extern void fl_raise(value_t e); #pragma noreturn(fl_raise) -extern void type_error(char *fname, char *expected, value_t got); +extern void type_error(const char *fname, const char *expected, value_t got); #pragma noreturn(type_error) -extern void bounds_error(char *fname, value_t arr, value_t ind); +extern void bounds_error(const char *fname, value_t arr, value_t ind); #pragma noreturn(bounds_error) diff --git a/c/error_gnuc.h b/c/error_gnuc.h index 5cf3287..c5d9898 100644 --- a/c/error_gnuc.h +++ b/c/error_gnuc.h @@ -1,13 +1,14 @@ void DivideByZeroError(void) __attribute__((__noreturn__)); -void lerrorf(value_t e, char *format, ...) __attribute__((__noreturn__)); +void lerrorf(value_t e, const char *format, ...) +__attribute__((__noreturn__)); void lerror(value_t e, const char *msg) __attribute__((__noreturn__)); void fl_raise(value_t e) __attribute__((__noreturn__)); -void type_error(char *fname, char *expected, value_t got) +void type_error(const char *fname, const char *expected, value_t got) __attribute__((__noreturn__)); -void bounds_error(char *fname, value_t arr, value_t ind) +void bounds_error(const char *fname, value_t arr, value_t ind) __attribute__((__noreturn__)); diff --git a/c/error_msc.h b/c/error_msc.h index 289f9c3..e535d27 100644 --- a/c/error_msc.h +++ b/c/error_msc.h @@ -1,13 +1,14 @@ __declspec(noreturn) extern void DivideByZeroError(void); -__declspec(noreturn) extern void lerrorf(value_t e, char *format, ...); +__declspec(noreturn) extern void lerrorf(value_t e, const char *format, ...); __declspec(noreturn) extern void lerror(value_t e, const char *msg); __declspec(noreturn) extern void fl_raise(value_t e); -__declspec(noreturn) extern void type_error(char *fname, char *expected, +__declspec(noreturn) extern void type_error(const char *fname, + const char *expected, value_t got); -__declspec(noreturn) extern void bounds_error(char *fname, value_t arr, +__declspec(noreturn) extern void bounds_error(const char *fname, value_t arr, value_t ind); diff --git a/c/error_watcomc.h b/c/error_watcomc.h index cf04235..f281e74 100644 --- a/c/error_watcomc.h +++ b/c/error_watcomc.h @@ -2,7 +2,7 @@ extern void DivideByZeroError(void); #pragma aux lerrorf aborts; -extern void lerrorf(value_t e, char *format, ...); +extern void lerrorf(value_t e, const char *format, ...); #pragma aux lerror aborts; extern void lerror(value_t e, const char *msg); @@ -11,7 +11,7 @@ extern void lerror(value_t e, const char *msg); extern void fl_raise(value_t e); #pragma aux type_error aborts; -extern void type_error(char *fname, char *expected, value_t got); +extern void type_error(const char *fname, const char *expected, value_t got); #pragma aux bounds_error aborts; -extern void bounds_error(char *fname, value_t arr, value_t ind); +extern void bounds_error(const char *fname, value_t arr, value_t ind); diff --git a/c/flisp.c b/c/flisp.c index 92c218b..52dd3a6 100644 --- a/c/flisp.c +++ b/c/flisp.c @@ -208,7 +208,7 @@ void fl_raise(value_t e) longjmp(thisctx->buf, 1); } -static value_t make_error_msg(char *format, va_list args) +static value_t make_error_msg(const char *format, va_list args) { char msgbuf[512]; @@ -216,7 +216,7 @@ static value_t make_error_msg(char *format, va_list args) return string_from_cstr(msgbuf); } -void lerrorf(value_t e, char *format, ...) +void lerrorf(value_t e, const char *format, ...) { va_list args; value_t msg; @@ -239,12 +239,12 @@ void lerror(value_t e, const char *msg) fl_raise(fl_list2(e, m)); } -void type_error(char *fname, char *expected, value_t got) +void type_error(const char *fname, const char *expected, value_t got) { fl_raise(fl_listn(4, TypeError, symbol(fname), symbol(expected), got)); } -void bounds_error(char *fname, value_t arr, value_t ind) +void bounds_error(const char *fname, value_t arr, value_t ind) { fl_raise(fl_listn(4, BoundsError, symbol(fname), arr, ind)); } diff --git a/c/flisp.h b/c/flisp.h index 722cf59..220cb3d 100644 --- a/c/flisp.h +++ b/c/flisp.h @@ -335,7 +335,7 @@ int fl_isstring(value_t v); int fl_isnumber(value_t v); int fl_isgensym(value_t v); int fl_isiostream(value_t v); -struct ios *fl_toiostream(value_t v, char *fname); +struct ios *fl_toiostream(value_t v, const char *fname); value_t cvalue_compare(value_t a, value_t b); int numeric_compare(value_t a, value_t b, int eq, int eqnans, char *fname); diff --git a/c/iostream.c b/c/iostream.c index 72c9c69..43f3192 100644 --- a/c/iostream.c +++ b/c/iostream.c @@ -81,14 +81,14 @@ value_t fl_eof_objectp(value_t *args, uint32_t nargs) return (FL_EOF == args[0]) ? FL_T : FL_F; } -static struct ios *toiostream(value_t v, char *fname) +static struct ios *toiostream(value_t v, const char *fname) { if (!fl_isiostream(v)) type_error(fname, "iostream", v); return value2c(struct ios *, v); } -struct ios *fl_toiostream(value_t v, char *fname) +struct ios *fl_toiostream(value_t v, const char *fname) { return toiostream(v, fname); }