Skip to content

Commit

Permalink
Clean up compiler warnings (#882)
Browse files Browse the repository at this point in the history
* Remove unnecessary copies
* Clean up unused variables

Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Mar 16, 2022
1 parent 1acea10 commit 297aef2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ sdf::ElementPtr Plugin::ToElement() const
elem->GetAttribute("filename")->Set(this->Filename());

// Insert plugin content
for (const sdf::ElementPtr content : this->dataPtr->contents)
for (const sdf::ElementPtr &content : this->dataPtr->contents)
elem->InsertElement(content, true);

return elem;
Expand Down Expand Up @@ -188,7 +188,7 @@ Plugin &Plugin::operator=(const Plugin &_plugin)

this->dataPtr->contents.clear();
// Copy the contents of the plugin
for (const sdf::ElementPtr content : _plugin.Contents())
for (const sdf::ElementPtr &content : _plugin.Contents())
{
this->dataPtr->contents.push_back(content->Clone());
}
Expand Down
1 change: 0 additions & 1 deletion src/parser_urdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,6 @@ void CreateLink(tinyxml2::XMLElement *_root,
elem->SetAttribute("name", _link->name.c_str());

// compute global transform
ignition::math::Pose3d localTransform;
// this is the transform from parent link to current _link
// this transform does not exist for the root link
if (_link->parent_joint)
Expand Down
2 changes: 0 additions & 2 deletions test/integration/joint_dom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,6 @@ TEST(DOMJoint, Sensors)
EXPECT_EQ("joint", joint->Name());
EXPECT_EQ(1u, joint->SensorCount());

ignition::math::Pose3d pose;

// Get the force_torque sensor
const sdf::Sensor *forceTorqueSensor =
joint->SensorByName("force_torque_sensor");
Expand Down
2 changes: 1 addition & 1 deletion usd/src/cmd/sdf2usd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void addFlags(CLI::App &_app)
opt->outputFilename,
"Output filename. Defaults to output.usd unless otherwise specified.");

_app.callback([&_app, opt](){
_app.callback([opt](){
runCommand(*opt);
});
}
Expand Down

0 comments on commit 297aef2

Please sign in to comment.