From bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 13:24:12 -0700 Subject: Merge to XFA: Use stdint.h types throughout PDFium. Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002 --- xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp | 12 +-- xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h | 6 +- xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp | 20 ++--- xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h | 6 +- xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp | 38 ++++----- xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h | 12 +-- .../datamatrix/BC_DataMatrixBitMatrixParser.cpp | 94 +++++++++++----------- .../datamatrix/BC_DataMatrixBitMatrixParser.h | 20 ++--- .../datamatrix/BC_DataMatrixDataBlock.cpp | 36 ++++----- .../fxbarcode/datamatrix/BC_DataMatrixDataBlock.h | 8 +- .../BC_DataMatrixDecodedBitStreamParser.cpp | 94 +++++++++++----------- .../BC_DataMatrixDecodedBitStreamParser.h | 32 ++++---- .../fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp | 24 +++--- .../fxbarcode/datamatrix/BC_DataMatrixDecoder.h | 4 +- .../fxbarcode/datamatrix/BC_DataMatrixDetector.cpp | 72 ++++++++--------- .../fxbarcode/datamatrix/BC_DataMatrixDetector.h | 24 +++--- .../fxbarcode/datamatrix/BC_DataMatrixReader.cpp | 4 +- xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h | 4 +- .../datamatrix/BC_DataMatrixSymbolInfo144.cpp | 4 +- .../datamatrix/BC_DataMatrixSymbolInfo144.h | 4 +- .../fxbarcode/datamatrix/BC_DataMatrixVersion.cpp | 38 ++++----- .../fxbarcode/datamatrix/BC_DataMatrixVersion.h | 56 ++++++------- .../fxbarcode/datamatrix/BC_DataMatrixWriter.cpp | 28 +++---- xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h | 12 +-- .../fxbarcode/datamatrix/BC_DefaultPlacement.cpp | 38 ++++----- xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h | 28 +++---- xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp | 28 +++---- xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h | 10 +-- xfa/src/fxbarcode/datamatrix/BC_Encoder.h | 4 +- xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp | 20 ++--- xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h | 22 ++--- .../fxbarcode/datamatrix/BC_ErrorCorrection.cpp | 48 +++++------ xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h | 16 ++-- .../fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 66 +++++++-------- xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h | 16 ++-- xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp | 44 +++++----- xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h | 54 ++++++------- xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp | 6 +- xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h | 4 +- xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp | 16 ++-- xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h | 8 +- 41 files changed, 540 insertions(+), 540 deletions(-) (limited to 'xfa/src/fxbarcode/datamatrix') diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp index bc29b7d6ce..df58f15212 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp @@ -34,13 +34,13 @@ CBC_ASCIIEncoder::CBC_ASCIIEncoder() CBC_ASCIIEncoder::~CBC_ASCIIEncoder() { } -FX_INT32 CBC_ASCIIEncoder::getEncodingMode() +int32_t CBC_ASCIIEncoder::getEncodingMode() { return ASCII_ENCODATION; } -void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, int32_t &e) { - FX_INT32 n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos); + int32_t n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(context.m_msg, context.m_pos); if (n >= 2) { FX_WCHAR code = encodeASCIIDigits(context.m_msg.GetAt(context.m_pos), context.m_msg.GetAt(context.m_pos + 1), e); if (e != BCExceptionNO) { @@ -50,7 +50,7 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) context.m_pos += 2; } else { FX_WCHAR c = context.getCurrentChar(); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { switch (newMode) { case BASE256_ENCODATION: @@ -87,10 +87,10 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } } } -FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e) +FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e) { if (CBC_HighLevelEncoder::isDigit(digit1) && CBC_HighLevelEncoder::isDigit(digit2)) { - FX_INT32 num = (digit1 - 48) * 10 + (digit2 - 48); + int32_t num = (digit1 - 48) * 10 + (digit2 - 48); FX_WCHAR a = (FX_WCHAR) (num + 130); return (FX_WCHAR) (num + 130); } diff --git a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h index 9a48b8762f..3c05a41d7b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h @@ -14,9 +14,9 @@ class CBC_ASCIIEncoder : public CBC_Encoder public: CBC_ASCIIEncoder(); virtual ~CBC_ASCIIEncoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e); + static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp index d896cf6445..7a68fcaef6 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -34,11 +34,11 @@ CBC_Base256Encoder::CBC_Base256Encoder() CBC_Base256Encoder::~CBC_Base256Encoder() { } -FX_INT32 CBC_Base256Encoder::getEncodingMode() +int32_t CBC_Base256Encoder::getEncodingMode() { return BASE256_ENCODATION; } -void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; buffer += (FX_WCHAR)'\0'; @@ -46,13 +46,13 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FX_WCHAR c = context.getCurrentChar(); buffer += c; context.m_pos++; - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; } } - FX_INT32 dataCount = buffer.GetLength() - 1; + int32_t dataCount = buffer.GetLength() - 1; FX_CHAR buf[128]; #if defined(_FX_WINAPI_PARTITION_APP_) memset(buf, 0, sizeof(FX_CHAR) * 128); @@ -61,8 +61,8 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) FXSYS_itoa(dataCount, buf, 10); #endif buffer.SetAt(0, FX_WCHAR(*buf) - '0'); - FX_INT32 lengthFieldSize = 1; - FX_INT32 currentSize = context.getCodewordCount() + dataCount + lengthFieldSize; + int32_t lengthFieldSize = 1; + int32_t currentSize = context.getCodewordCount() + dataCount + lengthFieldSize; context.updateSymbolInfo(currentSize, e); if (e != BCExceptionNO) { return; @@ -79,14 +79,14 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return; } } - for (FX_INT32 i = 0, c = buffer.GetLength(); i < c; i++) { + for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) { context.writeCodeword(randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1)); } } -FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition) +FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch, int32_t codewordPosition) { - FX_INT32 pseudoRandom = ((149 * codewordPosition) % 255) + 1; - FX_INT32 tempVariable = ch + pseudoRandom; + int32_t pseudoRandom = ((149 * codewordPosition) % 255) + 1; + int32_t tempVariable = ch + pseudoRandom; if (tempVariable <= 255) { return (FX_WCHAR) tempVariable; } else { diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h index 96110b1d08..61e6c8085f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h @@ -13,9 +13,9 @@ class CBC_Base256Encoder : public CBC_Encoder public: CBC_Base256Encoder(); virtual ~CBC_Base256Encoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static FX_WCHAR randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition); + static FX_WCHAR randomize255State(FX_WCHAR ch, int32_t codewordPosition); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp index 4c3b458afa..0afd018558 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp @@ -35,27 +35,27 @@ CBC_C40Encoder::CBC_C40Encoder() CBC_C40Encoder::~CBC_C40Encoder() { } -FX_INT32 CBC_C40Encoder::getEncodingMode() +int32_t CBC_C40Encoder::getEncodingMode() { return C40_ENCODATION; } -void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_C40Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { FX_WCHAR c = context.getCurrentChar(); context.m_pos++; - FX_INT32 lastCharSize = encodeChar(c, buffer, e); + int32_t lastCharSize = encodeChar(c, buffer, e); if (e != BCExceptionNO) { return; } - FX_INT32 unwritten = (buffer.GetLength() / 3) * 2; - FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten; + int32_t unwritten = (buffer.GetLength() / 3) * 2; + int32_t curCodewordCount = context.getCodewordCount() + unwritten; context.updateSymbolInfo(curCodewordCount, e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; + int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; if (!context.hasMoreCharacters()) { CFX_WideString removed; if ((buffer.GetLength() % 3) == 2) { @@ -75,9 +75,9 @@ void CBC_C40Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } break; } - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if ((count % 3) == 0) { - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; @@ -91,16 +91,16 @@ void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext &context, CFX_WideStrin context.writeCodewords(encodeToCodewords(buffer, 0)); buffer.Delete(0, 3); } -void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e) +void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e) { - FX_INT32 unwritten = (buffer.GetLength() / 3) * 2; - FX_INT32 rest = buffer.GetLength() % 3; - FX_INT32 curCodewordCount = context.getCodewordCount() + unwritten; + int32_t unwritten = (buffer.GetLength() / 3) * 2; + int32_t rest = buffer.GetLength() % 3; + int32_t curCodewordCount = context.getCodewordCount() + unwritten; context.updateSymbolInfo(curCodewordCount, e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; + int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount; if (rest == 2) { buffer += (FX_WCHAR)'\0'; while (buffer.GetLength() >= 3) { @@ -130,7 +130,7 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff } context.signalEncoderChange(ASCII_ENCODATION); } -FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == ' ') { sb += (FX_WCHAR)'\3'; @@ -164,7 +164,7 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) } else if (c >= 80) { sb += (FX_WCHAR)'\1'; sb += (FX_WCHAR)0x001e; - FX_INT32 len = 2; + int32_t len = 2; len += encodeChar((c - 128), sb, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); return len; @@ -173,9 +173,9 @@ FX_INT32 CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) return 0; } } -FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e) +int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e) { - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); buffer.Delete(count - lastCharSize, count); context.m_pos--; FX_WCHAR c = context.getCurrentChar(); @@ -184,12 +184,12 @@ FX_INT32 CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext &context, CFX_ context.resetSymbolInfo(); return lastCharSize; } -CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos) +CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb, int32_t startPos) { FX_WCHAR c1 = sb.GetAt(startPos); FX_WCHAR c2 = sb.GetAt(startPos + 1); FX_WCHAR c3 = sb.GetAt(startPos + 2); - FX_INT32 v = (1600 * c1) + (40 * c2) + c3 + 1; + int32_t v = (1600 * c1) + (40 * c2) + c3 + 1; FX_WCHAR cw1 = (FX_WCHAR) (v / 256); FX_WCHAR cw2 = (FX_WCHAR) (v % 256); CFX_WideString b1(cw1); diff --git a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h index 7f2d2f7e79..2ab7f4e29b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h @@ -12,13 +12,13 @@ class CBC_C40Encoder : public CBC_Encoder public: CBC_C40Encoder(); virtual ~CBC_C40Encoder(); - virtual FX_INT32 getEncodingMode(); - virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e); + virtual int32_t getEncodingMode(); + virtual void Encode(CBC_EncoderContext &context, int32_t &e); static void writeNextTriplet(CBC_EncoderContext &context, CFX_WideString &buffer); - virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e); - virtual FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e); + virtual int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); private: - FX_INT32 backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e); - static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos); + int32_t backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, int32_t lastCharSize, int32_t &e); + static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp index cfb676b0a7..4fb82f1034 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp @@ -30,9 +30,9 @@ CBC_DataMatrixBitMatrixParser::CBC_DataMatrixBitMatrixParser() m_version = NULL; m_readMappingMatrix = NULL; } -void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e) +void CBC_DataMatrixBitMatrixParser::Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e) { - FX_INT32 dimension = bitMatrix->GetHeight(); + int32_t dimension = bitMatrix->GetHeight(); if (dimension < 8 || dimension > 144 || (dimension & 0x01) != 0) { e = BCExceptionFormatException; return; @@ -59,45 +59,45 @@ CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::GetVersion() { return m_version; } -CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e) +CBC_DataMatrixVersion *CBC_DataMatrixBitMatrixParser::ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e) { - FX_INT32 rows = bitMatrix->GetHeight(); - FX_INT32 columns = bitMatrix->GetWidth(); + int32_t rows = bitMatrix->GetHeight(); + int32_t columns = bitMatrix->GetWidth(); CBC_DataMatrixVersion *temp = CBC_DataMatrixVersion::GetVersionForDimensions(rows, columns, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return temp; } -CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) +CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(int32_t &e) { CBC_AutoPtr result(FX_NEW CFX_ByteArray()); result->SetSize(m_version->GetTotalCodewords()); - FX_INT32 resultOffset = 0; - FX_INT32 row = 4; - FX_INT32 column = 0; - FX_INT32 numRows = m_mappingBitMatrix->GetHeight(); - FX_INT32 numColumns = m_mappingBitMatrix->GetWidth(); + int32_t resultOffset = 0; + int32_t row = 4; + int32_t column = 0; + int32_t numRows = m_mappingBitMatrix->GetHeight(); + int32_t numColumns = m_mappingBitMatrix->GetWidth(); FX_BOOL corner1Read = FALSE; FX_BOOL corner2Read = FALSE; FX_BOOL corner3Read = FALSE; FX_BOOL corner4Read = FALSE; do { if ((row == numRows) && (column == 0) && !corner1Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner1(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner1(numRows, numColumns); row -= 2; column += 2; corner1Read = TRUE; } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner2(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner2(numRows, numColumns); row -= 2; column += 2; corner2Read = TRUE; } else if ((row == numRows + 4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner3(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner3(numRows, numColumns); row -= 2; column += 2; corner3Read = TRUE; } else if ((row == numRows - 2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) { - (*result)[resultOffset++] = (FX_BYTE) ReadCorner4(numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadCorner4(numRows, numColumns); row -= 2; column += 2; corner4Read = TRUE; @@ -105,7 +105,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do { if ((row < numRows) && (column >= 0) && !m_readMappingMatrix->Get(column, row)) { if (resultOffset < (*result).GetSize() ) { - (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns); } } row -= 2; @@ -116,7 +116,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) do { if ((row >= 0) && (column < numColumns) && !m_readMappingMatrix->Get(column, row)) { if (resultOffset < (*result).GetSize() ) { - (*result)[resultOffset++] = (FX_BYTE) ReadUtah(row, column, numRows, numColumns); + (*result)[resultOffset++] = (uint8_t) ReadUtah(row, column, numRows, numColumns); } } row += 2; @@ -132,7 +132,7 @@ CFX_ByteArray *CBC_DataMatrixBitMatrixParser::ReadCodewords(FX_INT32 &e) } return result.release(); } -FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns) +FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns) { if (row < 0) { row += numRows; @@ -145,9 +145,9 @@ FX_BOOL CBC_DataMatrixBitMatrixParser::ReadModule(FX_INT32 row, FX_INT32 column, m_readMappingMatrix->Set(column, row); return m_mappingBitMatrix->Get(column, row); } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(row - 2, column - 2, numRows, numColumns)) { currentByte |= 1; } @@ -181,9 +181,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadUtah(FX_INT32 row, FX_INT32 column, } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner1(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; } @@ -217,9 +217,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner1(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner2(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; } @@ -253,9 +253,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner2(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner3(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; } @@ -289,9 +289,9 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner3(FX_INT32 numRows, FX_INT32 n } return currentByte; } -FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns) +int32_t CBC_DataMatrixBitMatrixParser::ReadCorner4(int32_t numRows, int32_t numColumns) { - FX_INT32 currentByte = 0; + int32_t currentByte = 0; if (ReadModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; } @@ -325,37 +325,37 @@ FX_INT32 CBC_DataMatrixBitMatrixParser::ReadCorner4(FX_INT32 numRows, FX_INT32 n } return currentByte; } -CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , FX_INT32 &e) +CBC_CommonBitMatrix *CBC_DataMatrixBitMatrixParser::ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix , int32_t &e) { - FX_INT32 symbolSizeRows = m_version->GetSymbolSizeRows(); - FX_INT32 symbolSizeColumns = m_version->GetSymbolSizeColumns(); + int32_t symbolSizeRows = m_version->GetSymbolSizeRows(); + int32_t symbolSizeColumns = m_version->GetSymbolSizeColumns(); if (bitMatrix->GetHeight() != symbolSizeRows) { e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix; return NULL; } - FX_INT32 dataRegionSizeRows = m_version->GetDataRegionSizeRows(); - FX_INT32 dataRegionSizeColumns = m_version->GetDataRegionSizeColumns(); - FX_INT32 numDataRegionsRow = symbolSizeRows / dataRegionSizeRows; - FX_INT32 numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns; - FX_INT32 sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows; - FX_INT32 sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; + int32_t dataRegionSizeRows = m_version->GetDataRegionSizeRows(); + int32_t dataRegionSizeColumns = m_version->GetDataRegionSizeColumns(); + int32_t numDataRegionsRow = symbolSizeRows / dataRegionSizeRows; + int32_t numDataRegionsColumn = symbolSizeColumns / dataRegionSizeColumns; + int32_t sizeDataRegionRow = numDataRegionsRow * dataRegionSizeRows; + int32_t sizeDataRegionColumn = numDataRegionsColumn * dataRegionSizeColumns; CBC_CommonBitMatrix *bitMatrixWithoutAlignment = FX_NEW CBC_CommonBitMatrix(); bitMatrixWithoutAlignment->Init(sizeDataRegionColumn, sizeDataRegionRow); - FX_INT32 dataRegionRow; + int32_t dataRegionRow; for (dataRegionRow = 0; dataRegionRow < numDataRegionsRow; ++dataRegionRow) { - FX_INT32 dataRegionRowOffset = dataRegionRow * dataRegionSizeRows; - FX_INT32 dataRegionColumn; + int32_t dataRegionRowOffset = dataRegionRow * dataRegionSizeRows; + int32_t dataRegionColumn; for (dataRegionColumn = 0; dataRegionColumn < numDataRegionsColumn; ++dataRegionColumn) { - FX_INT32 dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns; - FX_INT32 i; + int32_t dataRegionColumnOffset = dataRegionColumn * dataRegionSizeColumns; + int32_t i; for (i = 0; i < dataRegionSizeRows; ++i) { - FX_INT32 readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i; - FX_INT32 writeRowOffset = dataRegionRowOffset + i; - FX_INT32 j; + int32_t readRowOffset = dataRegionRow * (dataRegionSizeRows + 2) + 1 + i; + int32_t writeRowOffset = dataRegionRowOffset + i; + int32_t j; for (j = 0; j < dataRegionSizeColumns; ++j) { - FX_INT32 readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j; + int32_t readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j; if (bitMatrix->Get(readColumnOffset, readRowOffset)) { - FX_INT32 writeColumnOffset = dataRegionColumnOffset + j; + int32_t writeColumnOffset = dataRegionColumnOffset + j; bitMatrixWithoutAlignment->Set(writeColumnOffset, writeRowOffset); } } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h index 812aa6424f..da9fdc7db5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h @@ -14,17 +14,17 @@ public: CBC_DataMatrixBitMatrixParser(); virtual ~CBC_DataMatrixBitMatrixParser(); CBC_DataMatrixVersion *GetVersion(); - CFX_ByteArray *ReadCodewords(FX_INT32 &e); - FX_BOOL ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns); - FX_INT32 ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns); - CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); - virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); + CFX_ByteArray *ReadCodewords(int32_t &e); + FX_BOOL ReadModule(int32_t row, int32_t column, int32_t numRows, int32_t numColumns); + int32_t ReadUtah(int32_t row, int32_t column, int32_t numRows, int32_t numColumns); + int32_t ReadCorner1(int32_t numRows, int32_t numColumns); + int32_t ReadCorner2(int32_t numRows, int32_t numColumns); + int32_t ReadCorner3(int32_t numRows, int32_t numColumns); + int32_t ReadCorner4(int32_t numRows, int32_t numColumns); + CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, int32_t &e); + virtual void Init(CBC_CommonBitMatrix *bitMatrix, int32_t &e); private: - static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e); + static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, int32_t &e); CBC_CommonBitMatrix *m_mappingBitMatrix; CBC_CommonBitMatrix *m_readMappingMatrix; CBC_DataMatrixVersion *m_version; diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp index c884834fa9..fcf2804ef2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp @@ -26,40 +26,40 @@ CBC_DataMatrixDataBlock::~CBC_DataMatrixDataBlock() { } -CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords) +CBC_DataMatrixDataBlock::CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords) { m_codewords.Copy(*codewords); m_numDataCodewords = numDataCodewords; } -CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e) +CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e) { ECBlocks *ecBlocks = version->GetECBlocks(); - FX_INT32 totalBlocks = 0; + int32_t totalBlocks = 0; const CFX_PtrArray &ecBlockArray = ecBlocks->GetECBlocks(); - FX_INT32 i; + int32_t i; for (i = 0; i < ecBlockArray.GetSize(); i++) { totalBlocks += ((ECB*)ecBlockArray[i])->GetCount(); } CBC_AutoPtrresult(FX_NEW CFX_PtrArray()); result->SetSize(totalBlocks); - FX_INT32 numResultBlocks = 0; - FX_INT32 j; + int32_t numResultBlocks = 0; + int32_t j; for (j = 0; j < ecBlockArray.GetSize(); j++) { for (i = 0; i < ((ECB*)ecBlockArray[j])->GetCount(); i++) { - FX_INT32 numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords(); - FX_INT32 numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords; + int32_t numDataCodewords = ((ECB*)ecBlockArray[j])->GetDataCodewords(); + int32_t numBlockCodewords = ecBlocks->GetECCodewords() + numDataCodewords; CFX_ByteArray codewords; codewords.SetSize(numBlockCodewords); (*result)[numResultBlocks++] = FX_NEW CBC_DataMatrixDataBlock(numDataCodewords, &codewords); codewords.SetSize(0); } } - FX_INT32 longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); - FX_INT32 longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords(); - FX_INT32 shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1; - FX_INT32 rawCodewordsOffset = 0; + int32_t longerBlocksTotalCodewords = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); + int32_t longerBlocksNumDataCodewords = longerBlocksTotalCodewords - ecBlocks->GetECCodewords(); + int32_t shorterBlocksNumDataCodewords = longerBlocksNumDataCodewords - 1; + int32_t rawCodewordsOffset = 0; for (i = 0; i < shorterBlocksNumDataCodewords; i++) { - FX_INT32 j; + int32_t j; for (j = 0; j < numResultBlocks; j++) { if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](i) = (*rawCodewords)[rawCodewordsOffset++]; @@ -67,17 +67,17 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords } } FX_BOOL specialVersion = version->GetVersionNumber() == 24; - FX_INT32 numLongerBlocks = specialVersion ? 8 : numResultBlocks; + int32_t numLongerBlocks = specialVersion ? 8 : numResultBlocks; for (j = 0; j < numLongerBlocks; j++) { if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](longerBlocksNumDataCodewords - 1) = (*rawCodewords)[rawCodewordsOffset++]; } } - FX_INT32 max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); + int32_t max = ((CBC_DataMatrixDataBlock*)(*result)[0])->GetCodewords()->GetSize(); for (i = longerBlocksNumDataCodewords; i < max; i++) { - FX_INT32 j; + int32_t j; for (j = 0; j < numResultBlocks; j++) { - FX_INT32 iOffset = specialVersion && j > 7 ? i - 1 : i; + int32_t iOffset = specialVersion && j > 7 ? i - 1 : i; if (rawCodewordsOffset < rawCodewords->GetSize()) { ((CBC_DataMatrixDataBlock*)(*result)[j])->GetCodewords()->operator [](iOffset) = (*rawCodewords)[rawCodewordsOffset++]; } @@ -89,7 +89,7 @@ CFX_PtrArray *CBC_DataMatrixDataBlock::GetDataBlocks(CFX_ByteArray* rawCodewords } return result.release(); } -FX_INT32 CBC_DataMatrixDataBlock::GetNumDataCodewords() +int32_t CBC_DataMatrixDataBlock::GetNumDataCodewords() { return m_numDataCodewords; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h index d0f4af036e..21be66549c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h @@ -12,14 +12,14 @@ class CBC_DataMatrixDataBlock public: virtual ~CBC_DataMatrixDataBlock(); - FX_INT32 GetNumDataCodewords(); + int32_t GetNumDataCodewords(); CFX_ByteArray* GetCodewords(); - static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e); + static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, int32_t &e); private: - FX_INT32 m_numDataCodewords; + int32_t m_numDataCodewords; CFX_ByteArray m_codewords; - CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords); + CBC_DataMatrixDataBlock(int32_t numDataCodewords, CFX_ByteArray *codewords); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp index e934d9313d..07393c0fec 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp @@ -42,26 +42,26 @@ const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (FX_CHAR) 127 }; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; -const FX_INT32 CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; +const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; +const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; +const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; +const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; +const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; +const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; +const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() { } CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() { } -CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, FX_INT32 &e) +CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteArray &bytes, int32_t &e) { CBC_CommonBitSource bits(&bytes); CFX_ByteString result; CFX_ByteString resultTrailer; CFX_Int32Array byteSegments; - FX_INT32 mode = ASCII_ENCODE; + int32_t mode = ASCII_ENCODE; do { if (mode == 1) { mode = DecodeAsciiSegment(&bits, result, resultTrailer, e); @@ -104,12 +104,12 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecodedBitStreamParser::Decode(CFX_ByteAr BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return tempCp; } -FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e) +int32_t CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e) { FX_CHAR buffer[128]; FX_BOOL upperShift = FALSE; do { - FX_INT32 oneByte = bits->ReadBits(8, e); + int32_t oneByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnValue(e, 0); if (oneByte == 0) { e = BCExceptionFormatException; @@ -122,7 +122,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } else if (oneByte == 129) { return PAD_ENCODE; } else if (oneByte <= 229) { - FX_INT32 value = oneByte - 130; + int32_t value = oneByte - 130; #if defined(_FX_WINAPI_PARTITION_APP_) memset(buffer, 0, sizeof(FX_CHAR) * 128); _itoa_s(value, buffer, 128, 10); @@ -174,7 +174,7 @@ FX_INT32 CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(CBC_CommonBitS } while (bits->Available() > 0); return ASCII_ENCODE; } -void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_BOOL upperShift = FALSE; CFX_Int32Array cValues; @@ -183,18 +183,18 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 tempp = bits->ReadBits(8, e); + int32_t tempp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, tempp, cValues); - FX_INT32 shift = 0; - FX_INT32 i; + int32_t shift = 0; + int32_t i; for (i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + int32_t cValue = cValues[i]; switch (shift) { case 0: if (cValue < 3) { @@ -258,26 +258,26 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeC40Segment(CBC_CommonBitSource } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_BOOL upperShift = FALSE; CFX_Int32Array cValues; cValues.SetSize(3); - FX_INT32 shift = 0; + int32_t shift = 0; do { if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 inTp = bits->ReadBits(8, e); + int32_t inTp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, inTp, cValues); - for (FX_INT32 i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + for (int32_t i = 0; i < 3; i++) { + int32_t cValue = cValues[i]; switch (shift) { case 0: if (cValue < 3) { @@ -347,7 +347,7 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment(CBC_CommonBitSource } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { CFX_Int32Array cValues; cValues.SetSize(3); @@ -355,17 +355,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou if (bits->Available() == 8) { return; } - FX_INT32 firstByte = bits->ReadBits(8, e); + int32_t firstByte = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (firstByte == 254) { return; } - FX_INT32 iTemp1 = bits->ReadBits(8, e); + int32_t iTemp1 = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); ParseTwoBytes(firstByte, iTemp1, cValues); - FX_INT32 i; + int32_t i; for (i = 0; i < 3; i++) { - FX_INT32 cValue = cValues[i]; + int32_t cValue = cValues[i]; if (cValue == 0) { BC_FX_ByteString_Append(result, 1, '\r'); } else if (cValue == 1) { @@ -385,17 +385,17 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment(CBC_CommonBitSou } } while (bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result) +void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result) { - FX_INT32 fullBitValue = (firstByte << 8) + secondByte - 1; - FX_INT32 temp = fullBitValue / 1600; + int32_t fullBitValue = (firstByte << 8) + secondByte - 1; + int32_t temp = fullBitValue / 1600; result[0] = temp; fullBitValue -= temp * 1600; temp = fullBitValue / 40; result[1] = temp; result[2] = fullBitValue - temp * 40; } -void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e) { FX_CHAR buffer[128]; FX_BOOL unlatch = FALSE; @@ -403,9 +403,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou if (bits->Available() <= 16) { return; } - FX_INT32 i; + int32_t i; for (i = 0; i < 4; i++) { - FX_INT32 edifactValue = bits->ReadBits(6, e); + int32_t edifactValue = bits->ReadBits(6, e); BC_EXCEPTION_CHECK_ReturnVoid(e); if (edifactValue == 0x1F) { unlatch = TRUE; @@ -425,19 +425,19 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(CBC_CommonBitSou } } while (!unlatch && bits->Available() > 0); } -void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e) +void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e) { - FX_INT32 codewordPosition = 1 + bits->getByteOffset(); - FX_INT32 iTmp = bits->ReadBits(8, e); + int32_t codewordPosition = 1 + bits->getByteOffset(); + int32_t iTmp = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - FX_INT32 d1 = Unrandomize255State(iTmp, codewordPosition++); - FX_INT32 count; + int32_t d1 = Unrandomize255State(iTmp, codewordPosition++); + int32_t count; if (d1 == 0) { count = bits->Available() / 8; } else if (d1 < 250) { count = d1; } else { - FX_INT32 iTmp3 = bits->ReadBits(8, e); + int32_t iTmp3 = bits->ReadBits(8, e); BC_EXCEPTION_CHECK_ReturnVoid(e); count = 250 * (d1 - 249) + Unrandomize255State(iTmp3, codewordPosition++); } @@ -447,14 +447,14 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou } CFX_ByteArray *bytes = FX_NEW CFX_ByteArray(); bytes->SetSize(count); - FX_INT32 i; + int32_t i; for (i = 0; i < count; i++) { if (bits->Available() < 8) { e = BCExceptionFormatException; delete bytes; return; } - FX_INT32 iTemp5 = bits->ReadBits(8, e); + int32_t iTemp5 = bits->ReadBits(8, e); if (e != BCExceptionNO) { delete bytes; return; @@ -464,9 +464,9 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(CBC_CommonBitSou BC_FX_ByteString_Append(result, *bytes); delete bytes; } -FX_BYTE CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition) +uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition) { - FX_INT32 pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; - FX_INT32 tempVariable = randomizedBase256Codeword - pseudoRandomNumber; - return (FX_BYTE) (tempVariable >= 0 ? tempVariable : tempVariable + 256); + int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; + int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; + return (uint8_t) (tempVariable >= 0 ? tempVariable : tempVariable + 256); } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h index 45db800176..4fa5407fb5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h @@ -13,17 +13,17 @@ class CBC_DataMatrixDecodedBitStreamParser public: CBC_DataMatrixDecodedBitStreamParser(); virtual ~CBC_DataMatrixDecodedBitStreamParser(); - static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, FX_INT32 &e); + static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, int32_t &e); private: - static FX_INT32 DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e); - static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result); - static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e); - static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e); - static FX_BYTE Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition); + static int32_t DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, int32_t &e); + static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void ParseTwoBytes(int32_t firstByte, int32_t secondByte, CFX_Int32Array &result); + static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, int32_t &e); + static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, int32_t &e); + static uint8_t Unrandomize255State(int32_t randomizedBase256Codeword, int32_t base256CodewordPosition); const static FX_CHAR C40_BASIC_SET_CHARS[]; const static FX_CHAR C40_SHIFT2_SET_CHARS[]; @@ -31,12 +31,12 @@ private: const static FX_CHAR TEXT_BASIC_SET_CHARS[]; const static FX_CHAR TEXT_SHIFT3_SET_CHARS[]; - const static FX_INT32 PAD_ENCODE; - const static FX_INT32 ASCII_ENCODE; - const static FX_INT32 C40_ENCODE; - const static FX_INT32 TEXT_ENCODE; - const static FX_INT32 ANSIX12_ENCODE; - const static FX_INT32 EDIFACT_ENCODE; - const static FX_INT32 BASE256_ENCODE; + const static int32_t PAD_ENCODE; + const static int32_t ASCII_ENCODE; + const static int32_t C40_ENCODE; + const static int32_t TEXT_ENCODE; + const static int32_t ANSIX12_ENCODE; + const static int32_t EDIFACT_ENCODE; + const static int32_t BASE256_ENCODE; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp index e9eb32cf84..8dfdea81c1 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixDecoder::~CBC_DataMatrixDecoder() } m_rsDecoder = NULL; } -CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e) +CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits, int32_t &e) { CBC_DataMatrixBitMatrixParser parser; parser.Init(bits, e); @@ -55,9 +55,9 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits CBC_AutoPtr codewords(byteTemp); CFX_PtrArray *dataBlocks = CBC_DataMatrixDataBlock::GetDataBlocks(codewords.get(), version, e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 dataBlocksCount = dataBlocks->GetSize(); - FX_INT32 totalBytes = 0; - FX_INT32 i, j; + int32_t dataBlocksCount = dataBlocks->GetSize(); + int32_t totalBytes = 0; + int32_t i, j; for (i = 0; i < dataBlocksCount; i++) { totalBytes += ((CBC_DataMatrixDataBlock*)(*dataBlocks)[i])->GetNumDataCodewords(); } @@ -65,17 +65,17 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits resultBytes.SetSize(totalBytes); for (j = 0; j < dataBlocksCount; j++) { CFX_ByteArray *codewordBytes = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetCodewords(); - FX_INT32 numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords(); + int32_t numDataCodewords = ((CBC_DataMatrixDataBlock*)(*dataBlocks)[j])->GetNumDataCodewords(); CorrectErrors(*codewordBytes, numDataCodewords, e); if (e != BCExceptionNO) { - for(FX_INT32 i = 0; i < dataBlocks->GetSize(); i++) { + for(int32_t i = 0; i < dataBlocks->GetSize(); i++) { delete (CBC_DataMatrixDataBlock*)(*dataBlocks)[i]; } delete dataBlocks; dataBlocks = NULL; return NULL; } - FX_INT32 i; + int32_t i; for (i = 0; i < numDataCodewords; i++) { resultBytes[i * dataBlocksCount + j] = (*codewordBytes)[i]; } @@ -89,22 +89,22 @@ CBC_CommonDecoderResult *CBC_DataMatrixDecoder::Decode(CBC_CommonBitMatrix *bits BC_EXCEPTION_CHECK_ReturnValue(e, NULL); return resultR; } -void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e) +void CBC_DataMatrixDecoder::CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e) { - FX_INT32 numCodewords = codewordBytes.GetSize(); + int32_t numCodewords = codewordBytes.GetSize(); CFX_Int32Array codewordsInts; codewordsInts.SetSize(numCodewords); - FX_INT32 i; + int32_t i; for (i = 0; i < numCodewords; i++) { codewordsInts[i] = codewordBytes[i] & 0xFF; } - FX_INT32 numECCodewords = codewordBytes.GetSize() - numDataCodewords; + int32_t numECCodewords = codewordBytes.GetSize() - numDataCodewords; m_rsDecoder->Decode(&codewordsInts, numECCodewords, e); if (e != BCExceptionNO) { e = BCExceptionChecksumException; return ; } for (i = 0; i < numDataCodewords; i++) { - codewordBytes[i] = (FX_BYTE) codewordsInts[i]; + codewordBytes[i] = (uint8_t) codewordsInts[i]; } } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h index 1d6059379b..d4d2cc7bb9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h @@ -14,10 +14,10 @@ class CBC_DataMatrixDecoder public: CBC_DataMatrixDecoder(); virtual ~CBC_DataMatrixDecoder(); - CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e); + CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, int32_t &e); virtual void Init(); private: - void CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e); + void CorrectErrors(CFX_ByteArray &codewordBytes, int32_t numDataCodewords, int32_t &e); CBC_ReedSolomonDecoder *m_rsDecoder; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp index 12877c5c3a..bdcbc4c418 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp @@ -28,12 +28,12 @@ #include "../qrcode/BC_QRDetectorResult.h" #include "../qrcode/BC_QRGridSampler.h" #include "BC_DataMatrixDetector.h" -const FX_INT32 CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4}; +const int32_t CBC_DataMatrixDetector::INTEGERS[5] = {0, 1, 2, 3, 4}; CBC_DataMatrixDetector::CBC_DataMatrixDetector(CBC_CommonBitMatrix *image): m_image(image), m_rectangleDetector(NULL) { } -void CBC_DataMatrixDetector::Init(FX_INT32 &e) +void CBC_DataMatrixDetector::Init(int32_t &e) { m_rectangleDetector = FX_NEW CBC_WhiteRectangleDetector(m_image); m_rectangleDetector->Init(e); @@ -50,7 +50,7 @@ inline FX_BOOL ResultPointsAndTransitionsComparator(FX_LPVOID a, FX_LPVOID b) { return ((CBC_ResultPointsAndTransitions *)b)->GetTransitions() > ((CBC_ResultPointsAndTransitions *)a)->GetTransitions(); } -CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) +CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(int32_t &e) { CFX_PtrArray* cornerPoints = m_rectangleDetector->Detect(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); @@ -70,7 +70,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete ( (CBC_ResultPointsAndTransitions *)transitions[3] ); CBC_ResultPointsAndTransitions *lSideOne = (CBC_ResultPointsAndTransitions*)transitions[0]; CBC_ResultPointsAndTransitions *lSideTwo = (CBC_ResultPointsAndTransitions*)transitions[1]; - CFX_MapPtrTemplate pointCount; + CFX_MapPtrTemplate pointCount; Increment(pointCount, lSideOne->GetFrom()); Increment(pointCount, lSideOne->GetTo()); Increment(pointCount, lSideTwo->GetFrom()); @@ -84,7 +84,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) FX_POSITION itBegin = pointCount.GetStartPosition(); while(itBegin != NULL) { CBC_ResultPoint *key = 0; - FX_INT32 value = 0; + int32_t value = 0; pointCount.GetNextAssoc(itBegin, key, value); if(value == 2) { bottomLeft = key; @@ -114,7 +114,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) bottomLeft = (CBC_ResultPoint*)corners[1]; CBC_ResultPoint *topLeft = (CBC_ResultPoint*)corners[2]; CBC_ResultPoint *topRight = NULL; - FX_INT32 value; + int32_t value; if (!pointCount.Lookup(pointA, value)) { topRight = pointA; } else if (!pointCount.Lookup(pointB, value)) { @@ -124,8 +124,8 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) } else { topRight = pointD; } - FX_INT32 dimensionTop = CBC_AutoPtr(TransitionsBetween(topLeft, topRight))->GetTransitions(); - FX_INT32 dimensionRight = CBC_AutoPtr(TransitionsBetween(bottomRight, topRight))->GetTransitions(); + int32_t dimensionTop = CBC_AutoPtr(TransitionsBetween(topLeft, topRight))->GetTransitions(); + int32_t dimensionRight = CBC_AutoPtr(TransitionsBetween(bottomRight, topRight))->GetTransitions(); if ((dimensionTop & 0x01) == 1) { dimensionTop++; } @@ -158,7 +158,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) correctedTopRight.get(), dimensionTop, dimensionRight, e)); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); } else { - FX_INT32 dimension = FX_MIN(dimensionRight, dimensionTop); + int32_t dimension = FX_MIN(dimensionRight, dimensionTop); correctedTopRight = CBC_AutoPtr(CorrectTopRight(bottomLeft, bottomRight, topLeft, topRight, dimension)); if (correctedTopRight.get() == NULL) { @@ -167,7 +167,7 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) delete topRight; topRight = NULL; } - FX_INT32 dimensionCorrected = FX_MAX(CBC_AutoPtr(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(), + int32_t dimensionCorrected = FX_MAX(CBC_AutoPtr(TransitionsBetween(topLeft, correctedTopRight.get()))->GetTransitions(), CBC_AutoPtr(TransitionsBetween(bottomRight, correctedTopRight.get()))->GetTransitions()); dimensionCorrected++; if ((dimensionCorrected & 0x01) == 1) { @@ -190,10 +190,10 @@ CBC_QRDetectorResult *CBC_DataMatrixDetector::Detect(FX_INT32 &e) result->Add(correctedTopRight.release()); return FX_NEW CBC_QRDetectorResult(bits.release(), result); } -CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimensionTop, FX_INT32 dimensionRight) +CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimensionTop, int32_t dimensionRight) { FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT)dimensionTop; - FX_INT32 norm = Distance(topLeft, topRight); + int32_t norm = Distance(topLeft, topRight); FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm; FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm; CBC_AutoPtr c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin)); @@ -210,19 +210,19 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRightRectangular(CBC_ResultPo } else if (!IsValid(c2.get())) { return c1.release(); } - FX_INT32 l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) + + int32_t l1 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions()) + FXSYS_abs(dimensionRight - CBC_AutoPtr(TransitionsBetween(bottomRight, c1.get()))->GetTransitions()); - FX_INT32 l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) + + int32_t l2 = FXSYS_abs(dimensionTop - CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions()) + FXSYS_abs(dimensionRight - CBC_AutoPtr(TransitionsBetween(bottomRight, c2.get()))->GetTransitions()); if (l1 <= l2) { return c1.release(); } return c2.release(); } -CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, FX_INT32 dimension) +CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, int32_t dimension) { FX_FLOAT corr = Distance(bottomLeft, bottomRight) / (FX_FLOAT) dimension; - FX_INT32 norm = Distance(topLeft, topRight); + int32_t norm = Distance(topLeft, topRight); FX_FLOAT cos = (topRight->GetX() - topLeft->GetX()) / norm; FX_FLOAT sin = (topRight->GetY() - topLeft->GetY()) / norm; CBC_AutoPtr c1(FX_NEW CBC_ResultPoint(topRight->GetX() + corr * cos, topRight->GetY() + corr * sin)); @@ -239,9 +239,9 @@ CBC_ResultPoint *CBC_DataMatrixDetector::CorrectTopRight(CBC_ResultPoint *bottom } else if (!IsValid(c2.get())) { return c1.release(); } - FX_INT32 l1 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions() - + int32_t l1 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c1.get()))->GetTransitions() - CBC_AutoPtr(TransitionsBetween(bottomRight, c1.get()))->GetTransitions()); - FX_INT32 l2 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions() - + int32_t l2 = FXSYS_abs(CBC_AutoPtr(TransitionsBetween(topLeft, c2.get()))->GetTransitions() - CBC_AutoPtr(TransitionsBetween(bottomRight, c2.get()))->GetTransitions()); return l1 <= l2 ? c1.release() : c2.release(); } @@ -249,19 +249,19 @@ FX_BOOL CBC_DataMatrixDetector::IsValid(CBC_ResultPoint *p) { return p->GetX() >= 0 && p->GetX() < m_image->GetWidth() && p->GetY() > 0 && p->GetY() < m_image->GetHeight(); } -FX_INT32 CBC_DataMatrixDetector::Round(FX_FLOAT d) +int32_t CBC_DataMatrixDetector::Round(FX_FLOAT d) { - return (FX_INT32) (d + 0.5f); + return (int32_t) (d + 0.5f); } -FX_INT32 CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b) +int32_t CBC_DataMatrixDetector::Distance(CBC_ResultPoint *a, CBC_ResultPoint *b) { return Round((FX_FLOAT) sqrt((a->GetX() - b->GetX()) * (a->GetX() - b->GetX()) + (a->GetY() - b->GetY()) * (a->GetY() - b->GetY()))); } -void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key) +void CBC_DataMatrixDetector::Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key) { - FX_INT32 value; + int32_t value; if(table.Lookup(key, value)) { table.SetAt(key, INTEGERS[value + 1]); } else { @@ -273,7 +273,7 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topRight, - FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e) + int32_t dimensionX, int32_t dimensionY, int32_t &e) { CBC_QRGridSampler &sampler = CBC_QRGridSampler::GetInstance(); CBC_CommonBitMatrix* cbm = sampler.SampleGrid(image, @@ -300,27 +300,27 @@ CBC_CommonBitMatrix *CBC_DataMatrixDetector::SampleGrid(CBC_CommonBitMatrix *ima } CBC_ResultPointsAndTransitions *CBC_DataMatrixDetector::TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to) { - FX_INT32 fromX = (FX_INT32) from->GetX(); - FX_INT32 fromY = (FX_INT32) from->GetY(); - FX_INT32 toX = (FX_INT32) to->GetX(); - FX_INT32 toY = (FX_INT32) to->GetY(); + int32_t fromX = (int32_t) from->GetX(); + int32_t fromY = (int32_t) from->GetY(); + int32_t toX = (int32_t) to->GetX(); + int32_t toY = (int32_t) to->GetY(); FX_BOOL steep = FXSYS_abs(toY - fromY) > FXSYS_abs(toX - fromX); if (steep) { - FX_INT32 temp = fromX; + int32_t temp = fromX; fromX = fromY; fromY = temp; temp = toX; toX = toY; toY = temp; } - FX_INT32 dx = FXSYS_abs(toX - fromX); - FX_INT32 dy = FXSYS_abs(toY - fromY); - FX_INT32 error = -dx >> 1; - FX_INT32 ystep = fromY < toY ? 1 : -1; - FX_INT32 xstep = fromX < toX ? 1 : -1; - FX_INT32 transitions = 0; + int32_t dx = FXSYS_abs(toX - fromX); + int32_t dy = FXSYS_abs(toY - fromY); + int32_t error = -dx >> 1; + int32_t ystep = fromY < toY ? 1 : -1; + int32_t xstep = fromX < toX ? 1 : -1; + int32_t transitions = 0; FX_BOOL inBlack = m_image->Get(steep ? fromY : fromX, steep ? fromX : fromY); - for (FX_INT32 x = fromX, y = fromY; x != toX; x += xstep) { + for (int32_t x = fromX, y = fromY; x != toX; x += xstep) { FX_BOOL isBlack = m_image->Get(steep ? y : x, steep ? x : y); if (isBlack != inBlack) { transitions++; diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h index a9e244c5f4..e36ef678cd 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h @@ -15,7 +15,7 @@ class ResultPointsAndTransitions; class CBC_ResultPointsAndTransitions { public: - CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, FX_INT32 transitions) + CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, int32_t transitions) { m_from = from; m_to = to; @@ -32,47 +32,47 @@ public: { return m_to; } - FX_INT32 GetTransitions() + int32_t GetTransitions() { return m_transitions; } private: CBC_ResultPoint *m_from; CBC_ResultPoint *m_to; - FX_INT32 m_transitions; + int32_t m_transitions; }; class CBC_DataMatrixDetector { public: CBC_DataMatrixDetector(CBC_CommonBitMatrix *image); virtual ~CBC_DataMatrixDetector(); - CBC_QRDetectorResult *Detect(FX_INT32 &e); + CBC_QRDetectorResult *Detect(int32_t &e); CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - FX_INT32 dimensionTop, FX_INT32 dimensionRight); + int32_t dimensionTop, int32_t dimensionRight); CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, - FX_INT32 dimension); + int32_t dimension); CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *bottomLeft, CBC_ResultPoint *bottomRight, CBC_ResultPoint *topRight, - FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e); + int32_t dimensionX, int32_t dimensionY, int32_t &e); CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to); FX_BOOL IsValid(CBC_ResultPoint *p); - FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); - void Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key); - FX_INT32 Round(FX_FLOAT d); + int32_t Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); + void Increment(CFX_MapPtrTemplate &table, CBC_ResultPoint *key); + int32_t Round(FX_FLOAT d); void OrderBestPatterns(CFX_PtrArray *patterns); - virtual void Init(FX_INT32 &e); + virtual void Init(int32_t &e); private: CBC_CommonBitMatrix *m_image; CBC_WhiteRectangleDetector *m_rectangleDetector; - const static FX_INT32 INTEGERS[5]; + const static int32_t INTEGERS[5]; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index cf076cd313..1b9f55dc9f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -44,7 +44,7 @@ CBC_DataMatrixReader::~CBC_DataMatrixReader() } m_decoder = NULL; } -CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) +CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t hints, int32_t &e) { CBC_CommonBitMatrix *cdr = image->GetBlackMatrix(e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); @@ -59,7 +59,7 @@ CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 hi CBC_AutoPtr decodeResult(ResultTemp); return decodeResult->GetText(); } -CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, FX_INT32 &e) +CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap *image, int32_t &e) { CFX_ByteString bs = Decode(image, 0, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h index 4301512d70..6ba17a89e3 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h @@ -15,8 +15,8 @@ class CBC_DataMatrixReader : public CBC_Reader public: CBC_DataMatrixReader(); virtual ~CBC_DataMatrixReader(); - CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e); - CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, FX_INT32 &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int32_t &e); + CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, int32_t &e); virtual void Init(); private: diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp index 256117883d..dfe0e11f1c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp @@ -33,11 +33,11 @@ CBC_DataMatrixSymbolInfo144::CBC_DataMatrixSymbolInfo144() : CBC_SymbolInfo(FALS CBC_DataMatrixSymbolInfo144::~CBC_DataMatrixSymbolInfo144() { } -FX_INT32 CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() +int32_t CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() { return 10; } -FX_INT32 CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_DataMatrixSymbolInfo144getDataLengthForInterleavedBlock(int32_t index) { return (index <= 8) ? 156 : 155; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h index e749b27d86..2c13551145 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h @@ -13,7 +13,7 @@ class CBC_DataMatrixSymbolInfo144 : public CBC_SymbolInfo public: CBC_DataMatrixSymbolInfo144(); virtual ~CBC_DataMatrixSymbolInfo144(); - FX_INT32 getInterleavedBlockCount(); - FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index); + int32_t getInterleavedBlockCount(); + int32_t getDataLengthForInterleavedBlock(int32_t index); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp index 1a4e59864e..bbbf4bdee5 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp @@ -29,17 +29,17 @@ void CBC_DataMatrixVersion::Initialize() } void CBC_DataMatrixVersion::Finalize() { - for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) { + for (int32_t i = 0; i < VERSIONS->GetSize(); i++) { delete ( (CBC_DataMatrixVersion*)(VERSIONS->GetAt(i)) ); } VERSIONS->RemoveAll(); delete VERSIONS; } -CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber, - FX_INT32 symbolSizeRows, - FX_INT32 symbolSizeColumns, - FX_INT32 dataRegionSizeRows, - FX_INT32 dataRegionSizeColumns, +CBC_DataMatrixVersion::CBC_DataMatrixVersion(int32_t versionNumber, + int32_t symbolSizeRows, + int32_t symbolSizeColumns, + int32_t dataRegionSizeRows, + int32_t dataRegionSizeColumns, ECBlocks *ecBlocks) { m_versionNumber = versionNumber; @@ -48,10 +48,10 @@ CBC_DataMatrixVersion::CBC_DataMatrixVersion(FX_INT32 versionNumber, m_dataRegionSizeRows = dataRegionSizeRows; m_dataRegionSizeColumns = dataRegionSizeColumns; m_ecBlocks = ecBlocks; - FX_INT32 total = 0; - FX_INT32 ecCodewords = ecBlocks->GetECCodewords(); + int32_t total = 0; + int32_t ecCodewords = ecBlocks->GetECCodewords(); const CFX_PtrArray &ecbArray = ecBlocks->GetECBlocks(); - for (FX_INT32 i = 0; i < ecbArray.GetSize(); i++) { + for (int32_t i = 0; i < ecbArray.GetSize(); i++) { total += ((ECB*)ecbArray[i])->GetCount() * (((ECB*)ecbArray[i])->GetDataCodewords() + ecCodewords); } m_totalCodewords = total; @@ -63,27 +63,27 @@ CBC_DataMatrixVersion::~CBC_DataMatrixVersion() } m_ecBlocks = NULL; } -FX_INT32 CBC_DataMatrixVersion::GetVersionNumber() +int32_t CBC_DataMatrixVersion::GetVersionNumber() { return m_versionNumber; } -FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeRows() +int32_t CBC_DataMatrixVersion::GetSymbolSizeRows() { return m_symbolSizeRows; } -FX_INT32 CBC_DataMatrixVersion::GetSymbolSizeColumns() +int32_t CBC_DataMatrixVersion::GetSymbolSizeColumns() { return m_symbolSizeColumns; } -FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeRows() +int32_t CBC_DataMatrixVersion::GetDataRegionSizeRows() { return m_dataRegionSizeRows; } -FX_INT32 CBC_DataMatrixVersion::GetDataRegionSizeColumns() +int32_t CBC_DataMatrixVersion::GetDataRegionSizeColumns() { return m_dataRegionSizeColumns; } -FX_INT32 CBC_DataMatrixVersion::GetTotalCodewords() +int32_t CBC_DataMatrixVersion::GetTotalCodewords() { return m_totalCodewords; } @@ -93,12 +93,12 @@ ECBlocks *CBC_DataMatrixVersion::GetECBlocks() } void CBC_DataMatrixVersion::ReleaseAll() { - for (FX_INT32 i = 0; i < VERSIONS->GetSize(); i++) { + for (int32_t i = 0; i < VERSIONS->GetSize(); i++) { delete (CBC_DataMatrixVersion*)VERSIONS->GetAt(i); } VERSIONS->RemoveAll(); } -CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e) +CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e) { if ((numRows & 0x01) != 0 || (numColumns & 0x01) != 0) { e = BCExceptionNotFound; @@ -136,8 +136,8 @@ CBC_DataMatrixVersion *CBC_DataMatrixVersion::GetVersionForDimensions(FX_INT32 n VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(29, 16, 36, 14, 16, FX_NEW ECBlocks(24, FX_NEW ECB(1, 32)))); VERSIONS->Add(FX_NEW CBC_DataMatrixVersion(30, 16, 48, 14, 22, FX_NEW ECBlocks(28, FX_NEW ECB(1, 49)))); } - FX_INT32 numVersions = VERSIONS->GetSize(); - for (FX_INT32 i = 0; i < numVersions; ++i) { + int32_t numVersions = VERSIONS->GetSize(); + for (int32_t i = 0; i < numVersions; ++i) { if (((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeRows == numRows && ((CBC_DataMatrixVersion*)((*VERSIONS)[i]))->m_symbolSizeColumns == numColumns) { return (CBC_DataMatrixVersion*)(*VERSIONS)[i]; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h index 9661834bd8..90f6509f0f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h @@ -11,35 +11,35 @@ class CBC_DataMatrixVersion; class ECB { public: - ECB(FX_INT32 count, FX_INT32 dataCodewords) + ECB(int32_t count, int32_t dataCodewords) { m_count = count; m_dataCodewords = dataCodewords; } - FX_INT32 GetCount() + int32_t GetCount() { return m_count; } - FX_INT32 GetDataCodewords() + int32_t GetDataCodewords() { return m_dataCodewords; } private: - FX_INT32 m_count; - FX_INT32 m_dataCodewords; + int32_t m_count; + int32_t m_dataCodewords; }; class ECBlocks { public: - ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks) + ECBlocks(int32_t ecCodewords, ECB *ecBlocks) { m_ecCodewords = ecCodewords; m_ecBlocks.Add(ecBlocks); } - ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) + ECBlocks(int32_t ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2) { m_ecCodewords = ecCodewords; m_ecBlocks.Add(ecBlocks1); @@ -47,13 +47,13 @@ public: } ~ECBlocks() { - for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) { + for(int32_t i = 0; i < m_ecBlocks.GetSize(); i++) { delete (ECB*)m_ecBlocks[i]; } m_ecBlocks.RemoveAll(); } - FX_INT32 GetECCodewords() + int32_t GetECCodewords() { return m_ecCodewords; } @@ -63,38 +63,38 @@ public: return m_ecBlocks; } private: - FX_INT32 m_ecCodewords; + int32_t m_ecCodewords; CFX_PtrArray m_ecBlocks; }; class CBC_DataMatrixVersion { public: - CBC_DataMatrixVersion(FX_INT32 versionNumber, - FX_INT32 symbolSizeRows, - FX_INT32 symbolSizeColumns, - FX_INT32 dataRegionSizeRows, - FX_INT32 dataRegionSizeColumns, + CBC_DataMatrixVersion(int32_t versionNumber, + int32_t symbolSizeRows, + int32_t symbolSizeColumns, + int32_t dataRegionSizeRows, + int32_t dataRegionSizeColumns, ECBlocks *ecBlocks); virtual ~CBC_DataMatrixVersion(); static void Initialize(); static void Finalize(); - FX_INT32 GetVersionNumber(); - FX_INT32 GetSymbolSizeRows(); - FX_INT32 GetSymbolSizeColumns(); - FX_INT32 GetDataRegionSizeRows(); - FX_INT32 GetDataRegionSizeColumns(); - FX_INT32 GetTotalCodewords(); + int32_t GetVersionNumber(); + int32_t GetSymbolSizeRows(); + int32_t GetSymbolSizeColumns(); + int32_t GetDataRegionSizeRows(); + int32_t GetDataRegionSizeColumns(); + int32_t GetTotalCodewords(); ECBlocks *GetECBlocks(); - static CBC_DataMatrixVersion *GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e); + static CBC_DataMatrixVersion *GetVersionForDimensions(int32_t numRows, int32_t numColumns, int32_t &e); static void ReleaseAll(); private: - FX_INT32 m_versionNumber; - FX_INT32 m_symbolSizeRows; - FX_INT32 m_symbolSizeColumns; - FX_INT32 m_dataRegionSizeRows; - FX_INT32 m_dataRegionSizeColumns; + int32_t m_versionNumber; + int32_t m_symbolSizeRows; + int32_t m_symbolSizeColumns; + int32_t m_dataRegionSizeRows; + int32_t m_dataRegionSizeColumns; ECBlocks *m_ecBlocks; - FX_INT32 m_totalCodewords; + int32_t m_totalCodewords; static CFX_PtrArray* VERSIONS; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp index 652758a635..4bccdd0bf8 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp @@ -49,12 +49,12 @@ CBC_DataMatrixWriter::CBC_DataMatrixWriter() CBC_DataMatrixWriter::~CBC_DataMatrixWriter() { } -FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (FX_INT32 level) +FX_BOOL CBC_DataMatrixWriter::SetErrorCorrectionLevel (int32_t level) { m_iCorrectLevel = level; return TRUE; } -FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e) { if (outWidth < 0 || outHeight < 0) { e = BCExceptionHeightAndWidthMustBeAtLeast1; @@ -77,42 +77,42 @@ FX_BYTE* CBC_DataMatrixWriter::Encode(const CFX_WideString &contents, FX_INT32 & BC_EXCEPTION_CHECK_ReturnValue(e, NULL); outWidth = bytematrix->GetWidth(); outHeight = bytematrix->GetHeight(); - FX_BYTE* result = FX_Alloc(FX_BYTE, outWidth * outHeight); + uint8_t* result = FX_Alloc(uint8_t, outWidth * outHeight); FXSYS_memcpy32(result, bytematrix->GetArray(), outWidth * outHeight); delete bytematrix; delete placement; return result; } -FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) +uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e) { return NULL; } -FX_BYTE *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) +uint8_t *CBC_DataMatrixWriter::Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e) { return NULL; } -CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e) +CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e) { - FX_INT32 symbolWidth = symbolInfo->getSymbolDataWidth(e); + int32_t symbolWidth = symbolInfo->getSymbolDataWidth(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); - FX_INT32 symbolHeight = symbolInfo->getSymbolDataHeight(e); + int32_t symbolHeight = symbolInfo->getSymbolDataHeight(e); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); CBC_CommonByteMatrix* matrix = FX_NEW CBC_CommonByteMatrix(symbolInfo->getSymbolWidth(e), symbolInfo->getSymbolHeight(e)); BC_EXCEPTION_CHECK_ReturnValue(e, NULL); matrix->Init(); - FX_INT32 matrixY = 0; - for (FX_INT32 y = 0; y < symbolHeight; y++) { - FX_INT32 matrixX; + int32_t matrixY = 0; + for (int32_t y = 0; y < symbolHeight; y++) { + int32_t matrixX; if ((y % symbolInfo->m_matrixHeight) == 0) { matrixX = 0; - for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) { + for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { matrix->Set(matrixX, matrixY, (x % 2) == 0); matrixX++; } matrixY++; } matrixX = 0; - for (FX_INT32 x = 0; x < symbolWidth; x++) { + for (int32_t x = 0; x < symbolWidth; x++) { if ((x % symbolInfo->m_matrixWidth) == 0) { matrix->Set(matrixX, matrixY, TRUE); matrixX++; @@ -127,7 +127,7 @@ CBC_CommonByteMatrix* CBC_DataMatrixWriter::encodeLowLevel(CBC_DefaultPlacement* matrixY++; if ((y % symbolInfo->m_matrixHeight) == symbolInfo->m_matrixHeight - 1) { matrixX = 0; - for (FX_INT32 x = 0; x < symbolInfo->getSymbolWidth(e); x++) { + for (int32_t x = 0; x < symbolInfo->getSymbolWidth(e); x++) { matrix->Set(matrixX, matrixY, TRUE); matrixX++; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h index c8a6bdd823..241229b467 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h @@ -18,13 +18,13 @@ class CBC_DataMatrixWriter : public CBC_TwoDimWriter public: CBC_DataMatrixWriter(); virtual ~CBC_DataMatrixWriter(); - FX_BYTE* Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e); - FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e); - FX_BOOL SetErrorCorrectionLevel (FX_INT32 level); + uint8_t* Encode(const CFX_WideString &contents, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t &e); + uint8_t * Encode(const CFX_ByteString &contents, BCFORMAT format, int32_t &outWidth, int32_t &outHeight, int32_t hints, int32_t &e); + FX_BOOL SetErrorCorrectionLevel (int32_t level); private: - static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e); - FX_INT32 m_iCorrectLevel; + static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, int32_t &e); + int32_t m_iCorrectLevel; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp index e6bab5a65e..57c6cc92d2 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp @@ -23,25 +23,25 @@ #include "../barcode.h" #include "BC_Encoder.h" #include "BC_DefaultPlacement.h" -CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows) +CBC_DefaultPlacement::CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows) { m_codewords = codewords; m_numcols = numcols; m_numrows = numrows; m_bits.SetSize(numcols * numrows); - for (FX_INT32 i = 0; i < numcols * numrows; i++) { - m_bits[i] = (FX_BYTE) 2; + for (int32_t i = 0; i < numcols * numrows; i++) { + m_bits[i] = (uint8_t) 2; } } CBC_DefaultPlacement::~CBC_DefaultPlacement() { m_bits.RemoveAll(); } -FX_INT32 CBC_DefaultPlacement::getNumrows() +int32_t CBC_DefaultPlacement::getNumrows() { return m_numrows; } -FX_INT32 CBC_DefaultPlacement::getNumcols() +int32_t CBC_DefaultPlacement::getNumcols() { return m_numcols; } @@ -49,23 +49,23 @@ CFX_ByteArray& CBC_DefaultPlacement::getBits() { return m_bits; } -FX_BOOL CBC_DefaultPlacement::getBit(FX_INT32 col, FX_INT32 row) +FX_BOOL CBC_DefaultPlacement::getBit(int32_t col, int32_t row) { return m_bits[row * m_numcols + col] == 1; } -void CBC_DefaultPlacement::setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit) +void CBC_DefaultPlacement::setBit(int32_t col, int32_t row, FX_BOOL bit) { - m_bits[row * m_numcols + col] = bit ? (FX_BYTE) 1 : (FX_BYTE) 0; + m_bits[row * m_numcols + col] = bit ? (uint8_t) 1 : (uint8_t) 0; } -FX_BOOL CBC_DefaultPlacement::hasBit(FX_INT32 col, FX_INT32 row) +FX_BOOL CBC_DefaultPlacement::hasBit(int32_t col, int32_t row) { return m_bits[row * m_numcols + col] != 2; } void CBC_DefaultPlacement::place() { - FX_INT32 pos = 0; - FX_INT32 row = 4; - FX_INT32 col = 0; + int32_t pos = 0; + int32_t row = 4; + int32_t col = 0; do { if ((row == m_numrows) && (col == 0)) { corner1(pos++); @@ -103,7 +103,7 @@ void CBC_DefaultPlacement::place() setBit(m_numcols - 2, m_numrows - 2, TRUE); } } -void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit) +void CBC_DefaultPlacement::module(int32_t row, int32_t col, int32_t pos, int32_t bit) { if (row < 0) { row += m_numrows; @@ -113,11 +113,11 @@ void CBC_DefaultPlacement::module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_I col += m_numcols; row += 4 - ((m_numcols + 4) % 8); } - FX_INT32 v = m_codewords.GetAt(pos); + int32_t v = m_codewords.GetAt(pos); v &= 1 << (8 - bit); setBit(col, row, v != 0); } -void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos) +void CBC_DefaultPlacement::utah(int32_t row, int32_t col, int32_t pos) { module(row - 2, col - 2, pos, 1); module(row - 2, col - 1, pos, 2); @@ -128,7 +128,7 @@ void CBC_DefaultPlacement::utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos) module(row, col - 1, pos, 7); module(row, col, pos, 8); } -void CBC_DefaultPlacement::corner1(FX_INT32 pos) +void CBC_DefaultPlacement::corner1(int32_t pos) { module(m_numrows - 1, 0, pos, 1); module(m_numrows - 1, 1, pos, 2); @@ -139,7 +139,7 @@ void CBC_DefaultPlacement::corner1(FX_INT32 pos) module(2, m_numcols - 1, pos, 7); module(3, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner2(FX_INT32 pos) +void CBC_DefaultPlacement::corner2(int32_t pos) { module(m_numrows - 3, 0, pos, 1); module(m_numrows - 2, 0, pos, 2); @@ -150,7 +150,7 @@ void CBC_DefaultPlacement::corner2(FX_INT32 pos) module(0, m_numcols - 1, pos, 7); module(1, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner3(FX_INT32 pos) +void CBC_DefaultPlacement::corner3(int32_t pos) { module(m_numrows - 3, 0, pos, 1); module(m_numrows - 2, 0, pos, 2); @@ -161,7 +161,7 @@ void CBC_DefaultPlacement::corner3(FX_INT32 pos) module(2, m_numcols - 1, pos, 7); module(3, m_numcols - 1, pos, 8); } -void CBC_DefaultPlacement::corner4(FX_INT32 pos) +void CBC_DefaultPlacement::corner4(int32_t pos) { module(m_numrows - 1, 0, pos, 1); module(m_numrows - 1, m_numcols - 1, pos, 2); diff --git a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h index 2194e9f18a..dec26a6c70 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h +++ b/xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h @@ -9,26 +9,26 @@ class CBC_DefaultPlacement { public: - CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows); + CBC_DefaultPlacement(CFX_WideString codewords, int32_t numcols, int32_t numrows); virtual ~CBC_DefaultPlacement(); - FX_INT32 getNumrows(); - FX_INT32 getNumcols(); + int32_t getNumrows(); + int32_t getNumcols(); CFX_ByteArray& getBits(); - FX_BOOL getBit(FX_INT32 col, FX_INT32 row); - void setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit); - FX_BOOL hasBit(FX_INT32 col, FX_INT32 row); + FX_BOOL getBit(int32_t col, int32_t row); + void setBit(int32_t col, int32_t row, FX_BOOL bit); + FX_BOOL hasBit(int32_t col, int32_t row); void place(); private: CFX_WideString m_codewords; - FX_INT32 m_numrows; - FX_INT32 m_numcols; + int32_t m_numrows; + int32_t m_numcols; CFX_ByteArray m_bits; - void module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit); - void utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos); - void corner1(FX_INT32 pos); - void corner2(FX_INT32 pos); - void corner3(FX_INT32 pos); - void corner4(FX_INT32 pos); + void module(int32_t row, int32_t col, int32_t pos, int32_t bit); + void utah(int32_t row, int32_t col, int32_t pos); + void corner1(int32_t pos); + void corner2(int32_t pos); + void corner3(int32_t pos); + void corner4(int32_t pos); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp index d1e84af73e..8a0271f1a0 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp @@ -35,11 +35,11 @@ CBC_EdifactEncoder::CBC_EdifactEncoder() CBC_EdifactEncoder::~CBC_EdifactEncoder() { } -FX_INT32 CBC_EdifactEncoder::getEncodingMode() +int32_t CBC_EdifactEncoder::getEncodingMode() { return EDIFACT_ENCODATION; } -void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { @@ -49,14 +49,14 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) return; } context.m_pos++; - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if (count >= 4) { context.writeCodewords(encodeToCodewords(buffer, 0, e)); if (e != BCExceptionNO) { return; } buffer.Delete(0, 4); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(ASCII_ENCODATION); break; @@ -66,9 +66,9 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) buffer += (FX_WCHAR)31; handleEOD(context, buffer, e); } -void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e) +void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e) { - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if (count == 0) { return; } @@ -77,8 +77,8 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); - FX_INT32 remaining = context.getRemainingCharacters(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t remaining = context.getRemainingCharacters(); if (remaining == 0 && available <= 2) { return; } @@ -87,7 +87,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b e = BCExceptionIllegalStateCountMustNotExceed4; return; } - FX_INT32 restChars = count - 1; + int32_t restChars = count - 1; CFX_WideString encoded = encodeToCodewords(buffer, 0, e); if (e != BCExceptionNO) { return; @@ -99,7 +99,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); if (available >= 3) { restInAscii = FALSE; context.updateSymbolInfo(context.getCodewordCount() + encoded.GetLength(), e); @@ -116,7 +116,7 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext &context, CFX_WideString b } context.signalEncoderChange(ASCII_ENCODATION); } -void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c >= ' ' && c <= '?') { sb += c; @@ -126,9 +126,9 @@ void CBC_EdifactEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) CBC_HighLevelEncoder::illegalCharacter(c, e); } } -CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e) +CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e) { - FX_INT32 len = sb.GetLength() - startPos; + int32_t len = sb.GetLength() - startPos; if (len == 0) { e = BCExceptionNoContents; return (FX_LPWSTR)""; @@ -137,7 +137,7 @@ CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb, FX_INT32 FX_WCHAR c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0; FX_WCHAR c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0; FX_WCHAR c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0; - FX_INT32 v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4; + int32_t v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4; FX_WCHAR cw1 = (FX_WCHAR) ((v >> 16) & 255); FX_WCHAR cw2 = (FX_WCHAR) ((v >> 8) & 255); FX_WCHAR cw3 = (FX_WCHAR) (v & 255); diff --git a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h index 7e2453a71d..6b102c689c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h @@ -13,11 +13,11 @@ class CBC_EdifactEncoder : public CBC_Encoder public: CBC_EdifactEncoder(); virtual ~CBC_EdifactEncoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); private: - static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e); - static void encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); - static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e); + static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, int32_t &e); + static void encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); + static CFX_WideString encodeToCodewords(CFX_WideString sb, int32_t startPos, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h index 7d1a1b5b62..9a51af06e9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_Encoder.h @@ -12,7 +12,7 @@ class CBC_Encoder public: CBC_Encoder(); virtual ~CBC_Encoder(); - virtual FX_INT32 getEncodingMode() = 0; - virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e) = 0; + virtual int32_t getEncodingMode() = 0; + virtual void Encode(CBC_EncoderContext &context, int32_t &e) = 0; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp index f65c9f29bc..066b4b2037 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp @@ -28,13 +28,13 @@ #include "BC_SymbolShapeHint.h" #include "BC_SymbolInfo.h" #include "BC_EncoderContext.h" -CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e) +CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e) { CFX_ByteString dststr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, dststr); CFX_WideString sb; - FX_INT32 c = dststr.GetLength(); - for (FX_INT32 i = 0; i < c; i++) { + int32_t c = dststr.GetLength(); + for (int32_t i = 0; i < c; i++) { FX_WCHAR ch = (FX_WCHAR)(dststr.GetAt(i) & 0xff); if (ch == '?' && dststr.GetAt(i) != '?') { e = BCExceptionCharactersOutsideISO88591Encoding; @@ -66,7 +66,7 @@ CFX_WideString CBC_EncoderContext::getMessage() { return m_msg; } -void CBC_EncoderContext::setSkipAtEnd(FX_INT32 count) +void CBC_EncoderContext::setSkipAtEnd(int32_t count) { m_skipAtEnd = count; } @@ -86,11 +86,11 @@ void CBC_EncoderContext::writeCodeword(FX_WCHAR codeword) { m_codewords += codeword; } -FX_INT32 CBC_EncoderContext::getCodewordCount() +int32_t CBC_EncoderContext::getCodewordCount() { return m_codewords.GetLength(); } -void CBC_EncoderContext::signalEncoderChange(FX_INT32 encoding) +void CBC_EncoderContext::signalEncoderChange(int32_t encoding) { m_newEncoding = encoding; } @@ -102,15 +102,15 @@ FX_BOOL CBC_EncoderContext::hasMoreCharacters() { return m_pos < getTotalMessageCharCount(); } -FX_INT32 CBC_EncoderContext::getRemainingCharacters() +int32_t CBC_EncoderContext::getRemainingCharacters() { return getTotalMessageCharCount() - m_pos; } -void CBC_EncoderContext::updateSymbolInfo(FX_INT32 &e) +void CBC_EncoderContext::updateSymbolInfo(int32_t &e) { updateSymbolInfo(getCodewordCount(), e); } -void CBC_EncoderContext::updateSymbolInfo(FX_INT32 len, FX_INT32 &e) +void CBC_EncoderContext::updateSymbolInfo(int32_t len, int32_t &e) { if (m_symbolInfo == NULL || len > m_symbolInfo->m_dataCapacity) { m_symbolInfo = CBC_SymbolInfo::lookup(len, m_shape, m_minSize, m_maxSize, true, e); @@ -121,7 +121,7 @@ void CBC_EncoderContext::resetSymbolInfo() { m_shape = FORCE_NONE; } -FX_INT32 CBC_EncoderContext::getTotalMessageCharCount() +int32_t CBC_EncoderContext::getTotalMessageCharCount() { return m_msg.GetLength() - m_skipAtEnd; } diff --git a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h index 0099dbc9f0..e2dd0b35bb 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h @@ -13,36 +13,36 @@ class CBC_EncoderContext; class CBC_EncoderContext : public CBC_SymbolShapeHint { public: - CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e); + CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t &e); virtual ~CBC_EncoderContext(); void setSymbolShape(SymbolShapeHint shape); void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize); CFX_WideString getMessage(); - void setSkipAtEnd(FX_INT32 count); + void setSkipAtEnd(int32_t count); FX_WCHAR getCurrentChar(); FX_WCHAR getCurrent(); void writeCodewords(CFX_WideString codewords); void writeCodeword(FX_WCHAR codeword); - FX_INT32 getCodewordCount(); - void signalEncoderChange(FX_INT32 encoding); + int32_t getCodewordCount(); + void signalEncoderChange(int32_t encoding); void resetEncoderSignal(); FX_BOOL hasMoreCharacters(); - FX_INT32 getRemainingCharacters(); - void updateSymbolInfo(FX_INT32 &e); - void updateSymbolInfo(FX_INT32 len, FX_INT32 &e); + int32_t getRemainingCharacters(); + void updateSymbolInfo(int32_t &e); + void updateSymbolInfo(int32_t len, int32_t &e); void resetSymbolInfo(); public: CFX_WideString m_msg; CFX_WideString m_codewords; - FX_INT32 m_pos; - FX_INT32 m_newEncoding; + int32_t m_pos; + int32_t m_newEncoding; CBC_SymbolInfo* m_symbolInfo; private: - FX_INT32 getTotalMessageCharCount(); + int32_t getTotalMessageCharCount(); private: SymbolShapeHint m_shape; CBC_Dimension* m_minSize; CBC_Dimension* m_maxSize; - FX_INT32 m_skipAtEnd; + int32_t m_skipAtEnd; }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp index f346072499..e574742b54 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp @@ -25,8 +25,8 @@ #include "BC_SymbolShapeHint.h" #include "BC_SymbolInfo.h" #include "BC_ErrorCorrection.h" -FX_INT32 CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68}; -FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = { +int32_t CBC_ErrorCorrection::FACTOR_SETS[] = {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68}; +int32_t CBC_ErrorCorrection::FACTORS[][100] = { {228, 48, 15, 111, 62}, {23, 68, 144, 134, 240, 92, 254}, {28, 24, 185, 166, 223, 248, 116, 255, 110, 61}, @@ -78,13 +78,13 @@ FX_INT32 CBC_ErrorCorrection::FACTORS[][100] = { 96, 103, 82, 186 } }; -FX_INT32 CBC_ErrorCorrection::MODULO_VALUE = 0x12D; -FX_INT32 CBC_ErrorCorrection::LOG[256] = {0}; -FX_INT32 CBC_ErrorCorrection::ALOG[256] = {0}; +int32_t CBC_ErrorCorrection::MODULO_VALUE = 0x12D; +int32_t CBC_ErrorCorrection::LOG[256] = {0}; +int32_t CBC_ErrorCorrection::ALOG[256] = {0}; void CBC_ErrorCorrection::Initialize() { - FX_INT32 p = 1; - for (FX_INT32 i = 0; i < 255; i++) { + int32_t p = 1; + for (int32_t i = 0; i < 255; i++) { ALOG[i] = p; LOG[p] = i; p <<= 1; @@ -102,7 +102,7 @@ CBC_ErrorCorrection::CBC_ErrorCorrection() CBC_ErrorCorrection::~CBC_ErrorCorrection() { } -CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e) { if (codewords.GetLength() != symbolInfo->m_dataCapacity) { e = BCExceptionIllegalArgument; @@ -110,7 +110,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S } CFX_WideString sb; sb += codewords; - FX_INT32 blockCount = symbolInfo->getInterleavedBlockCount(); + int32_t blockCount = symbolInfo->getInterleavedBlockCount(); if (blockCount == 1) { CFX_WideString ecc = createECCBlock(codewords, symbolInfo->m_errorCodewords, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); @@ -122,7 +122,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S errorSizes.SetSize(blockCount); CFX_Int32Array startPos; startPos.SetSize(blockCount); - for (FX_INT32 i = 0; i < blockCount; i++) { + for (int32_t i = 0; i < blockCount; i++) { dataSizes[i] = symbolInfo->getDataLengthForInterleavedBlock(i + 1); errorSizes[i] = symbolInfo->getErrorLengthForInterleavedBlock(i + 1); startPos[i] = 0; @@ -130,29 +130,29 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords, CBC_S startPos[i] = startPos[i - 1] + dataSizes[i]; } } - for (FX_INT32 block = 0; block < blockCount; block++) { + for (int32_t block = 0; block < blockCount; block++) { CFX_WideString temp; - for (FX_INT32 d = block; d < symbolInfo->m_dataCapacity; d += blockCount) { + for (int32_t d = block; d < symbolInfo->m_dataCapacity; d += blockCount) { temp += (FX_WCHAR)codewords.GetAt(d); } CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); - FX_INT32 pos = 0; - for (FX_INT32 l = block; l < errorSizes[block] * blockCount; l += blockCount) { + int32_t pos = 0; + for (int32_t l = block; l < errorSizes[block] * blockCount; l += blockCount) { sb.SetAt(symbolInfo->m_dataCapacity + l, ecc.GetAt(pos++)); } } } return sb; } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e) { return createECCBlock(codewords, 0, codewords.GetLength(), numECWords, e); } -CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e) +CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e) { - FX_INT32 table = -1; - for (FX_INT32 i = 0; i < sizeof(FACTOR_SETS) / sizeof(FX_INT32); i++) { + int32_t table = -1; + for (int32_t i = 0; i < sizeof(FACTOR_SETS) / sizeof(int32_t); i++) { if (FACTOR_SETS[i] == numECWords) { table = i; break; @@ -164,14 +164,14 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ } FX_WORD* ecc = FX_Alloc(FX_WORD, numECWords); FXSYS_memset32(ecc, 0, numECWords * sizeof(FX_WORD)); - for (FX_INT32 l = start; l < start + len; l++) { - FX_BYTE A = (FX_BYTE)codewords.GetAt(l); + for (int32_t l = start; l < start + len; l++) { + uint8_t A = (uint8_t)codewords.GetAt(l); FX_WORD B = ecc[numECWords - 1]; FX_WORD m = ecc[numECWords - 1] ^ codewords.GetAt(l); - for (FX_INT32 k = numECWords - 1; k > 0; k--) { + for (int32_t k = numECWords - 1; k > 0; k--) { if (m != 0 && FACTORS[table][k] != 0) { - FX_INT32 a = LOG[FACTORS[table][k]]; - FX_INT32 b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]; + int32_t a = LOG[FACTORS[table][k]]; + int32_t b = ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]; FX_WORD c = ecc[k - 1]; FX_WORD D = (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); ecc[k] = (FX_WORD ) (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[FACTORS[table][k]]) % 255]); @@ -186,7 +186,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords, FX_ } } CFX_WideString strecc; - for (FX_INT32 j = 0; j < numECWords; j++) { + for (int32_t j = 0; j < numECWords; j++) { strecc += (FX_WCHAR)ecc[numECWords - j - 1]; } FX_Free(ecc); diff --git a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h index 0bc71cdeb5..2ec7b27aaa 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h +++ b/xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h @@ -14,15 +14,15 @@ public: virtual ~CBC_ErrorCorrection(); static void Initialize(); static void Finalize(); - static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e); + static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, int32_t &e); private: - static FX_INT32 FACTOR_SETS[]; - static FX_INT32 FACTORS[][100]; - static FX_INT32 MODULO_VALUE; - static FX_INT32 LOG[256]; - static FX_INT32 ALOG[256]; + static int32_t FACTOR_SETS[]; + static int32_t FACTORS[][100]; + static int32_t MODULO_VALUE; + static int32_t LOG[256]; + static int32_t ALOG[256]; private: - static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e); - static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e); + static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t numECWords, int32_t &e); + static CFX_WideString createECCBlock(CFX_WideString codewords, int32_t start, int32_t len, int32_t numECWords, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index 5b46612d62..3866f45a5e 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -60,16 +60,16 @@ CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) { CFX_ByteString bytestr; CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr); - for (FX_INT32 i = 0; i < bytestr.GetLength(); i++) { + for (int32_t i = 0; i < bytestr.GetLength(); i++) { m_bytearray.Add(bytestr.GetAt(i)); } return m_bytearray; } -CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e) +CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e) { return encodeHighLevel(msg, ecLevel, FORCE_NONE, NULL, NULL, e); } -CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e) +CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e) { CBC_EncoderContext context(msg, ecLevel, e); BC_EXCEPTION_CHECK_ReturnValue(e, (FX_LPWSTR)""); @@ -91,11 +91,11 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi encoders.Add(FX_NEW CBC_X12Encoder()); encoders.Add(FX_NEW CBC_EdifactEncoder()); encoders.Add(FX_NEW CBC_Base256Encoder()); - FX_INT32 encodingMode = ASCII_ENCODATION; + int32_t encodingMode = ASCII_ENCODATION; while (context.hasMoreCharacters()) { ((CBC_Encoder*)encoders.GetAt(encodingMode))->Encode(context, e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); @@ -106,16 +106,16 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi context.resetEncoderSignal(); } } - FX_INT32 len = context.m_codewords.GetLength(); + int32_t len = context.m_codewords.GetLength(); context.updateSymbolInfo(e); if (e != BCExceptionNO) { - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); return (FX_LPWSTR)""; } - FX_INT32 capacity = context.m_symbolInfo->m_dataCapacity; + int32_t capacity = context.m_symbolInfo->m_dataCapacity; if (len < capacity) { if (encodingMode != ASCII_ENCODATION && encodingMode != BASE256_ENCODATION) { context.writeCodeword(0x00fe); @@ -128,13 +128,13 @@ CFX_WideString CBC_HighLevelEncoder::encodeHighLevel(CFX_WideString msg, CFX_Wi while (codewords.GetLength() < capacity) { codewords += (randomize253State(PAD, codewords.GetLength() + 1)); } - for (FX_INT32 i = 0; i < encoders.GetSize(); i++) { + for (int32_t i = 0; i < encoders.GetSize(); i++) { delete (CBC_Encoder*)encoders.GetAt(i); } encoders.RemoveAll(); return codewords; } -FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode) +int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, int32_t startpos, int32_t currentMode) { if (startpos >= msg.GetLength()) { return currentMode; @@ -156,7 +156,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp charCounts.Add(2.25f); charCounts[currentMode] = 0; } - FX_INT32 charsProcessed = 0; + int32_t charsProcessed = 0; while (TRUE) { if ((startpos + charsProcessed) == msg.GetLength()) { FX_DWORD min = Integer_MAX_VALUE; @@ -165,7 +165,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_Int32Array intCharCounts; intCharCounts.SetSize(6); min = findMinimums(charCounts, intCharCounts, min, mins); - FX_INT32 minCount = getMinimumCount(mins); + int32_t minCount = getMinimumCount(mins); if (intCharCounts[ASCII_ENCODATION] == min) { return ASCII_ENCODATION; } @@ -233,7 +233,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp CFX_ByteArray mins; mins.SetSize(6); findMinimums(charCounts, intCharCounts, Integer_MAX_VALUE, mins); - FX_INT32 minCount = getMinimumCount(mins); + int32_t minCount = getMinimumCount(mins); if (intCharCounts[ASCII_ENCODATION] < intCharCounts[BASE256_ENCODATION] && intCharCounts[ASCII_ENCODATION] < intCharCounts[C40_ENCODATION] && intCharCounts[ASCII_ENCODATION] < intCharCounts[TEXT_ENCODATION] @@ -262,7 +262,7 @@ FX_INT32 CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, FX_INT32 startp return C40_ENCODATION; } if (intCharCounts[C40_ENCODATION] == intCharCounts[X12_ENCODATION]) { - FX_INT32 p = startpos + charsProcessed + 1; + int32_t p = startpos + charsProcessed + 1; while (p < msg.GetLength()) { FX_WCHAR tc = msg.GetAt(p); if (isX12TermSep(tc)) { @@ -287,11 +287,11 @@ FX_BOOL CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) { return ch >= 128 && ch <= 255; } -FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos) +int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos) { - FX_INT32 count = 0; - FX_INT32 len = msg.GetLength(); - FX_INT32 idx = startpos; + int32_t count = 0; + int32_t len = msg.GetLength(); + int32_t idx = startpos; if (idx < len) { FX_WCHAR ch = msg.GetAt(idx); while (isDigit(ch) && idx < len) { @@ -304,28 +304,28 @@ FX_INT32 CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg } return count; } -void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, FX_INT32 &e) +void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, int32_t &e) { e = BCExceptionIllegalArgument; } -FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition) +FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch, int32_t codewordPosition) { - FX_INT32 pseudoRandom = ((149 * codewordPosition) % 253) + 1; - FX_INT32 tempVariable = ch + pseudoRandom; + int32_t pseudoRandom = ((149 * codewordPosition) % 253) + 1; + int32_t tempVariable = ch + pseudoRandom; return tempVariable <= 254 ? (FX_WCHAR) tempVariable : (FX_WCHAR) (tempVariable - 254); } -FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins) +int32_t CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, int32_t min, CFX_ByteArray &mins) { - for (FX_INT32 l = 0; l < mins.GetSize(); l++) { - mins[l] = (FX_BYTE)0; + for (int32_t l = 0; l < mins.GetSize(); l++) { + mins[l] = (uint8_t)0; } - for (FX_INT32 i = 0; i < 6; i++) { - intCharCounts[i] = (FX_INT32)ceil(charCounts[i]); - FX_INT32 current = intCharCounts[i]; + for (int32_t i = 0; i < 6; i++) { + intCharCounts[i] = (int32_t)ceil(charCounts[i]); + int32_t current = intCharCounts[i]; if (min > current) { min = current; - for (FX_INT32 j = 0; j < mins.GetSize(); j++) { - mins[j] = (FX_BYTE)0; + for (int32_t j = 0; j < mins.GetSize(); j++) { + mins[j] = (uint8_t)0; } } if (min == current) { @@ -334,10 +334,10 @@ FX_INT32 CBC_HighLevelEncoder::findMinimums(CFX_FloatArray &charCounts, CFX_Int3 } return min; } -FX_INT32 CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins) +int32_t CBC_HighLevelEncoder::getMinimumCount(CFX_ByteArray &mins) { - FX_INT32 minCount = 0; - for (FX_INT32 i = 0; i < 6; i++) { + int32_t minCount = 0; + for (int32_t i = 0; i < 6; i++) { minCount += mins[i]; } return minCount; diff --git a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 170ca9f8fa..c2bfdccb1b 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -20,13 +20,13 @@ public: CBC_HighLevelEncoder(); virtual ~CBC_HighLevelEncoder(); CFX_ByteArray& getBytesForMessage(CFX_WideString msg); - static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e); - static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e); - static FX_INT32 lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode); + static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, int32_t &e); + static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, int32_t &e); + static int32_t lookAheadTest(CFX_WideString msg, int32_t startpos, int32_t currentMode); static FX_BOOL isDigit(FX_WCHAR ch); static FX_BOOL isExtendedASCII(FX_WCHAR ch); - static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos); - static void illegalCharacter(FX_WCHAR c, FX_INT32 &e); + static int32_t determineConsecutiveDigitCount(CFX_WideString msg, int32_t startpos); + static void illegalCharacter(FX_WCHAR c, int32_t &e); public: static FX_WCHAR LATCH_TO_C40; @@ -46,9 +46,9 @@ private: static const wchar_t MACRO_TRAILER; CFX_ByteArray m_bytearray; private: - static FX_WCHAR randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition); - static FX_INT32 findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins); - static FX_INT32 getMinimumCount(CFX_ByteArray &mins); + static FX_WCHAR randomize253State(FX_WCHAR ch, int32_t codewordPosition); + static int32_t findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, int32_t min, CFX_ByteArray &mins); + static int32_t getMinimumCount(CFX_ByteArray &mins); static FX_BOOL isNativeC40(FX_WCHAR ch); static FX_BOOL isNativeText(FX_WCHAR ch); static FX_BOOL isNativeX12(FX_WCHAR ch); diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp index 415cbd6b3c..0044683a5c 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp @@ -62,19 +62,19 @@ void CBC_SymbolInfo::Initialize() m_PROD_SYMBOLS[27] = FX_NEW CBC_SymbolInfo(FALSE, 1050, 408, 18, 18, 36, 175, 68); m_PROD_SYMBOLS[28] = FX_NEW CBC_SymbolInfo(FALSE, 1304, 496, 20, 20, 36, 163, 62); m_PROD_SYMBOLS[29] = FX_NEW CBC_DataMatrixSymbolInfo144(); - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { m_symbols[i] = m_PROD_SYMBOLS[i]; } } void CBC_SymbolInfo::Finalize() { - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { delete m_PROD_SYMBOLS[i]; m_PROD_SYMBOLS[i] = NULL; m_symbols[i] = NULL; } } -CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions) +CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions) { m_rectangular = rectangular; m_dataCapacity = dataCapacity; @@ -85,8 +85,8 @@ CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_IN m_rsBlockData = dataCapacity; m_rsBlockError = errorCodewords; } -CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions, - FX_INT32 rsBlockData, FX_INT32 rsBlockError) +CBC_SymbolInfo::CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions, + int32_t rsBlockData, int32_t rsBlockError) { m_rectangular = rectangular; m_dataCapacity = dataCapacity; @@ -101,26 +101,26 @@ CBC_SymbolInfo::~CBC_SymbolInfo() { } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, int32_t &e) { return lookup(dataCodewords, FORCE_NONE, TRUE, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e) { return lookup(dataCodewords, shape, TRUE, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e) { SymbolShapeHint shape = allowRectangular ? FORCE_NONE : FORCE_SQUARE; return lookup(dataCodewords, shape, fail, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e) { return lookup(dataCodewords, shape, NULL, NULL, fail, e); } -CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e) +CBC_SymbolInfo* CBC_SymbolInfo::lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e) { - for (FX_INT32 i = 0; i < SYMBOLS_COUNT; i++) { + for (int32_t i = 0; i < SYMBOLS_COUNT; i++) { CBC_SymbolInfo* symbol = m_symbols[i]; if (shape == FORCE_SQUARE && symbol->m_rectangular) { continue; @@ -146,7 +146,7 @@ CBC_SymbolInfo* CBC_SymbolInfo::lookup(FX_INT32 dataCodewords, SymbolShapeHint s } return NULL; } -FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e) +int32_t CBC_SymbolInfo::getHorizontalDataRegions(int32_t &e) { switch (m_dataRegions) { case 1: @@ -164,7 +164,7 @@ FX_INT32 CBC_SymbolInfo::getHorizontalDataRegions(FX_INT32 &e) return 0; } } -FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e) +int32_t CBC_SymbolInfo::getVerticalDataRegions(int32_t &e) { switch (m_dataRegions) { case 1: @@ -182,39 +182,39 @@ FX_INT32 CBC_SymbolInfo::getVerticalDataRegions(FX_INT32 &e) return 0; } } -FX_INT32 CBC_SymbolInfo::getSymbolDataWidth(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolDataWidth(int32_t &e) { return getHorizontalDataRegions(e) * m_matrixWidth; } -FX_INT32 CBC_SymbolInfo::getSymbolDataHeight(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolDataHeight(int32_t &e) { return getVerticalDataRegions(e) * m_matrixHeight; } -FX_INT32 CBC_SymbolInfo::getSymbolWidth(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolWidth(int32_t &e) { return getSymbolDataWidth(e) + (getHorizontalDataRegions(e) * 2); } -FX_INT32 CBC_SymbolInfo::getSymbolHeight(FX_INT32 &e) +int32_t CBC_SymbolInfo::getSymbolHeight(int32_t &e) { return getSymbolDataHeight(e) + (getVerticalDataRegions(e) * 2); } -FX_INT32 CBC_SymbolInfo::getCodewordCount() +int32_t CBC_SymbolInfo::getCodewordCount() { return m_dataCapacity + m_errorCodewords; } -FX_INT32 CBC_SymbolInfo::getInterleavedBlockCount() +int32_t CBC_SymbolInfo::getInterleavedBlockCount() { return m_dataCapacity / m_rsBlockData; } -FX_INT32 CBC_SymbolInfo::getDataLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_SymbolInfo::getDataLengthForInterleavedBlock(int32_t index) { return m_rsBlockData; } -FX_INT32 CBC_SymbolInfo::getErrorLengthForInterleavedBlock(FX_INT32 index) +int32_t CBC_SymbolInfo::getErrorLengthForInterleavedBlock(int32_t index) { return m_rsBlockError; } -CFX_WideString CBC_SymbolInfo::toString(FX_INT32 &e) +CFX_WideString CBC_SymbolInfo::toString(int32_t &e) { CFX_WideString sb; sb += (FX_LPWSTR)(m_rectangular ? "Rectangular Symbol:" : "Square Symbol:"); diff --git a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h index 0450a28725..5ace547442 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -12,42 +12,42 @@ class CBC_SymbolInfo; class CBC_SymbolInfo : public CBC_SymbolShapeHint { public: - CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, - FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions); + CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, + int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions); virtual ~CBC_SymbolInfo(); static void Initialize(); static void Finalize(); static void overrideSymbolSet(CBC_SymbolInfo* override); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e); - static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e); - FX_INT32 getHorizontalDataRegions(FX_INT32 &e); - FX_INT32 getVerticalDataRegions(FX_INT32 &e); - FX_INT32 getSymbolDataWidth(FX_INT32 &e); - FX_INT32 getSymbolDataHeight(FX_INT32 &e); - FX_INT32 getSymbolWidth(FX_INT32 &e); - FX_INT32 getSymbolHeight(FX_INT32 &e); - FX_INT32 getCodewordCount(); - FX_INT32 getInterleavedBlockCount(); - FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index); - FX_INT32 getErrorLengthForInterleavedBlock(FX_INT32 index); - CFX_WideString toString(FX_INT32 &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, FX_BOOL fail, int32_t &e); + static CBC_SymbolInfo* lookup(int32_t dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, int32_t &e); + int32_t getHorizontalDataRegions(int32_t &e); + int32_t getVerticalDataRegions(int32_t &e); + int32_t getSymbolDataWidth(int32_t &e); + int32_t getSymbolDataHeight(int32_t &e); + int32_t getSymbolWidth(int32_t &e); + int32_t getSymbolHeight(int32_t &e); + int32_t getCodewordCount(); + int32_t getInterleavedBlockCount(); + int32_t getDataLengthForInterleavedBlock(int32_t index); + int32_t getErrorLengthForInterleavedBlock(int32_t index); + CFX_WideString toString(int32_t &e); public: - FX_INT32 m_dataCapacity; - FX_INT32 m_errorCodewords; - FX_INT32 m_matrixWidth; - FX_INT32 m_matrixHeight; - FX_INT32 m_rsBlockData; - FX_INT32 m_rsBlockError; + int32_t m_dataCapacity; + int32_t m_errorCodewords; + int32_t m_matrixWidth; + int32_t m_matrixHeight; + int32_t m_rsBlockData; + int32_t m_rsBlockError; static CBC_SymbolInfo* m_PROD_SYMBOLS[30]; private: static CBC_SymbolInfo* m_symbols[30]; FX_BOOL m_rectangular; - FX_INT32 m_dataRegions; + int32_t m_dataRegions; private: - CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions, - FX_INT32 rsBlockData, FX_INT32 rsBlockError); + CBC_SymbolInfo(FX_BOOL rectangular, int32_t dataCapacity, int32_t errorCodewords, int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions, + int32_t rsBlockData, int32_t rsBlockError); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp index 45abec4d4a..afccce598f 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp @@ -36,11 +36,11 @@ CBC_TextEncoder::CBC_TextEncoder() CBC_TextEncoder::~CBC_TextEncoder() { } -FX_INT32 CBC_TextEncoder::getEncodingMode() +int32_t CBC_TextEncoder::getEncodingMode() { return TEXT_ENCODATION; } -FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == ' ') { sb += (FX_WCHAR)'\3'; @@ -92,7 +92,7 @@ FX_INT32 CBC_TextEncoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e if (c >= 0x0080) { sb += (FX_WCHAR)'\1'; sb += (FX_WCHAR)0x001e; - FX_INT32 len = 2; + int32_t len = 2; len += encodeChar((FX_WCHAR) (c - 128), sb, e); BC_EXCEPTION_CHECK_ReturnValue(e, -1); return len; diff --git a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h index f1168679a6..7d46e92d5d 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h @@ -12,7 +12,7 @@ class CBC_TextEncoder : public CBC_C40Encoder public: CBC_TextEncoder(); virtual ~CBC_TextEncoder(); - FX_INT32 getEncodingMode(); - FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + int32_t getEncodingMode(); + int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); }; #endif diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp index f6263f6777..7f56de7aed 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp @@ -36,11 +36,11 @@ CBC_X12Encoder::CBC_X12Encoder() CBC_X12Encoder::~CBC_X12Encoder() { } -FX_INT32 CBC_X12Encoder::getEncodingMode() +int32_t CBC_X12Encoder::getEncodingMode() { return X12_ENCODATION; } -void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) +void CBC_X12Encoder::Encode(CBC_EncoderContext &context, int32_t &e) { CFX_WideString buffer; while (context.hasMoreCharacters()) { @@ -50,10 +50,10 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) if (e != BCExceptionNO) { return; } - FX_INT32 count = buffer.GetLength(); + int32_t count = buffer.GetLength(); if ((count % 3) == 0) { writeNextTriplet(context, buffer); - FX_INT32 newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); + int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(context.m_msg, context.m_pos, getEncodingMode()); if (newMode != getEncodingMode()) { context.signalEncoderChange(newMode); break; @@ -62,14 +62,14 @@ void CBC_X12Encoder::Encode(CBC_EncoderContext &context, FX_INT32 &e) } handleEOD(context, buffer, e); } -void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e) +void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e) { context.updateSymbolInfo(e); if (e != BCExceptionNO) { return; } - FX_INT32 available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); - FX_INT32 count = buffer.GetLength(); + int32_t available = context.m_symbolInfo->m_dataCapacity - context.getCodewordCount(); + int32_t count = buffer.GetLength(); if (count == 2) { context.writeCodeword(CBC_HighLevelEncoder::X12_UNLATCH); context.m_pos -= 2; @@ -82,7 +82,7 @@ void CBC_X12Encoder::handleEOD(CBC_EncoderContext &context, CFX_WideString &buff context.signalEncoderChange(ASCII_ENCODATION); } } -FX_INT32 CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e) +int32_t CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e) { if (c == '\r') { sb += (FX_WCHAR)'\0'; diff --git a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h index 21111bc5cc..210f07a5d9 100644 --- a/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h +++ b/xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h @@ -13,9 +13,9 @@ class CBC_X12Encoder : public CBC_C40Encoder public: CBC_X12Encoder(); virtual ~CBC_X12Encoder(); - FX_INT32 getEncodingMode(); - void Encode(CBC_EncoderContext &context, FX_INT32 &e); - void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e); - FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e); + int32_t getEncodingMode(); + void Encode(CBC_EncoderContext &context, int32_t &e); + void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, int32_t &e); + int32_t encodeChar(FX_WCHAR c, CFX_WideString &sb, int32_t &e); }; #endif -- cgit v1.2.3