aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFCatalog.cpp
diff options
context:
space:
mode:
authorGravatar sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-11 18:45:12 +0000
committerGravatar sugoi@google.com <sugoi@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-11 18:45:12 +0000
commitdfc867bab24e184f5093d4eabbac7d9c58cc6320 (patch)
tree686cf78a0fa2fa6ac12ec99c85eec3aa97538eea /src/pdf/SkPDFCatalog.cpp
parent61f70b4478fea5d7d805480227536d8a8e633426 (diff)
Turning on warning as error on Linux
Fixed the few remaining warnings and turned on warning as error on Linux. Explicitly turned off warning as error in libjpeg, cityhash and json. Review URL: https://codereview.chromium.org/12521010 git-svn-id: http://skia.googlecode.com/svn/trunk@8067 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFCatalog.cpp')
-rw-r--r--src/pdf/SkPDFCatalog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pdf/SkPDFCatalog.cpp b/src/pdf/SkPDFCatalog.cpp
index c0f6fb03b9..b26c923c16 100644
--- a/src/pdf/SkPDFCatalog.cpp
+++ b/src/pdf/SkPDFCatalog.cpp
@@ -128,8 +128,11 @@ int32_t SkPDFCatalog::emitXrefTable(SkWStream* stream, bool firstPage) {
first++;
}
for (int i = first; i <= last; i++) {
+ // For 32 bits platforms, the maximum offset has to fit within off_t which is a 32 bits
+ // signed integer on these platforms. On other platforms, we can use the actual maximum.
+ SkDEBUGCODE(static const off_t kMaxOff = (sizeof(off_t) > 4) ? 10000000000 : 2147483647;)
SkASSERT(fCatalog[i].fFileOffset > 0);
- SkASSERT(fCatalog[i].fFileOffset <= 9999999999LL);
+ SkASSERT(fCatalog[i].fFileOffset < kMaxOff);
stream->writeBigDecAsText(fCatalog[i].fFileOffset, 10);
stream->writeText(" 00000 n \n");
}