Tweaked a C++ integer cast.

This commit is contained in:
Project Nayuki 2019-09-10 19:25:21 +00:00
parent 6431ef47fd
commit c5d4709e0e
1 changed files with 1 additions and 1 deletions

View File

@ -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");