Skip to content

Commit

Permalink
Removed unused var assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Dec 3, 2019
1 parent 10e59de commit af5b035
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 32 deletions.
3 changes: 1 addition & 2 deletions src/armor_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ void draw_mid_pane( const catacurses::window &w_sort_middle,
bad_item_name, body_parts
);
}
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
i += fold_and_print( w_sort_middle, point( 0, i ), win_width, c_light_gray, message );
fold_and_print( w_sort_middle, point( 0, i ), win_width, c_light_gray, message );
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/auto_note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ void auto_note_manager_gui::show()
int tmpx = 0;
tmpx += shortcut_print( w_header, point( tmpx, 0 ), c_white, c_light_green, _( "<E>nable" ) ) + 2;
tmpx += shortcut_print( w_header, point( tmpx, 0 ), c_white, c_light_green, _( "<D>isable" ) ) + 2;
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
tmpx += shortcut_print( w_header, point( tmpx, 0 ), c_white, c_light_green,
_( "<Enter> - Toggle" ) ) + 2;
shortcut_print( w_header, point( tmpx, 0 ), c_white, c_light_green, _( "<Enter> - Toggle" ) );

// Draw horizontal line and corner pieces of the table
for( int x = 0; x < 78; x++ ) {
Expand Down Expand Up @@ -257,9 +255,7 @@ void auto_note_manager_gui::show()
get_option<bool>( "AUTO_NOTES" ) ? _( "True" ) : _( "False" ) );

currentX += shortcut_print( w_header, point( currentX, 0 ), c_white, c_light_green, " " );
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
currentX += shortcut_print( w_header, point( currentX, 0 ), c_white, c_light_green,
_( "<S>witch " ) );
shortcut_print( w_header, point( currentX, 0 ), c_white, c_light_green, _( "<S>witch " ) );

// Clear table
for( int y = 0; y < iContentHeight; y++ ) {
Expand Down
6 changes: 2 additions & 4 deletions src/bionics_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@ static void draw_description( const catacurses::window &win, const bionic &bio )
// TODO: Unhide when enforcing limits
if( get_option < bool >( "CBM_SLOTS_ENABLED" ) ) {
const bool each_bp_on_new_line = ypos + static_cast<int>( num_bp ) + 1 < getmaxy( win );
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
ypos += fold_and_print( win, point( 0, ypos ), width, c_light_gray,
list_occupied_bps( bio.id, _( "This bionic occupies the following body parts:" ),
each_bp_on_new_line ) );
fold_and_print( win, point( 0, ypos ), width, c_light_gray, list_occupied_bps( bio.id,
_( "This bionic occupies the following body parts:" ), each_bp_on_new_line ) );
}
wrefresh( win );
}
Expand Down
4 changes: 2 additions & 2 deletions src/crafting_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,8 @@ std::string peek_related_recipe( const recipe *current, const recipe_subset &ava
if( !related_results.empty() ) {
rel_menu.addentry( ++np_last, false, -1, _( "RESULTS" ) );
}
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
np_last = related_menu_fill( rel_menu, related_results, available );

related_menu_fill( rel_menu, related_results, available );

rel_menu.settext( _( "Related recipes:" ) );
rel_menu.query();
Expand Down
9 changes: 3 additions & 6 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6019,20 +6019,17 @@ static void zones_manager_shortcuts( const catacurses::window &w_info )
tmpx += shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "<A>dd" ) ) + 2;
tmpx += shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "<R>emove" ) ) + 2;
tmpx += shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "<E>nable" ) ) + 2;
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
tmpx += shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "<D>isable" ) ) + 2;
shortcut_print( w_info, point( tmpx, 1 ), c_white, c_light_green, _( "<D>isable" ) );

tmpx = 1;
tmpx += shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green,
_( "<+-> Move up/down" ) ) + 2;
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
tmpx += shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, _( "<Enter>-Edit" ) ) + 2;
shortcut_print( w_info, point( tmpx, 2 ), c_white, c_light_green, _( "<Enter>-Edit" ) );

tmpx = 1;
tmpx += shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green,
_( "<S>how all / hide distant" ) ) + 2;
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
tmpx += shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "<M>ap" ) ) + 2;
shortcut_print( w_info, point( tmpx, 3 ), c_white, c_light_green, _( "<M>ap" ) );

wrefresh( w_info );
}
Expand Down
2 changes: 0 additions & 2 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,6 @@ float map::vehicle_vehicle_collision( vehicle &veh, vehicle &veh2,
veh2.damage( parm2, dmg2_part, DT_BASH );
}

epicenter1.x /= coll_parts_cnt;
epicenter1.y /= coll_parts_cnt;
epicenter2.x /= coll_parts_cnt;
epicenter2.y /= coll_parts_cnt;

Expand Down
3 changes: 1 addition & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,8 +1983,7 @@ void player::apply_damage( Creature *source, body_part hurt, int dam, const bool
remove_med -= reduce_healing_effect( effect_bandaged, remove_med, hurt );
}
if( remove_med > 0 && has_effect( effect_disinfected, hurt ) ) {
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
remove_med -= reduce_healing_effect( effect_disinfected, remove_med, hurt );
reduce_healing_effect( effect_disinfected, remove_med, hurt );
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ static int draw_targeting_window( const catacurses::window &w_target, const std:
}

if( is_mouse_enabled() ) {
mvwprintz( w_target, point( 1, text_y++ ), c_white,
mvwprintz( w_target, point( 1, text_y ), c_white,
_( "Mouse: LMB: Target, Wheel: Cycle, RMB: Fire" ) );
}
return lines_used;
Expand Down Expand Up @@ -1464,14 +1464,11 @@ std::vector<tripoint> target_handler::target_ui( player &pc, target_mode mode,
predicted_delay );
}
} else if( mode == TARGET_MODE_TURRET ) {
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
line_number = draw_turret_aim( pc, w_target, line_number, dst );
draw_turret_aim( pc, w_target, line_number, dst );
} else if( mode == TARGET_MODE_THROW ) {
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
line_number = draw_throw_aim( pc, w_target, line_number, ctxt, relevant, dst, false );
draw_throw_aim( pc, w_target, line_number, ctxt, relevant, dst, false );
} else if( mode == TARGET_MODE_THROW_BLIND ) {
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
line_number = draw_throw_aim( pc, w_target, line_number, ctxt, relevant, dst, true );
draw_throw_aim( pc, w_target, line_number, ctxt, relevant, dst, true );
}

wrefresh( g->w_terrain );
Expand Down
1 change: 0 additions & 1 deletion src/suffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ void Character::suffer_from_schizophrenia()

add_msg_if_player( m_bad, "%s", str );
drop( get_item_position( &weapon ), pos() );
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores)
return;
}
// Talk to self
Expand Down

0 comments on commit af5b035

Please sign in to comment.