From 3388b5baed9b9288ccd4fcd7611f936cb6025469 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 12 Mar 2019 22:49:39 -0700 Subject: lib: use accessor for lcons function. * hash.c (hash_keys_lazy, hash_values_lazy, hash_pairs_lazy, hash_alist_lazy): Use us_lcons_fun instead of direct lcons->lc.fun access. * lib.c (simple_lazy_stream_func, lazy_stream_func): Likewise. --- hash.c | 8 ++++---- lib.c | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hash.c b/hash.c index 93be6805..2bf527b9 100644 --- a/hash.c +++ b/hash.c @@ -1299,7 +1299,7 @@ val group_reduce(val hash, val by_fun, val reduce_fun, val seq, static val hash_keys_lazy(val iter, val lcons) { val cell = hash_next(iter); - us_rplacd(lcons, if2(cell, make_lazy_cons_car(lcons->lc.func, us_car(cell)))); + us_rplacd(lcons, if2(cell, make_lazy_cons_car(us_lcons_fun(lcons), us_car(cell)))); return nil; } @@ -1315,7 +1315,7 @@ val hash_keys(val hash) static val hash_values_lazy(val iter, val lcons) { val cell = hash_next(iter); - us_rplacd(lcons, if2(cell, make_lazy_cons_car(lcons->lc.func, us_cdr(cell)))); + us_rplacd(lcons, if2(cell, make_lazy_cons_car(us_lcons_fun(lcons), us_cdr(cell)))); return nil; } @@ -1332,7 +1332,7 @@ static val hash_pairs_lazy(val iter, val lcons) { val cell = hash_next(iter); us_rplacd(lcons, if2(cell, - make_lazy_cons_car(lcons->lc.func, + make_lazy_cons_car(us_lcons_fun(lcons), cons(us_car(cell), cons(us_cdr(cell), nil))))); @@ -1352,7 +1352,7 @@ val hash_pairs(val hash) static val hash_alist_lazy(val iter, val lcons) { val cell = hash_next(iter); - us_rplacd(lcons, if2(cell, make_lazy_cons_car(lcons->lc.func, cell))); + us_rplacd(lcons, if2(cell, make_lazy_cons_car(us_lcons_fun(lcons), cell))); return nil; } diff --git a/lib.c b/lib.c index d162fe98..1ca81fc8 100644 --- a/lib.c +++ b/lib.c @@ -7757,7 +7757,7 @@ toobig: static val simple_lazy_stream_func(val stream, val lcons) { if (set(mkloc(lcons->lc.car, lcons), get_line(stream)) != nil) { - set(mkloc(lcons->lc.cdr, lcons), make_lazy_cons(lcons->lc.func)); + set(mkloc(lcons->lc.cdr, lcons), make_lazy_cons(us_lcons_fun(lcons))); } else { close_stream(stream, t); lcons->lc.cdr = nil; @@ -7785,7 +7785,8 @@ static val lazy_stream_func(val env, val lcons) val prefetched_line = cdr(env); set(mkloc(lcons->lc.car, lcons), prefetched_line); - set(mkloc(lcons->lc.cdr, lcons), lazy_stream_cont(stream, lcons->lc.func, env)); + set(mkloc(lcons->lc.cdr, lcons), lazy_stream_cont(stream, + us_lcons_fun(lcons), env)); return prefetched_line; } -- cgit v1.2.3