From cb4919d5bd0b57ea55ad004b2f3daa06a2e41830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 12 Jan 2025 10:37:21 +0100 Subject: [PATCH] Silence clang-tidy warnings --- src/data.cpp | 2 +- src/sprites.cpp | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/data.cpp b/src/data.cpp index 20f9582..8dcf9c2 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -11,7 +11,7 @@ struct CTX { CTX(const QByteArray &ba) - : bp(ba.constData()), be(bp + ba.size()) {} + : bp(ba.constData()), be(bp + ba.size()), tag(0) {} const char *bp; const char *be; diff --git a/src/sprites.cpp b/src/sprites.cpp index 3b9b046..d144f7d 100644 --- a/src/sprites.cpp +++ b/src/sprites.cpp @@ -22,6 +22,7 @@ static QImage sdf2img(const QImage &sdf, const QColor &color) } Sprites::Sprite::Sprite(const QJsonObject &json) + : _pixelRatio(1.0), _sdf(false) { int x, y, width, height; @@ -44,16 +45,10 @@ Sprites::Sprite::Sprite(const QJsonObject &json) _rect = QRect(x, y, width, height); - if (json.contains("pixelRatio") && json["pixelRatio"].isDouble()) _pixelRatio = json["pixelRatio"].toDouble(); - else - _pixelRatio = 1.0; - if (json.contains("sdf") && json["sdf"].isBool()) _sdf = json["sdf"].toBool(); - else - _sdf = false; } bool Sprites::load(const QString &jsonFile, const QString &imageFile)