Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/core/qr_matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "qr_matrix.hpp"

#include <cstddef>
#include <vector>
#include <string>
#include <algorithm>
Expand Down Expand Up @@ -353,8 +354,8 @@ QrMatrix QrMatrix::generate(const std::string& text, int minVersion, int maxVers

for (int b = 0; b < bcount; ++b) {
dBlocks[b].assign(
dataCodewords.begin() + b * dPerBlock,
dataCodewords.begin() + (b + 1) * dPerBlock
dataCodewords.begin() + static_cast<std::ptrdiff_t>(b) * dPerBlock,
dataCodewords.begin() + static_cast<std::ptrdiff_t>(b + 1) * dPerBlock
);
ecBlocks[b] = g_gf.computeErrorCorrection(dBlocks[b], ecPerBlock);
}
Expand All @@ -374,8 +375,9 @@ QrMatrix QrMatrix::generate(const std::string& text, int minVersion, int maxVers
}

// 3. Matrix Setup & Function Patterns
std::vector<uint8_t> baseModules(N * N, 0);
std::vector<uint8_t> reserved(N * N, 0);
const size_t cells = static_cast<size_t>(N) * N;
std::vector<uint8_t> baseModules(cells, 0);
std::vector<uint8_t> reserved(cells, 0);

// Finders
applyFinderPattern(baseModules, reserved, N, 0, 0);
Expand Down
Loading
Loading