From ffbf683eb07ec320cea55f40d2ef5c740b422a34 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Thu, 3 Jul 2014 21:56:35 -0400 Subject: [PATCH] Fix unused variable and parameter warnings from gcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deals with the following warnings (errors in strict mode) by removing the offending code and dropping a parameter name, respectively. src/pathfind/teleport.cpp: In member function ‘void pathfind::teleport_group::get_teleport_pair(pathfind::teleport_pair&, const unit&, bool) const’: src/pathfind/teleport.cpp:70:12: error: variable ‘units’ set but not used [-Werror=unused-but-set-variable] src/pathfind/teleport.cpp:66:16: error: unused parameter ‘ignore_units’ [-Werror=unused-parameter] iceiceice, you probably should take a look at this. --- src/pathfind/teleport.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pathfind/teleport.cpp b/src/pathfind/teleport.cpp index dda736148143..d561c0f8ffe3 100644 --- a/src/pathfind/teleport.cpp +++ b/src/pathfind/teleport.cpp @@ -63,16 +63,11 @@ teleport_group::teleport_group(const vconfig& cfg, bool reversed) : cfg_(cfg.get void teleport_group::get_teleport_pair( teleport_pair& loc_pair , const unit& u - , const bool ignore_units) const + , const bool /*ignore_units*/) const { const map_location &loc = u.get_location(); static unit_map empty_unit_map; - unit_map *units; - if (ignore_units) { - units = &empty_unit_map; - } else { - units = resources::units; - } + vconfig filter(cfg_.child_or_empty("filter"), true); vconfig source(cfg_.child_or_empty("source"), true); vconfig target(cfg_.child_or_empty("target"), true);