Internals: enum constructor cleanups. No functional change intended.

This commit is contained in:
Wilson Snyder
2022-09-15 19:58:10 -04:00
parent dbe1348b4c
commit 2dc85a5acd
26 changed files with 123 additions and 121 deletions
+4 -4
View File
@@ -149,7 +149,7 @@ FileLine::FileLine(FileLine::EmptySecret) {
m_warnOn = 0;
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {
const V3ErrorCode code = V3ErrorCode(codei);
const V3ErrorCode code{codei};
warnOff(code, code.defaultsOff());
}
}
@@ -309,14 +309,14 @@ bool FileLine::warnOff(const string& msg, bool flag) {
void FileLine::warnLintOff(bool flag) {
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {
const V3ErrorCode code = V3ErrorCode(codei);
const V3ErrorCode code{codei};
if (code.lintError()) warnOff(code, flag);
}
}
void FileLine::warnStyleOff(bool flag) {
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {
const V3ErrorCode code = V3ErrorCode(codei);
const V3ErrorCode code{codei};
if (code.styleError()) warnOff(code, flag);
}
}
@@ -335,7 +335,7 @@ bool FileLine::warnIsOff(V3ErrorCode code) const {
void FileLine::modifyStateInherit(const FileLine* fromp) {
// Any warnings that are off in "from", become off in "this".
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {
const V3ErrorCode code = V3ErrorCode(codei);
const V3ErrorCode code{codei};
if (fromp->warnIsOff(code)) warnOff(code, true);
}
}