From b9d23bcf53ee7b041b511a25a36291ae7166c73b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 1 Aug 2015 17:51:51 -0700 Subject: Pass pretty flag to cobj print operation. * hash.c (hash_print_op): Take third argument, and call cobj_print_impl rather than cobj_print. * lib.c (cobj_print_op): Take third argument. The object class is * printed with obj_print_impl. (obj_print_impl): Static function becomes extern. Passes its pretty flag argument to cobj print virtual function. * lib.h (cobj_ops): print takes third argument. (cobj_print_op): Declaration updated. (obj_print_impl): Declared. * regex.c (regex_print): Takes third argument, and ignores it. * stream.c (stream_print_op, stdio_stream_print, cat_stream_print): Take third argument, and ignore it. * stream.h (stream_print_op): Declaration updated. --- hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 73738b6b..d279ece8 100644 --- a/hash.c +++ b/hash.c @@ -347,7 +347,7 @@ static cnum hash_hash_op(val obj) return out; } -static void hash_print_op(val hash, val out) +static void hash_print_op(val hash, val out, val pretty) { struct hash *h = coerce(struct hash *, hash->co.handle); int need_space = 0; @@ -370,13 +370,13 @@ static void hash_print_op(val hash, val out) put_char(chr(' '), out); switch (h->flags) { case hash_weak_both: - obj_print(weak_keys_k, out); + obj_print_impl(weak_keys_k, out, pretty); /* fallthrough */ case hash_weak_vals: - obj_print(weak_vals_k, out); + obj_print_impl(weak_vals_k, out, pretty); break; case hash_weak_keys: - obj_print(weak_keys_k, out); + obj_print_impl(weak_keys_k, out, pretty); break; default: break; -- cgit v1.2.3