Tweaked a C++ integer cast.
This commit is contained in:
parent
6431ef47fd
commit
c5d4709e0e
|
@ -287,7 +287,7 @@ void QrCode::drawVersion() {
|
|||
int rem = version; // version is uint6, in the range [7, 40]
|
||||
for (int i = 0; i < 12; i++)
|
||||
rem = (rem << 1) ^ ((rem >> 11) * 0x1F25);
|
||||
long bits = (long)version << 12 | rem; // uint18
|
||||
long bits = static_cast<long>(version) << 12 | rem; // uint18
|
||||
if (bits >> 18 != 0)
|
||||
throw std::logic_error("Assertion error");
|
||||
|
||||
|
|
Loading…
Reference in New Issue