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

Side by Side Diff: src/core/SkReadBuffer.cpp

Issue 247753003: fix size_t/int warnings (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: revert name-change in swap32 Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkReader32.h ('k') | src/core/SkRegion.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 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkErrorInternals.h" 10 #include "SkErrorInternals.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (NULL == factory) { 314 if (NULL == factory) {
315 return NULL; // writer failed to give us the flattenable 315 return NULL; // writer failed to give us the flattenable
316 } 316 }
317 } 317 }
318 318
319 // if we get here, factory may still be null, but if that is the case, the 319 // if we get here, factory may still be null, but if that is the case, the
320 // failure was ours, not the writer. 320 // failure was ours, not the writer.
321 SkFlattenable* obj = NULL; 321 SkFlattenable* obj = NULL;
322 uint32_t sizeRecorded = fReader.readU32(); 322 uint32_t sizeRecorded = fReader.readU32();
323 if (factory) { 323 if (factory) {
324 uint32_t offset = fReader.offset(); 324 size_t offset = fReader.offset();
325 obj = (*factory)(*this); 325 obj = (*factory)(*this);
326 // check that we read the amount we expected 326 // check that we read the amount we expected
327 uint32_t sizeRead = fReader.offset() - offset; 327 size_t sizeRead = fReader.offset() - offset;
328 if (sizeRecorded != sizeRead) { 328 if (sizeRecorded != sizeRead) {
329 // we could try to fix up the offset... 329 // we could try to fix up the offset...
330 sk_throw(); 330 sk_throw();
331 } 331 }
332 } else { 332 } else {
333 // we must skip the remaining data 333 // we must skip the remaining data
334 fReader.skip(sizeRecorded); 334 fReader.skip(sizeRecorded);
335 } 335 }
336 return obj; 336 return obj;
337 } 337 }
OLDNEW
« no previous file with comments | « include/core/SkReader32.h ('k') | src/core/SkRegion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698