From 297aef2c8f37370be59913463eeaff03343fe12d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 16 Mar 2022 10:29:43 -0500 Subject: [PATCH] Clean up compiler warnings (#882) * Remove unnecessary copies * Clean up unused variables Signed-off-by: Michael Carroll --- src/Plugin.cc | 4 ++-- src/parser_urdf.cc | 1 - test/integration/joint_dom.cc | 2 -- usd/src/cmd/sdf2usd.cc | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Plugin.cc b/src/Plugin.cc index d59e6bb64..e35a0fee4 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -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; @@ -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()); } diff --git a/src/parser_urdf.cc b/src/parser_urdf.cc index 9c191d4d9..5a305cdd8 100644 --- a/src/parser_urdf.cc +++ b/src/parser_urdf.cc @@ -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) diff --git a/test/integration/joint_dom.cc b/test/integration/joint_dom.cc index 0050d6442..4783c6a49 100644 --- a/test/integration/joint_dom.cc +++ b/test/integration/joint_dom.cc @@ -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"); diff --git a/usd/src/cmd/sdf2usd.cc b/usd/src/cmd/sdf2usd.cc index 5ca0d7131..02ab81579 100644 --- a/usd/src/cmd/sdf2usd.cc +++ b/usd/src/cmd/sdf2usd.cc @@ -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); }); }