aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-12 20:22:04 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-12 20:22:04 +0000
commit30580f69493fd8aa86c223736b4f7564ce458760 (patch)
tree02988e82911494c3f21fa21fa785c4140575046c /src
parent0cb1e2bcaec0693b3a927f48705a9eb6234021dc (diff)
Fix setFileOffset type to remove warnings.
Review URL: https://codereview.appspot.com/6334050 git-svn-id: http://skia.googlecode.com/svn/trunk@4585 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/pdf/SkPDFCatalog.cpp4
-rw-r--r--src/pdf/SkPDFCatalog.h2
-rw-r--r--src/pdf/SkPDFDocument.cpp15
-rw-r--r--src/pdf/SkPDFPage.cpp2
4 files changed, 10 insertions, 13 deletions
diff --git a/src/pdf/SkPDFCatalog.cpp b/src/pdf/SkPDFCatalog.cpp
index 646476b111..c0f6fb03b9 100644
--- a/src/pdf/SkPDFCatalog.cpp
+++ b/src/pdf/SkPDFCatalog.cpp
@@ -38,7 +38,7 @@ SkPDFObject* SkPDFCatalog::addObject(SkPDFObject* obj, bool onFirstPage) {
return obj;
}
-size_t SkPDFCatalog::setFileOffset(SkPDFObject* obj, size_t offset) {
+size_t SkPDFCatalog::setFileOffset(SkPDFObject* obj, off_t offset) {
int objIndex = assignObjNum(obj) - 1;
SkASSERT(fCatalog[objIndex].fObjNumAssigned);
SkASSERT(fCatalog[objIndex].fFileOffset == 0);
@@ -190,7 +190,7 @@ off_t SkPDFCatalog::setSubstituteResourcesOffsets(off_t fileOffset,
SkTDArray<SkPDFObject*>* targetList = getSubstituteList(firstPage);
off_t offsetSum = fileOffset;
for (int i = 0; i < targetList->count(); ++i) {
- offsetSum += setFileOffset((*targetList)[i], (size_t) offsetSum);
+ offsetSum += setFileOffset((*targetList)[i], offsetSum);
}
return offsetSum - fileOffset;
}
diff --git a/src/pdf/SkPDFCatalog.h b/src/pdf/SkPDFCatalog.h
index 44005c6784..d5825ace5a 100644
--- a/src/pdf/SkPDFCatalog.h
+++ b/src/pdf/SkPDFCatalog.h
@@ -42,7 +42,7 @@ public:
* @param obj The object to add.
* @param offset The byte offset in the output stream of this object.
*/
- size_t setFileOffset(SkPDFObject* obj, size_t offset);
+ size_t setFileOffset(SkPDFObject* obj, off_t offset);
/** Output the object number for the passed object.
* @param obj The object of interest.
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index cb24fbacf5..00c445e195 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -123,14 +123,13 @@ bool SkPDFDocument::emitPDF(SkWStream* stream) {
// Figure out the size of things and inform the catalog of file offsets.
off_t fileOffset = headerSize();
- fileOffset += fCatalog->setFileOffset(fDocCatalog.get(),
- (size_t) fileOffset);
- fileOffset += fCatalog->setFileOffset(fPages[0], (size_t) fileOffset);
+ fileOffset += fCatalog->setFileOffset(fDocCatalog.get(), fileOffset);
+ fileOffset += fCatalog->setFileOffset(fPages[0], fileOffset);
fileOffset += fPages[0]->getPageSize(fCatalog.get(),
(size_t) fileOffset);
for (int i = 0; i < fSecondPageFirstResourceIndex; i++) {
fileOffset += fCatalog->setFileOffset(fPageResources[i],
- (size_t) fileOffset);
+ fileOffset);
}
// Add the size of resources of substitute objects used on page 1.
fileOffset += fCatalog->setSubstituteResourcesOffsets(fileOffset, true);
@@ -140,20 +139,18 @@ bool SkPDFDocument::emitPDF(SkWStream* stream) {
}
for (int i = 0; i < fPageTree.count(); i++) {
- fileOffset += fCatalog->setFileOffset(fPageTree[i],
- (size_t) fileOffset);
+ fileOffset += fCatalog->setFileOffset(fPageTree[i], fileOffset);
}
for (int i = 1; i < fPages.count(); i++) {
- fileOffset += fPages[i]->getPageSize(fCatalog.get(),
- (size_t) fileOffset);
+ fileOffset += fPages[i]->getPageSize(fCatalog.get(), fileOffset);
}
for (int i = fSecondPageFirstResourceIndex;
i < fPageResources.count();
i++) {
fileOffset += fCatalog->setFileOffset(fPageResources[i],
- (size_t) fileOffset);
+ fileOffset);
}
fileOffset += fCatalog->setSubstituteResourcesOffsets(fileOffset,
diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp
index 3c8bd04a91..3f3dec98b3 100644
--- a/src/pdf/SkPDFPage.cpp
+++ b/src/pdf/SkPDFPage.cpp
@@ -37,7 +37,7 @@ void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage,
off_t SkPDFPage::getPageSize(SkPDFCatalog* catalog, off_t fileOffset) {
SkASSERT(fContentStream.get() != NULL);
- catalog->setFileOffset(fContentStream.get(), (size_t) fileOffset);
+ catalog->setFileOffset(fContentStream.get(), fileOffset);
return fContentStream->getOutputSize(catalog, true);
}