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

Side by Side Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2036203004: Fix some code which causes warnings when compiled by /analyze tool (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 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 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 "public/fpdf_flatten.h" 7 #include "public/fpdf_flatten.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 break; 150 break;
151 } 151 }
152 case BOTTOM: { 152 case BOTTOM: {
153 for (int i = 0; i < nRects; i++) 153 for (int i = 0; i < nRects; i++)
154 pArray[i] = CFX_FloatRect(array.GetAt(i)).bottom; 154 pArray[i] = CFX_FloatRect(array.GetAt(i)).bottom;
155 155
156 break; 156 break;
157 } 157 }
158 default: 158 default:
159 break; 159 // Not reachable.
160 return 0.0f;
160 } 161 }
161 fRet = pArray[0]; 162 fRet = pArray[0];
162 if (type == MAX) { 163 if (type == MAX) {
163 for (int i = 1; i < nRects; i++) 164 for (int i = 1; i < nRects; i++)
164 if (fRet <= pArray[i]) 165 if (fRet <= pArray[i])
165 fRet = pArray[i]; 166 fRet = pArray[i];
166 } else { 167 } else {
167 for (int i = 1; i < nRects; i++) 168 for (int i = 1; i < nRects; i++)
168 if (fRet >= pArray[i]) 169 if (fRet >= pArray[i])
169 fRet = pArray[i]; 170 fRet = pArray[i];
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 sStream += sTemp; 508 sStream += sTemp;
508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); 509 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE);
509 } 510 }
510 pPageDict->RemoveAt("Annots"); 511 pPageDict->RemoveAt("Annots");
511 512
512 ObjectArray.RemoveAll(); 513 ObjectArray.RemoveAll();
513 RectArray.RemoveAll(); 514 RectArray.RemoveAll();
514 515
515 return FLATTEN_SUCCESS; 516 return FLATTEN_SUCCESS;
516 } 517 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698