Fix or suppress some google-runtime-int warnings.
Bug: 112478838
Test: build with WITH_TIDY=1
Change-Id: Ie3b15a85770b5806cddfd49a475aaf0553f9ec78
diff --git a/tools/zipalign/ZipAlign.cpp b/tools/zipalign/ZipAlign.cpp
index d56ac29..c4d6fc4 100644
--- a/tools/zipalign/ZipAlign.cpp
+++ b/tools/zipalign/ZipAlign.cpp
@@ -102,7 +102,7 @@
* file position in the new file will be equal to the file
* position in the original.
*/
- long newOffset = pEntry->getFileOffset() + bias;
+ off_t newOffset = pEntry->getFileOffset() + bias;
padding = (alignTo - (newOffset % alignTo)) % alignTo;
//printf("--- %s: orig at %ld(+%d) len=%ld, adding pad=%d\n",
@@ -190,23 +190,23 @@
pEntry = zipFile.getEntryByIndex(i);
if (pEntry->isCompressed()) {
if (verbose) {
- printf("%8ld %s (OK - compressed)\n",
- (long) pEntry->getFileOffset(), pEntry->getFileName());
+ printf("%8jd %s (OK - compressed)\n",
+ (intmax_t) pEntry->getFileOffset(), pEntry->getFileName());
}
} else {
- long offset = pEntry->getFileOffset();
+ off_t offset = pEntry->getFileOffset();
const int alignTo = getAlignment(pageAlignSharedLibs, alignment, pEntry);
if ((offset % alignTo) != 0) {
if (verbose) {
- printf("%8ld %s (BAD - %ld)\n",
- (long) offset, pEntry->getFileName(),
+ printf("%8jd %s (BAD - %ld)\n",
+ (intmax_t) offset, pEntry->getFileName(),
offset % alignTo);
}
foundBad = true;
} else {
if (verbose) {
- printf("%8ld %s (OK)\n",
- (long) offset, pEntry->getFileName());
+ printf("%8jd %s (OK)\n",
+ (intmax_t) offset, pEntry->getFileName());
}
}
}