Fix gcc and clang -Wdouble-promotion

This commit is contained in:
Vasily
2019-02-21 18:48:53 +01:00
committed by username223
parent 85fbbbbd42
commit 4d06360c92
2 changed files with 3 additions and 2 deletions
@@ -534,7 +534,8 @@ void UtilitiesTabController::eventLoopTick()
i,
vr::ETrackedDeviceProperty::
Prop_DeviceBatteryPercentage_Float );
int batteryState = ceil( battery * 5 );
int batteryState = static_cast<int>(
ceil( static_cast<float>( battery * 5 ) ) );
if ( batteryState != m_batteryState[i] )
{
+1 -1
View File
@@ -1202,7 +1202,7 @@ base::type::string_t DateTime::formatTime(unsigned long long time, base::Timesta
if (time <= base::consts::kTimeFormats[i].value) {
break;
}
if (base::consts::kTimeFormats[i].value == 1000.0f && time / 1000.0f < 1.9f) {
if (base::consts::kTimeFormats[i].value == 1000.0 && time / 1000.0f < 1.9f) {
break;
}
time /= static_cast<decltype(time)>(base::consts::kTimeFormats[i].value);