From 9cd28a4c3dc3429bb0f879cc0483519cb14765e4 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 5 Sep 2003 21:16:33 +0000 Subject: [PATCH] No more static variables in CEXEBuild member functions git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2849 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.h | 9 ++++----- Source/script.cpp | 7 +++---- TODO.txt | 2 -- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Source/build.h b/Source/build.h index e02ee074..5caac0da 100644 --- a/Source/build.h +++ b/Source/build.h @@ -140,15 +140,12 @@ class CEXEBuild { } *cur_ifblock; TinyGrowBuf build_preprocessor_data; - int last_line_had_slash; void start_ifblock(); void end_ifblock(); int num_ifblock(); - /*int ignore; - int if_count; - int ignored_if_count; - int wait_for_endif;*/ + + int last_line_had_slash; bool inside_comment; void ERROR_MSG(const char *s, ...); @@ -282,6 +279,8 @@ class CEXEBuild { char build_output_filename[1024]; + int build_include_depth; + // Added by ramon 6 jun 2003 #ifdef NSIS_SUPPORT_VERSION_INFO CResourceVersionInfo rVersionInfo; diff --git a/Source/script.cpp b/Source/script.cpp index 58b9fc73..0712d876 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2431,14 +2431,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) if (malloced) free(f); return PS_ERROR; } - static int depth; - if (depth >= MAX_INCLUDEDEPTH) + if (build_include_depth >= MAX_INCLUDEDEPTH) { ERROR_MSG("parseScript: too many levels of includes (%d max).\n",MAX_INCLUDEDEPTH); if (malloced) free(f); return PS_ERROR; } - depth++; + build_include_depth++; int last_linecnt=linecnt; linecnt=0; @@ -2468,7 +2467,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) curfilename=last_filename; fp=last_fp; - depth--; + build_include_depth--; fclose(incfp); if (r != PS_EOF && r != PS_OK) { diff --git a/TODO.txt b/TODO.txt index 22abca76..6fb57fd9 100644 --- a/TODO.txt +++ b/TODO.txt @@ -16,8 +16,6 @@ NSIS * LZMA compression -* stop using static variables so CEXEBuild can be used as a real class - EXAMPLES * write an advanced paging example showing multiple components page with multiple