1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-06-10 07:33:43 +00:00

GUI: suppress some more "-Wshorten-64-to-32" warnings (qt5/6 diff)

AZTEC: better assert
BWIPP: latest
This commit is contained in:
gitlost
2026-05-06 22:49:41 +01:00
parent 0a617a410b
commit 76aac611ca
7 changed files with 45 additions and 21 deletions
+9 -3
View File
@@ -43,6 +43,12 @@
#define QSL QStringLiteral
#define QSEmpty QLatin1String("")
#if QT_VERSION < 0x60000
#define QZINT_SIZETYPE int
#else
#define QZINT_SIZETYPE qsizetype
#endif
namespace Zint {
static const int maxSegs = 256;
static const int maxCLISegs = 10; /* CLI restricted to 10 segments (including main data) */
@@ -98,9 +104,9 @@ namespace Zint {
QColor color;
int r, g, b, a;
if (text.contains(',')) {
qsizetype comma1 = text.indexOf(',');
qsizetype comma2 = text.indexOf(',', comma1 + 1);
qsizetype comma3 = text.indexOf(',', comma2 + 1);
QZINT_SIZETYPE comma1 = text.indexOf(',');
QZINT_SIZETYPE comma2 = text.indexOf(',', comma1 + 1);
QZINT_SIZETYPE comma3 = text.indexOf(',', comma2 + 1);
int black = 100 - text.mid(comma3 + 1).toInt();
int val = 100 - text.mid(0, comma1).toInt();
r = (int) roundf((0xFF * val * black) / 10000.0f);