From 2f3d405f8b8c9768f2039519ceefb8476ca06826 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Jul 2020 19:51:54 +0200 Subject: [PATCH] - moved getatoken to scriptfile.cpp so common.cpp could be removed. --- source/CMakeLists.txt | 1 - source/build/src/common.cpp | 34 --------------------------------- source/build/src/scriptfile.cpp | 18 +++++++++++++++++ 3 files changed, 18 insertions(+), 35 deletions(-) delete mode 100644 source/build/src/common.cpp diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0492fd0a0..0aed88559 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -771,7 +771,6 @@ set (PCH_SOURCES # Todo: Split out the license-safe code from this. build/src/animvpx.cpp build/src/clip.cpp - build/src/common.cpp build/src/defs.cpp build/src/engine.cpp build/src/mdsprite.cpp diff --git a/source/build/src/common.cpp b/source/build/src/common.cpp deleted file mode 100644 index 8fe80ee55..000000000 --- a/source/build/src/common.cpp +++ /dev/null @@ -1,34 +0,0 @@ - -#define LIBDIVIDE_BODY -#include "compat.h" -#include "build.h" -#include "scriptfile.h" - -#include "baselayer.h" - -#include "common.h" - -#include "../../glbackend/glbackend.h" - -// def/clipmap handling - - -////////// - -int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens) -{ - char *tok; - int32_t i; - - if (!sf) return T_ERROR; - tok = scriptfile_gettoken(sf); - if (!tok) return T_EOF; - - for (i=ntokens-1; i>=0; i--) - { - if (!Bstrcasecmp(tok, tl[i].text)) - return tl[i].tokenid; - } - return T_ERROR; -} - diff --git a/source/build/src/scriptfile.cpp b/source/build/src/scriptfile.cpp index f645b98fb..9ccc94fe2 100644 --- a/source/build/src/scriptfile.cpp +++ b/source/build/src/scriptfile.cpp @@ -438,3 +438,21 @@ void scriptfile_clearsymbols(void) symbtablength = 0; symbtaballoclength = 0; } + +int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens) +{ + char *tok; + int32_t i; + + if (!sf) return T_ERROR; + tok = scriptfile_gettoken(sf); + if (!tok) return T_EOF; + + for (i=ntokens-1; i>=0; i--) + { + if (!Bstrcasecmp(tok, tl[i].text)) + return tl[i].tokenid; + } + return T_ERROR; +} +