summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-08-24 13:26:52 +0200
committerJo-Philipp Wich <jo@mein.io>2020-08-25 20:38:15 +0200
commit2d2ab2f4f0c56f613fb093180ed58f990f3c67e0 (patch)
tree2fb218d690d3ccc68873b449a14aedf091031f50 /lib.c
parent6564992f2464e561d11f82f65731bc0c44ea9e2a (diff)
treewide: add dedicated T_CFUNC type
Tag C function values with a dedicated T_CFUNC type to clearly differentiate them from runtime declared functions. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 9bfa842..fdda6a0 100644
--- a/lib.c
+++ b/lib.c
@@ -1609,8 +1609,8 @@ func_to_string(struct json_object *v, struct printbuf *pb, int level, int flags)
static bool
add_function(struct ut_state *state, struct json_object *scope, const char *name, ut_c_fn *fn)
{
- struct ut_opcode *op = ut_new_op(state, T_FUNC,
- json_object_new_boolean(1), (struct ut_opcode *)fn, (void *)1);
+ struct ut_opcode *op = ut_new_op(state, T_CFUNC,
+ json_object_new_boolean(0), (struct ut_opcode *)fn, (void *)1);
json_object_set_serializer(op->val, func_to_string, op, NULL);