From 0815812546c1dabc6a2d850329994b821137cc11 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 11 Dec 2008 15:23:44 -0500 Subject: [PATCH] Internals: Flip state of FileLine warning array, in prep for next change --- src/V3Error.cpp | 10 +++++----- src/V3Error.h | 16 +++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/V3Error.cpp b/src/V3Error.cpp index e77b46d19..8c094d3b5 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -69,10 +69,10 @@ FileLine::FileLine(FileLine::EmptySecret) { m_lineno=0; m_filename="COMMAND_LINE"; - m_warnOff=0; - for (int codei=V3ErrorCode::FIRST_WARN; codei m_warnOff; + bitset m_warnOn; static FileLine s_defaultFileLine; struct EmptySecret {}; protected: @@ -216,8 +218,8 @@ protected: void incLineno() { m_lineno++; } FileLine* copyOrSameFileLine(); public: - FileLine (const string& filename, int lineno) { m_lineno=lineno; m_filename = filename; m_warnOff=s_defaultFileLine.m_warnOff; } - FileLine (FileLine* fromp) { m_lineno=fromp->lineno(); m_filename = fromp->filename(); m_warnOff=fromp->m_warnOff; } + FileLine (const string& filename, int lineno) { m_lineno=lineno; m_filename = filename; m_warnOn=s_defaultFileLine.m_warnOn; } + FileLine (FileLine* fromp) { m_lineno=fromp->lineno(); m_filename = fromp->filename(); m_warnOn=fromp->m_warnOn; } FileLine (EmptySecret); ~FileLine() { } #ifdef VL_LEAK_CHECKS @@ -231,11 +233,11 @@ public: const string filebasename () const; const char* cfilename () const { return m_filename.c_str(); } const string profileFuncname() const; - void warnOff(V3ErrorCode code, bool flag) { m_warnOff.set(code,flag); } // Turn on/off warning messages on this line. + void warnOff(V3ErrorCode code, bool flag) { m_warnOn.set(code,!flag); } // Turn on/off warning messages on this line. bool warnOff(const string& code, bool flag); // Returns 1 if ok bool warnIsOff(V3ErrorCode code) const; void warnLintOff(bool flag); - void warnStateFrom(const FileLine& from) { m_warnOff=from.m_warnOff; } + void warnStateFrom(const FileLine& from) { m_warnOn=from.m_warnOn; } void warnStateInherit(const FileLine& from); void warnResetDefault() { warnStateFrom(s_defaultFileLine); }