From 10e3a2f2e827307da455618c39a473c142a2fd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Sat, 13 Jun 2020 15:40:50 +0200 Subject: [PATCH] Don't cast doubles to enums C:\Repos\StepMania\src\Grade.cpp(56): error C2440: 'type cast': cannot convert from 'double' to 'Grade' [C:\Repos\StepMania\Build\src\StepMania.vcxproj] C:\Repos\StepMania\src\Grade.cpp(56): note: Conversions between enumeration and floating point values are no longer allowed --- src/Grade.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Grade.cpp b/src/Grade.cpp index 5b04df78a0..82a1de93be 100644 --- a/src/Grade.cpp +++ b/src/Grade.cpp @@ -53,7 +53,7 @@ Grade GradeToOldGrade( Grade g ) // There used to be 7 grades (plus fail) but grades can now be defined by themes. // So we need to re-scale the grade bands based on how many actual grades the theme defines. if( g < NUM_GRADE_TIERS_USED ) - g = (Grade)round((double)g * Grade_Tier07 / (NUM_GRADE_TIERS_USED - 1)); + g = (Grade)std::lround((double)g * Grade_Tier07 / (NUM_GRADE_TIERS_USED - 1)); return g; }