From 00c6905a465e25bc2a24d09eeb69aa5887b1e461 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sun, 18 Jan 2026 11:48:42 +0100 Subject: [PATCH] fix: comparison of integers of different signs (#6749) The `targetIndex` (`int`) was compared to `maxIndex` (`size_t`). This generated a large warning, because it was in a lambda. Since we parse `targetIndex`, we can parse it as a `size_t`. --- CHANGELOG.md | 2 +- src/controllers/commands/builtin/twitch/Prediction.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4d902a..2d8558cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ - Minor: Added a setting to show the stream title in live messages. (#6572) - Minor: Add categories to the emoji viewer. (#6598) - Minor: Added broadcaster-only `/poll`, `/cancelpoll`, and `/endpoll` commands. (#6583, #6605) -- Minor: Added broadcaster-only `/prediction`, `/cancelprediction`, `/lockprediction`, and `/completeprediction` commands. (#6583, #6612, #6632) +- Minor: Added broadcaster-only `/prediction`, `/cancelprediction`, `/lockprediction`, and `/completeprediction` commands. (#6583, #6612, #6632, #6749) - Minor: Added support for BetterTTV Pro subscriber badges. (#6625, #6724) - Minor: Added `debug.traceback` for plugins. (#6652) - Minor: Added title and duration options for `/clip` command. (#6669) diff --git a/src/controllers/commands/builtin/twitch/Prediction.cpp b/src/controllers/commands/builtin/twitch/Prediction.cpp index f400ba21..82b32c48 100644 --- a/src/controllers/commands/builtin/twitch/Prediction.cpp +++ b/src/controllers/commands/builtin/twitch/Prediction.cpp @@ -280,7 +280,7 @@ QString completePrediction(const CommandContext &ctx) return ""; } - int targetIndex = 0; + size_t targetIndex = 0; QString targetName; if (hasName) { @@ -289,8 +289,8 @@ QString completePrediction(const CommandContext &ctx) else { bool ok = true; - targetIndex = parser.value(indexOption).toInt(&ok); - if (!ok || targetIndex <= 0) + targetIndex = parser.value(indexOption).toULongLong(&ok); + if (!ok || targetIndex == 0) { ctx.channel->addSystemMessage("Invalid index - " + usage); return "";