diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-02 20:58:12 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-02 20:58:12 +0000 |
commit | 5f008652f69ce7809b920b9fa573bc72216acd51 (patch) | |
tree | 5a24726df32f81f1ba65bcdce814edb0d5af39a2 | |
parent | 4b897fa1f6f2f3c2319699545c6e3b8d3c82db17 (diff) |
Remove some PdfViewer warnings.
Fix build.
git-svn-id: http://skia.googlecode.com/svn/trunk@12438 2bbb7eff-a529-9590-31e7-b0007b416f81
6 files changed, 10 insertions, 10 deletions
diff --git a/experimental/PdfViewer/SkPdfFont.h b/experimental/PdfViewer/SkPdfFont.h index 4a66edfaaa..a46e31c645 100644 --- a/experimental/PdfViewer/SkPdfFont.h +++ b/experimental/PdfViewer/SkPdfFont.h @@ -54,7 +54,7 @@ struct SkUnencodedText { public: SkUnencodedText(const SkPdfString* obj) { text = (void*)obj->c_str(); - len = obj->lenstr(); + len = (int) obj->lenstr(); } }; @@ -272,7 +272,7 @@ public: unsigned long ch4 = ch; char utf8[10]; - int len = SkUTF8_FromUnichar(ch4, utf8); + size_t len = SkUTF8_FromUnichar((SkUnichar) ch4, utf8); canvas->drawText(utf8, len, SkDoubleToScalar(0), SkDoubleToScalar(0), *paint); diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp b/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp index 1c376b8508..8c776371ab 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp +++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp @@ -379,7 +379,7 @@ SkPdfNativeObject* SkPdfNativeDoc::readObject(int id/*, int expectedGeneration*/ const unsigned char* current = fFileContent + startOffset; const unsigned char* end = fFileContent + fContentLength; - SkPdfNativeTokenizer tokenizer(current, end - current, fAllocator, this); + SkPdfNativeTokenizer tokenizer(current, (int) (end - current), fAllocator, this); SkPdfNativeObject idObj; SkPdfNativeObject generationObj; @@ -439,7 +439,7 @@ void SkPdfNativeDoc::fillPages(SkPdfPageTreeNodeDictionary* tree) { return; } - int cnt = kids->size(); + int cnt = (int) kids->size(); for (int i = 0; i < cnt; i++) { SkPdfNativeObject* obj = resolveReference(kids->objAtAIndex(i)); if (fMapper->mapPageObjectDictionary(obj) != kPageObjectDictionary_SkPdfNativeObjectType) { diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp b/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp index 1682fb92b2..d9b3c01201 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp +++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp @@ -91,7 +91,7 @@ bool SkPdfNativeObject::filterStream() { applyFilter(filterName.c_str()); } else if (stream->isFilterAArray(NULL)) { const SkPdfArray* filters = stream->getFilterAsArray(NULL); - int cnt = filters->size(); + int cnt = (int) filters->size(); for (int i = cnt - 1; i >= 0; i--) { const SkPdfNativeObject* filterName = filters->objAtAIndex(i); if (filterName != NULL && filterName->isName()) { diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.h b/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.h index 6ce5622fee..22b5a58f7e 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.h +++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.h @@ -1240,7 +1240,7 @@ public: while ((key = iter.next(&obj)) != NULL) { appendSpaces(&str, level + 2); str.appendf("/%s %s\n", key, - obj->toString(0, level + strlen(key) + 4).c_str()); + obj->toString(0, level + (int) strlen(key) + 4).c_str()); } appendSpaces(&str, level); str.append(">>"); diff --git a/experimental/PdfViewer/src/SkPdfContext.cpp b/experimental/PdfViewer/src/SkPdfContext.cpp index c2162556bb..f29afe52a0 100644 --- a/experimental/PdfViewer/src/SkPdfContext.cpp +++ b/experimental/PdfViewer/src/SkPdfContext.cpp @@ -74,7 +74,7 @@ void reportPdfRenderStats() { const char* key; int value = 0; while ((key = iter.next(&value)) != NULL) { - printf("%s: %s -> count %i\n", gRenderStatsNames[i], key, value); + SkDebugf("%s: %s -> count %i\n", gRenderStatsNames[i], key, value); } } } diff --git a/experimental/PdfViewer/src/SkPdfRenderer.cpp b/experimental/PdfViewer/src/SkPdfRenderer.cpp index 69adbda415..714da5027c 100644 --- a/experimental/PdfViewer/src/SkPdfRenderer.cpp +++ b/experimental/PdfViewer/src/SkPdfRenderer.cpp @@ -1635,7 +1635,7 @@ static SkPdfResult PdfOp_CS_cs(SkPdfContext* pdfContext, SkCanvas* canvas, if (colorSpace->isName()) { colorOperator->fColorSpace = colorSpace->strRef(); } else if (colorSpace->isArray()) { - int cnt = colorSpace->size(); + size_t cnt = colorSpace->size(); if (cnt == 0) { SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kIncostistentSizes_SkPdfIssue, "color space has length 0", colorSpace, pdfContext); @@ -1938,7 +1938,7 @@ static SkPdfResult skpdfGraphicsStateApplyD(SkPdfContext* pdfContext, SkPdfArray return kIgnoreError_SkPdfResult; } - int cnt = intervals->size(); + int cnt = (int) intervals->size(); if (cnt >= 256) { // TODO(edisonn): alloc memory SkPdfReport(kCodeWarning_SkPdfIssueSeverity, kNYI_SkPdfIssue, @@ -2180,7 +2180,7 @@ static void skpdfGraphicsStateApplyBM_array(SkPdfContext* pdfContext, SkPdfArray } SkXfermode::Mode modes[256]; - int cnt = blendModes->size(); + int cnt = (int) blendModes->size(); for (int i = 0; i < cnt; i++) { SkPdfNativeObject* name = blendModes->objAtAIndex(i); if (!name || !name->isName()) { |