DM warning-free on win64
Review URL: https://codereview.chromium.org/805543002
diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp
index 75c6f3f..9f6a5b5 100644
--- a/tests/FlateTest.cpp
+++ b/tests/FlateTest.cpp
@@ -30,7 +30,7 @@
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 60a1099..ca18b2a 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -58,9 +58,9 @@
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 c307aa9..bf22de1 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_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 14ff1f7..a534768 100644
--- a/tests/SkBase64Test.cpp
+++ b/tests/SkBase64Test.cpp
@@ -20,7 +20,7 @@
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 56cea2a..5b65caa 100644
--- a/tests/Writer32Test.cpp
+++ b/tests/Writer32Test.cpp
@@ -163,7 +163,7 @@
}
}
- uint32_t totalBytes = writer->bytesWritten();
+ size_t totalBytes = writer->bytesWritten();
SkAutoMalloc readStorage(totalBytes);
writer->flatten(readStorage.get());