cast currentpage

This commit is contained in:
jpirnay
2026-03-13 21:15:05 +01:00
parent 60fd878162
commit beeab0ff55
+4 -1
View File
@@ -144,7 +144,10 @@ std::string SleepActivity::getBookOverlayText(const std::string& bookPath) const
if (Storage.openFileForRead("SLP", xtc.getCachePath() + "/progress.bin", f)) {
uint8_t data[4];
if (f.read(data, 4) == 4) {
uint32_t currentPage = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
uint32_t currentPage = static_cast<uint32_t>(data[0]) |
(static_cast<uint32_t>(data[1]) << 8) |
(static_cast<uint32_t>(data[2]) << 16) |
(static_cast<uint32_t>(data[3]) << 24);
uint32_t totalPages = xtc.getPageCount();
float progress = xtc.calculateProgress(currentPage) * 100.0f;
char progressStr[32];