Browse Source

UI: Fix implicit conversion warning on Linux with Clang

tytan652 3 years ago
parent
commit
6dd99e3a9f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      UI/volume-control.cpp

+ 2 - 1
UI/volume-control.cpp

@@ -1077,7 +1077,8 @@ inline int VolumeMeter::convertToInt(float number)
 	constexpr int min = std::numeric_limits<int>::min();
 	constexpr int max = std::numeric_limits<int>::max();
 
-	if (number > max)
+	// NOTE: Conversion from 'const int' to 'float' changes max value from 2147483647 to 2147483648
+	if (number >= (float)max)
 		return max;
 	else if (number < min)
 		return min;