diff options
author | bsalomon <bsalomon@google.com> | 2014-12-12 16:41:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-12 16:41:46 -0800 |
commit | fbaace082745a0e301186b2d3b84af62e2fb87ec (patch) | |
tree | 27982934bbf0defcc05ee93bdae535cd2863b8ff | |
parent | f6139f7c3867a70a750620cd34ce10338a54086e (diff) |
DM warning-free on win64
Review URL: https://codereview.chromium.org/805543002
-rwxr-xr-x | gm/dftext.cpp | 4 | ||||
-rw-r--r-- | gm/glyph_pos_align.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrLayerHoister.cpp | 4 | ||||
-rw-r--r-- | src/pdf/SkPDFPage.cpp | 2 | ||||
-rw-r--r-- | tests/FlateTest.cpp | 2 | ||||
-rw-r--r-- | tests/PDFPrimitivesTest.cpp | 4 | ||||
-rw-r--r-- | tests/PaintTest.cpp | 4 | ||||
-rw-r--r-- | tests/SkBase64Test.cpp | 2 | ||||
-rw-r--r-- | tests/Writer32Test.cpp | 2 | ||||
-rw-r--r-- | third_party/ktx/ktx.cpp | 2 |
10 files changed, 14 insertions, 14 deletions
diff --git a/gm/dftext.cpp b/gm/dftext.cpp index 16fe4bd385..d501e58673 100755 --- a/gm/dftext.cpp +++ b/gm/dftext.cpp @@ -138,8 +138,8 @@ protected: canvas->scale(2.0f, 2.0f); - SkAutoTArray<SkPoint> pos(textLen); - SkAutoTArray<SkScalar> widths(textLen); + SkAutoTArray<SkPoint> pos(SkToInt(textLen)); + SkAutoTArray<SkScalar> widths(SkToInt(textLen)); paint.setTextSize(textSizes[0]); paint.getTextWidths(text, textLen, &widths[0]); diff --git a/gm/glyph_pos_align.cpp b/gm/glyph_pos_align.cpp index 9a94e75b92..8877379217 100644 --- a/gm/glyph_pos_align.cpp +++ b/gm/glyph_pos_align.cpp @@ -59,7 +59,7 @@ protected: SkScalar widths[kMaxStringLength]; SkScalar posX[kMaxStringLength]; SkPoint pos[kMaxStringLength]; - int length = strlen(text); + int length = SkToInt(strlen(text)); SkASSERT(length <= kMaxStringLength); paint.getTextWidths(text, length, widths); diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp index 493e2f752a..c63fb5476c 100644 --- a/src/gpu/GrLayerHoister.cpp +++ b/src/gpu/GrLayerHoister.cpp @@ -31,8 +31,8 @@ static void prepare_for_hoisting(GrLayerCache* layerCache, const SkPicture* pict = info.fPicture ? info.fPicture : topLevelPicture; GrCachedLayer* layer = layerCache->findLayerOrCreate(topLevelPicture->uniqueID(), - info.fSaveLayerOpID, - info.fRestoreOpID, + SkToInt(info.fSaveLayerOpID), + SkToInt(info.fRestoreOpID), layerRect, initialMat, info.fKey, diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp index cfb6790876..cd05c9f59c 100644 --- a/src/pdf/SkPDFPage.cpp +++ b/src/pdf/SkPDFPage.cpp @@ -49,7 +49,7 @@ void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage, off_t SkPDFPage::getPageSize(SkPDFCatalog* catalog, off_t fileOffset) { SkASSERT(fContentStream.get() != NULL); catalog->setFileOffset(fContentStream.get(), fileOffset); - return fContentStream->getOutputSize(catalog, true); + return SkToOffT(fContentStream->getOutputSize(catalog, true)); } void SkPDFPage::emitPage(SkWStream* stream, SkPDFCatalog* catalog) { diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp index 75c6f3f9c6..9f6a5b5f43 100644 --- a/tests/FlateTest.cpp +++ b/tests/FlateTest.cpp @@ -30,7 +30,7 @@ public: static SkData* new_test_data(size_t dataSize) { SkAutoTMalloc<uint8_t> testBuffer(dataSize); for (size_t i = 0; i < dataSize; ++i) { - testBuffer[i] = i % 64; + testBuffer[SkToInt(i)] = i % 64; } return SkData::NewFromMalloc(testBuffer.detach(), dataSize); } diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 60a1099136..ca18b2aebf 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -58,9 +58,9 @@ static bool stream_equals(const SkDynamicMemoryWStream& stream, size_t offset, static bool stream_contains(const SkDynamicMemoryWStream& stream, const char* buffer) { SkAutoDataUnref data(stream.copyToData()); - int len = strlen(buffer); // our buffer does not have EOSs. + size_t len = strlen(buffer); // our buffer does not have EOSs. - for (int offset = 0 ; offset < (int)data->size() - len; offset++) { + for (size_t offset = 0 ; offset < data->size() - len; offset++) { if (memcmp(data->bytes() + offset, buffer, len) == 0) { return true; } diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp index c307aa94bc..bf22de1daf 100644 --- a/tests/PaintTest.cpp +++ b/tests/PaintTest.cpp @@ -21,7 +21,7 @@ static size_t uni_to_utf8(const SkUnichar src[], void* dst, int count) { char* u8 = (char*)dst; for (int i = 0; i < count; ++i) { - int n = SkUTF8_FromUnichar(src[i], u8); + int n = SkToInt(SkUTF8_FromUnichar(src[i], u8)); u8 += n; } return u8 - (char*)dst; @@ -30,7 +30,7 @@ static size_t uni_to_utf8(const SkUnichar src[], void* dst, int count) { static size_t uni_to_utf16(const SkUnichar src[], void* dst, int count) { uint16_t* u16 = (uint16_t*)dst; for (int i = 0; i < count; ++i) { - int n = SkUTF16_FromUnichar(src[i], u16); + int n = SkToInt(SkUTF16_FromUnichar(src[i], u16)); u16 += n; } return (char*)u16 - (char*)dst; diff --git a/tests/SkBase64Test.cpp b/tests/SkBase64Test.cpp index 14ff1f7717..a534768793 100644 --- a/tests/SkBase64Test.cpp +++ b/tests/SkBase64Test.cpp @@ -20,7 +20,7 @@ DEF_TEST(SkBase64, reporter) { size_t encodeLength = SkBase64::Encode(all + offset, length, NULL); SkAutoTMalloc<char> src(encodeLength + 1); SkBase64::Encode(all + offset, length, src.get()); - src[encodeLength] = '\0'; + src[SkToInt(encodeLength)] = '\0'; SkBase64 tryMe; tryMe.decode(src.get(), encodeLength); REPORTER_ASSERT(reporter, (strcmp((const char*) (all + offset), tryMe.getData()) == 0)); diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp index 56cea2a926..5b65caa000 100644 --- a/tests/Writer32Test.cpp +++ b/tests/Writer32Test.cpp @@ -163,7 +163,7 @@ static void testWritePad(skiatest::Reporter* reporter, SkWriter32* writer) { } } - uint32_t totalBytes = writer->bytesWritten(); + size_t totalBytes = writer->bytesWritten(); SkAutoMalloc readStorage(totalBytes); writer->flatten(readStorage.get()); diff --git a/third_party/ktx/ktx.cpp b/third_party/ktx/ktx.cpp index 7cc2f28585..42b3ca119f 100644 --- a/third_party/ktx/ktx.cpp +++ b/third_party/ktx/ktx.cpp @@ -500,7 +500,7 @@ bool SkKTXFile::WriteBitmapToKTX(SkWStream* stream, const SkBitmap& bitmap) { size_t kvsize = kv->size(); kvsize += 4; kvsize = (kvsize + 3) & ~3; - hdr.fBytesOfKeyValueData += kvsize; + hdr.fBytesOfKeyValueData = SkToU32(hdr.fBytesOfKeyValueData + kvsize); } // Write the header |