Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang-tidy readability-redundant-declarations #39702

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ readability-*,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-redundant-control-flow,\
-readability-redundant-declaration,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test|tools).*'
Expand Down
4 changes: 2 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,8 +2582,8 @@ void activity_handlers::lockpicking_finish( player_activity *act, player *p )
/** @EFFECT_LOCKPICK greatly improves chances of successfully picking door lock, reduces chances of bad outcomes */
int pick_roll = std::pow( 1.5, p->get_skill_level( skill_lockpick ) ) *
( std::pow( 1.3, p->get_skill_level( skill_mechanics ) ) +
it->get_quality( qual_LOCKPICK ) - it->damage() / 2000 ) +
p->dex_cur / 4;
it->get_quality( qual_LOCKPICK ) - it->damage() / 2000.0 ) +
p->dex_cur / 4.0;
int lock_roll = rng( 1, 120 );
if( pick_roll >= lock_roll ) {
p->practice( skill_lockpick, lock_roll );
Expand Down
1 change: 0 additions & 1 deletion src/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class game;

extern std::unique_ptr<game> g;

extern bool trigdist;
extern bool use_tiles;
extern bool fov_3d;
extern int fov_3d_z_range;
Expand Down
2 changes: 2 additions & 0 deletions src/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "output.h"
#include "enums.h"

bool trigdist;

void bresenham( const point &p1, const point &p2, int t,
const std::function<bool( const point & )> &interact )
{
Expand Down
4 changes: 2 additions & 2 deletions src/line.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "math_defines.h"
#include "point.h"

extern bool trigdist;

/** Converts degrees to radians */
constexpr double DEGREES( double v )
{
Expand Down Expand Up @@ -147,8 +149,6 @@ std::vector<point> line_to( const point &p1, const point &p2, int t = 0 );
std::vector<tripoint> line_to( const tripoint &loc1, const tripoint &loc2, int t = 0, int t2 = 0 );
// sqrt(dX^2 + dY^2)

extern bool trigdist;

inline float trig_dist( const tripoint &loc1, const tripoint &loc2 )
{
return std::sqrt( static_cast<double>( ( loc1.x - loc2.x ) * ( loc1.x - loc2.x ) ) +
Expand Down
1 change: 0 additions & 1 deletion src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include <sstream>
#include <string>

bool trigdist;
bool use_tiles;
bool log_from_top;
int message_ttl;
Expand Down
2 changes: 0 additions & 2 deletions tests/monster_vision_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ static monster &spawn_and_clear( const tripoint &pos, bool set_floor )

static const time_point midday = calendar::turn_zero + 12_hours;

extern bool fov_3d;

TEST_CASE( "monsters shouldn't see through floors", "[vision]" )
{
override_option opt( "ZLEVELS", "true" );
Expand Down