diff --git a/lang/module.c b/lang/module.c index 2ed171e..adcb74f 100644 --- a/lang/module.c +++ b/lang/module.c @@ -8,6 +8,7 @@ #include "object.h" #include "string.h" #include "vm.h" +#include // Useful macro for getting array size #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) @@ -58,13 +59,13 @@ } // Checks if a ModuleInfo is in a module_stack -static int in_stack(const ModuleInfo *info, struct module_stack *stack) { +static bool in_stack(const ModuleInfo *info, struct module_stack *stack) { for (int i = 0; i < stack->next; ++i) { const ModuleInfo *elem = stack->elems[i]; if (elem == info) - return 1; + return true; } - return 0; + return false; } // Traverses a module use dependency tree, checking for circular dependencies