Renamed variable 'upwards' to 'upward' in drawCodewords() of all language versions, without changing behavior.
This commit is contained in:
parent
f020833cd4
commit
3e634c9f26
|
@ -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 vert = 0; vert < size; vert++) { // Vertical counter
|
||||||
for (int j = 0; j < 2; j++) {
|
for (int j = 0; j < 2; j++) {
|
||||||
int x = right - j; // Actual x coordinate
|
int x = right - j; // Actual x coordinate
|
||||||
bool upwards = ((right & 2) == 0) ^ (x < 6);
|
bool upward = ((right & 2) == 0) ^ (x < 6);
|
||||||
int y = upwards ? size - 1 - vert : vert; // Actual y coordinate
|
int y = upward ? size - 1 - vert : vert; // Actual y coordinate
|
||||||
if (!getModule(qrcode, size, x, y) && i < dataLen * 8) {
|
if (!getModule(qrcode, size, x, y) && i < dataLen * 8) {
|
||||||
bool black = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0;
|
bool black = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0;
|
||||||
setModule(qrcode, size, x, y, black);
|
setModule(qrcode, size, x, y, black);
|
||||||
|
|
|
@ -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 vert = 0; vert < size; vert++) { // Vertical counter
|
||||||
for (int j = 0; j < 2; j++) {
|
for (int j = 0; j < 2; j++) {
|
||||||
int x = right - j; // Actual x coordinate
|
int x = right - j; // Actual x coordinate
|
||||||
bool upwards = ((right & 2) == 0) ^ (x < 6);
|
bool upward = ((right & 2) == 0) ^ (x < 6);
|
||||||
int y = upwards ? size - 1 - vert : vert; // Actual y coordinate
|
int y = upward ? size - 1 - vert : vert; // Actual y coordinate
|
||||||
if (!isFunction.at(y).at(x) && i < data.size() * 8) {
|
if (!isFunction.at(y).at(x) && i < data.size() * 8) {
|
||||||
modules.at(y).at(x) = ((data.at(i >> 3) >> (7 - (i & 7))) & 1) != 0;
|
modules.at(y).at(x) = ((data.at(i >> 3) >> (7 - (i & 7))) & 1) != 0;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -504,8 +504,8 @@ public final class QrCode {
|
||||||
for (int vert = 0; vert < size; vert++) { // Vertical counter
|
for (int vert = 0; vert < size; vert++) { // Vertical counter
|
||||||
for (int j = 0; j < 2; j++) {
|
for (int j = 0; j < 2; j++) {
|
||||||
int x = right - j; // Actual x coordinate
|
int x = right - j; // Actual x coordinate
|
||||||
boolean upwards = ((right & 2) == 0) ^ (x < 6);
|
boolean upward = ((right & 2) == 0) ^ (x < 6);
|
||||||
int y = upwards ? size - 1 - vert : vert; // Actual y coordinate
|
int y = upward ? size - 1 - vert : vert; // Actual y coordinate
|
||||||
if (!isFunction[y][x] && i < data.length * 8) {
|
if (!isFunction[y][x] && i < data.length * 8) {
|
||||||
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
|
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -405,8 +405,8 @@ var qrcodegen = new function() {
|
||||||
for (var vert = 0; vert < size; vert++) { // Vertical counter
|
for (var vert = 0; vert < size; vert++) { // Vertical counter
|
||||||
for (var j = 0; j < 2; j++) {
|
for (var j = 0; j < 2; j++) {
|
||||||
var x = right - j; // Actual x coordinate
|
var x = right - j; // Actual x coordinate
|
||||||
var upwards = ((right & 2) == 0) ^ (x < 6);
|
var upward = ((right & 2) == 0) ^ (x < 6);
|
||||||
var y = upwards ? size - 1 - vert : vert; // Actual y coordinate
|
var y = upward ? size - 1 - vert : vert; // Actual y coordinate
|
||||||
if (!isFunction[y][x] && i < data.length * 8) {
|
if (!isFunction[y][x] && i < data.length * 8) {
|
||||||
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
|
modules[y][x] = ((data[i >>> 3] >>> (7 - (i & 7))) & 1) != 0;
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -404,8 +404,8 @@ class QrCode(object):
|
||||||
for vert in range(self._size): # Vertical counter
|
for vert in range(self._size): # Vertical counter
|
||||||
for j in range(2):
|
for j in range(2):
|
||||||
x = right - j # Actual x coordinate
|
x = right - j # Actual x coordinate
|
||||||
upwards = ((right & 2) == 0) ^ (x < 6)
|
upward = ((right & 2) == 0) ^ (x < 6)
|
||||||
y = (self._size - 1 - vert) if upwards else vert # Actual y coordinate
|
y = (self._size - 1 - vert) if upward else vert # Actual y coordinate
|
||||||
if not self._isfunction[y][x] and i < len(data) * 8:
|
if not self._isfunction[y][x] and i < len(data) * 8:
|
||||||
self._modules[y][x] = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0
|
self._modules[y][x] = ((data[i >> 3] >> (7 - (i & 7))) & 1) != 0
|
||||||
i += 1
|
i += 1
|
||||||
|
|
Loading…
Reference in New Issue