diff --git a/src/construction.cpp b/src/construction.cpp index 894c65fde1471..85f9e34b99c38 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -1442,16 +1442,16 @@ void construct::done_wiring( const tripoint &p, Character &/*who*/ ) bounding_box vehicle_box = veh->get_bounding_box( false ); point size; - size.x = abs( ( vehicle_box.p2 - vehicle_box.p1 ).x ) + 1; - size.y = abs( ( vehicle_box.p2 - vehicle_box.p1 ).y ) + 1; + size.x = std::abs( ( vehicle_box.p2 - vehicle_box.p1 ).x ) + 1; + size.y = std::abs( ( vehicle_box.p2 - vehicle_box.p1 ).y ) + 1; vehicle &veh_target = vp->vehicle(); if( &veh_target != veh && veh_target.has_tag( flag_WIRING ) ) { bounding_box target_vehicle_box = veh_target.get_bounding_box( false ); point target_size; - target_size.x = abs( ( target_vehicle_box.p2 - target_vehicle_box.p1 ).x ) + 1; - target_size.y = abs( ( target_vehicle_box.p2 - target_vehicle_box.p1 ).y ) + 1; + target_size.x = std::abs( ( target_vehicle_box.p2 - target_vehicle_box.p1 ).x ) + 1; + target_size.y = std::abs( ( target_vehicle_box.p2 - target_vehicle_box.p1 ).y ) + 1; if( size.x + target_size.x <= MAX_WIRE_VEHICLE_SIZE && size.y + target_size.y <= MAX_WIRE_VEHICLE_SIZE ) { diff --git a/src/faction_camp.cpp b/src/faction_camp.cpp index c40bf11957682..17f732796ea13 100644 --- a/src/faction_camp.cpp +++ b/src/faction_camp.cpp @@ -2525,7 +2525,7 @@ static const int max_salt_water_pipe_length = // Hard coded strings used to construct expansion "provides" needed by recipes to coordinate salt water pipe construction static const std::string salt_water_pipe_string_base = "salt_water_pipe_"; static const std::string salt_water_pipe_string_suffix = "_scheduled"; -static const double diagonal_salt_pipe_cost = sqrt( 2.0 ); +static const double diagonal_salt_pipe_cost = std::sqrt( 2.0 ); static const double salt_pipe_legal = 0.0; static const double salt_pipe_illegal = -0.1; static const double salt_pipe_swamp = -0.2; diff --git a/src/item.cpp b/src/item.cpp index 0607a68591d51..d70f2b4c2009b 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -4968,7 +4968,7 @@ void item::melee_combat_info( std::vector &info, const iteminfo_query if( base_stamina || base_dpstam ) { stam = player_character.get_total_melee_stamina_cost( this ) * -1; - stam_pct = truncf( stam * 1000.0 / player_character.get_stamina_max() ) / 10; + stam_pct = std::truncf( stam * 1000.0 / player_character.get_stamina_max() ) / 10; } if( base_dps || base_dpstam ) { diff --git a/src/material.cpp b/src/material.cpp index 841222d10164b..8b085de3d55da 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -282,7 +282,7 @@ bool material_type::is_valid_thickness( float thickness ) const } // float calcs so rounding need to be mindful of - return fmodf( thickness, _sheet_thickness ) < .01; + return std::fmod( thickness, _sheet_thickness ) < .01f; } float material_type::thickness_multiple() const