Skip to content

Commit

Permalink
Merge pull request #37844 from olanti-p/fix-warnings
Browse files Browse the repository at this point in the history
Fix type cast warnings
  • Loading branch information
ZhilkinSerg authored Feb 9, 2020
2 parents 1ca4f95 + 93d5c85 commit c8871f1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
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

0 comments on commit c8871f1

Please sign in to comment.