Skip to content

Commit

Permalink
Fix unused variable and parameter warnings from gcc
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
irydacea committed Jul 4, 2014
1 parent ec52e2e commit ffbf683
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/pathfind/teleport.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit ffbf683

Please sign in to comment.