diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-27 13:42:58 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-27 13:42:58 +0000 |
commit | 7fa2a65c0cfc714364490cb715171461143024e0 (patch) | |
tree | b7e40b0ca71a7ac8d957d150f038603cde2dcd3c /samplecode | |
parent | 1a5e51f94ed8cb01600184119e52bb64bdb3dccc (diff) |
fix more 64bit warnings
BUG=skia:
Review URL: https://codereview.chromium.org/147683003
git-svn-id: http://skia.googlecode.com/svn/trunk@13190 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleAll.cpp | 6 | ||||
-rw-r--r-- | samplecode/SampleApp.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleComplexClip.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleEncode.cpp | 6 | ||||
-rw-r--r-- | samplecode/SampleHairline.cpp | 5 | ||||
-rw-r--r-- | samplecode/SamplePatch.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleRegion.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleRotateCircles.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleShaderText.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleSlides.cpp | 2 |
10 files changed, 16 insertions, 15 deletions
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp index 647a199dda..6b742b8355 100644 --- a/samplecode/SampleAll.cpp +++ b/samplecode/SampleAll.cpp @@ -336,10 +336,10 @@ protected: SkRect rect = {0, 0, SkIntToScalar(40), SkIntToScalar(40) }; SkRect rect2 = {0, 0, SkIntToScalar(65), SkIntToScalar(20) }; SkScalar left = 0, top = 0, x = 0, y = 0; - size_t index; + int index; char ascii[] = "ascii..."; - size_t asciiLength = sizeof(ascii) - 1; + int asciiLength = sizeof(ascii) - 1; char utf8[] = "utf8" "\xe2\x80\xa6"; short utf16[] = {'u', 't', 'f', '1', '6', 0x2026 }; short utf16simple[] = {'u', 't', 'f', '1', '6', '!' }; @@ -602,7 +602,7 @@ SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect { SkString str("GOOGLE"); for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { - apply_shader(&paint, i); + apply_shader(&paint, (int)i); // paint.setMaskFilter(NULL); // paint.setColor(SK_ColorBLACK); diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 3b953f4846..287639ad88 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -128,7 +128,7 @@ static bool readTitleFromPrefs(SkString* title) { return false; } - int len = stream.getLength(); + size_t len = stream.getLength(); SkString data(len); stream.read(data.writable_str(), len); const char* s = data.c_str(); diff --git a/samplecode/SampleComplexClip.cpp b/samplecode/SampleComplexClip.cpp index 30f94f7b48..0d613ec161 100644 --- a/samplecode/SampleComplexClip.cpp +++ b/samplecode/SampleComplexClip.cpp @@ -96,7 +96,7 @@ protected: for (int invA = 0; invA < 2; ++invA) { for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); ++op) { - int idx = invA * SK_ARRAY_COUNT(gOps) + op; + size_t idx = invA * SK_ARRAY_COUNT(gOps) + op; if (!(idx % 3)) { canvas->restore(); canvas->translate(0, SkIntToScalar(250)); diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp index 45666a3b06..7af47a697e 100644 --- a/samplecode/SampleEncode.cpp +++ b/samplecode/SampleEncode.cpp @@ -112,7 +112,7 @@ public: SkBitmap* fBitmaps; SkAutoDataUnref* fEncodedPNGs; SkAutoDataUnref* fEncodedJPEGs; - size_t fBitmapCount; + int fBitmapCount; EncodeView() { #if 1 @@ -120,7 +120,7 @@ public: fBitmaps = new SkBitmap[fBitmapCount]; fEncodedPNGs = new SkAutoDataUnref[fBitmapCount]; fEncodedJPEGs = new SkAutoDataUnref[fBitmapCount]; - for (size_t i = 0; i < fBitmapCount; i++) { + for (int i = 0; i < fBitmapCount; i++) { make_image(&fBitmaps[i], gConfigs[i], i); for (size_t j = 0; j < SK_ARRAY_COUNT(gTypes); j++) { @@ -181,7 +181,7 @@ protected: SkScalar x = 0, y = 0, maxX = 0; const int SPACER = 10; - for (size_t i = 0; i < fBitmapCount; i++) { + for (int i = 0; i < fBitmapCount; i++) { canvas->drawText(gConfigLabels[i], strlen(gConfigLabels[i]), x + SkIntToScalar(fBitmaps[i].width()) / 2, 0, paint); diff --git a/samplecode/SampleHairline.cpp b/samplecode/SampleHairline.cpp index 5da2639115..f08146e672 100644 --- a/samplecode/SampleHairline.cpp +++ b/samplecode/SampleHairline.cpp @@ -74,11 +74,12 @@ static bool check_bitmap_margin(const SkBitmap& bm, int margin) { return false; } // left column - if (!check_zeros(bm.getAddr32(i, 0), bm.height(), rb >> 2)) { + if (!check_zeros(bm.getAddr32(i, 0), bm.height(), SkToInt(rb >> 2))) { return false; } int right = bm.width() - margin + i; - if (!check_zeros(bm.getAddr32(right, 0), bm.height(), rb >> 2)) { + if (!check_zeros(bm.getAddr32(right, 0), bm.height(), + SkToInt(rb >> 2))) { return false; } } diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp index c630e8956a..5f39eda37a 100644 --- a/samplecode/SamplePatch.cpp +++ b/samplecode/SamplePatch.cpp @@ -314,7 +314,7 @@ protected: unsigned modi) SK_OVERRIDE { for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); i++) { if (hittest(fPts[i], x, y)) { - return new PtClick(this, i); + return new PtClick(this, (int)i); } } return this->INHERITED::onFindClickHandler(x, y, modi); diff --git a/samplecode/SampleRegion.cpp b/samplecode/SampleRegion.cpp index 7e3e0d260c..c29f0907ce 100644 --- a/samplecode/SampleRegion.cpp +++ b/samplecode/SampleRegion.cpp @@ -123,7 +123,7 @@ inline float roundf(float x) { return (x-floor(x))>0.5 ? ceil(x) : floor(x); } #ifdef SK_DEBUG static void make_rgn(SkRegion* rgn, int left, int top, int right, int bottom, - size_t count, int32_t runs[]) { + int count, int32_t runs[]) { SkIRect r; r.set(left, top, right, bottom); diff --git a/samplecode/SampleRotateCircles.cpp b/samplecode/SampleRotateCircles.cpp index 1f586be4fe..537f42485b 100644 --- a/samplecode/SampleRotateCircles.cpp +++ b/samplecode/SampleRotateCircles.cpp @@ -333,7 +333,7 @@ protected: unsigned modi) SK_OVERRIDE { for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); ++i) { if (hittest(fPts[i], x, y)) { - return new MyClick(this, i); + return new MyClick(this, (int)i); } } return this->INHERITED::onFindClickHandler(x, y, modi); diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp index 603d67e384..6855824d3f 100644 --- a/samplecode/SampleShaderText.cpp +++ b/samplecode/SampleShaderText.cpp @@ -186,7 +186,7 @@ protected: canvas->save(); for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); s++) { canvas->save(); - int i = 2*s; + size_t i = 2*s; canvas->translate(SkIntToScalar((i / testsPerCol) * colWidth), SkIntToScalar((i % testsPerCol) * rowHeight)); paint.setShader(shaders[s])->unref(); diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp index 9372d5d468..68651f3ea1 100644 --- a/samplecode/SampleSlides.cpp +++ b/samplecode/SampleSlides.cpp @@ -646,7 +646,7 @@ static void texteffect_slide(SkCanvas* canvas) { paint.setAntiAlias(true); paint.setColor(SK_ColorBLUE); for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { - apply_shader(&paint, i); + apply_shader(&paint, (int)i); canvas->drawText(str, len, x, y, paint); y += 80; if (i == 4) { |