Merge branch 'master' of https://github.com/danmar/cppcheck
This commit is contained in:
commit
fa55899ff3
|
@ -224,11 +224,9 @@ Library::Error Library::load(const tinyxml2::XMLDocument &doc)
|
||||||
const char *value = node->Attribute("value");
|
const char *value = node->Attribute("value");
|
||||||
if (value == nullptr)
|
if (value == nullptr)
|
||||||
return Error(MISSING_ATTRIBUTE, "value");
|
return Error(MISSING_ATTRIBUTE, "value");
|
||||||
defines.push_back(std::string("#define ") +
|
defines.push_back(std::string(name) +
|
||||||
name +
|
|
||||||
" " +
|
" " +
|
||||||
value +
|
value);
|
||||||
"\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (nodename == "function") {
|
else if (nodename == "function") {
|
||||||
|
|
|
@ -529,14 +529,12 @@ static simplecpp::DUI createDUI(const Settings &mSettings, const std::string &cf
|
||||||
splitcfg(cfg, dui.defines, emptyString);
|
splitcfg(cfg, dui.defines, emptyString);
|
||||||
|
|
||||||
for (const std::string &def : mSettings.library.defines) {
|
for (const std::string &def : mSettings.library.defines) {
|
||||||
if (def.compare(0,8,"#define ") != 0)
|
const std::string::size_type pos = def.find_first_of(" (");
|
||||||
continue;
|
|
||||||
std::string s = def.substr(8);
|
|
||||||
const std::string::size_type pos = s.find_first_of(" (");
|
|
||||||
if (pos == std::string::npos) {
|
if (pos == std::string::npos) {
|
||||||
dui.defines.push_back(s);
|
dui.defines.push_back(def);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
std::string s = def;
|
||||||
if (s[pos] == ' ') {
|
if (s[pos] == ' ') {
|
||||||
s[pos] = '=';
|
s[pos] = '=';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue