From 98793377edef5f75130ff497b6c0a22beb48cf91 Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Mon, 27 May 2024 21:44:33 +0200 Subject: [PATCH] Reorganized the project to move headers in their own directory --- CMakeLists.txt | 3 ++- bench.c | 2 +- ink.h => include/ink.h | 0 lib.c | 3 ++- 4 files changed, 5 insertions(+), 3 deletions(-) rename ink.h => include/ink.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index eaf6b50..15dfb03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(ink C) set(CMAKE_C_STANDARD 90) -add_library(ink lib.c ink.h) +add_library(ink lib.c include/ink.h) # Uncomment to disable the redundant arithmetic # add_definitions(-DNOEXTRAARITHMETIC) @@ -16,6 +16,7 @@ add_library(ink lib.c ink.h) add_executable(ink_exe main.c) target_link_libraries(ink_exe PUBLIC ink) +target_include_directories(ink PUBLIC include) # Benchmark is broken since the addition to coroutines # add_executable(ink_bench bench.c) diff --git a/bench.c b/bench.c index d1753db..ba64d3e 100644 --- a/bench.c +++ b/bench.c @@ -1,4 +1,4 @@ -#include "ink.h" +#include "include/ink.h" #include #include #include diff --git a/ink.h b/include/ink.h similarity index 100% rename from ink.h rename to include/ink.h diff --git a/lib.c b/lib.c index cfd8542..519c968 100644 --- a/lib.c +++ b/lib.c @@ -1,4 +1,4 @@ -#include "ink.h" +#include "include/ink.h" #ifndef NOSTDLIB #include #include @@ -594,6 +594,7 @@ static int ink_parse(struct context* pContext, struct elem* executable_buffer, i #define FUNCTION_BUFFER 256 struct label labels[LABEL_BUFFER]; struct elem function_buffer[FUNCTION_BUFFER]; + /* TODO: add checks for overflows in these arrays */ currentRoutine = pContext->routines + pContext->routine_current; function_buffer_top = 0; function_name = -1;