diff options
author | 2014-04-18 19:29:07 +0000 | |
---|---|---|
committer | 2014-04-18 19:29:07 +0000 | |
commit | aec406650cbfa4ef65d83db5ff4f82572e8e098f (patch) | |
tree | dfc4bd1845a09779496bef36e89f6aefd8c91361 /src/pdf/SkPDFFont.cpp | |
parent | 770963f23f4fc313db0fa3bac18b1b8aafb55f17 (diff) |
fix int/size_t warnings
patch from issue 239933002
BUG=skia:
R=bungeman@google.com
Review URL: https://codereview.chromium.org/242113010
git-svn-id: http://skia.googlecode.com/svn/trunk@14259 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFFont.cpp')
-rw-r--r-- | src/pdf/SkPDFFont.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp index 07ecbba37e..0d41176982 100644 --- a/src/pdf/SkPDFFont.cpp +++ b/src/pdf/SkPDFFont.cpp @@ -568,21 +568,21 @@ static void sk_delete_array(const void* ptr, size_t, void*) { } #endif -static int get_subset_font_stream(const char* fontName, - const SkTypeface* typeface, - const SkTDArray<uint32_t>& subset, - SkPDFStream** fontStream) { +static size_t get_subset_font_stream(const char* fontName, + const SkTypeface* typeface, + const SkTDArray<uint32_t>& subset, + SkPDFStream** fontStream) { int ttcIndex; SkAutoTUnref<SkStream> fontData(typeface->openStream(&ttcIndex)); - int fontSize = fontData->getLength(); + size_t fontSize = fontData->getLength(); #if defined (SK_SFNTLY_SUBSETTER) // Read font into buffer. SkPDFStream* subsetFontStream = NULL; SkTDArray<unsigned char> originalFont; - originalFont.setCount(fontSize); - if (fontData->read(originalFont.begin(), fontSize) == (size_t)fontSize) { + originalFont.setCount(SkToInt(fontSize)); + if (fontData->read(originalFont.begin(), fontSize) == fontSize) { unsigned char* subsetFont = NULL; // sfntly requires unsigned int* to be passed in, as far as we know, // unsigned int is equivalent to uint32_t on all platforms. @@ -765,14 +765,13 @@ bool SkPDFFont::hasGlyph(uint16_t id) { return (id >= fFirstGlyphID && id <= fLastGlyphID) || id == 0; } -size_t SkPDFFont::glyphsToPDFFontEncoding(uint16_t* glyphIDs, - size_t numGlyphs) { +int SkPDFFont::glyphsToPDFFontEncoding(uint16_t* glyphIDs, int numGlyphs) { // A font with multibyte glyphs will support all glyph IDs in a single font. if (this->multiByteGlyphs()) { return numGlyphs; } - for (size_t i = 0; i < numGlyphs; i++) { + for (int i = 0; i < numGlyphs; i++) { if (glyphIDs[i] == 0) { continue; } @@ -1112,10 +1111,10 @@ bool SkPDFCIDFont::addFontDescriptor(int16_t defaultWidth, SkASSERT(subset); // Font subsetting SkPDFStream* rawStream = NULL; - int fontSize = get_subset_font_stream(fontInfo()->fFontName.c_str(), - typeface(), - *subset, - &rawStream); + size_t fontSize = get_subset_font_stream(fontInfo()->fFontName.c_str(), + typeface(), + *subset, + &rawStream); SkASSERT(fontSize); SkASSERT(rawStream); SkAutoTUnref<SkPDFStream> fontStream(rawStream); |