fix: compiler warning wconversion

[]
pull/222/head
AlexisCompain 5 months ago
parent 2c9044de6b
commit 7df17960ce

@ -310,7 +310,7 @@ QrCode QrCode::encodeSegments(const vector<QrSegment> &segs, Ecc ecl,
// Pack bits into bytes in big endian // Pack bits into bytes in big endian
vector<uint8_t> dataCodewords(bb.size() / 8); vector<uint8_t> dataCodewords(bb.size() / 8);
for (size_t i = 0; i < bb.size(); i++) for (size_t i = 0; i < bb.size(); i++)
dataCodewords.at(i >> 3) |= (bb.at(i) ? 1 : 0) << (7 - (i & 7)); dataCodewords.at(i >> 3) |= static_cast<uint8_t>((bb.at(i) ? 1 : 0) << (7 - (i & 7)));
// Create the QR Code object // Create the QR Code object
return QrCode(version, ecl, dataCodewords, mask); return QrCode(version, ecl, dataCodewords, mask);

Loading…
Cancel
Save