summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-01 17:51:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-01 20:05:06 -0700
commitb9d23bcf53ee7b041b511a25a36291ae7166c73b (patch)
tree36b5fe477b442176f91ca549d6080029c756b2b9 /hash.c
parent0f050c4f3d57605ad0692e5abf2f61d0e75f408e (diff)
downloadtxr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.gz
txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.tar.bz2
txr-b9d23bcf53ee7b041b511a25a36291ae7166c73b.zip
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.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 4 insertions, 4 deletions
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;