diff --git a/lang/number.c b/lang/number.c index e5f5f31..175ee5d 100644 --- a/lang/number.c +++ b/lang/number.c @@ -6,7 +6,7 @@ #include "stdio.h" #include -struct object_class num_class; +static struct object_class num_class; struct number { struct object obj; @@ -22,7 +22,7 @@ return (struct object *)num; } -void number_cleanup(struct object *obj) { +static void number_cleanup(struct object *obj) { abort_if(obj->class_data != &num_class, "number_cleanup obj is not a number"); struct number *num = (struct number *)obj; @@ -36,7 +36,8 @@ return num->value; } -void number_add(struct object *obj, int arg_count, struct object **args) { +static void number_add( + struct object *obj, int arg_count, struct object **args) { abort_if(arg_count != 1, "number_add called with more than 1 argument"); abort_if(!args[0], "number_add arg is NULL"); abort_if(obj->class_data != &num_class, @@ -49,10 +50,10 @@ args[0] = number_create(added); } -struct object_call calls[] = { +static struct object_call calls[] = { {.name = "Add", .handler = number_add}, {.name = NULL, /* end */}}; -struct object_class num_class = { +static struct object_class num_class = { .cleanup = number_cleanup, .calls = &calls[0], };