diff options
-rw-r--r-- | args.c | 35 | ||||
-rw-r--r-- | args.h | 70 | ||||
-rw-r--r-- | arith.c | 38 | ||||
-rw-r--r-- | eval.c | 98 | ||||
-rw-r--r-- | ffi.c | 4 | ||||
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | hash.c | 20 | ||||
-rw-r--r-- | lib.c | 76 | ||||
-rw-r--r-- | lib.h | 92 | ||||
-rw-r--r-- | parser.c | 2 | ||||
-rw-r--r-- | stream.c | 8 | ||||
-rw-r--r-- | struct.c | 30 | ||||
-rw-r--r-- | struct.h | 10 | ||||
-rw-r--r-- | syslog.c | 2 | ||||
-rw-r--r-- | syslog.h | 2 | ||||
-rw-r--r-- | unwind.c | 20 | ||||
-rw-r--r-- | vm.c | 2 | ||||
-rw-r--r-- | vm.h | 2 |
18 files changed, 256 insertions, 257 deletions
@@ -37,16 +37,16 @@ #include "gc.h" #include "args.h" -val args_cons_list(struct args *args); +val args_cons_list(varg args); -val args_add_checked(val name, struct args *args, val arg) +val args_add_checked(val name, varg args, val arg) { if (args->fill >= args->argc) uw_throwf(assert_s, lit("~a: argument list size exceeded"), name, nao); return args_add(args, arg); } -void args_normalize_exact(struct args *args, cnum fill) +void args_normalize_exact(varg args, cnum fill) { bug_unless (fill <= args->argc); @@ -58,7 +58,7 @@ void args_normalize_exact(struct args *args, cnum fill) } -void args_normalize_least(struct args *args, cnum minfill) +void args_normalize_least(varg args, cnum minfill) { bug_unless (minfill <= args->argc); @@ -66,7 +66,7 @@ void args_normalize_least(struct args *args, cnum minfill) args_add(args, pop(&args->list)); } -void args_normalize_fill(struct args *args, cnum minfill, cnum maxfill) +void args_normalize_fill(varg args, cnum minfill, cnum maxfill) { args_normalize_least(args, maxfill); @@ -75,14 +75,14 @@ void args_normalize_fill(struct args *args, cnum minfill, cnum maxfill) args_add(args, colon_k); } -val args_get_checked(val name, struct args *args, cnum *arg_index) +val args_get_checked(val name, varg args, cnum *arg_index) { if (*arg_index >= args->fill && !args->list) uw_throwf(assert_s, lit("~a: insufficient arguments"), name, nao); return args_get(args, arg_index); } -struct args *args_copy(struct args *to, struct args *from) +varg args_copy(varg to, varg from) { to->fill = from->fill; to->list = from->list; @@ -90,14 +90,14 @@ struct args *args_copy(struct args *to, struct args *from) return to; } -struct args *args_copy_zap(struct args *to, struct args *from) +varg args_copy_zap(varg to, varg from) { args_copy(to, from); memset(from->arg, 0, sizeof *from->arg * from->fill); return to; } -struct args *args_cat(struct args *to, struct args *from) +varg args_cat(varg to, varg from) { size_t size = sizeof *from->arg * from->fill; to->list = from->list; @@ -106,7 +106,7 @@ struct args *args_cat(struct args *to, struct args *from) return to; } -struct args *args_cat_zap(struct args *to, struct args *from) +varg args_cat_zap(varg to, varg from) { size_t size = sizeof *from->arg * from->fill; to->list = from->list; @@ -116,7 +116,7 @@ struct args *args_cat_zap(struct args *to, struct args *from) return to; } -struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index) +varg args_cat_zap_from(varg to, varg from, cnum index) { size_t size = sizeof *from->arg * (from->fill - index); to->list = from->list; @@ -126,7 +126,7 @@ struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index) return to; } -struct args *args_copy_reverse(struct args *to, struct args *from, cnum nargs) +varg args_copy_reverse(varg to, varg from, cnum nargs) { cnum i, index = 0; @@ -137,7 +137,7 @@ struct args *args_copy_reverse(struct args *to, struct args *from, cnum nargs) return to; } -val args_copy_to_list(struct args *args) +val args_copy_to_list(varg args) { list_collect_decl (out, ptail); cnum i; @@ -150,7 +150,7 @@ val args_copy_to_list(struct args *args) return out; } -void args_for_each(struct args *args, +void args_for_each(varg args, int (*fn)(val arg, int ix, mem_t *ctx), mem_t *ctx) { @@ -199,7 +199,7 @@ static int args_key_check_store(val arg, int ix, mem_t *ctx) return 0; } -void args_keys_extract(struct args *args, struct args_bool_key *akv, int n) +void args_keys_extract(varg args, struct args_bool_key *akv, int n) { if (n > 0) { struct args_bool_ctx acx; @@ -210,11 +210,10 @@ void args_keys_extract(struct args *args, struct args_bool_key *akv, int n) } } -val dyn_args(struct args *args, val car, val cdr) +val dyn_args(varg args, val car, val cdr) { size_t size = offsetof(struct args, arg) + sizeof (val) * args->argc; - struct args *copy = coerce(struct args *, chk_copy_obj(coerce(mem_t *, args), - size)); + varg copy = coerce(varg , chk_copy_obj(coerce(mem_t *, args), size)); val obj = make_obj(); obj->a.type = DARG; @@ -46,7 +46,7 @@ struct args_bool_key { val *store; }; -INLINE struct args *args_init_list(struct args *args, cnum argc, val list) +INLINE varg args_init_list(varg args, cnum argc, val list) { args->argc = argc; args->fill = 0; @@ -54,14 +54,14 @@ INLINE struct args *args_init_list(struct args *args, cnum argc, val list) return args; } -INLINE void args_set_fill(struct args *args, cnum fill) +INLINE void args_set_fill(varg args, cnum fill) { args->fill = fill; } #define args_decl_list(NAME, N, L) \ struct { struct args args; val arg[(N) - 1]; } _ac; \ - struct args *NAME = args_init_list(&_ac.args, N, L) + varg NAME = args_init_list(&_ac.args, N, L) #define args_decl_constsize(NAME, N) args_decl_list(NAME, N, nil) @@ -69,17 +69,17 @@ INLINE void args_set_fill(struct args *args, cnum fill) mem_t *NAME ## _mem = \ coerce(mem_t *, \ alloca(offsetof(struct args, arg) + (N)*sizeof (val))); \ - struct args *NAME = args_init_list(coerce(struct args *, \ + varg NAME = args_init_list(coerce(varg , \ NAME ## _mem), N, L) #define args_decl(NAME, N) args_decl_list_dyn(NAME, N, nil) -INLINE val args_add(struct args *args, val arg) +INLINE val args_add(varg args, val arg) { return args->arg[args->fill++] = arg; } -INLINE void args_add2(struct args *args, val arg1, val arg2) +INLINE void args_add2(varg args, val arg1, val arg2) { val *arg = args->arg + args->fill; args->fill += 2; @@ -87,7 +87,7 @@ INLINE void args_add2(struct args *args, val arg1, val arg2) *arg++ = arg2; } -INLINE void args_add3(struct args *args, val arg1, val arg2, val arg3) +INLINE void args_add3(varg args, val arg1, val arg2, val arg3) { val *arg = args->arg + args->fill; args->fill += 3; @@ -96,7 +96,7 @@ INLINE void args_add3(struct args *args, val arg1, val arg2, val arg3) *arg++ = arg3; } -INLINE void args_add4(struct args *args, val arg1, val arg2, val arg3, val arg4) +INLINE void args_add4(varg args, val arg1, val arg2, val arg3, val arg4) { val *arg = args->arg + args->fill; args->fill += 4; @@ -106,7 +106,7 @@ INLINE void args_add4(struct args *args, val arg1, val arg2, val arg3, val arg4) *arg++ = arg4; } -INLINE void args_add5(struct args *args, val arg1, val arg2, val arg3, +INLINE void args_add5(varg args, val arg1, val arg2, val arg3, val arg4, val arg5) { val *arg = args->arg + args->fill; @@ -118,19 +118,19 @@ INLINE void args_add5(struct args *args, val arg1, val arg2, val arg3, *arg++ = arg5; } -val args_add_checked(val name, struct args *args, val arg); +val args_add_checked(val name, varg args, val arg); -INLINE void args_add_list(struct args *args, val list) +INLINE void args_add_list(varg args, val list) { args->list = list; } -INLINE int args_more(struct args *args, cnum index) +INLINE int args_more(varg args, cnum index) { return index < args->fill || args->list; } -INLINE int args_two_more(struct args *args, cnum index) +INLINE int args_two_more(varg args, cnum index) { return index + 1 < args->fill || @@ -138,16 +138,16 @@ INLINE int args_two_more(struct args *args, cnum index) cdr(args->list); } -INLINE int args_more_nozap(struct args *args, cnum index, val list) +INLINE int args_more_nozap(varg args, cnum index, val list) { return list || index < args->fill; } -void args_normalize_exact(struct args *args, cnum fill); -void args_normalize_least(struct args *args, cnum fill); -void args_normalize_fill(struct args *args, cnum minfill, cnum maxfill); +void args_normalize_exact(varg args, cnum fill); +void args_normalize_least(varg args, cnum fill); +void args_normalize_fill(varg args, cnum minfill, cnum maxfill); -INLINE val args_get_list(struct args *args) +INLINE val args_get_list(varg args) { if (args->fill == 0) return z(args->list); @@ -155,7 +155,7 @@ INLINE val args_get_list(struct args *args) return z(args->list); } -INLINE val args_get_rest(struct args *args, cnum index) +INLINE val args_get_rest(varg args, cnum index) { if (args->fill == index) return z(args->list); @@ -163,14 +163,14 @@ INLINE val args_get_rest(struct args *args, cnum index) return z(args->list); } -INLINE val args_at(struct args *args, cnum arg_index) +INLINE val args_at(varg args, cnum arg_index) { if (arg_index < args->fill) return args->arg[arg_index]; return car(args->list); } -INLINE val args_atz(struct args *args, cnum arg_index) +INLINE val args_atz(varg args, cnum arg_index) { if (arg_index < args->fill) { return z(args->arg[arg_index]); @@ -179,35 +179,35 @@ INLINE val args_atz(struct args *args, cnum arg_index) } } -INLINE val args_get(struct args *args, cnum *arg_index) +INLINE val args_get(varg args, cnum *arg_index) { if (*arg_index < args->fill) return z(args->arg[(*arg_index)++]); return pop(&args->list); } -INLINE val args_get_nozap(struct args *args, cnum *arg_index, val *list) +INLINE val args_get_nozap(varg args, cnum *arg_index, val *list) { if (*arg_index < args->fill) return args->arg[(*arg_index)++]; return pop(list); } -INLINE cnum args_count(struct args *args, val self) +INLINE cnum args_count(varg args, val self) { return args->fill + c_num(length_list(args->list), self); } -val args_get_checked(val name, struct args *args, cnum *arg_index); -struct args *args_copy(struct args *to, struct args *from); -struct args *args_copy_zap(struct args *to, struct args *from); -struct args *args_cat(struct args *to, struct args *from); -struct args *args_cat_zap(struct args *to, struct args *from); -struct args *args_cat_zap_from(struct args *to, struct args *from, cnum index); -struct args *args_copy_reverse(struct args *to, struct args *from, cnum nargs); -val args_copy_to_list(struct args *args); -void args_for_each(struct args *args, +val args_get_checked(val name, varg args, cnum *arg_index); +varg args_copy(varg to, varg from); +varg args_copy_zap(varg to, varg from); +varg args_cat(varg to, varg from); +varg args_cat_zap(varg to, varg from); +varg args_cat_zap_from(varg to, varg from, cnum index); +varg args_copy_reverse(varg to, varg from, cnum nargs); +val args_copy_to_list(varg args); +void args_for_each(varg args, int (*fn)(val arg, int ix, mem_t *ctx), mem_t *ctx); -void args_keys_extract(struct args *args, struct args_bool_key *, int n); -val dyn_args(struct args *args, val car, val cdr); +void args_keys_extract(varg args, struct args_bool_key *, int n); +val dyn_args(varg args, val car, val cdr); @@ -4108,7 +4108,7 @@ bad4: do_mp_error(self, mpe); } -val maskv(struct args *bits) +val maskv(varg bits) { cnum index = 0; val accum = zero; @@ -4819,7 +4819,7 @@ val arithp(val obj) val nary_op(val self, val (*bfun)(val, val), val (*ufun)(val self, val), - struct args *args, val emptyval) + varg args, val emptyval) { val acc, next; cnum index = 0; @@ -4841,7 +4841,7 @@ val nary_op(val self, val (*bfun)(val, val), } val nary_simple_op(val (*bfun)(val, val), - struct args *args, val firstval) + varg args, val firstval) { val acc = firstval, next; cnum index = 0; @@ -4933,12 +4933,12 @@ static val unary_int(val self, val arg) return arg; } -val plusv(struct args *nlist) +val plusv(varg nlist) { return nary_op(plus_s, plus, unary_arith, nlist, zero); } -val minusv(val minuend, struct args *nlist) +val minusv(val minuend, varg nlist) { val acc = minuend, next; cnum index = 0; @@ -4954,12 +4954,12 @@ val minusv(val minuend, struct args *nlist) return acc; } -val mulv(struct args *nlist) +val mulv(varg nlist) { return nary_op(mul_s, mul, unary_num, nlist, one); } -val divv(val dividend, struct args *nlist) +val divv(val dividend, varg nlist) { val acc = dividend, next; cnum index = 0; @@ -4975,17 +4975,17 @@ val divv(val dividend, struct args *nlist) return acc; } -val logandv(struct args *nlist) +val logandv(varg nlist) { return nary_op(logand_s, logand, unary_int, nlist, negone); } -val logiorv(struct args *nlist) +val logiorv(varg nlist) { return nary_op(logior_s, logior, unary_int, nlist, zero); } -val gtv(val first, struct args *rest) +val gtv(val first, varg rest) { cnum index = 0; @@ -5002,7 +5002,7 @@ val gtv(val first, struct args *rest) return t; } -val ltv(val first, struct args *rest) +val ltv(val first, varg rest) { cnum index = 0; @@ -5019,7 +5019,7 @@ val ltv(val first, struct args *rest) return t; } -val gev(val first, struct args *rest) +val gev(val first, varg rest) { cnum index = 0; @@ -5036,7 +5036,7 @@ val gev(val first, struct args *rest) return t; } -val lev(val first, struct args *rest) +val lev(val first, varg rest) { cnum index = 0; @@ -5053,7 +5053,7 @@ val lev(val first, struct args *rest) return t; } -val numeqv(val first, struct args *rest) +val numeqv(val first, varg rest) { cnum index = 0; @@ -5070,7 +5070,7 @@ val numeqv(val first, struct args *rest) return t; } -val numneqv(struct args *args) +val numneqv(varg args) { if (!args->list) { cnum i, j, n = args->fill; @@ -5122,7 +5122,7 @@ static val rexpt(val right, val left) return expt(left, right); } -val exptv(struct args *nlist) +val exptv(varg nlist) { val self = lit("exptv"); cnum nargs = args_count(nlist, self); @@ -5137,12 +5137,12 @@ static val abso_self(val self, val arg) return abso(arg); } -val gcdv(struct args *nlist) +val gcdv(varg nlist) { return nary_op(lit("gcd"), gcd, abso_self, nlist, zero); } -val lcmv(struct args *nlist) +val lcmv(varg nlist) { return nary_op(lit("lcm"), lcm, abso_self, nlist, zero); } @@ -5153,7 +5153,7 @@ static struct cobj_ops psq_ops = cobj_ops_init(cobj_equal_handle_op, cobj_mark_op, cobj_handle_hash_op); -static val quant_fun(val psqo, struct args *args) +static val quant_fun(val psqo, varg args) { val self = lit("quantile"); cnum idx = 0; @@ -972,7 +972,7 @@ INLINE void lex_or_dyn_bind(val *dyn_made, val lex_env, val sym, val obj) } } -static val bind_args(val env, val params, struct args *args, val ctx) +static val bind_args(val env, val params, varg args, val ctx) { val new_env = make_env(nil, nil, env); val dyn_env_made = nil; @@ -1384,7 +1384,7 @@ static val apply_intrinsic_frob_args(val args) } } -val applyv(val fun, struct args *args) +val applyv(val fun, varg args) { args_normalize_least(args, 1); @@ -1406,7 +1406,7 @@ static loc term(loc head) return head; } -static val iapply(val fun, struct args *args) +static val iapply(val fun, varg args) { cnum index = 0; list_collect_decl (mod_args, ptail); @@ -1437,7 +1437,7 @@ static val iapply(val fun, struct args *args) return apply(fun, z(mod_args)); } -static val list_star_intrinsic(struct args *args) +static val list_star_intrinsic(varg args) { return apply_frob_args(args_get_list(args)); } @@ -1588,7 +1588,7 @@ static val do_eval(val form, val env, static void do_eval_args(val form, val env, val ctx, val (*lookup)(val env, val sym), - struct args *args) + varg args) { for (; form; form = cdr(form)) args_add(args, do_eval(car(form), env, ctx, lookup)); @@ -1601,7 +1601,7 @@ val set_dyn_env(val de) return old; } -val funcall_interp(val interp_fun, struct args *args) +val funcall_interp(val interp_fun, varg args) { val env = interp_fun->f.env; val fun = interp_fun->f.f.interp_fun; @@ -1759,7 +1759,7 @@ val eval(val form, val env, val ctx) return do_eval(form, env, ctx, &lookup_var); } -static void eval_args_lisp1(val form, val env, val ctx, struct args *args) +static void eval_args_lisp1(val form, val env, val ctx, varg args) { do_eval_args(form, env, ctx, &lookup_sym_lisp1, args); } @@ -3090,7 +3090,7 @@ static val fmt_simple(val obj, val n, val sep, nil); } -static val fmt_flex(val obj, val plist, struct args *args) +static val fmt_flex(val obj, val plist, varg args) { cnum ix = 0; val n = zero, sep = lit(" "); @@ -4783,7 +4783,7 @@ static void run_load_hooks_atexit(void) run_load_hooks(dyn_env); } -val loadv(val target, struct args *load_args) +val loadv(val target, varg load_args) { val self = lit("load"); uses_or2; @@ -4876,7 +4876,7 @@ val load(val target) return loadv(target, load_args); } -static val rt_load_for(struct args *args) +static val rt_load_for(varg args) { val self = lit("sys:rt-load-for"); cnum index = 0; @@ -5464,7 +5464,7 @@ val expand(val form, val menv) return ret; } -static val muffle_unbound_warning(val exc, struct args *args) +static val muffle_unbound_warning(val exc, varg args) { (void) exc; @@ -5494,7 +5494,7 @@ static val no_warn_expand(val form, val menv) return ret; } -static val gather_free_refs(val info_cons, val exc, struct args *args) +static val gather_free_refs(val info_cons, val exc, varg args) { val self = lit("expand-with-free-refs"); (void) exc; @@ -5521,7 +5521,7 @@ static val gather_free_refs(val info_cons, val exc, struct args *args) } static val gather_free_refs_nw(val info_cons, val exc, - struct args *args) + varg args) { gather_free_refs(info_cons, exc, args); return uw_rthrow(continue_s, nil); @@ -5721,7 +5721,7 @@ static val me_l1_setq(val form, val menv) } static val rt_assert_fail(val file, val line, val expr, - val fmt, struct args *args) + val fmt, varg args) { val str_stream = make_string_output_stream(); @@ -5777,7 +5777,7 @@ static val abscond_star(val name, val retval) abort(); } -static val map_common(val self, val fun, struct args *lists, +static val map_common(val self, val fun, varg lists, loc (*collect_fn)(loc ptail, val obj), val (*map_fn)(val fun, val seq)) { @@ -5823,7 +5823,7 @@ static val map_common(val self, val fun, struct args *lists, } } -val mapcarv(val fun, struct args *lists) +val mapcarv(val fun, varg lists) { return map_common(lit("mapcar"), fun, lists, list_collect, mapcar); } @@ -5834,12 +5834,12 @@ val mapcarl(val fun, val list_of_lists) return mapcarv(fun, args); } -static val mappendv(val fun, struct args *lists) +static val mappendv(val fun, varg lists) { return map_common(lit("mappend"), fun, lists, list_collect_append, mappend); } -static val mapdov(val fun, struct args *lists) +static val mapdov(val fun, varg lists) { return map_common(lit("mapdo"), fun, lists, 0, mapdo); } @@ -5882,7 +5882,7 @@ static val lazy_mapcarv_func(val env, val lcons) return nil; } -static val lazy_mapcarv(val fun, struct args *lists) +static val lazy_mapcarv(val fun, varg lists) { if (!args_more(lists, 0)) { return nil; @@ -5906,14 +5906,14 @@ static val lazy_mapcarl(val fun, val list_of_lists) return lazy_mapcarv(fun, args); } -static val lazy_mappendv(val fun, struct args *lists) +static val lazy_mappendv(val fun, varg lists) { return lazy_appendl(lazy_mapcarv(fun, lists)); } -static val prod_common(val self, val fun, struct args *lists, +static val prod_common(val self, val fun, varg lists, loc (*collect_fn)(loc ptail, val obj), - val (*mapv_fn)(val fun, struct args *lists)) + val (*mapv_fn)(val fun, varg lists)) { if (!args_more(lists, 0)) { return nil; @@ -5963,17 +5963,17 @@ static val prod_common(val self, val fun, struct args *lists, } } -val maprodv(val fun, struct args *lists) +val maprodv(val fun, varg lists) { return prod_common(lit("maprod"), fun, lists, list_collect, mapcarv); } -val maprendv(val fun, struct args *lists) +val maprendv(val fun, varg lists) { return prod_common(lit("maprend"), fun, lists, list_collect_append, mappendv); } -static val maprodo(val fun, struct args *lists) +static val maprodo(val fun, varg lists) { return prod_common(lit("maprodo"), fun, lists, 0, mapdov); } @@ -6339,14 +6339,14 @@ static val rlist_star_fun(val item) return cons(item, nil); } -static val rlist(struct args *items) +static val rlist(varg items) { args_decl_list(lists, ARGS_MIN, lazy_mapcar(func_n1(rlist_fun), args_get_list(items))); return lazy_appendv(lists); } -static val rlist_star(struct args *items) +static val rlist_star(varg items) { args_decl_list(lists, ARGS_MIN, lazy_mapcar(func_n1(rlist_star_fun), args_get_list(items))); @@ -6610,7 +6610,7 @@ static val weave_gen(val env) return ret; } -static val weavev(struct args *args) +static val weavev(varg args) { val lists = args_get_list(args); val uniq = cons(nil, nil); @@ -6701,7 +6701,7 @@ static val if_fun(val cond, val then, val alt) return if3(cond, then, default_null_arg(alt)); } -static val or_fun(struct args *vals) +static val or_fun(varg vals) { cnum index = 0; @@ -6713,12 +6713,12 @@ static val or_fun(struct args *vals) return nil; } -static val nor_fun(struct args *vals) +static val nor_fun(varg vals) { return tnil(!or_fun(vals)); } -static val and_fun(struct args *vals) +static val and_fun(varg vals) { val item = t; cnum index = 0; @@ -6732,22 +6732,22 @@ static val and_fun(struct args *vals) return item; } -static val nand_fun(struct args *vals) +static val nand_fun(varg vals) { return tnil(!and_fun(vals)); } -static val progn_fun(struct args *vals) +static val progn_fun(varg vals) { return if3(vals->list, car(lastcons(vals->list)), vals->arg[vals->fill - 1]); } -static val prog1_fun(struct args *vals) +static val prog1_fun(varg vals) { return if2(args_more(vals, 0), args_at(vals, 0)); } -static val prog2_fun(struct args *vals) +static val prog2_fun(varg vals) { args_normalize_least(vals, 2); return if2(vals->fill >= 2, vals->arg[1]); @@ -6758,19 +6758,19 @@ static val not_null(val obj) return if3(nilp(obj), nil, t); } -static val tf(struct args *args) +static val tf(varg args) { (void) args; return t; } -static val nilf(struct args *args) +static val nilf(varg args) { (void) args; return nil; } -static val do_retf(val ret, struct args *args) +static val do_retf(val ret, varg args) { (void) args; return ret; @@ -6781,16 +6781,16 @@ val retf(val ret) return func_f0v(ret, do_retf); } -static val do_apf(val fun, struct args *args) +static val do_apf(val fun, varg args) { return applyv(fun, args); } -static val do_args_apf(val dargs, struct args *args) +static val do_args_apf(val dargs, varg args) { val self = lit("apf"); val fun = dargs->a.car; - struct args *da = dargs->a.args; + varg da = dargs->a.args; cnum da_nargs = da->fill + c_num(length(da->list), self); args_decl(args_call, max(args->fill + da_nargs, ARGS_MIN)); args_copy(args_call, da); @@ -6800,7 +6800,7 @@ static val do_args_apf(val dargs, struct args *args) return applyv(fun, args_call); } -static val apf(val fun, struct args *args) +static val apf(val fun, varg args) { if (!args || !args_more(args, 0)) return func_f0v(fun, do_apf); @@ -6808,16 +6808,16 @@ static val apf(val fun, struct args *args) return func_f0v(dyn_args(args, fun, nil), do_args_apf); } -static val do_ipf(val fun, struct args *args) +static val do_ipf(val fun, varg args) { return iapply(fun, args); } -static val do_args_ipf(val dargs, struct args *args) +static val do_args_ipf(val dargs, varg args) { val self = lit("ipf"); val fun = dargs->a.car; - struct args *da = dargs->a.args; + varg da = dargs->a.args; cnum da_nargs = da->fill + c_num(length(da->list), self); args_decl(args_call, max(args->fill + da_nargs, ARGS_MIN)); args_copy(args_call, da); @@ -6828,7 +6828,7 @@ static val do_args_ipf(val dargs, struct args *args) } -static val ipf(val fun, struct args *args) +static val ipf(val fun, varg args) { if (!args || !args_more(args, 0)) return func_f0v(fun, do_ipf); @@ -6836,21 +6836,21 @@ static val ipf(val fun, struct args *args) return func_f0v(dyn_args(args, fun, nil), do_args_ipf); } -static val callf(val func, struct args *funlist) +static val callf(val func, varg funlist) { val juxt_fun = juxtv(funlist); val apf_fun = apf(func, 0); return chain(juxt_fun, apf_fun, nao); } -static val do_mapf(val env, struct args *args) +static val do_mapf(val env, varg args) { cons_bind (fun, funlist, env); val mapped_args = mapcarl(call_f, cons(funlist, cons(args_get_list(args), nil))); return apply(fun, z(mapped_args)); } -static val mapf(val fun, struct args *funlist) +static val mapf(val fun, varg funlist) { return func_f0v(cons(fun, args_get_list(funlist)), do_mapf); } @@ -5472,7 +5472,7 @@ val ffi_make_call_desc(val ntotal, val nfixed, val rettype, val argtypes, return obj; } -val ffi_call_wrap(val fptr, val ffi_call_desc, struct args *args) +val ffi_call_wrap(val fptr, val ffi_call_desc, varg args) { val real_self = lit("ffi-call"); struct txr_ffi_call_desc *tfcd = ffi_call_desc_checked(real_self, ffi_call_desc); @@ -7187,7 +7187,7 @@ val union_out(val uni, val memb, val memb_obj) return memb_obj; } -val make_zstruct(val type, struct args *args) +val make_zstruct(val type, varg args) { val self = lit("make-zstruct"); struct txr_ffi_type *tft = ffi_type_struct_checked(self, type); @@ -480,7 +480,7 @@ tail_call: mark_obj_tail(obj->tn.key); case DARG: { - struct args *args = obj->a.args; + varg args = obj->a.args; cnum i, n = args->fill; val *arg = args->arg; @@ -1619,7 +1619,7 @@ static val equal_based_p(val equal, val eql, val eq, val wkeys) return null(eql); } -val hashv(struct args *args) +val hashv(varg args) { val self = lit("hash"); val wkeys = nil, wvals = nil, equal = nil, eql = nil, wand = nil, wor = nil; @@ -1680,12 +1680,12 @@ val hash_construct(val hashl_args, val pairs) return hash; } -val hash_from_pairs_v(val pairs, struct args *hashv_args) +val hash_from_pairs_v(val pairs, varg hashv_args) { return hash_construct(args_get_list(hashv_args), pairs); } -val hash_from_alist_v(val alist, struct args *hashv_args) +val hash_from_alist_v(val alist, varg hashv_args) { val hash = hashv(hashv_args); @@ -1699,7 +1699,7 @@ val hash_from_alist_v(val alist, struct args *hashv_args) return hash; } -val hash_map(val fun, val seq, struct args *hashv_args) +val hash_map(val fun, val seq, varg hashv_args) { val self = lit("hash-map"); seq_iter_t iter; @@ -1712,7 +1712,7 @@ val hash_map(val fun, val seq, struct args *hashv_args) return hash; } -val hash_props(struct args *plist) +val hash_props(varg plist) { val self = lit("hash-props"); args_decl_constsize(args, ARGS_MIN); @@ -1732,7 +1732,7 @@ val hash_props(struct args *plist) return hash; } -val hash_list(val keys, struct args *hashv_args) +val hash_list(val keys, varg hashv_args) { val hash = hashv(hashv_args); @@ -1746,7 +1746,7 @@ val hash_list(val keys, struct args *hashv_args) return hash; } -val hash_zip(val keys, val vals, struct args *hashv_args) +val hash_zip(val keys, val vals, varg hashv_args) { val self = lit("hash-zip"); seq_iter_t key_iter, val_iter; @@ -1762,7 +1762,7 @@ val hash_zip(val keys, val vals, struct args *hashv_args) return hash; } -val group_by(val func, val seq, struct args *hashv_args) +val group_by(val func, val seq, varg hashv_args) { val self = lit("group-by"); val hash = hashv(hashv_args); @@ -1787,7 +1787,7 @@ val group_by(val func, val seq, struct args *hashv_args) } } -val group_map(val by_fun, val filter_fun, val seq, struct args *hashv_args) +val group_map(val by_fun, val filter_fun, val seq, varg hashv_args) { val hash = group_by(by_fun, seq, hashv_args); return hash_update(hash, filter_fun); @@ -2132,7 +2132,7 @@ val hash_keys_of(val hash, val value, val test, val keyfun) return out; } -val hash_invert(val hash, val joinfun, val unitfun, struct args *hashv_args) +val hash_invert(val hash, val joinfun, val unitfun, varg hashv_args) { val self = lit("hash-invert"); val hout = hashv(hashv_args); @@ -2440,7 +2440,7 @@ val append2(val list1, val list2) return out; } -val appendv(struct args *lists) +val appendv(varg lists) { cnum index = 0; list_collect_decl (out, ptail); @@ -2489,7 +2489,7 @@ val nreconc(val list1, val list2) return out; } -val nconcv(struct args *lists) +val nconcv(varg lists) { cnum index = 0; list_collect_decl (out, ptail); @@ -2726,7 +2726,7 @@ static val lazy_appendv_func(val rl, val lcons) return nil; } -val lazy_appendv(struct args *args) +val lazy_appendv(varg args) { val nonempty = nil; cnum index = 0; @@ -3631,7 +3631,7 @@ val none_satisfy(val seq, val pred_in, val key_in) return t; } -val multi(val func, struct args *lists) +val multi(val func, varg lists) { val transposed = mapcarv(list_f, lists); val processed = funcall1(func, transposed); @@ -3898,7 +3898,7 @@ val partition_by(val func, val seq) funcall1(func, car(seq)), seq); } -static val partition_if_countdown_funv(val envcons, struct args *args) +static val partition_if_countdown_funv(val envcons, varg args) { cons_bind(count, targetfun, envcons); val ret; @@ -4784,7 +4784,7 @@ val list(val first, ...) return list; } -val listv(struct args *args) +val listv(varg args) { return args_get_list(args); } @@ -4960,12 +4960,12 @@ val min2(val a, val b) return if3(less(a, b), a, b); } -val maxv(val first, struct args *rest) +val maxv(val first, varg rest) { return nary_simple_op(max2, rest, first); } -val minv(val first, struct args *rest) +val minv(val first, varg rest) { return nary_simple_op(min2, rest, first); } @@ -4987,7 +4987,7 @@ val clamp(val low, val high, val num) return max2(low, min2(high, num)); } -val bracket(val larg, struct args *args) +val bracket(val larg, varg args) { cnum index = 0, i = 0; @@ -6009,7 +6009,7 @@ val scat3(val s1, val sep, val s2) return cat_str_get(&cs); } -val join_with(val sep, struct args *args) +val join_with(val sep, varg args) { val self = lit("join-with"); cnum index; @@ -6036,7 +6036,7 @@ val join_with(val sep, struct args *args) return cat_str_get(&cs); } -val fmt_join(struct args *args) +val fmt_join(varg args) { return join_with(nil, args); } @@ -6845,7 +6845,7 @@ val lequal(val left, val right) return or2(equal(left, right), less(left, right)); } -val lessv(val first, struct args *rest) +val lessv(val first, varg rest) { cnum index = 0; @@ -6859,7 +6859,7 @@ val lessv(val first, struct args *rest) return t; } -val greaterv(val first, struct args *rest) +val greaterv(val first, varg rest) { cnum index = 0; @@ -6873,7 +6873,7 @@ val greaterv(val first, struct args *rest) return t; } -val lequalv(val first, struct args *rest) +val lequalv(val first, varg rest) { cnum index = 0; @@ -6887,7 +6887,7 @@ val lequalv(val first, struct args *rest) return t; } -val gequalv(val first, struct args *rest) +val gequalv(val first, varg rest) { cnum index = 0; @@ -8396,10 +8396,10 @@ static NORETURN void callerror(val fun, val msg) abort(); } -INLINE val do_generic_funcall(val fun, struct args *args_in) +INLINE val do_generic_funcall(val fun, varg args_in) { int variadic, fixparam, reqargs; - struct args *args = args_in; + varg args = args_in; switch (type(fun)) { case FUN: @@ -8649,7 +8649,7 @@ INLINE val do_generic_funcall(val fun, struct args *args_in) internal_error("corrupt function type field"); } -val generic_funcall(val fun, struct args *args) +val generic_funcall(val fun, varg args) { if (dbg_backtrace) { val ret; @@ -9157,7 +9157,7 @@ val pa_12_1(val fun2, val arg2) return func_f1(cons(fun2, arg2), do_pa_12_1); } -static val do_pa_12_1_v(val fcons, struct args *args) +static val do_pa_12_1_v(val fcons, varg args) { return funcall2(car(fcons), args_get_list(args), cdr(fcons)); } @@ -9222,7 +9222,7 @@ val pa_1234_34(val fun4, val arg1, val arg2) return func_f2(cons(fun4, cons(arg1, arg2)), do_pa_1234_34); } -val transposev(struct args *list) +val transposev(varg list) { val func = list_f; @@ -9251,7 +9251,7 @@ val transpose(val seq) return make_like(transposev(args), seq); } -static val do_chain(val fun1_list, struct args *args) +static val do_chain(val fun1_list, varg args) { val arg = nil; @@ -9287,12 +9287,12 @@ val chain(val first_fun, ...) return func_f0v(out, do_chain); } -val chainv(struct args *funlist) +val chainv(varg funlist) { return func_f0v(args_get_list(funlist), do_chain); } -static val do_chand(val fun1_list, struct args *args) +static val do_chand(val fun1_list, varg args) { val arg = nil; @@ -9310,22 +9310,22 @@ static val do_chand(val fun1_list, struct args *args) } -val chandv(struct args *funlist) +val chandv(varg funlist) { return func_f0v(args_get_list(funlist), do_chand); } -static val do_juxt(val funcs, struct args *args) +static val do_juxt(val funcs, varg args) { return mapcar(pa_12_1(func_n2(apply), args_get_list(args)), funcs); } -val juxtv(struct args *funlist) +val juxtv(varg funlist) { return func_f0v(args_get_list(funlist), do_juxt); } -static val do_and(val fun1_list, struct args *args_in) +static val do_and(val fun1_list, varg args_in) { cnum argc = args_in->argc; args_decl(args, argc); @@ -9363,7 +9363,7 @@ val andf(val first_fun, ...) return func_f0v(out, do_and); } -val andv(struct args *funlist) +val andv(varg funlist) { return func_f0v(args_get_list(funlist), do_and); } @@ -9378,7 +9378,7 @@ val swap_12_21(val fun) return func_f2(fun, do_swap_12_21); } -static val do_or(val fun1_list, struct args *args_in) +static val do_or(val fun1_list, varg args_in) { cnum argc = args_in->argc; args_decl(args, argc); @@ -9397,12 +9397,12 @@ static val do_or(val fun1_list, struct args *args_in) return ret; } -val orv(struct args *funlist) +val orv(varg funlist) { return func_f0v(args_get_list(funlist), do_or); } -static val do_not(val fun, struct args *args) +static val do_not(val fun, varg args) { return null(apply(fun, args_get_list(args))); } @@ -9412,17 +9412,17 @@ val notf(val fun) return func_f0v(fun, do_not); } -val nandv(struct args *funlist) +val nandv(varg funlist) { return notf(andv(funlist)); } -val norv(struct args *funlist) +val norv(varg funlist) { return notf(orv(funlist)); } -static val do_iff(val env, struct args *args_in) +static val do_iff(val env, varg args_in) { cons_bind (condfun, choices, env); cons_bind (thenfun, elsefun, choices); @@ -9584,7 +9584,7 @@ val size_vec(val vec) return vec->v.vec[vec_alloc]; } -val vectorv(struct args *args) +val vectorv(varg args) { cnum index = 0; val vec = vector(zero, nil); @@ -10638,7 +10638,7 @@ val alist_remove(val list, val keys) return set_diff(list, keys, func_n2(alist_remove_test), nil); } -val alist_removev(val list, struct args *keys) +val alist_removev(val list, varg keys) { return alist_remove(list, args_get_list(keys)); } @@ -10657,7 +10657,7 @@ val alist_nremove(val list, val keys) return list; } -val alist_nremovev(val list, struct args *keys) +val alist_nremovev(val list, varg keys) { return alist_nremove(list, args_get_list(keys)); } @@ -11443,7 +11443,7 @@ val sort_group(val seq, val keyfun, val lessfun) return partition_by(kf, sorted); } -val unique(val seq, val keyfun, struct args *hashv_args) +val unique(val seq, val keyfun, varg hashv_args) { val self = lit("unique"); val hash = hashv(hashv_args); @@ -300,7 +300,7 @@ struct dyn_args { obj_common; val car; val cdr; - struct args *args; + varg args; }; struct strm_ctx; @@ -809,12 +809,12 @@ val append2(val list1, val list2); val nappend2(val list1, val list2); val revappend(val list1, val list2); val nreconc(val list1, val list2); -val appendv(struct args *lists); -val nconcv(struct args *lists); +val appendv(varg lists); +val nconcv(varg lists); val sub_list(val list, val from, val to); val replace_list(val list, val items, val from, val to); val lazy_appendl(val lists); -val lazy_appendv(struct args *lists); +val lazy_appendv(varg lists); val ldiff(val list1, val list2); val ldiff_old(val list1, val list2); val flatten(val list); @@ -866,7 +866,7 @@ val count(val item, val seq, val testfun_in, val keyfun_in); val some_satisfy(val list, val pred, val key); val all_satisfy(val list, val pred, val key); val none_satisfy(val list, val pred, val key); -val multi(val func, struct args *lists); +val multi(val func, varg lists); val eql(val left, val right); val equal(val left, val right); val meq(val item, varg args); @@ -901,7 +901,7 @@ void rcyc_empty(void); val lcons_fun(val lcons); INLINE val us_lcons_fun(val lcons) { return lcons->lc.func; } val list(val first, ...); /* terminated by nao */ -val listv(struct args *); +val listv(varg ); val consp(val obj); val lconsp(val obj); val atom(val obj); @@ -931,18 +931,18 @@ val numberp(val num); val arithp(val obj); val nary_op(val self, val (*bfun)(val, val), val (*ufun)(val self, val), - struct args *args, val emptyval); + varg args, val emptyval); val nary_simple_op(val (*bfun)(val, val), - struct args *args, val emptyval); + varg args, val emptyval); val plus(val anum, val bnum); -val plusv(struct args *); +val plusv(varg ); val minus(val anum, val bnum); -val minusv(val minuend, struct args *nlist); +val minusv(val minuend, varg nlist); val neg(val num); val abso(val num); val mul(val anum, val bnum); -val mulv(struct args *); -val divv(val dividend, struct args *); +val mulv(varg ); +val divv(val dividend, varg ); val trunc(val anum, val bnum); val mod(val anum, val bnum); val wrap_star(val start, val end, val num); @@ -965,32 +965,32 @@ val lt(val anum, val bnum); val ge(val anum, val bnum); val le(val anum, val bnum); val numeq(val anum, val bnum); -val gtv(val first, struct args *rest); -val ltv(val first, struct args *rest); -val gev(val first, struct args *rest); -val lev(val first, struct args *rest); -val numeqv(val first, struct args *rest); -val numneqv(struct args *list); +val gtv(val first, varg rest); +val ltv(val first, varg rest); +val gev(val first, varg rest); +val lev(val first, varg rest); +val numeqv(val first, varg rest); +val numneqv(varg list); val sum(val seq, val keyfun); val prod(val seq, val keyfun); val max2(val a, val b); val min2(val a, val b); -val maxv(val first, struct args *rest); -val minv(val first, struct args *rest); +val maxv(val first, varg rest); +val minv(val first, varg rest); val maxl(val first, val rest); val minl(val first, val rest); val clamp(val low, val high, val num); -val bracket(val larg, struct args *args); +val bracket(val larg, varg args); val expt(val base, val exp); -val exptv(struct args *nlist); +val exptv(varg nlist); val exptmod(val base, val exp, val mod); val sqroot(val anum); val isqrt(val anum); val square(val anum); val gcd(val anum, val bnum); -val gcdv(struct args *nlist); +val gcdv(varg nlist); val lcm(val anum, val bnum); -val lcmv(struct args *nlist); +val lcmv(varg nlist); val floorf(val); val floordiv(val, val); val ceili(val); @@ -1019,8 +1019,8 @@ val logtwo(val num); val expo(val); val logand(val, val); val logior(val, val); -val logandv(struct args *nlist); -val logiorv(struct args *nlist); +val logandv(varg nlist); +val logiorv(varg nlist); val logxor(val, val); val logxor_old(val, val); val logtest(val, val); @@ -1029,7 +1029,7 @@ val logtrunc(val a, val bits); val sign_extend(val num, val nbits); val ash(val a, val bits); val bit(val a, val bit); -val maskv(struct args *bits); +val maskv(varg bits); val logcount(val n); val bitset(val n); val string_own(wchar_t *str); @@ -1063,8 +1063,8 @@ val cat_str(val list, val sep); val scat(val sep, ...); val scat2(val s1, val s2); val scat3(val s1, val sep, val s2); -val join_with(val sep, struct args *args); -val fmt_join(struct args *args); +val join_with(val sep, varg args); +val fmt_join(varg args); val split_str(val str, val sep); val split_str_keep(val str, val sep, val keep_sep_opt, val count_opt); val spl(val sep, val arg1, val arg2); @@ -1093,10 +1093,10 @@ val flo_int(val i); val less(val left, val right); val greater(val left, val right); val lequal(val left, val right); -val lessv(val first, struct args *rest); -val greaterv(val first, struct args *rest); -val lequalv(val first, struct args *rest); -val gequalv(val first, struct args *rest); +val lessv(val first, varg rest); +val greaterv(val first, varg rest); +val lequalv(val first, varg rest); +val gequalv(val first, varg rest); val chrp(val chr); wchar_t c_chr(val chr); val chr_isalnum(val ch); @@ -1210,7 +1210,7 @@ val vm_fun_p(val); val fun_fixparam_count(val obj); val fun_optparam_count(val obj); val fun_variadic(val obj); -val generic_funcall(val fun, struct args *); +val generic_funcall(val fun, varg ); val funcall(val fun); val funcall1(val fun, val arg); val funcall2(val fun, val arg1, val arg2); @@ -1218,7 +1218,7 @@ val funcall3(val fun, val arg1, val arg2, val arg3); val funcall4(val fun, val arg1, val arg2, val arg3, val arg4); val reduce_left(val fun, val list, val init, val key); val reduce_right(val fun, val list, val init, val key); -val transposev(struct args *lists); +val transposev(varg lists); val transpose(val lists); /* The notation pa_12_2 means take some function f(arg1, arg2) and fix a value for argument 1 to create a g(arg2). @@ -1231,15 +1231,15 @@ val pa_123_1(val fun3, val arg2, val arg3); val pa_1234_1(val fun4, val arg2, val arg3, val arg4); val pa_1234_34(val fun3, val arg1, val arg2); val chain(val first_fun, ...); -val chainv(struct args *funlist); -val chandv(struct args *funlist); -val juxtv(struct args *funlist); +val chainv(varg funlist); +val chandv(varg funlist); +val juxtv(varg funlist); val andf(val first_fun, ...); -val andv(struct args *funlist); -val orv(struct args *funlist); +val andv(varg funlist); +val orv(varg funlist); val notf(val fun); -val nandv(struct args *funlist); -val norv(struct args *funlist); +val nandv(varg funlist); +val norv(varg funlist); val iff(val condfun, val thenfun, val elsefun); val iffi(val condfun, val thenfun, val elsefun); val dupl(val fun); @@ -1252,7 +1252,7 @@ loc vecref_l(val vec, val ind); val vec_push(val vec, val item); val length_vec(val vec); val size_vec(val vec); -val vectorv(struct args *); +val vectorv(varg ); val vec(val first, ...); val vec_list(val list); val list_vec(val vector); @@ -1308,10 +1308,10 @@ val acons_new(val key, val value, val list); val acons_new_c(val key, loc new_p, loc list); val aconsql_new(val key, val value, val list); val alist_remove(val list, val keys); -val alist_removev(val list, struct args *keys); +val alist_removev(val list, varg keys); val alist_remove1(val list, val key); val alist_nremove(val list, val keys); -val alist_nremovev(val list, struct args *keys); +val alist_nremovev(val list, varg keys); val alist_nremove1(val list, val key); val copy_cons(val cons); val copy_tree(val tree); @@ -1335,7 +1335,7 @@ val nshuffle(val seq, val randstate); val shuffle(val seq, val randstate); val multi_sort(val lists, val funcs, val key_funcs); val sort_group(val seq, val keyfun, val lessfun); -val unique(val seq, val keyfun, struct args *hashv_args); +val unique(val seq, val keyfun, varg hashv_args); val uniq(val seq); val grade(val seq, val lessfun, val keyfun_in); val nrot(val seq, val n_in); @@ -1323,7 +1323,7 @@ static val get_home_path(void) return getenv_wrap(lit("HOME")); } -static val repl_warning(val out_stream, val exc, struct args *rest) +static val repl_warning(val out_stream, val exc, varg rest) { val args = args_get_list(rest); @@ -2692,7 +2692,7 @@ val make_catenated_stream(val stream_list) return catstrm; } -val make_catenated_stream_v(struct args *streams) +val make_catenated_stream_v(varg streams) { return make_catenated_stream(args_get_list(streams)); } @@ -3342,7 +3342,7 @@ static void vformat_str(val stream, val str, int width, enum align align, gc_hint(str); } -val formatv(val stream_in, val fmtstr, struct args *al) +val formatv(val stream_in, val fmtstr, varg al) { uses_or2; val stream = if3(stream_in == t, @@ -3865,7 +3865,7 @@ val format(val stream, val str, ...) } } -val fmt(val string, struct args *args) +val fmt(val string, varg args) { return formatv(nil, string, args); } @@ -5303,7 +5303,7 @@ val path_cat(val dir_name, val base_name) return scat(lit("/"), dir_name, base_name, nao); } -static val path_vcat(struct args *args) +static val path_vcat(varg args) { cnum ix = 0; @@ -133,8 +133,8 @@ static_forward(struct cobj_ops struct_type_ops); static struct stslot *lookup_static_slot_desc(struct struct_type *st, val sym); static val make_struct_type_compat(val name, val super, val slots, val initfun, val boactor); -static val call_super_method(val inst, val sym, struct args *); -static val call_super_fun(val type, val sym, struct args *); +static val call_super_method(val inst, val sym, varg ); +static val call_super_fun(val type, val sym, varg ); void struct_init(void) { @@ -779,7 +779,7 @@ val allocate_struct(val type) memset(name, 0, size_name) static val make_struct_impl(val self, val type, - struct args *plist, struct args *args) + varg plist, varg args) { struct struct_type *st = stype_handle(&type, self); cnum nslots = st->nslots; @@ -840,19 +840,19 @@ static val make_struct_impl(val self, val type, return sinst; } -val make_struct(val type, val plist, struct args *boa) +val make_struct(val type, val plist, varg boa) { args_decl_list(pargs, ARGS_MIN, plist); return make_struct_impl(lit("make-struct"), type, pargs, boa); } -val struct_from_plist(val type, struct args *plist) +val struct_from_plist(val type, varg plist) { args_decl_constsize(boa, ARGS_ABS_MIN); return make_struct_impl(lit("struct-from-plist"), type, plist, boa); } -val struct_from_args(val type, struct args *boa) +val struct_from_args(val type, varg boa) { args_decl_constsize(pargs, ARGS_ABS_MIN); return make_struct_impl(lit("struct-from-args"), type, pargs, boa); @@ -1512,7 +1512,7 @@ val static_slot_home(val stype, val sym) static val do_super(struct struct_type *st, val inst, val sym, val self, - struct args *args) + varg args) { val type = st->self; cnum i; @@ -1547,7 +1547,7 @@ static val do_super(struct struct_type *st, type, nao); } -static val call_super_method(val inst, val sym, struct args *args) +static val call_super_method(val inst, val sym, varg args) { val type = struct_type(inst); val self = lit("call-super-method"); @@ -1555,7 +1555,7 @@ static val call_super_method(val inst, val sym, struct args *args) return do_super(st, inst, sym, self, args); } -static val call_super_fun(val type, val sym, struct args *args) +static val call_super_fun(val type, val sym, varg args) { val self = lit("call-super-fun"); struct struct_type *st = stype_handle(&type, self); @@ -1647,7 +1647,7 @@ static val method_fun(val env, varg args) static val method_args_fun(val dargs, varg args) { val self = lit("method"); - struct args *da = dargs->a.args; + varg da = dargs->a.args; val fun = dargs->a.car; val strct = dargs->a.cdr; cnum da_nargs = da->fill + c_num(length(da->list), self); @@ -1664,7 +1664,7 @@ val method(val strct, val slotsym) return func_f0v(cons(slot(strct, slotsym), strct), method_fun); } -val method_args(val strct, val slotsym, struct args *args) +val method_args(val strct, val slotsym, varg args) { if (!args_more(args, 0)) return func_f0v(cons(slot(strct, slotsym), strct), method_fun); @@ -1701,7 +1701,7 @@ val uslot(val slot) return func_f1(slot, uslot_fun); } -static val umethod_fun(val sym, struct args *args) +static val umethod_fun(val sym, varg args) { val self = lit("umethod"); @@ -1723,11 +1723,11 @@ static val umethod_fun(val sym, struct args *args) } } -static val umethod_args_fun(val dargs, struct args *args) +static val umethod_args_fun(val dargs, varg args) { val self = lit("umethod"); val sym = dargs->a.car; - struct args *da = dargs->a.args; + varg da = dargs->a.args; if (!args_more(args, 0)) { uw_throwf(type_error_s, lit("~a: object argument required to call ~s"), @@ -1753,7 +1753,7 @@ static val umethod_args_fun(val dargs, struct args *args) } } -val umethod(val slot, struct args *args) +val umethod(val slot, varg args) { if (!args_more(args, 0)) return func_f0v(slot, umethod_fun); @@ -53,9 +53,9 @@ val struct_set_initfun(val type, val fun); val struct_get_postinitfun(val type); val struct_set_postinitfun(val type, val fun); val super(val type, val idx); -val make_struct(val type, val plist, struct args *); -val struct_from_plist(val type, struct args *plist); -val struct_from_args(val type, struct args *boa); +val make_struct(val type, val plist, varg ); +val struct_from_plist(val type, varg plist); +val struct_from_args(val type, varg boa); val make_lazy_struct(val type, val argfun); val make_struct_lit(val type, val plist); val allocate_struct(val type); @@ -82,10 +82,10 @@ val struct_type(val strct); val struct_type_name(val stype); val struct_subtype_p(val sub, val sup); val method(val strct, val slotsym); -val method_args(val strct, val slotsym, struct args *); +val method_args(val strct, val slotsym, varg ); val super_method(val strct, val slotsym); val uslot(val slot); -val umethod(val slot, struct args *); +val umethod(val slot, varg ); val method_name(val fun); val slot_types(val slot); val static_slot_types(val slot); @@ -111,7 +111,7 @@ val setlogmask_wrap(val mask) return num(setlogmask(c_num(mask, self))); } -val syslog_wrapv(val prio, val fmt, struct args *args) +val syslog_wrapv(val prio, val fmt, varg args) { val self = lit("syslog"); val text = formatv(nil, fmt, args); @@ -42,5 +42,5 @@ val openlog_wrap(val ident, val optmask, val facility); val closelog_wrap(void); val setlogmask_wrap(val mask); val syslog_wrap(val prio, val fmt, val args); -val syslog_wrapv(val prio, val fmt, struct args *args); +val syslog_wrapv(val prio, val fmt, varg args); val make_syslog_stream(val prio); @@ -436,7 +436,7 @@ val uw_find_frames_by_mask(val mask_in) } case UW_FCALL: { - struct args *frargs = fr->fc.args; + varg frargs = fr->fc.args; args_decl(acopy, frargs->argc); args_copy(acopy, frargs); frame = allocate_struct(fcall_frame_type); @@ -488,7 +488,7 @@ val uw_last_form_expanded(void) #endif -val uw_invoke_catch(val catch_frame, val sym, struct args *args) +val uw_invoke_catch(val catch_frame, val sym, varg args) { uw_frame_t *ex, *ex_point; @@ -513,14 +513,14 @@ val uw_invoke_catch(val catch_frame, val sym, struct args *args) abort(); } -val uw_muffle_warning(val exc, struct args *args) +val uw_muffle_warning(val exc, varg args) { (void) exc; (void) args; return uw_rthrow(continue_s, nil); } -val uw_trace_error(val ctx, val exc, struct args *args) +val uw_trace_error(val ctx, val exc, varg args) { cons_bind (stream, prefix, ctx); error_trace(exc, args_get_list(args), stream, prefix); @@ -607,7 +607,7 @@ void uw_push_handler(uw_frame_t *fr, val matches, val fun) #if CONFIG_DEBUG_SUPPORT -void uw_push_fcall(uw_frame_t *fr, val fun, struct args *args) +void uw_push_fcall(uw_frame_t *fr, val fun, varg args) { memset(fr, 0, sizeof *fr); fr->fc.type = UW_FCALL; @@ -651,7 +651,7 @@ val uw_exception_subtype_p(val sub, val sup) } } -static void invoke_handler(uw_frame_t *fr, struct args *args) +static void invoke_handler(uw_frame_t *fr, varg args) { val saved_dyn_env = dyn_env; val cur_pkg_alist = deref(cur_package_alist_loc); @@ -775,12 +775,12 @@ val uw_rthrow(val sym, val args) abort(); } -val uw_rthrowv(val sym, struct args *arglist) +val uw_rthrowv(val sym, varg arglist) { return uw_rthrow(sym, args_get_list(arglist)); } -val uw_rthrowfv(val sym, val fmt, struct args *args) +val uw_rthrowfv(val sym, val fmt, varg args) { val stream = make_string_output_stream(); (void) formatv(stream, fmt, args); @@ -821,7 +821,7 @@ val uw_ethrowf(val sym, val fmt, ...) abort(); } -val uw_errorfv(val fmt, struct args *args) +val uw_errorfv(val fmt, varg args) { val stream = make_string_output_stream(); (void) formatv(stream, fmt, args); @@ -988,7 +988,7 @@ val uw_register_subtype(val sub, val sup) return sup; } -static val register_exception_subtypes(struct args *args) +static val register_exception_subtypes(varg args) { val types = args_copy_to_list(args); reduce_left(func_n2(uw_register_subtype), types, nil, nil); @@ -1147,7 +1147,7 @@ val vm_execute_toplevel(val desc) return vm_execute(&vm); } -val vm_execute_closure(val fun, struct args *args) +val vm_execute_closure(val fun, varg args) { val self = lit("vm-execute-closure"); val closure = fun->f.env; @@ -34,7 +34,7 @@ val vm_make_desc(val nlevels, val nregs, val bytecode, val datavec, val funvec); val vm_execute_toplevel(val desc); val vm_copy_closure(val closure); -val vm_execute_closure(val fun, struct args *); +val vm_execute_closure(val fun, varg); val vm_funcall(val fun); val vm_funcall1(val fun, val arg); val vm_funcall2(val fun, val arg1, val arg2); |