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

Death to void params #38546

Merged
merged 4 commits into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 1 addition & 3 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,9 +1563,8 @@ void activity_handlers::forage_finish( player_activity *act, player *p )
act->set_to_null();
}

void activity_handlers::generic_game_do_turn( player_activity *act, player *p )
void activity_handlers::generic_game_do_turn( player_activity */*act*/, player *p )
{
( void )act;
if( calendar::once_every( 1_minutes ) ) {
p->add_morale( MORALE_GAME, 4, 60 );
}
Expand Down Expand Up @@ -2928,7 +2927,6 @@ void activity_handlers::fish_do_turn( player_activity *act, player *p )

void activity_handlers::fish_finish( player_activity *act, player *p )
{
( void )p;
act->set_to_null();
p->add_msg_if_player( m_info, _( "You finish fishing" ) );
if( !p->backlog.empty() && p->backlog.front().id() == ACT_MULTIPLE_FISH ) {
Expand Down
14 changes: 3 additions & 11 deletions src/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,9 @@ void draw_bullet_curses( map &m, const tripoint &t, const char bullet, const tri
#if defined(TILES)
/* Bullet Animation -- Maybe change this to animate the ammo itself flying through the air?*/
// need to have a version where there is no player defined, possibly. That way shrapnel works as intended
void game::draw_bullet( const tripoint &t, const int i, const std::vector<tripoint> &trajectory,
void game::draw_bullet( const tripoint &t, const int /*i*/, const std::vector<tripoint> &/*trajectory*/,
const char bullet )
kevingranade marked this conversation as resolved.
Show resolved Hide resolved
{
// TODO: signature and impl could be changed to eliminate these params
( void )i;
( void )trajectory;

if( !use_tiles ) {
draw_bullet_curses( m, t, bullet, nullptr );
return;
Expand Down Expand Up @@ -557,11 +553,9 @@ void game::draw_hit_player( const player &p, const int dam )
/* Line drawing code, not really an animation but should be separated anyway */
namespace
{
void draw_line_curses( game &g, const tripoint &pos, const tripoint &center,
void draw_line_curses( game &g, const tripoint &/*pos*/, const tripoint &center,
const std::vector<tripoint> &ret )
{
( void )pos;

for( const tripoint &p : ret ) {
const auto critter = g.critter_at( p, true );

Expand Down Expand Up @@ -624,10 +618,8 @@ void game::draw_line( const tripoint &p, const std::vector<tripoint> &points )
tilecontext->init_draw_line( p, points, "line_trail", false );
}
#else
void game::draw_line( const tripoint &p, const std::vector<tripoint> &points )
void game::draw_line( const tripoint &/*p*/, const std::vector<tripoint> &points )
{
( void )p;

draw_line_curses( *this, points );
}
#endif
Expand Down
6 changes: 2 additions & 4 deletions src/clzones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,8 @@ std::unordered_set<tripoint> zone_manager::get_point_set_loot( const tripoint &w
}

std::unordered_set<tripoint> zone_manager::get_point_set_loot( const tripoint &where,
int radius, bool npc_search, const faction_id &fac ) const
int radius, bool npc_search, const faction_id &/*fac*/ ) const
{
( void )fac;
std::unordered_set<tripoint> res;
for( const tripoint elem : g->m.points_in_radius( g->m.getlocal( where ), radius ) ) {
const zone_data *zone = get_zone_at( g->m.getabs( elem ) );
Expand Down Expand Up @@ -784,8 +783,7 @@ zone_type_id zone_manager::get_near_zone_type_for_item( const item &it,
const item_category &cat = it.get_category();

if( has_near( zone_type_id( "LOOT_CUSTOM" ), where, range ) ) {
for( const auto elem : get_near( zone_type_id( "LOOT_CUSTOM" ), where, range, &it ) ) {
( void )elem;
if( !get_near( zone_type_id( "LOOT_CUSTOM" ), where, range, &it ).empty() ) {
return zone_type_id( "LOOT_CUSTOM" );
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,8 @@ void conditional_t<T>::set_is_driving( bool is_npc )
}

template<class T>
void conditional_t<T>::set_has_stolen_item( bool is_npc )
void conditional_t<T>::set_has_stolen_item( bool /*is_npc*/ )
{
( void )is_npc;
condition = []( const T & d ) {
player *actor = d.alpha;
npc &p = *d.beta;
Expand Down
3 changes: 1 addition & 2 deletions src/construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,8 @@ bool construct::check_no_trap( const tripoint &p )
return g->m.tr_at( p ).is_null();
}

void construct::done_trunk_plank( const tripoint &p )
void construct::done_trunk_plank( const tripoint &/*p*/ )
{
( void )p; //unused
int num_logs = rng( 2, 3 );
for( int i = 0; i < num_logs; ++i ) {
iuse::cut_log_into_planks( g->u );
Expand Down
3 changes: 1 addition & 2 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,9 +1187,8 @@ bool Creature::resists_effect( const effect &e )
return false;
}

bool Creature::has_trait( const trait_id &flag ) const
bool Creature::has_trait( const trait_id &/*flag*/ ) const
{
( void )flag;
return false;
}

Expand Down
6 changes: 2 additions & 4 deletions src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ namespace
{

#if defined(_WIN32)
bool do_mkdir( const std::string &path, const int mode )
bool do_mkdir( const std::string &path, const int /*mode*/ )
{
( void )mode; //not used on windows
#if defined(_MSC_VER)
return _mkdir( path.c_str() ) == 0;
#else
Expand Down Expand Up @@ -209,10 +208,9 @@ bool is_directory_stat( const std::string &full_path )
// Returns true if entry is a directory, false otherwise.
//--------------------------------------------------------------------------------------------------
#if defined(__MINGW32__)
bool is_directory( const dirent &entry, const std::string &full_path )
bool is_directory( const dirent &/*entry*/, const std::string &full_path )
{
// no dirent::d_type
( void )entry; //not used for mingw
return is_directory_stat( full_path );
}
#else
Expand Down
12 changes: 7 additions & 5 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4253,9 +4253,9 @@ void game::knockback( const tripoint &s, const tripoint &t, int force, int stun,
stun > 0 indicates base stun duration, and causes impact stun; stun == -1 indicates only impact stun
dam_mult multiplies impact damage, bash effect on impact, and sound level on impact */

void game::knockback( std::vector<tripoint> &traj, int force, int stun, int dam_mult )
void game::knockback( std::vector<tripoint> &traj, int /*force*/, int stun, int dam_mult )
{
( void )force; // FIXME: unused but header says it should do something
// FIXME: force is unused but header says it should do something
// TODO: make the force parameter actually do something.
// the header file says higher force causes more damage.
// perhaps that is what it should do?
Expand Down Expand Up @@ -6939,15 +6939,17 @@ int game::get_user_action_counter() const
return user_action_counter;
}

#if defined(TILES)
bool game::take_screenshot( const std::string &path ) const
{
#if defined(TILES)
return save_screenshot( path );
}
#else
( void )path; // unused
bool game::take_screenshot( const std::string &/*path*/ ) const
{
return false;
#endif
}
#endif

//helper method so we can keep list_items shorter
void game::reset_item_list_state( const catacurses::window &window, int height, bool bRadiusSort )
Expand Down
3 changes: 1 addition & 2 deletions src/gamemode_defense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ void defense_game::pre_action( action_id &act )
}
}

void defense_game::post_action( action_id act )
void defense_game::post_action( action_id /*act*/ )
{
( void )act;
}

void defense_game::game_over()
Expand Down
4 changes: 1 addition & 3 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ static void pick_plant( player &p, const tripoint &examp, const std::string &ite
/**
* Nothing player can interact with here.
*/
void iexamine::none( player &p, const tripoint &examp )
void iexamine::none( player &/*p*/, const tripoint &examp )
{
( void )p; //unused
add_msg( _( "That is a %s." ), g->m.name( examp ) );
}

Expand Down Expand Up @@ -700,7 +699,6 @@ void iexamine::toilet( player &p, const tripoint &examp )
*/
void iexamine::elevator( player &p, const tripoint &examp )
{
( void )p; //unused
if( !query_yn( _( "Use the %s?" ), g->m.tername( examp ) ) ) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions src/melee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,10 +994,9 @@ void player::roll_cut_damage( bool crit, damage_instance &di, bool average, cons
di.add_damage( DT_CUT, cut_dam, arpen, armor_mult, cut_mul );
}

void player::roll_stab_damage( bool crit, damage_instance &di, bool average,
void player::roll_stab_damage( bool crit, damage_instance &di, bool /*average*/,
const item &weap ) const
{
( void )average; // No random rolls in stab damage
float cut_dam = mabuff_damage_bonus( DT_STAB ) + weap.damage_melee( DT_STAB );

int unarmed_skill = get_skill_level( skill_unarmed );
Expand Down
3 changes: 1 addition & 2 deletions src/mondeath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,8 @@ void mdeath::gameover( monster &z )
g->u.hp_cur[hp_torso] = 0;
}

void mdeath::kill_breathers( monster &z )
void mdeath::kill_breathers( monster &/*z*/ )
{
( void )z; //unused
for( monster &critter : g->all_monsters() ) {
const mtype_id &monID = critter.type->id;
if( monID == mon_breather_hub || monID == mon_breather ) {
Expand Down
3 changes: 1 addition & 2 deletions src/npctalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3088,9 +3088,8 @@ void load_talk_topic( const JsonObject &jo )
}
}

std::string npc::pick_talk_topic( const player &u )
std::string npc::pick_talk_topic( const player &/*u*/ )
{
( void )u;
if( personality.aggression > 0 ) {
if( op_of_u.fear * 2 < personality.bravery && personality.altruism < 0 ) {
set_attitude( NPCATT_MUG );
Expand Down
12 changes: 4 additions & 8 deletions src/npctalk_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,13 @@ static void generic_barber( const std::string &mut_type )
}
}

void talk_function::barber_beard( npc &p )
void talk_function::barber_beard( npc &/*p*/ )
{
( void )p;
generic_barber( "facial_hair" );
}

void talk_function::barber_hair( npc &p )
void talk_function::barber_hair( npc &/*p*/ )
{
( void )p;
generic_barber( "hair_style" );
}

Expand Down Expand Up @@ -831,15 +829,13 @@ void talk_function::drop_weapon( npc &p )
g->m.add_item_or_charges( p.pos(), p.remove_weapon() );
}

void talk_function::player_weapon_away( npc &p )
void talk_function::player_weapon_away( npc &/*p*/ )
{
( void )p; //unused
g->u.i_add( g->u.remove_weapon() );
}

void talk_function::player_weapon_drop( npc &p )
void talk_function::player_weapon_drop( npc &/*p*/ )
{
( void )p; // unused
g->m.add_item_or_charges( g->u.pos(), g->u.remove_weapon() );
}

Expand Down
3 changes: 1 addition & 2 deletions src/sdlsound.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ inline bool init_sound()
return false;
}
inline void shutdown_sound() { }
inline void play_music( const std::string &playlist )
inline void play_music( const std::string &/*playlist*/ )
{
( void )playlist;
}
inline void update_music_volume() { }
inline void load_soundset() { }
Expand Down
5 changes: 2 additions & 3 deletions src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ void uilist::refresh( bool refresh_callback )
/**
* redraw borders, which is required in some cases ( look_around() )
*/
void uilist::redraw( bool redraw_callback )
void uilist::redraw( bool /*redraw_callback*/ )
{
draw_border( window, border_color );
if( !title.empty() ) {
Expand All @@ -717,8 +717,7 @@ void uilist::redraw( bool redraw_callback )
mvwprintz( window, point( 2, w_height - 1 ), border_color, "< %s >", filter );
mvwprintz( window, point( 4, w_height - 1 ), text_color, filter );
}
// TODO: something
( void )redraw_callback;
// TODO: something with the redraw_callback
/*
// pending tests on if this is needed
if ( redraw_callback && callback != NULL ) {
Expand Down
10 changes: 2 additions & 8 deletions src/wish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,7 @@ class wish_monster_callback: public uilist_callback
wrefresh( w_info );
}

bool key( const input_context &, const input_event &event, int entnum, uilist *menu ) override {
// Unused
( void )entnum;
// Unused
( void )menu;
bool key( const input_context &, const input_event &event, int /*entnum*/, uilist */*menu*/ ) override {
kevingranade marked this conversation as resolved.
Show resolved Hide resolved
if( event.get_first_input() == 'f' ) {
friendly = !friendly;
// Force tmp monster regen
Expand Down Expand Up @@ -372,9 +368,7 @@ class wish_monster_callback: public uilist_callback
ctxt.get_desc( "FILTER" ), ctxt.get_desc( "QUIT" ) );
}

void refresh( uilist *menu ) override {
// Unused
( void )menu;
void refresh( uilist */*menu*/ ) override {
wrefresh( w_info );
}

Expand Down