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

Fix type cast warnings #37844

Merged
merged 1 commit into from
Feb 9, 2020
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
3 changes: 2 additions & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,8 @@ static void draw_spellbook_info( const spell_type &sp, uilist *menu )
}

if( sp.min_duration != 0 && sp.max_duration != 0 ) {
rows.emplace_back( _( "Duration" ), sp.min_duration, sp.duration_increment, sp.max_duration );
rows.emplace_back( _( "Duration" ), sp.min_duration, static_cast<float>( sp.duration_increment ),
sp.max_duration );
}

rows.emplace_back( _( "Cast Cost" ), sp.base_energy_cost, sp.energy_increment,
Expand Down
2 changes: 1 addition & 1 deletion src/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ bool mission::is_complete( const character_id &_npc_id ) const

int total_match = std::accumulate( matches.begin(), matches.end(), 0,
[]( const std::size_t previous, const std::pair<const std::string, std::size_t> &p ) {
return previous + p.second;
return static_cast<int>( previous + p.second );
} );

if( total_match >= ( type->item_count ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ std::vector<item_pricing> npc_trading::init_selling( npc &np )
const int price = it.price( true );
int val = np.value( it );
if( np.wants_to_sell( it, val, price ) ) {
result.emplace_back( np, i->front(), val, i->size() );
result.emplace_back( np, i->front(), val, static_cast<int>( i->size() ) );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4450,7 +4450,7 @@ void vehicle::consume_fuel( int load, const int t_seconds, bool skip_electric )

double amnt_precise_j = static_cast<double>( fuel_pr.second ) * t_seconds;
amnt_precise_j *= load / 1000.0 * ( 1.0 + st * st * 100.0 );
auto inserted = fuel_used_last_turn.insert( { ft, 0 } );
auto inserted = fuel_used_last_turn.insert( { ft, 0.0f } );
inserted.first->second += amnt_precise_j;
double remainder = fuel_remainder[ ft ];
amnt_precise_j -= remainder;
Expand Down
2 changes: 1 addition & 1 deletion src/weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ std::string weather_forecast( const point &abs_sm_pos )
day = _( "Today" );
started_at_night = false;
}
if( d > 0 && started_at_night != d % 2 ) {
if( d > 0 && static_cast<int>( started_at_night ) != d % 2 ) {
day = string_format( pgettext( "Mon Night", "%s Night" ), to_string( day_of_week( c ) ) );
} else {
day = to_string( day_of_week( c ) );
Expand Down