aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-27 13:42:58 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-27 13:42:58 +0000
commit7fa2a65c0cfc714364490cb715171461143024e0 (patch)
treeb7e40b0ca71a7ac8d957d150f038603cde2dcd3c /src/core
parent1a5e51f94ed8cb01600184119e52bb64bdb3dccc (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 'src/core')
-rw-r--r--src/core/SkDebug.cpp5
-rw-r--r--src/core/SkFlate.cpp4
-rw-r--r--src/core/SkPictureFlat.h4
3 files changed, 9 insertions, 4 deletions
diff --git a/src/core/SkDebug.cpp b/src/core/SkDebug.cpp
index 772352248d..d484f5eaff 100644
--- a/src/core/SkDebug.cpp
+++ b/src/core/SkDebug.cpp
@@ -46,4 +46,9 @@ int SkToInt(intmax_t x) {
return (int)x;
}
+unsigned SkToUInt(uintmax_t x) {
+ SkASSERT((unsigned)x == x);
+ return (unsigned)x;
+}
+
#endif
diff --git a/src/core/SkFlate.cpp b/src/core/SkFlate.cpp
index 8258cdcd1d..2b4e36d727 100644
--- a/src/core/SkFlate.cpp
+++ b/src/core/SkFlate.cpp
@@ -61,7 +61,7 @@ bool doFlate(bool compress, SkStream* src, SkWStream* dst) {
flateData.avail_in = 0;
} else {
flateData.next_in = input;
- flateData.avail_in = inputLength;
+ flateData.avail_in = SkToUInt(inputLength);
}
rc = Z_OK;
@@ -83,7 +83,7 @@ bool doFlate(bool compress, SkStream* src, SkWStream* dst) {
if (read == 0)
break;
flateData.next_in = inputBuffer;
- flateData.avail_in = read;
+ flateData.avail_in = SkToUInt(read);
}
if (compress)
rc = deflate(&flateData, Z_NO_FLUSH);
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index 06a9840975..d92e4c45df 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -272,7 +272,7 @@ public:
buffer.setFlags(controller->getWriteBufferFlags());
Traits::flatten(buffer, obj);
- uint32_t size = buffer.size();
+ size_t size = buffer.size();
SkASSERT(SkIsAlign4(size));
// Allocate enough memory to hold SkFlatData struct and the flat data itself.
@@ -282,7 +282,7 @@ public:
// Put the serialized contents into the data section of the new allocation.
buffer.writeToMemory(result->data());
// Stamp the index, size and checksum in the header.
- result->stampHeader(index, size);
+ result->stampHeader(index, SkToS32(size));
return result;
}