build: Fix cppcheck issues

This commit is contained in:
WerWolv
2025-07-10 13:57:08 +02:00
parent e58ce527c6
commit da2aa85a8a
40 changed files with 87 additions and 230 deletions

View File

@@ -74,9 +74,9 @@ namespace hex::plugin::builtin {
i64 precision;
} ieee754 = {};
std::string specialNumbers[] = {
"inf" , "Inf", "INF" , "nan" , "Nan" , "NAN",
"qnan","Qnan", "QNAN", "snan", "Snan", "SNAN"
constexpr static std::array SpecialNumbers = {
"inf" , "Inf", "INF" , "nan" , "Nan" , "NAN",
"qnan","Qnan", "QNAN", "snan", "Snan", "SNAN"
};
@@ -345,7 +345,7 @@ namespace hex::plugin::builtin {
}
};
const static auto FloatToBits = [&specialNumbers](IEEE754 &ieee754, std::string decimalFloatingPointNumberString, int totalBitCount) {
const static auto FloatToBits = [](IEEE754 &ieee754, std::string decimalFloatingPointNumberString, int totalBitCount) {
// Always obtain sign first.
if (decimalFloatingPointNumberString[0] == '-') {
@@ -362,7 +362,7 @@ namespace hex::plugin::builtin {
// Detect and use special numbers.
for (u32 i = 0; i < 12; i++) {
if (decimalFloatingPointNumberString == specialNumbers[i]) {
if (decimalFloatingPointNumberString == SpecialNumbers[i]) {
inputType = InputType(i/3);
matchFound = true;
break;