Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: src/core/SkWriter32.cpp

Issue 247753003: fix size_t/int warnings (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: revert name-change in swap32 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkValidatingReadBuffer.cpp ('k') | src/sfnt/SkOTUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkWriter32.cpp
diff --git a/src/core/SkWriter32.cpp b/src/core/SkWriter32.cpp
index c7bfd92d56aafd832868c42f2690f3bcd8082ef3..3397c37360df64df2878da127a6248586ce76804 100644
--- a/src/core/SkWriter32.cpp
+++ b/src/core/SkWriter32.cpp
@@ -47,7 +47,7 @@ void SkWriter32::writeString(const char str[], size_t len) {
// [ 4 byte len ] [ str ... ] [1 - 4 \0s]
uint32_t* ptr = this->reservePad(sizeof(uint32_t) + len + 1);
- *ptr = len;
+ *ptr = SkToU32(len);
char* chars = (char*)(ptr + 1);
memcpy(chars, str, len);
chars[len] = '\0';
« no previous file with comments | « src/core/SkValidatingReadBuffer.cpp ('k') | src/sfnt/SkOTUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698