summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-01-29 21:32:56 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-01-29 21:32:56 -0800
commit0ba5923568ef1bf13eee30012fbf2977fe8b5a7c (patch)
tree76dad63ef029e3ed14eaac2eb329eee58582a58b /hash.c
parenta11dd30b417e1f48da573748fa4ab5fe09f0b212 (diff)
downloadtxr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.tar.gz
txr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.tar.bz2
txr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.zip
Use macro to initialize cobj_ops.
* lib.h (cobj_ops_init): New macro. * hash.c (hash_ops, hash_iter_ops): Initialize with cobj_ops_init. * rand.c (random_state_ops): Likewise. * regex.c (char_set_obj_ops, regex_obj_ops): Likewise.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/hash.c b/hash.c
index 8a4c554b..2a4beda8 100644
--- a/hash.c
+++ b/hash.c
@@ -426,13 +426,11 @@ static void hash_mark(val hash)
}
}
-static struct cobj_ops hash_ops = {
- hash_equal_op,
- hash_print_op,
- cobj_destroy_free_op,
- hash_mark,
- hash_hash_op,
-};
+static struct cobj_ops hash_ops = cobj_ops_init(hash_equal_op,
+ hash_print_op,
+ cobj_destroy_free_op,
+ hash_mark,
+ hash_hash_op);
static void hash_grow(struct hash *h, val hash)
{
@@ -655,13 +653,11 @@ static void hash_iter_mark(val hash_iter)
reachable_iters = hi;
}
-static struct cobj_ops hash_iter_ops = {
- eq,
- cobj_print_op,
- cobj_destroy_free_op,
- hash_iter_mark,
- cobj_hash_op
-};
+static struct cobj_ops hash_iter_ops = cobj_ops_init(eq,
+ cobj_print_op,
+ cobj_destroy_free_op,
+ hash_iter_mark,
+ cobj_hash_op);
val hash_begin(val hash)
{