From 875e98c581952478f3a3ccef9b2f2e3ed06c5346 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 27 Sep 2017 10:53:11 -0400 Subject: Remove FX_STRSIZE and replace with size_t BUG=pdfium:828 Change-Id: I5c40237433ebabaeabdb43aec9cdf783e41dfe16 Reviewed-on: https://pdfium-review.googlesource.com/13230 Reviewed-by: dsinclair Commit-Queue: Ryan Harrison --- fxbarcode/oned/BC_OnedCode39Writer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'fxbarcode/oned/BC_OnedCode39Writer.cpp') diff --git a/fxbarcode/oned/BC_OnedCode39Writer.cpp b/fxbarcode/oned/BC_OnedCode39Writer.cpp index 2e02e01583..8adef14765 100644 --- a/fxbarcode/oned/BC_OnedCode39Writer.cpp +++ b/fxbarcode/oned/BC_OnedCode39Writer.cpp @@ -49,7 +49,7 @@ CBC_OnedCode39Writer::~CBC_OnedCode39Writer() {} bool CBC_OnedCode39Writer::CheckContentValidity( const WideStringView& contents) { - for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { + for (size_t i = 0; i < contents.GetLength(); i++) { wchar_t ch = contents[i]; if ((ch >= L'0' && ch <= L'9') || (ch >= L'A' && ch <= L'Z') || ch == L'-' || ch == L'.' || ch == L' ' || ch == L'*' || ch == L'$' || @@ -64,7 +64,7 @@ bool CBC_OnedCode39Writer::CheckContentValidity( WideString CBC_OnedCode39Writer::FilterContents( const WideStringView& contents) { WideString filtercontents; - for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { + for (size_t i = 0; i < contents.GetLength(); i++) { wchar_t ch = contents[i]; if (ch == L'*' && (i == 0 || i == contents.GetLength() - 1)) { continue; @@ -87,7 +87,7 @@ WideString CBC_OnedCode39Writer::FilterContents( WideString CBC_OnedCode39Writer::RenderTextContents( const WideStringView& contents) { WideString renderContents; - for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { + for (size_t i = 0; i < contents.GetLength(); i++) { wchar_t ch = contents[i]; if (ch == L'*' && (i == 0 || i == contents.GetLength() - 1)) { continue; @@ -138,8 +138,7 @@ void CBC_OnedCode39Writer::ToIntArray(int32_t a, int8_t* toReturn) { } char CBC_OnedCode39Writer::CalcCheckSum(const ByteString& contents) { - FX_STRSIZE length = contents.GetLength(); - if (length > 80) + if (contents.GetLength() > 80) return '*'; int32_t checksum = 0; @@ -176,7 +175,7 @@ uint8_t* CBC_OnedCode39Writer::EncodeImpl(const ByteString& contents, int32_t codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 + 1 + m_iContentLen; size_t len = strlen(ALPHABET_STRING); - for (FX_STRSIZE j = 0; j < m_iContentLen; j++) { + for (size_t j = 0; j < m_iContentLen; j++) { for (size_t i = 0; i < len; i++) { if (ALPHABET_STRING[i] != encodedContents[j]) continue; -- cgit v1.2.3