Use kConstant naming in fxbarcode.
-- Namespace one extern constant while at it, since it was a short name.
Change-Id: Ia2c06b6f662bf73235b69c58f2d8189fdb7fdd06
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/83791
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxbarcode/pdf417/BC_PDF417.cpp b/fxbarcode/pdf417/BC_PDF417.cpp
index ef91627..7effff7 100644
--- a/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/fxbarcode/pdf417/BC_PDF417.cpp
@@ -31,7 +31,7 @@
namespace {
-const uint16_t g_CodewordTable[3][929] = {
+const uint16_t kCodewordTable[3][929] = {
{0xd5c0, 0xeaf0, 0xf57c, 0xd4e0, 0xea78, 0xf53e, 0xa8c0, 0xd470, 0xa860,
0x5040, 0xa830, 0x5020, 0xadc0, 0xd6f0, 0xeb7c, 0xace0, 0xd678, 0xeb3e,
0x58c0, 0xac70, 0x5860, 0x5dc0, 0xaef0, 0xd77c, 0x5ce0, 0xae78, 0xd73e,
@@ -346,7 +346,7 @@
0x0fb2, 0xc7ea}};
int32_t Get17BitCodeword(int i, int j) {
- return (0x10000 | g_CodewordTable[i][j]);
+ return (0x10000 | kCodewordTable[i][j]);
}
} // namespace
diff --git a/fxbarcode/qrcode/BC_QRCoderECBlocksData.cpp b/fxbarcode/qrcode/BC_QRCoderECBlocksData.cpp
index 26ff748..dbe3659 100644
--- a/fxbarcode/qrcode/BC_QRCoderECBlocksData.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderECBlocksData.cpp
@@ -22,7 +22,9 @@
#include "fxbarcode/qrcode/BC_QRCoderECBlocksData.h"
-const CBC_QRCoderECBlockData g_ECBData[40][4] = {
+namespace fxbarcode {
+
+const CBC_QRCoderECBlockData kECBData[40][4] = {
{{7, 1, 19, 0, 0}, {10, 1, 16, 0, 0}, {13, 1, 13, 0, 0}, {17, 1, 9, 0, 0}},
{{10, 1, 34, 0, 0},
{16, 1, 28, 0, 0},
@@ -178,3 +180,5 @@
{30, 34, 24, 34, 25},
{30, 20, 15, 61, 16}},
};
+
+} // namespace fxbarcode
diff --git a/fxbarcode/qrcode/BC_QRCoderECBlocksData.h b/fxbarcode/qrcode/BC_QRCoderECBlocksData.h
index 7ed4ca4..b017cd0 100644
--- a/fxbarcode/qrcode/BC_QRCoderECBlocksData.h
+++ b/fxbarcode/qrcode/BC_QRCoderECBlocksData.h
@@ -17,6 +17,10 @@
uint8_t dataCodeWords2;
};
-extern const CBC_QRCoderECBlockData g_ECBData[40][4];
+namespace fxbarcode {
+
+extern const CBC_QRCoderECBlockData kECBData[40][4];
+
+} // namespace fxbarcode
#endif // FXBARCODE_QRCODE_BC_QRCODERECBLOCKSDATA_H_
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 5873107..9428b5e 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -55,7 +55,7 @@
};
// This is a mapping for an ASCII table, starting at an index of 32.
-const int8_t g_alphaNumericTable[] = {
+const int8_t kAlphaNumericTable[] = {
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // 32-47
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // 48-63
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // 64-79
@@ -65,9 +65,9 @@
if (code < 32)
return -1;
size_t code_index = static_cast<size_t>(code - 32);
- if (code_index >= pdfium::size(g_alphaNumericTable))
+ if (code_index >= pdfium::size(kAlphaNumericTable))
return -1;
- return g_alphaNumericTable[code_index];
+ return kAlphaNumericTable[code_index];
}
bool AppendNumericBytes(const ByteString& content, CBC_QRCoderBitVector* bits) {
diff --git a/fxbarcode/qrcode/BC_QRCoderVersion.cpp b/fxbarcode/qrcode/BC_QRCoderVersion.cpp
index f0074d2..0928b28 100644
--- a/fxbarcode/qrcode/BC_QRCoderVersion.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderVersion.cpp
@@ -65,7 +65,7 @@
if (g_VERSION->empty()) {
for (int i = 0; i < kMaxVersion; ++i) {
g_VERSION->push_back(
- std::make_unique<CBC_QRCoderVersion>(i + 1, g_ECBData[i]));
+ std::make_unique<CBC_QRCoderVersion>(i + 1, fxbarcode::kECBData[i]));
}
}
if (versionNumber < 1 || versionNumber > kMaxVersion)