From b4c9f3f04673753da30011e9f1282cd5d1fa0f40 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 13 Apr 2016 15:41:21 -0700 Subject: Remove implicit cast from CFX_ByteString to (const char*). BUG= Review URL: https://codereview.chromium.org/1885973002 --- xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp | 2 +- xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp | 10 +++++----- xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp | 8 ++++---- xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'xfa/fxbarcode') diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp index ac05e78910..98ec75ac2f 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp @@ -211,7 +211,7 @@ int32_t CBC_OnedCode128Writer::Encode128C(const CFX_ByteString& contents, patternIndex = (int32_t)ch; position++; } else { - patternIndex = FXSYS_atoi(contents.Mid(position, 2)); + patternIndex = FXSYS_atoi(contents.Mid(position, 2).c_str()); if (contents.GetAt(position + 1) < '0' || contents.GetAt(position + 1) > '9') { position += 1; diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp index b534602fb3..bdc5e1f2c7 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -66,9 +66,9 @@ int32_t CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString& contents) { int32_t j = 1; for (int32_t i = contents.GetLength() - 1; i >= 0; i--) { if (j % 2) { - odd += FXSYS_atoi(contents.Mid(i, 1)); + odd += FXSYS_atoi(contents.Mid(i, 1).c_str()); } else { - even += FXSYS_atoi(contents.Mid(i, 1)); + even += FXSYS_atoi(contents.Mid(i, 1).c_str()); } j++; } @@ -107,7 +107,7 @@ uint8_t* CBC_OnedEAN13Writer::Encode(const CFX_ByteString& contents, return NULL; } m_iDataLenth = 13; - int32_t firstDigit = FXSYS_atoi(contents.Mid(0, 1)); + int32_t firstDigit = FXSYS_atoi(contents.Mid(0, 1).c_str()); int32_t parities = CBC_OnedEAN13Reader::FIRST_DIGIT_ENCODINGS[firstDigit]; outLength = m_codeWidth; uint8_t* result = FX_Alloc(uint8_t, m_codeWidth); @@ -120,7 +120,7 @@ uint8_t* CBC_OnedEAN13Writer::Encode(const CFX_ByteString& contents, } int32_t i = 0; for (i = 1; i <= 6; i++) { - int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1).c_str()); if ((parities >> (6 - i) & 1) == 1) { digit += 10; } @@ -137,7 +137,7 @@ uint8_t* CBC_OnedEAN13Writer::Encode(const CFX_ByteString& contents, return NULL; } for (i = 7; i <= 12; i++) { - int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1).c_str()); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e); if (e != BCExceptionNO) { diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 5336867538..4427cb8970 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -76,9 +76,9 @@ int32_t CBC_OnedEAN8Writer::CalcChecksum(const CFX_ByteString& contents) { int32_t j = 1; for (int32_t i = contents.GetLength() - 1; i >= 0; i--) { if (j % 2) { - odd += FXSYS_atoi(contents.Mid(i, 1)); + odd += FXSYS_atoi(contents.Mid(i, 1).c_str()); } else { - even += FXSYS_atoi(contents.Mid(i, 1)); + even += FXSYS_atoi(contents.Mid(i, 1).c_str()); } j++; } @@ -128,7 +128,7 @@ uint8_t* CBC_OnedEAN8Writer::Encode(const CFX_ByteString& contents, } int32_t i = 0; for (i = 0; i <= 3; i++) { - int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1).c_str()); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 0, e); if (e != BCExceptionNO) { @@ -142,7 +142,7 @@ uint8_t* CBC_OnedEAN8Writer::Encode(const CFX_ByteString& contents, return NULL; } for (i = 4; i <= 7; i++) { - int32_t digit = FXSYS_atoi(contents.Mid(i, 1)); + int32_t digit = FXSYS_atoi(contents.Mid(i, 1).c_str()); pos += AppendPattern(result, pos, CBC_OneDimReader::L_PATTERNS[digit], 4, 1, e); if (e != BCExceptionNO) { diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 21ccafc20c..943384d55c 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -70,9 +70,9 @@ int32_t CBC_OnedUPCAWriter::CalcChecksum(const CFX_ByteString& contents) { int32_t j = 1; for (int32_t i = contents.GetLength() - 1; i >= 0; i--) { if (j % 2) { - odd += FXSYS_atoi(contents.Mid(i, 1)); + odd += FXSYS_atoi(contents.Mid(i, 1).c_str()); } else { - even += FXSYS_atoi(contents.Mid(i, 1)); + even += FXSYS_atoi(contents.Mid(i, 1).c_str()); } j++; } -- cgit v1.2.3