From 53c4ba4011ab59ecc8406e144df8aaaa1169801b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 12 Jan 2018 21:49:50 +0000 Subject: Add jumbo build support for fxbarcode. BUG=pdfium:964 Change-Id: Ic306a374bc9b710e2ac043eebe43504e5bd75926 Reviewed-on: https://pdfium-review.googlesource.com/22870 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- fxbarcode/oned/BC_OnedEAN13Writer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'fxbarcode/oned/BC_OnedEAN13Writer.cpp') diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp index daf53a8b7b..a6315bcdbb 100644 --- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -35,11 +35,11 @@ namespace { -const int8_t FIRST_DIGIT_ENCODINGS[10] = {0x00, 0x0B, 0x0D, 0xE, 0x13, - 0x19, 0x1C, 0x15, 0x16, 0x1A}; -const int8_t START_END_PATTERN[3] = {1, 1, 1}; -const int8_t MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1}; -const int8_t L_PATTERNS[10][4] = { +const int8_t kFirstDigitEncodings[10] = {0x00, 0x0B, 0x0D, 0xE, 0x13, + 0x19, 0x1C, 0x15, 0x16, 0x1A}; +const int8_t kOnedEAN13StartPattern[3] = {1, 1, 1}; +const int8_t kOnedEAN13MiddlePattern[5] = {1, 1, 1, 1, 1}; +const int8_t kOnedEAN13LPattern[10][4] = { {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, {1, 4, 1, 1}, {1, 1, 3, 2}, {1, 2, 3, 1}, {1, 1, 1, 4}, {1, 3, 1, 2}, {1, 2, 1, 3}, {3, 1, 1, 2}}; const int8_t L_AND_G_PATTERNS[20][4] = { @@ -98,13 +98,13 @@ uint8_t* CBC_OnedEAN13Writer::EncodeImpl(const ByteString& contents, m_iDataLenth = 13; int32_t firstDigit = FXSYS_DecimalCharToInt(contents.First()); - int32_t parities = FIRST_DIGIT_ENCODINGS[firstDigit]; + int32_t parities = kFirstDigitEncodings[firstDigit]; outLength = m_codeWidth; std::unique_ptr result( FX_Alloc(uint8_t, m_codeWidth)); int32_t pos = 0; int32_t e = BCExceptionNO; - pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN13StartPattern, 3, 1, e); if (e != BCExceptionNO) return nullptr; @@ -118,17 +118,17 @@ uint8_t* CBC_OnedEAN13Writer::EncodeImpl(const ByteString& contents, if (e != BCExceptionNO) return nullptr; } - pos += AppendPattern(result.get(), pos, MIDDLE_PATTERN, 5, 0, e); + pos += AppendPattern(result.get(), pos, kOnedEAN13MiddlePattern, 5, 0, e); if (e != BCExceptionNO) return nullptr; for (i = 7; i <= 12; i++) { int32_t digit = FXSYS_DecimalCharToInt(contents[i]); - pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN13LPattern[digit], 4, 1, e); if (e != BCExceptionNO) return nullptr; } - pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e); + pos += AppendPattern(result.get(), pos, kOnedEAN13StartPattern, 3, 1, e); if (e != BCExceptionNO) return nullptr; return result.release(); -- cgit v1.2.3