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

Side by Side Diff: xfa/fgas/xml/fgas_sax.cpp

Issue 1986533002: Fix the code that causes warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « xfa/fgas/localization/fgas_locale.cpp ('k') | xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fgas/xml/fgas_sax.h" 7 #include "xfa/fgas/xml/fgas_sax.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 14 matching lines...) Expand all
25 m_dwBufSize(0), 25 m_dwBufSize(0),
26 m_dwBufIndex(0) {} 26 m_dwBufIndex(0) {}
27 FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, 27 FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile,
28 uint32_t dwStart, 28 uint32_t dwStart,
29 uint32_t dwLen) { 29 uint32_t dwLen) {
30 ASSERT(m_pFile == NULL && pFile != NULL); 30 ASSERT(m_pFile == NULL && pFile != NULL);
31 uint32_t dwSize = pFile->GetSize(); 31 uint32_t dwSize = pFile->GetSize();
32 if (dwStart >= dwSize) { 32 if (dwStart >= dwSize) {
33 return FALSE; 33 return FALSE;
34 } 34 }
35 if (dwLen == -1 || dwStart + dwLen > dwSize) { 35 if (dwLen == static_cast<uint32_t>(-1) || dwStart + dwLen > dwSize) {
36 dwLen = dwSize - dwStart; 36 dwLen = dwSize - dwStart;
37 } 37 }
38 if (dwLen == 0) { 38 if (dwLen == 0) {
39 return FALSE; 39 return FALSE;
40 } 40 }
41 m_dwBufSize = std::min(dwLen, kSaxFileBufSize); 41 m_dwBufSize = std::min(dwLen, kSaxFileBufSize);
42 m_pBuf = FX_Alloc(uint8_t, m_dwBufSize); 42 m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
43 if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) { 43 if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) {
44 return FALSE; 44 return FALSE;
45 } 45 }
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 void CFX_SAXReader::SkipCurrentNode() { 679 void CFX_SAXReader::SkipCurrentNode() {
680 if (!m_pCurItem) 680 if (!m_pCurItem)
681 return; 681 return;
682 682
683 m_pCurItem->m_bSkip = TRUE; 683 m_pCurItem->m_bSkip = TRUE;
684 } 684 }
685 685
686 void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) { 686 void CFX_SAXReader::SetHandler(CXFA_SAXReaderHandler* pHandler) {
687 m_pHandler = pHandler; 687 m_pHandler = pHandler;
688 } 688 }
OLDNEW
« no previous file with comments | « xfa/fgas/localization/fgas_locale.cpp ('k') | xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698