mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
rename a local called not, which is a keyword
not is an alternative spelling of ! in ISO C++, so it cannot name a variable:
XML_Char const* not = GetAttribute("not", atts);
MSVC only treats it as an operator when iso646.h is included, so it accepts
this as an identifier and the file compiles. clang cannot parse any of the
three lines that mention it.
Renamed to notOp, matching cmpOp thirty lines above, which reads the "op"
attribute the same way. The attribute name in the XML is untouched.
Verification:
grep -rnE '\*[ \t]*(and|or|not|xor)\b' --include=*.cpp --include=*.h . # nothing
ninja -C build parse # parser-error class gone: 21 -> 17 sites
ninja -C build -k 0 # Release, four applications, green
ninja -C build-debug -k 0 # Debug, four applications, green
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
majcosta
co-authored by
Claude Opus 4.8
parent
897d3737c4
commit
31a2202c8a
@@ -125,9 +125,9 @@ namespace LogicalBodyTypes {
|
||||
else {
|
||||
data->criterionType |= Filter::_REQ_EQ;
|
||||
}
|
||||
XML_Char const* not = GetAttribute("not", atts);
|
||||
if (not != NULL) {
|
||||
if (strcmp(not, "") != 0) throw XMLParseException("Not attribute must not have a value assigned!", name, data->pParser);
|
||||
XML_Char const* notOp = GetAttribute("not", atts);
|
||||
if (notOp != NULL) {
|
||||
if (strcmp(notOp, "") != 0) throw XMLParseException("Not attribute must not have a value assigned!", name, data->pParser);
|
||||
data->criterionType |= Filter::_REQ_NOT;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user