Skip to content

Commit

Permalink
[App] Fix LGTM warning decl hides param
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes committed Sep 19, 2021
1 parent ef0e303 commit 6780ded
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/App/Expression.cpp
Expand Up @@ -484,11 +484,11 @@ App::any pyObjectToAny(Py::Object value, bool check) {
if (PyLong_Check(pyvalue))
return App::any(PyLong_AsLong(pyvalue));
else if (PyUnicode_Check(pyvalue)) {
const char* value = PyUnicode_AsUTF8(pyvalue);
if (!value) {
const char* utf8value = PyUnicode_AsUTF8(pyvalue);
if (!utf8value) {
FC_THROWM(Base::ValueError, "Invalid unicode string");
}
return App::any(std::string(value));
return App::any(std::string(utf8value));
}
else {
return App::any(pyObjectWrap(pyvalue));
Expand Down
6 changes: 3 additions & 3 deletions src/App/ObjectIdentifier.cpp
Expand Up @@ -1490,14 +1490,14 @@ void ObjectIdentifier::String::checkImport(const App::DocumentObject *owner,
else {
str.resize(str.size()-1);
auto mapped = reader->getName(str.c_str());
auto obj = owner->getDocument()->getObject(mapped);
if (!obj) {
auto objForMapped = owner->getDocument()->getObject(mapped);
if (!objForMapped) {
FC_ERR("Cannot find object " << str);
}
else {
isString = true;
forceIdentifier = false;
str = obj->Label.getValue();
str = objForMapped->Label.getValue();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/App/PropertyLinks.cpp
Expand Up @@ -2729,9 +2729,9 @@ class App::DocInfo :
// potentially unchanged. So we just touch at most one.
std::set<Document*> docs;
for(auto link : links) {
auto doc = static_cast<DocumentObject*>(link->getContainer())->getDocument();
auto ret = docs.insert(doc);
if(ret.second && !doc->isTouched())
auto linkdoc = static_cast<DocumentObject*>(link->getContainer())->getDocument();
auto ret = docs.insert(linkdoc);
if(ret.second && !linkdoc->isTouched())
link->touch();
}
}
Expand Down

0 comments on commit 6780ded

Please sign in to comment.