Skip to content

Commit

Permalink
clang-tidy readability_redundant_preprocessor (CleverRaven#39254)
Browse files Browse the repository at this point in the history
* Remove redundant preprocessor check

* Enable readability-redundant-preprocessor

* Assorted other clang-tidy fixes
  • Loading branch information
jbytheway authored Apr 4, 2020
1 parent ab122ce commit 0a74ae4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ readability-*,\
-readability-named-parameter,\
-readability-redundant-control-flow,\
-readability-redundant-declaration,\
-readability-redundant-preprocessor,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test).*'
Expand Down
5 changes: 0 additions & 5 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3586,17 +3586,12 @@ std::vector<options_manager::id_and_option> cata_tiles::build_renderer_list()
{
std::vector<options_manager::id_and_option> renderer_names;
std::vector<options_manager::id_and_option> default_renderer_names = {
#if defined(TILES)
# if defined(_WIN32)
{ "direct3d", translate_marker( "direct3d" ) },
# endif
{ "software", translate_marker( "software" ) },
{ "opengl", translate_marker( "opengl" ) },
{ "opengles2", translate_marker( "opengles2" ) },
#else
{ "software", translate_marker( "software" ) }
#endif

};
int numRenderDrivers = SDL_GetNumRenderDrivers();
DebugLog( D_INFO, DC_ALL ) << "Number of render drivers on your system: " << numRenderDrivers;
Expand Down
2 changes: 1 addition & 1 deletion src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class Character : public Creature, public visitable<Character>
int intensity = 0, bool force = false, bool deferred = false ) override;

/**Determine if character is susceptible to dis_type and if so apply the symptoms*/
void expose_to_disease( const diseasetype_id dis_type );
void expose_to_disease( diseasetype_id dis_type );
/**
* Handles end-of-turn processing.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1459,9 +1459,9 @@ void game_menus::inv::compare( player &p, const cata::optional<tripoint> &offset
ui.on_screen_resize( [&]( ui_adaptor & ui ) {
const int half_width = ( TERMX - VIEW_OFFSET_X * 2 ) / 2;
const int height = TERMY - VIEW_OFFSET_Y * 2;
w_last_item_info = catacurses::newwin( height, half_width, point( 0, 0 ) );
w_last_item_info = catacurses::newwin( height, half_width, point_zero );
w_cur_item_info = catacurses::newwin( height, half_width, point( half_width, 0 ) );
ui.position( point( 0, 0 ), point( half_width * 2, height ) );
ui.position( point_zero, point( half_width * 2, height ) );
} );
ui.mark_resize();

Expand Down
2 changes: 1 addition & 1 deletion src/veh_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class vpart_info
const itype_id &fuel_type );
static void load_wheel( cata::optional<vpslot_wheel> &whptr, const JsonObject &jo );
static void load_workbench( cata::optional<vpslot_workbench> &wbptr, const JsonObject &jo );
static void load_rotor( cata::optional<vpslot_rotor> &whptr, const JsonObject &jo );
static void load_rotor( cata::optional<vpslot_rotor> &roptr, const JsonObject &jo );
static void load( const JsonObject &jo, const std::string &src );
static void finalize();
static void check();
Expand Down
4 changes: 2 additions & 2 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,13 @@ static int get_turn_from_angle( const double angle, const tripoint &vehpos, cons
if( angle > 10.0 && angle <= 45.0 ) {
return reverse ? 4 : 1;
} else if( angle > 45.0 && angle <= 90.0 ) {
return reverse ? 3 : 3;
return 3;
} else if( angle > 90.0 && angle < 180.0 ) {
return reverse ? 1 : 4;
} else if( angle < -10.0 && angle >= -45.0 ) {
return reverse ? -4 : -1;
} else if( angle < -45.0 && angle >= -90.0 ) {
return reverse ? -3 : -3;
return -3;
} else if( angle < -90.0 && angle > -180.0 ) {
return reverse ? -1 : -4;
// edge case of being exactly on the button for the target.
Expand Down
2 changes: 1 addition & 1 deletion tests/npc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ TEST_CASE( "npc_can_target_player" )

g->faction_manager_ptr->create_if_needed();

g->place_player( tripoint( 0, 0, 0 ) );
g->place_player( tripoint_zero );

clear_npcs();
clear_creatures();
Expand Down

0 comments on commit 0a74ae4

Please sign in to comment.