summaryrefslogtreecommitdiff
path: root/src/runner
diff options
context:
space:
mode:
Diffstat (limited to 'src/runner')
-rw-r--r--src/runner/runner.c4
-rw-r--r--src/runner/runner.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/runner/runner.c b/src/runner/runner.c
index 2e8c347..f33f056 100644
--- a/src/runner/runner.c
+++ b/src/runner/runner.c
@@ -2,8 +2,8 @@
#include "compiler/ast-tree.h"
#include "utils/log.h"
#include "utils/memory.h"
+#include "utils/string.h"
#include <stdio.h>
-#include <string.h>
#define doOperation(op0, op1, operator, originalType, type) \
*((originalType *)(op0)->metadata) = \
@@ -53,7 +53,7 @@ bool runAstTree(AstTreeRoots roots) {
AstTreeVariable *variable = root->variables.data[i];
size_t name_size = variable->name_end - variable->name_begin;
if (name_size == MAIN_STR_SIZE &&
- strncmp(variable->name_begin, MAIN_STR, MAIN_STR_SIZE) == 0 &&
+ strnEquals(variable->name_begin, MAIN_STR, MAIN_STR_SIZE) &&
variable->type->token == AST_TREE_TOKEN_TYPE_FUNCTION) {
if (mainVariable != NULL) {
printLog("Too many main variables");
diff --git a/src/runner/runner.h b/src/runner/runner.h
index 12ee241..4de6fbe 100644
--- a/src/runner/runner.h
+++ b/src/runner/runner.h
@@ -1,7 +1,6 @@
#pragma once
#include "compiler/ast-tree.h"
-#include <stdint.h>
void runnerVariableSetValue(AstTreeVariable *variable, AstTree *value);
void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable,