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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 429593005: Fix a few more warnings in chromium_code mode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 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
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 "../../../include/fpdfapi/fpdf_parser.h" 7 #include "../../../include/fpdfapi/fpdf_parser.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_page.h" 9 #include "../../../include/fpdfapi/fpdf_page.h"
10 #include "../../../../third_party/numerics/safe_math.h" 10 #include "../../../../third_party/numerics/safe_math.h"
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 FX_DWORD totalsize = pObjStream->GetSize(); 1262 FX_DWORD totalsize = pObjStream->GetSize();
1263 CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((FX_LPBYTE)p Data, (size_t)totalsize, FALSE)); 1263 CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream((FX_LPBYTE)p Data, (size_t)totalsize, FALSE));
1264 syntax.InitParser((IFX_FileStream*)file, 0); 1264 syntax.InitParser((IFX_FileStream*)file, 0);
1265 while (n) { 1265 while (n) {
1266 FX_DWORD thisnum = syntax.GetDirectNum(); 1266 FX_DWORD thisnum = syntax.GetDirectNum();
1267 FX_DWORD thisoff = syntax.GetDirectNum(); 1267 FX_DWORD thisoff = syntax.GetDirectNum();
1268 if (thisnum == objnum) { 1268 if (thisnum == objnum) {
1269 if (n == 1) { 1269 if (n == 1) {
1270 size = totalsize - (thisoff + offset); 1270 size = totalsize - (thisoff + offset);
1271 } else { 1271 } else {
1272 FX_DWORD nextnum = syntax.GetDirectNum(); 1272 syntax.GetDirectNum(); // Skip nextnum.
1273 FX_DWORD nextoff = syntax.GetDirectNum(); 1273 FX_DWORD nextoff = syntax.GetDirectNum();
1274 size = nextoff - thisoff; 1274 size = nextoff - thisoff;
1275 } 1275 }
1276 pBuffer = FX_Alloc(FX_BYTE, size); 1276 pBuffer = FX_Alloc(FX_BYTE, size);
1277 FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size); 1277 FXSYS_memcpy32(pBuffer, pData + thisoff + offset, size);
1278 return; 1278 return;
1279 } 1279 }
1280 n --; 1280 n --;
1281 } 1281 }
1282 return; 1282 return;
(...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after
4405 { 4405 {
4406 FX_INT32 iSize = m_childNode.GetSize(); 4406 FX_INT32 iSize = m_childNode.GetSize();
4407 for (FX_INT32 i = 0; i < iSize; ++i) { 4407 for (FX_INT32 i = 0; i < iSize; ++i) {
4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4408 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4409 if (pNode) { 4409 if (pNode) {
4410 delete pNode; 4410 delete pNode;
4411 } 4411 }
4412 } 4412 }
4413 m_childNode.RemoveAll(); 4413 m_childNode.RemoveAll();
4414 } 4414 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698