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

Unified Diff: src/core/SkPaint.cpp

Issue 242643008: fix warnings around size_t/int (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SkPackBits.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 241175e4e08f044cf7e65410c05e581775dab07a..176992f441dc6f8c53a20373a51cb84e2d62ca9f 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -536,12 +536,11 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength,
case kUTF8_TextEncoding:
return SkUTF8_CountUnichars((const char*)textData, byteLength);
case kUTF16_TextEncoding:
- return SkUTF16_CountUnichars((const uint16_t*)textData,
- byteLength >> 1);
+ return SkUTF16_CountUnichars((const uint16_t*)textData, SkToInt(byteLength >> 1));
case kUTF32_TextEncoding:
- return byteLength >> 2;
+ return SkToInt(byteLength >> 2);
case kGlyphID_TextEncoding:
- return byteLength >> 1;
+ return SkToInt(byteLength >> 1);
default:
SkDEBUGFAIL("unknown text encoding");
}
@@ -554,7 +553,7 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength,
if (this->getTextEncoding() == kGlyphID_TextEncoding) {
// we want to ignore the low bit of byteLength
memcpy(glyphs, textData, byteLength >> 1 << 1);
- return byteLength >> 1;
+ return SkToInt(byteLength >> 1);
}
SkAutoGlyphCache autoCache(*this, NULL, NULL);
@@ -589,7 +588,7 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength,
default:
SkDEBUGFAIL("unknown text encoding");
}
- return gptr - glyphs;
+ return SkToInt(gptr - glyphs);
}
bool SkPaint::containsText(const void* textData, size_t byteLength) const {
« no previous file with comments | « src/core/SkPackBits.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698