Fix conversion compiler warnings

Using a release build with GCC 14.2.0 and -Wextra -Wconversion -Wall.
The generated binaries are not changed by this commit.
This commit is contained in:
Urs Fleisch
2025-06-25 22:08:09 +02:00
parent 88d6b18b4f
commit 148cc9a921
25 changed files with 51 additions and 49 deletions
+2 -2
View File
@@ -229,7 +229,7 @@ void MPC::Properties::readSV8(File *file, offset_t streamLength)
frameCount > 0 && d->sampleRate > 0) {
const auto length = static_cast<double>(frameCount) * 1000.0 / d->sampleRate;
d->length = static_cast<int>(length + 0.5);
d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5);
d->bitrate = static_cast<int>(static_cast<double>(streamLength) * 8.0 / length + 0.5);
}
}
else if (packetType == "RG") {
@@ -331,6 +331,6 @@ void MPC::Properties::readSV7(const ByteVector &data, offset_t streamLength)
d->length = static_cast<int>(length + 0.5);
if(d->bitrate == 0)
d->bitrate = static_cast<int>(streamLength * 8.0 / length + 0.5);
d->bitrate = static_cast<int>(static_cast<double>(streamLength) * 8.0 / length + 0.5);
}
}