From 1fb40bc11354bf216fc031809af560778a44dc0e Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Mon, 22 Jul 2019 15:00:00 +0000 Subject: [PATCH] In C++ version, added explicit integer casts for second argument of calls to BitBuffer.appendBits(). --- cpp/QrCode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index faff7ae..c849f44 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -107,8 +107,8 @@ QrCode QrCode::encodeSegments(const vector &segs, Ecc ecl, size_t dataCapacityBits = getNumDataCodewords(version, ecl) * 8; if (bb.size() > dataCapacityBits) throw std::logic_error("Assertion error"); - bb.appendBits(0, std::min(4, dataCapacityBits - bb.size())); - bb.appendBits(0, (8 - bb.size() % 8) % 8); + bb.appendBits(0, std::min(4, static_cast(dataCapacityBits - bb.size()))); + bb.appendBits(0, (8 - static_cast(bb.size() % 8)) % 8); if (bb.size() % 8 != 0) throw std::logic_error("Assertion error");