diff --git a/Source/build.cpp b/Source/build.cpp index 395a9a32..06776b47 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -3451,16 +3451,16 @@ int CEXEBuild::parse_pragma(LineParser &line) return ret; } -void CEXEBuild::DiagState::Push() +void DiagState::Push() { - CEXEBuild::DiagState *p = new DiagState(); + DiagState *p = new DiagState(); p->m_Disabled = m_Disabled; // Copy current state p->m_pStack = m_pStack, m_pStack = p; } -bool CEXEBuild::DiagState::Pop() +bool DiagState::Pop() { if (!m_pStack) return false; - CEXEBuild::DiagState *pPop = m_pStack; + DiagState *pPop = m_pStack; m_pStack = pPop->m_pStack, pPop->m_pStack = 0; m_Disabled.swap(pPop->m_Disabled); delete pPop; diff --git a/Source/build.h b/Source/build.h index 9818c77f..74eeb2ae 100644 --- a/Source/build.h +++ b/Source/build.h @@ -165,6 +165,21 @@ namespace MakensisAPI { #define FLAG_OFFSET(flag) (FIELD_OFFSET(exec_flags_t, flag)/sizeof(int)) +class DiagState { +public: + DiagState() : m_pStack(0) { assert(DIAGCODE_INTERNAL_LAST <= 0xffff); } + ~DiagState() { delete m_pStack; } + void Enable(DIAGCODE n) { m_Disabled.erase(static_cast(n)); } + void Disable(DIAGCODE n) { m_Disabled.insert(static_cast(n)); } + bool IsDisabled(DIAGCODE n) { return m_Disabled.find(static_cast(n)) != m_Disabled.end(); } + void Push(); + bool Pop(); + static bool IsValidCode(unsigned int n) { return n >= DIAGCODE_INTERNAL_FIRST && n <= DIAGCODE_INTERNAL_LAST; } +protected: + DiagState *m_pStack; + std::set m_Disabled; +}; + class CEXEBuild { public: CEXEBuild(signed char pponly); @@ -396,20 +411,7 @@ class CEXEBuild { void print_warnings(); void warninghelper(DIAGCODE dc, bool fl, const TCHAR *fmt, va_list args); - class DiagState { - public: - DiagState() : m_pStack(0) { assert(DIAGCODE_INTERNAL_LAST <= 0xffff); } - ~DiagState() { delete m_pStack; } - void Enable(DIAGCODE n) { m_Disabled.erase(static_cast(n)); } - void Disable(DIAGCODE n) { m_Disabled.insert(static_cast(n)); } - bool IsDisabled(DIAGCODE n) { return m_Disabled.find(static_cast(n)) != m_Disabled.end(); } - void Push(); - bool Pop(); - static bool IsValidCode(unsigned int n) { return n >= DIAGCODE_INTERNAL_FIRST && n <= DIAGCODE_INTERNAL_LAST; } - protected: - DiagState *m_pStack; - std::set m_Disabled; - } diagstate; + DiagState diagstate; /** Are we defining an uninstall version of the code? * @param un Use like a boolean to define whether in uninstall mode. diff --git a/Source/script.cpp b/Source/script.cpp index ae0efff3..aa10a0eb 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -868,7 +868,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) #endif multiple_entries_instruction=0; - entry ent={}; + entry ent={0,}; switch (which_token) { // macro stuff