Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h ('k') | xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp
diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp
index d896cf6445b774f5baaa51b679276f9896afaf6b..7a68fcaef66c5f56e9ed3055213b58776b78330c 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 {
« no previous file with comments | « xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h ('k') | xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698