From 3e634c9f2686de87bacb1da66b723d69478488e2 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Thu, 20 Apr 2017 04:06:46 +0000 Subject: [PATCH] Renamed variable 'upwards' to 'upward' in drawCodewords() of all language versions, without changing behavior. --- c/qrcodegen.c | 4 ++-- cpp/QrCode.cpp | 4 ++-- java/io/nayuki/qrcodegen/QrCode.java | 4 ++-- javascript/qrcodegen.js | 4 ++-- python/qrcodegen.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/c/qrcodegen.c b/c/qrcodegen.c index e7098cb..4f52163 100644 --- a/c/qrcodegen.c +++ b/c/qrcodegen.c @@ -668,8 +668,8 @@ static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[], i for (int vert = 0; vert < size; vert++) { // Vertical counter for (int j = 0; j < 2; j++) { int x = right - j; // Actual x coordinate - bool upwards = ((right & 2) == 0) ^ (x < 6); - int y = upwards ? size - 1 - vert : vert; // Actual y coordinate + bool upward = ((right & 2) == 0) ^ (x < 6); + int y = upward ? size - 1 - vert : vert; // Actual y coordinate if (!getModule(qrcode, size, x, y) && i < dataLen * 8) { bool black = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0; setModule(qrcode, size, x, y, black); diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index 684b938..ff30088 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -348,8 +348,8 @@ void qrcodegen::QrCode::drawCodewords(const std::vector &data) { for (int vert = 0; vert < size; vert++) { // Vertical counter for (int j = 0; j < 2; j++) { int x = right - j; // Actual x coordinate - bool upwards = ((right & 2) == 0) ^ (x < 6); - int y = upwards ? size - 1 - vert : vert; // Actual y coordinate + bool upward = ((right & 2) == 0) ^ (x < 6); + int y = upward ? size - 1 - vert : vert; // Actual y coordinate if (!isFunction.at(y).at(x) && i < data.size() * 8) { modules.at(y).at(x) = ((data.at(i >> 3) >> (7 - (i & 7))) & 1) != 0; i++; diff --git a/java/io/nayuki/qrcodegen/QrCode.java b/java/io/nayuki/qrcodegen/QrCode.java index 3296d8b..b62d42a 100644 --- a/java/io/nayuki/qrcodegen/QrCode.java +++ b/java/io/nayuki/qrcodegen/QrCode.java @@ -504,8 +504,8 @@ public final class QrCode { for (int vert = 0; vert < size; vert++) { // Vertical counter for (int j = 0; j < 2; j++) { int x = right - j; // Actual x coordinate - boolean upwards = ((right & 2) == 0) ^ (x < 6); - int y = upwards ? size - 1 - vert : vert; // Actual y coordinate + boolean upward = ((right & 2) == 0) ^ (x < 6); + int y = upward ? size - 1 - vert : vert; // Actual y coordinate if (!isFunction[y][x] && i < data.length * 8) { modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0; i++; diff --git a/javascript/qrcodegen.js b/javascript/qrcodegen.js index aea73fa..11d32f0 100644 --- a/javascript/qrcodegen.js +++ b/javascript/qrcodegen.js @@ -405,8 +405,8 @@ var qrcodegen = new function() { for (var vert = 0; vert < size; vert++) { // Vertical counter for (var j = 0; j < 2; j++) { var x = right - j; // Actual x coordinate - var upwards = ((right & 2) == 0) ^ (x < 6); - var y = upwards ? size - 1 - vert : vert; // Actual y coordinate + var upward = ((right & 2) == 0) ^ (x < 6); + var y = upward ? size - 1 - vert : vert; // Actual y coordinate if (!isFunction[y][x] && i < data.length * 8) { modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0; i++; diff --git a/python/qrcodegen.py b/python/qrcodegen.py index f0a549e..c101f1c 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -404,8 +404,8 @@ class QrCode(object): for vert in range(self._size): # Vertical counter for j in range(2): x = right - j # Actual x coordinate - upwards = ((right & 2) == 0) ^ (x < 6) - y = (self._size - 1 - vert) if upwards else vert # Actual y coordinate + upward = ((right & 2) == 0) ^ (x < 6) + y = (self._size - 1 - vert) if upward else vert # Actual y coordinate if not self._isfunction[y][x] and i < len(data) * 8: self._modules[y][x] = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0 i += 1