From 8498864dde6ab11bda8ed8b6d0bf09a4c4de0af0 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 7 Nov 2022 16:38:39 +0000 Subject: [PATCH] Resolved a name clash with the engine --- repl/repl_tools.h | 2 +- source/ast_node.h | 2 +- source/builtin.c | 2 +- source/compiler.h | 2 +- source/interpreter.c | 2 +- source/interpreter.h | 2 +- source/keyword_types.c | 2 +- source/lexer.h | 2 +- source/literal.h | 2 +- source/literal_array.h | 2 +- source/literal_dictionary.h | 2 +- source/memory.h | 2 +- source/parser.c | 2 -- source/parser.h | 2 +- source/{common.c => toy_common.c} | 2 +- source/{common.h => toy_common.h} | 0 16 files changed, 14 insertions(+), 16 deletions(-) rename source/{common.c => toy_common.c} (99%) rename source/{common.h => toy_common.h} (100%) diff --git a/repl/repl_tools.h b/repl/repl_tools.h index 9ef421a..e61a1ed 100644 --- a/repl/repl_tools.h +++ b/repl/repl_tools.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" char* readFile(char* path, size_t* fileSize); void writeFile(char* path, unsigned char* bytes, size_t size); diff --git a/source/ast_node.h b/source/ast_node.h index 042613f..9aef7ae 100644 --- a/source/ast_node.h +++ b/source/ast_node.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "literal.h" #include "opcodes.h" #include "token_types.h" diff --git a/source/builtin.c b/source/builtin.c index 5ffbb09..b3e7141 100644 --- a/source/builtin.c +++ b/source/builtin.c @@ -891,7 +891,7 @@ int _index(Interpreter* interpreter, LiteralArray* arguments) { //else override elements of the array instead else { //copy compound to result - snprintf(result, MAX_STRING_LENGTH, AS_STRING(compound)); + snprintf(result, MAX_STRING_LENGTH, "%s", AS_STRING(compound)); int assignLength = strlen(AS_STRING(assign)); int min = AS_INTEGER(third) > 0 ? AS_INTEGER(first) : AS_INTEGER(second) - 1; diff --git a/source/compiler.h b/source/compiler.h index f7aad35..d0f7fa5 100644 --- a/source/compiler.h +++ b/source/compiler.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "opcodes.h" #include "ast_node.h" #include "literal_array.h" diff --git a/source/interpreter.c b/source/interpreter.c index 5fc777f..9a4cec1 100644 --- a/source/interpreter.c +++ b/source/interpreter.c @@ -1,7 +1,7 @@ #include "interpreter.h" #include "console_colors.h" -#include "common.h" +#include "toy_common.h" #include "memory.h" #include "keyword_types.h" #include "opcodes.h" diff --git a/source/interpreter.h b/source/interpreter.h index 5b65dd1..71a8d68 100644 --- a/source/interpreter.h +++ b/source/interpreter.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "literal.h" #include "literal_array.h" #include "literal_dictionary.h" diff --git a/source/keyword_types.c b/source/keyword_types.c index e9a30d0..f20bb55 100644 --- a/source/keyword_types.c +++ b/source/keyword_types.c @@ -1,6 +1,6 @@ #include "keyword_types.h" -#include "common.h" +#include "toy_common.h" #include diff --git a/source/lexer.h b/source/lexer.h index 5df11a0..187fa61 100644 --- a/source/lexer.h +++ b/source/lexer.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "token_types.h" //lexers are bound to a string of code, and return a single token every time scan is called diff --git a/source/literal.h b/source/literal.h index 34318fc..f24f9d6 100644 --- a/source/literal.h +++ b/source/literal.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include diff --git a/source/literal_array.h b/source/literal_array.h index 48e1ce9..b877528 100644 --- a/source/literal_array.h +++ b/source/literal_array.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "literal.h" diff --git a/source/literal_dictionary.h b/source/literal_dictionary.h index a6f00d5..37f2275 100644 --- a/source/literal_dictionary.h +++ b/source/literal_dictionary.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "literal.h" diff --git a/source/memory.h b/source/memory.h index c988867..c0d1aae 100644 --- a/source/memory.h +++ b/source/memory.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #define ALLOCATE(type, count) ((type*)reallocate(NULL, 0, sizeof(type) * (count))) #define FREE(type, pointer) reallocate(pointer, sizeof(type), 0) diff --git a/source/parser.c b/source/parser.c index fd47d3c..81c0969 100644 --- a/source/parser.c +++ b/source/parser.c @@ -1,7 +1,5 @@ #include "parser.h" -#include "common.h" - #include "memory.h" #include "literal.h" #include "opcodes.h" diff --git a/source/parser.h b/source/parser.h index 4dd9579..58356a7 100644 --- a/source/parser.h +++ b/source/parser.h @@ -1,6 +1,6 @@ #pragma once -#include "common.h" +#include "toy_common.h" #include "lexer.h" #include "ast_node.h" diff --git a/source/common.c b/source/toy_common.c similarity index 99% rename from source/common.c rename to source/toy_common.c index 0865484..75e1f4d 100644 --- a/source/common.c +++ b/source/toy_common.c @@ -1,4 +1,4 @@ -#include "common.h" +#include "toy_common.h" #include #include diff --git a/source/common.h b/source/toy_common.h similarity index 100% rename from source/common.h rename to source/toy_common.h