summaryrefslogtreecommitdiffstats
path: root/regex.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 /regex.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 'regex.c')
-rw-r--r--regex.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/regex.c b/regex.c
index 5c664532..6ee25b9d 100644
--- a/regex.c
+++ b/regex.c
@@ -797,13 +797,11 @@ static void char_set_cobj_destroy(val chset)
chset->co.handle = 0;
}
-static struct cobj_ops char_set_obj_ops = {
- eq,
- cobj_print_op,
- char_set_cobj_destroy,
- cobj_mark_op,
- cobj_hash_op
-};
+static struct cobj_ops char_set_obj_ops = cobj_ops_init(eq,
+ cobj_print_op,
+ char_set_cobj_destroy,
+ cobj_mark_op,
+ cobj_hash_op);
static nfa_state_t *nfa_state_accept(void)
{
@@ -1311,13 +1309,11 @@ static void regex_mark(val obj)
static void regex_print(val obj, val stream);
-static struct cobj_ops regex_obj_ops = {
- eq,
- regex_print,
- regex_destroy,
- regex_mark,
- cobj_hash_op
-};
+static struct cobj_ops regex_obj_ops = cobj_ops_init(eq,
+ regex_print,
+ regex_destroy,
+ regex_mark,
+ cobj_hash_op);
static val reg_nullable(val);