aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-12-12 16:41:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-12 16:41:46 -0800
commitfbaace082745a0e301186b2d3b84af62e2fb87ec (patch)
tree27982934bbf0defcc05ee93bdae535cd2863b8ff /tests
parentf6139f7c3867a70a750620cd34ce10338a54086e (diff)
DM warning-free on win64
Diffstat (limited to 'tests')
-rw-r--r--tests/FlateTest.cpp2
-rw-r--r--tests/PDFPrimitivesTest.cpp4
-rw-r--r--tests/PaintTest.cpp4
-rw-r--r--tests/SkBase64Test.cpp2
-rw-r--r--tests/Writer32Test.cpp2
5 files changed, 7 insertions, 7 deletions
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());