Skip to content

Commit

Permalink
[Fix] QR Code compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nottinghster committed Oct 12, 2023
1 parent 9cd5ee3 commit 8a5180a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framework/stdext/qrcodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ namespace qrcodegen {
void QrCode::drawFinderPattern(int x, int y) {
for (int dy = -4; dy <= 4; dy++) {
for (int dx = -4; dx <= 4; dx++) {
int dist = std::max(std::abs(dx), std::abs(dy)); // Chebyshev/infinity norm
int dist = std::max<int>(std::abs(dx), std::abs(dy)); // Chebyshev/infinity norm
int xx = x + dx, yy = y + dy;
if (0 <= xx && xx < size && 0 <= yy && yy < size)
setFunctionModule(xx, yy, dist != 2 && dist != 4);
Expand All @@ -443,7 +443,7 @@ namespace qrcodegen {
void QrCode::drawAlignmentPattern(int x, int y) {
for (int dy = -2; dy <= 2; dy++) {
for (int dx = -2; dx <= 2; dx++)
setFunctionModule(x + dx, y + dy, std::max(std::abs(dx), std::abs(dy)) != 1);
setFunctionModule(x + dx, y + dy, std::max<int>(std::abs(dx), std::abs(dy)) != 1);
}
}

Expand Down

0 comments on commit 8a5180a

Please sign in to comment.