diff options
author | 2014-04-19 22:00:40 +0000 | |
---|---|---|
committer | 2014-04-19 22:00:40 +0000 | |
commit | 2cfa3200fda29279eba1240170c7e873d12f9d48 (patch) | |
tree | 42c50379d08cfbbf9d2af7b316010feafe1b1f78 /src/core/SkPaint.cpp | |
parent | 2dceedaa1e4dfb9accc82d8e3d3afac9ba5b2142 (diff) |
fix warnings around size_t/int
fix warnings around undeclared (non-static) functions
TBR=bsalomon@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/242643008
git-svn-id: http://skia.googlecode.com/svn/trunk@14267 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 241175e4e0..176992f441 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 { |