From 131eef9eb97c5cd3c71c7ffaec6e6ce489f9c842 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Jan 2019 16:09:59 +0100 Subject: [PATCH] - converted the ACS Stringbuilder macros into inline functions. --- src/p_acs.cpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 2786015c9f..3b7b2d87fe 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -714,6 +714,25 @@ protected: FBehavior *activeBehavior; int InModuleScriptNumber; + TArray ACS_StringBuilderStack; + + inline void STRINGBUILDER_START(FString &Builder) + { + if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) + { + ACS_StringBuilderStack.Push(Builder); + Builder = ""; + } + } + + inline void STRINGBUILDER_FINISH(FString &Builder) + { + if (!ACS_StringBuilderStack.Pop(Builder)) + { + Builder = ""; + } + } + void Link(); void Unlink(); void PutLast(); @@ -788,10 +807,6 @@ struct FBehavior::ArrayInfo }; TArray FBehavior::StaticModules; -TArray ACS_StringBuilderStack; - -#define STRINGBUILDER_START(Builder) if (Builder.IsNotEmpty() || ACS_StringBuilderStack.Size()) { ACS_StringBuilderStack.Push(Builder); Builder = ""; } -#define STRINGBUILDER_FINISH(Builder) if (!ACS_StringBuilderStack.Pop(Builder)) { Builder = ""; } //============================================================================ // @@ -3468,12 +3483,6 @@ void DACSThinker::Tick () // GlobalACSStrings.Clear(); - if (ACS_StringBuilderStack.Size()) - { - int size = ACS_StringBuilderStack.Size(); - ACS_StringBuilderStack.Clear(); - I_Error("Error: %d garbage entries on ACS string builder stack.", size); - } ACSTime.Unclock(); }