diff --git a/src/ClientConfig.cc b/src/ClientConfig.cc index f0d24ef2..1b11c76e 100644 --- a/src/ClientConfig.cc +++ b/src/ClientConfig.cc @@ -240,9 +240,9 @@ ClientConfig::ClientConfig(const ClientConfig &_copy) } ////////////////////////////////////////////////// -ClientConfig &ClientConfig::operator=(const ClientConfig &_rhs) +ClientConfig &ClientConfig::operator=(const ClientConfig &_copy) { - *(this->dataPtr) = *(_rhs.dataPtr); + *(this->dataPtr) = *(_copy.dataPtr); return *this; } @@ -526,7 +526,7 @@ std::string ClientConfig::AsString(const std::string &_prefix) const << _prefix << "Cache location: " << this->CacheLocation() << std::endl << _prefix << "Servers:" << std::endl; - for (auto s : this->Servers()) + for (const auto &s : this->Servers()) { out << _prefix << " ---" << std::endl; out << _prefix << s.AsString(" "); diff --git a/src/FuelClient.cc b/src/FuelClient.cc index d7acdea7..a30feaaa 100644 --- a/src/FuelClient.cc +++ b/src/FuelClient.cc @@ -530,7 +530,7 @@ void FuelClient::AddServerConfigParametersToHeaders( std::vector &_headers) const { bool privateTokenDefined = false; - for (auto header : _headers) + for (const auto &header : _headers) { if (header.find("Private-token:") != std::string::npos) { @@ -627,7 +627,7 @@ Result FuelClient::DownloadModel(const ModelIdentifier &_id, if(!res) return res; - for (ModelIdentifier dep : dependencies) + for (const ModelIdentifier &dep : dependencies) { // Download dependency if not in the local cache if (!this->dataPtr->cache->MatchingModel(dep)) @@ -787,7 +787,7 @@ Result FuelClient::ModelDependencies( std::vector &_dependencies) { std::vector newDeps; - for (auto modelId : _ids) + for (const auto &modelId : _ids) { std::vector modelDeps; auto result = this->ModelDependencies(modelId, modelDeps); @@ -946,7 +946,7 @@ std::vector FuelClient::DownloadModels( std::lock_guard lock(idsMutex); gzdbg << "Adding " << dependencies.size() << " model dependencies to queue from " << id.Name() << "\n"; - for (auto dep : dependencies) + for (const auto &dep : dependencies) { if (uniqueIds.count(dep) == 0) { @@ -1191,15 +1191,15 @@ bool FuelClient::ParseWorldUrl(const common::URI &_worldUrl, } ////////////////////////////////////////////////// -bool FuelClient::ParseModelFileUrl(const common::URI &_fileUrl, +bool FuelClient::ParseModelFileUrl(const common::URI &_modelFileUrl, ModelIdentifier &_id, std::string &_filePath) { - if (!_fileUrl.Valid()) + if (!_modelFileUrl.Valid()) return false; - this->dataPtr->CheckForDeprecatedUri(_fileUrl); + this->dataPtr->CheckForDeprecatedUri(_modelFileUrl); - auto urlStr = _fileUrl.Str(); + auto urlStr = _modelFileUrl.Str(); std::smatch match; std::string scheme; @@ -1262,13 +1262,13 @@ bool FuelClient::ParseModelFileUrl(const common::URI &_fileUrl, } ////////////////////////////////////////////////// -bool FuelClient::ParseWorldFileUrl(const common::URI &_fileUrl, +bool FuelClient::ParseWorldFileUrl(const common::URI &_worldFileUrl, WorldIdentifier &_id, std::string &_filePath) { - if (!_fileUrl.Valid()) + if (!_worldFileUrl.Valid()) return false; - auto urlStr = _fileUrl.Str(); + auto urlStr = _worldFileUrl.Str(); std::smatch match; std::string scheme; @@ -1935,7 +1935,7 @@ void FuelClientPrivate::CheckForDeprecatedUri(const common::URI &_uri) { std::string newUrl = _uri.Str(); newUrl.replace(ignFuelPos, oldServer.size(), "fuel.gazebosim.org"); - ignwarn << "The " << oldServer << " URL is deprecrated. Pleasse change " + gzwarn << "The " << oldServer << " URL is deprecrated. Pleasse change " << _uri.Str() << " to " << newUrl << std::endl; } } @@ -1959,7 +1959,7 @@ void FuelClientPrivate::ZipFromResponse(const RestResponse &_resp, // Check for valid URI if (common::URI::Valid(linkUri)) { - igndbg << "Downloading from a referral link [" << linkUri << "]\n"; + gzdbg << "Downloading from a referral link [" << linkUri << "]\n"; // Get the zip data. RestResponse linkResp = rest.Request(HttpMethod::GET, // URL @@ -1979,7 +1979,7 @@ void FuelClientPrivate::ZipFromResponse(const RestResponse &_resp, } else { - ignerr << "Invalid referral link URI [" << linkUri << "]. " + gzerr << "Invalid referral link URI [" << linkUri << "]. " << "Unable to download.\n"; } } @@ -1992,7 +1992,7 @@ void FuelClientPrivate::ZipFromResponse(const RestResponse &_resp, } else { - ignerr << "Invalid content-type of [" << contentTypeIter->second << "]. " + gzerr << "Invalid content-type of [" << contentTypeIter->second << "]. " << "Unable to download.\n"; } } diff --git a/src/Interface.cc b/src/Interface.cc index d2c5e82e..c1c9412a 100644 --- a/src/Interface.cc +++ b/src/Interface.cc @@ -140,7 +140,7 @@ namespace gz if (!basename.empty() && basename.find(".sdf") != std::string::npos) { std::string extension = basename.substr( - basename.find_last_of(".") + 1); + basename.find_last_of('.') + 1); if (extension == "sdf") return *dirIter; } diff --git a/src/Model.cc b/src/Model.cc index 5d760fdb..90f85560 100644 --- a/src/Model.cc +++ b/src/Model.cc @@ -24,9 +24,8 @@ #include "ModelPrivate.hh" -namespace ignft = gz::fuel_tools; using namespace gz; -using namespace ignft; +using namespace fuel_tools; ////////////////////////////////////////////////// Model::Model() : dataPtr(nullptr) diff --git a/src/ModelIdentifier.cc b/src/ModelIdentifier.cc index 2e96c43f..45df4b4d 100644 --- a/src/ModelIdentifier.cc +++ b/src/ModelIdentifier.cc @@ -174,10 +174,10 @@ bool ModelIdentifier::SetName(const std::string &_name) } ////////////////////////////////////////////////// -bool ModelIdentifier::SetOwner(const std::string &_owner) +bool ModelIdentifier::SetOwner(const std::string &_name) { bool success = false; - std::string owner = common::lowercase(_owner); + std::string owner = common::lowercase(_name); if (this->dataPtr->ValidName(owner)) { success = true; diff --git a/src/Model_TEST.cc b/src/Model_TEST.cc index 620341d3..a30502da 100644 --- a/src/Model_TEST.cc +++ b/src/Model_TEST.cc @@ -18,9 +18,8 @@ #include #include "gz/fuel_tools/Model.hh" -namespace ignft = gz::fuel_tools; using namespace gz; -using namespace ignft; +using namespace fuel_tools; ///////////////////////////////////////////////// /// \brief Nothing crashes diff --git a/src/WorldIdentifier.cc b/src/WorldIdentifier.cc index 38697476..9c9296a0 100644 --- a/src/WorldIdentifier.cc +++ b/src/WorldIdentifier.cc @@ -106,9 +106,9 @@ std::string WorldIdentifier::Owner() const } ////////////////////////////////////////////////// -bool WorldIdentifier::SetOwner(const std::string &_owner) +bool WorldIdentifier::SetOwner(const std::string &_name) { - this->dataPtr->owner = common::lowercase(_owner); + this->dataPtr->owner = common::lowercase(_name); return true; } @@ -177,9 +177,9 @@ std::string WorldIdentifier::LocalPath() const } ////////////////////////////////////////////////// -bool WorldIdentifier::SetLocalPath(const std::string &_localPath) +bool WorldIdentifier::SetLocalPath(const std::string &_path) { - this->dataPtr->localPath = _localPath; + this->dataPtr->localPath = _path; return true; }