summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-07 06:56:51 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-07 06:56:51 -0800
commit472b34daf3787e0a05891a1f1cdfc89316b8fc8b (patch)
tree906f7bb5aa916e9688b800929df84cacedf8ff24
parentb0828e2dd7540651aa6863c8bc7814d86ad9401e (diff)
downloadtxr-472b34daf3787e0a05891a1f1cdfc89316b8fc8b.tar.gz
txr-472b34daf3787e0a05891a1f1cdfc89316b8fc8b.tar.bz2
txr-472b34daf3787e0a05891a1f1cdfc89316b8fc8b.zip
Fix wrong uses of ~s for function name string.
* ffi.c (make_ffi_type_enum): Use ~a for function name rather than ~s because it's a string which is quoted under ~s. * lib.c (chk_xalloc, string_extend, find_symbol, intern_fallback): Likewise. * stream.c (open_process, run): Likewise. * sysif.c (exec_wrap, setgroups_wrap, dlclose_wrap): Likewise.
-rw-r--r--ffi.c14
-rw-r--r--lib.c10
-rw-r--r--stream.c6
-rw-r--r--sysif.c6
4 files changed, 18 insertions, 18 deletions
diff --git a/ffi.c b/ffi.c
index 2e67192e..93d6a2a2 100644
--- a/ffi.c
+++ b/ffi.c
@@ -3158,13 +3158,13 @@ static val make_ffi_type_enum(val syntax, val enums,
if (symbolp(en)) {
val sym = en;
if (!bindable(sym))
- uw_throwf(error_s, lit("~s: ~s member ~s isn't a bindable symbol"),
+ uw_throwf(error_s, lit("~a: ~s member ~s isn't a bindable symbol"),
self, syntax, sym, nao);
if (cur == INT_MAX)
- uw_throwf(error_s, lit("~s: ~s overflow at member ~s"),
+ uw_throwf(error_s, lit("~a: ~s overflow at member ~s"),
self, syntax, sym, nao);
if (gethash(num_sym, sym))
- uw_throwf(error_s, lit("~s: ~s duplicate member ~s"),
+ uw_throwf(error_s, lit("~a: ~s duplicate member ~s"),
self, syntax, sym, nao);
sethash(num_sym, sym, nn = num(++cur));
sethash(sym_num, nn, sym);
@@ -3177,22 +3177,22 @@ static val make_ffi_type_enum(val syntax, val enums,
val sym = car(en);
val n;
if (!bindable(sym))
- uw_throwf(error_s, lit("~s: ~s member ~s isn't a bindable symbol"),
+ uw_throwf(error_s, lit("~a: ~s member ~s isn't a bindable symbol"),
self, syntax, sym, nao);
if (gethash(num_sym, sym))
- uw_throwf(error_s, lit("~s: ~s duplicate member ~s"),
+ uw_throwf(error_s, lit("~a: ~s duplicate member ~s"),
self, syntax, sym, nao);
n = ffi_eval_expr(expr, shadow_menv, enum_env);
if (!integerp(n)) {
- uw_throwf(error_s, lit("~s: ~s member ~s value ~s not integer"),
+ uw_throwf(error_s, lit("~a: ~s member ~s value ~s not integer"),
self, syntax, n, nao);
}
cur = c_num(n);
if (cur > INT_MAX)
- uw_throwf(error_s, lit("~s: ~s member ~s value ~s too large"),
+ uw_throwf(error_s, lit("~a: ~s member ~s value ~s too large"),
self, syntax, n, nao);
sethash(num_sym, sym, nn = num(cur));
sethash(sym_num, nn, sym);
diff --git a/lib.c b/lib.c
index d5379143..e008eca2 100644
--- a/lib.c
+++ b/lib.c
@@ -2844,7 +2844,7 @@ mem_t *chk_xalloc(ucnum m, ucnum n, val self)
size_t size = mn;
if ((m > 0 && mn / m != n) || (ucnum) size != mn)
- uw_throwf(error_s, lit("~s: memory allocation size overflow"),
+ uw_throwf(error_s, lit("~a: memory allocation size overflow"),
self, nao);
return chk_malloc(size);
@@ -3640,10 +3640,10 @@ val string_extend(val str, val tail)
else if (integerp(tail))
delta = c_fixnum(tail, self);
else
- uw_throwf(error_s, lit("~s: tail ~s bad type"), self, str, nao);
+ uw_throwf(error_s, lit("~a: tail ~s bad type"), self, str, nao);
if (NUM_MAX - delta - 1 < len)
- uw_throwf(error_s, lit("~s: overflow"), self, nao);
+ uw_throwf(error_s, lit("~a: overflow"), self, nao);
needed = len + delta + 1;
@@ -5494,7 +5494,7 @@ val find_symbol(val str, val package_in)
val found, sym;
if (!stringp(str))
- uw_throwf(error_s, lit("~s: name ~s isn't a string"), self, str, nao);
+ uw_throwf(error_s, lit("~a: name ~s isn't a string"), self, str, nao);
if ((sym = gethash_f(package->pk.symhash, str, mkcloc(found))) || found)
return sym;
@@ -5605,7 +5605,7 @@ val intern_fallback(val str, val package_in)
val fblist = get_hash_userdata(package->pk.symhash);
if (!stringp(str))
- uw_throwf(error_s, lit("~s: name ~s isn't a string"), self, str, nao);
+ uw_throwf(error_s, lit("~a: name ~s isn't a string"), self, str, nao);
if (fblist) {
val found;
diff --git a/stream.c b/stream.c
index 9d67745f..1b6f831a 100644
--- a/stream.c
+++ b/stream.c
@@ -3949,7 +3949,7 @@ val open_process(val name, val mode_str, val args)
fds_swizzle(&sfds, (input ? FDS_IN : FDS_OUT) | FDS_ERR);
if (nargs < 0 || nargs == INT_MAX)
- uw_throwf(error_s, lit("~s: argument list overflow"), self, nao);
+ uw_throwf(error_s, lit("~a: argument list overflow"), self, nao);
argv = coerce(char **, chk_xalloc(nargs + 1, sizeof *argv, self));
@@ -4145,7 +4145,7 @@ static val run(val name, val args)
nargs = c_num(length(args)) + 1;
if (nargs < 0 || nargs == INT_MAX)
- uw_throwf(error_s, lit("~s: argument list overflow"), self, nao);
+ uw_throwf(error_s, lit("~a: argument list overflow"), self, nao);
argv = coerce(char **, chk_xalloc(nargs + 1, sizeof *argv, self));
@@ -4226,7 +4226,7 @@ static val run(val command, val args)
fds_swizzle(&sfds, FDS_IN | FDS_OUT | FDS_ERR);
if (nargs < 0 || nargs == INT_MAX)
- uw_throwf(error_s, lit("~s: argument list overflow"), self, nao);
+ uw_throwf(error_s, lit("~a: argument list overflow"), self, nao);
wargv = coerce(const wchar_t **, chk_xalloc(nargs + 1, sizeof *wargv, self));
diff --git a/sysif.c b/sysif.c
index 1020f075..b3b9c5b9 100644
--- a/sysif.c
+++ b/sysif.c
@@ -572,7 +572,7 @@ val exec_wrap(val file, val args_opt)
val args = default_null_arg(args_opt);
int nargs = c_num(length(args)) + 1;
char **argv = if3(nargs < 0 || nargs == INT_MAX,
- (uw_throwf(file_error_s, lit("~s: argument list overflow"),
+ (uw_throwf(file_error_s, lit("~a: argument list overflow"),
self, nao), convert(char **, 0)),
coerce(char **, chk_xalloc(nargs + 1, sizeof *argv, self)));
val iter;
@@ -1074,7 +1074,7 @@ static val setgroups_wrap(val list)
ucnum len = c_num(length(list));
if (convert(ucnum, convert(size_t, len)) != len) {
- uw_throwf(system_error_s, lit("~s: list too long"), self, nao);
+ uw_throwf(system_error_s, lit("~a: list too long"), self, nao);
} else {
gid_t *arr = coerce(gid_t *, chk_xalloc(len, sizeof *arr, self));
int i = 0, res;
@@ -1508,7 +1508,7 @@ static val dlclose_wrap(val cptr)
val self = lit("dlclose");
mem_t *ptr = cptr_handle(cptr, dlhandle_s, self);
if (cptr->co.ops != &cptr_dl_ops)
- uw_throwf(error_s, lit("~s: object ~s isn't a handle from dlopen"),
+ uw_throwf(error_s, lit("~a: object ~s isn't a handle from dlopen"),
self, cptr, nao);
if (ptr != 0) {
int res = dlclose(ptr);