diff --git a/lang/compile.py b/lang/compile.py index d80b7ca..8601148 100755 --- a/lang/compile.py +++ b/lang/compile.py @@ -802,8 +802,8 @@ header += """ static struct object_class module_class; -static Object module_create(VmState state, Object *args) { - for(Object *o = args; *o != object_none(); ++o) +static Object module_create(VmState state, Object *use_modules) { + for(Object *o = use_modules; *o != object_none(); ++o) object_drop(state, o); Object obj = object_create(state, &module_class, 1); vm_abort_if(state, !obj, "unable to allocate module"); diff --git a/lang/module.c b/lang/module.c index 07d9a0a..3717287 100644 --- a/lang/module.c +++ b/lang/module.c @@ -126,8 +126,8 @@ // Creates a module and stores it in a mapping Object create_module( VmState state, struct module_mapping *mapping, const ModuleInfo *info) { - static Object args[16]; - unsigned int args_next = 0; + static Object use_modules[16]; + unsigned int use_modules_next = 0; for (const char **use = info->uses; *use != NULL; ++use) { const ModuleInfo *use_info = info_by_name(*use); if (info == NULL) @@ -135,13 +135,13 @@ Object use_module = get_module_by_info(mapping, use_info); // Create a new reference for the module object_hold(state, use_module); - args[args_next++] = use_module; + use_modules[use_modules_next++] = use_module; // Check there's enough room left for this and an object_none - if (ARRAY_SIZE(args) < (args_next + 1)) - abort_print("Too many module args"); + if (ARRAY_SIZE(use_modules) < (use_modules_next + 1)) + abort_print("Too many module use_modules"); } - args[args_next++] = object_none(); - Object module = info->create(state, args); + use_modules[use_modules_next++] = object_none(); + Object module = info->create(state, use_modules); return module; } diff --git a/lang/module.h b/lang/module.h index 688d57b..77f9599 100644 --- a/lang/module.h +++ b/lang/module.h @@ -23,7 +23,7 @@ struct module_info { const char *name; const char **uses; - Object (*create)(VmState state, Object *args); + Object (*create)(VmState state, Object *use_modules); }; typedef const struct module_info ModuleInfo;