Renamed variable 'upwards' to 'upward' in drawCodewords() of all language versions, without changing behavior.

This commit is contained in:
Project Nayuki 2017-04-20 04:06:46 +00:00
parent f020833cd4
commit 3e634c9f26
5 changed files with 10 additions and 10 deletions

View File

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

View File

@ -348,8 +348,8 @@ void qrcodegen::QrCode::drawCodewords(const std::vector<uint8_t> &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++;

View File

@ -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++;

View File

@ -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++;

View File

@ -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