diff --git a/libs/minzip/SysUtil.c b/libs/minzip/SysUtil.c index 49a2522..ef75cbb 100644 --- a/libs/minzip/SysUtil.c +++ b/libs/minzip/SysUtil.c @@ -44,19 +44,19 @@ static void* sysCreateAnonShmem(size_t length) return ptr; } -static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) +static int getFileStartAndLength(int fd, loff_t *start_, size_t *length_) { - off_t start, end; + loff_t start, end; size_t length; assert(start_ != NULL); assert(length_ != NULL); - start = lseek(fd, 0L, SEEK_CUR); - end = lseek(fd, 0L, SEEK_END); - (void) lseek(fd, start, SEEK_SET); + start = lseek64(fd, 0L, SEEK_CUR); + end = lseek64(fd, 0L, SEEK_END); + (void) lseek64(fd, start, SEEK_SET); - if (start == (off_t) -1 || end == (off_t) -1) { + if (start == (loff_t) -1 || end == (loff_t) -1) { LOGE("could not determine length of file\n"); return -1; } @@ -82,7 +82,7 @@ static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) */ int sysLoadFileInShmem(int fd, MemMapping* pMap) { - off_t start; + loff_t start; size_t length, actual; void* memPtr; @@ -117,7 +117,7 @@ int sysLoadFileInShmem(int fd, MemMapping* pMap) */ int sysMapFileInShmem(int fd, MemMapping* pMap) { - off_t start; + loff_t start; size_t length; void* memPtr; @@ -146,6 +146,9 @@ int sysMapFileInShmem(int fd, MemMapping* pMap) * On success, returns 0 and fills out "pMap". On failure, returns a nonzero * value and does not disturb "pMap". */ + //nkk71: function not used by aroma installer, don't fix it + // it would break anyway, because mmap handles off_t not loff_t + // in mmap(....actualStart) int sysMapFileSegmentInShmem(int fd, off_t start, long length, MemMapping* pMap) { diff --git a/libs/minzip/Zip.c b/libs/minzip/Zip.c index 5ca3dd6..9eeafe6 100644 --- a/libs/minzip/Zip.c +++ b/libs/minzip/Zip.c @@ -372,7 +372,7 @@ static bool parseZipArchive(ZipArchive* pArchive, const MemMapping* pMap) } pEntry->offset = localHdrOffset + LOCHDR + get2LE(localHdr + LOCNAM) + get2LE(localHdr + LOCEXT); - if (!safe_add(NULL, pEntry->offset, pEntry->compLen)) { + if (!safe_add(NULL, pEntry->offset, (typeof(pEntry->offset))pEntry->compLen)) { LOGW("Integer overflow adding in parseZipArchive\n"); goto bail; } diff --git a/libs/minzip/Zip.h b/libs/minzip/Zip.h index 1c1df2f..c730486 100644 --- a/libs/minzip/Zip.h +++ b/libs/minzip/Zip.h @@ -25,7 +25,7 @@ typedef struct ZipEntry { unsigned int fileNameLen; const char* fileName; // not null-terminated - long offset; + loff_t offset; long compLen; long uncompLen; int compression; @@ -114,7 +114,7 @@ INLINE UnterminatedString mzGetZipEntryFileName(const ZipEntry* pEntry) { ret.len = pEntry->fileNameLen; return ret; } -INLINE long mzGetZipEntryOffset(const ZipEntry* pEntry) { +INLINE loff_t mzGetZipEntryOffset(const ZipEntry* pEntry) { return pEntry->offset; } INLINE long mzGetZipEntryUncompLen(const ZipEntry* pEntry) { diff --git a/src/libs/input/input_translate/translate_touch.c b/src/libs/input/input_translate/translate_touch.c index 8d2a7a7..6544b76 100644 --- a/src/libs/input/input_translate/translate_touch.c +++ b/src/libs/input/input_translate/translate_touch.c @@ -124,32 +124,32 @@ byte INDR_translate_touch(AINPUTP me, INDR_DEVICEP dev, ev->type = EV_SYN; ev->code = SYN_REPORT; - break; + } + break; - case ABS_MT_TOUCH_MAJOR: - case ABS_MT_PRESSURE: + case ABS_MT_TOUCH_MAJOR: + case ABS_MT_PRESSURE: - /* Multitouch Pressure Event */ - if (ev->value == 0) { - /* Screen UnTouched */ - dev->p.state |= INDR_POS_ST_RLS_NEXT; - dev->p.x = 0; - dev->p.y = 0; - } + /* Multitouch Pressure Event */ + if (ev->value == 0) { + /* Screen UnTouched */ + dev->p.state |= INDR_POS_ST_RLS_NEXT; + dev->p.x = 0; + dev->p.y = 0; + } - break; + break; - case ABS_MT_TRACKING_ID: - if (ev->value < 0) { - /* Screen UnTouched */ - dev->p.state |= INDR_POS_ST_RLS_NEXT; - dev->p.x = 0; - dev->p.y = 0; - TOUCH_RELEASE_NEXTSYN = 1; - MT_TRACKING_IS_UNTOUCHED = 1; - } + case ABS_MT_TRACKING_ID: + if (ev->value < 0) { + /* Screen UnTouched */ + dev->p.state |= INDR_POS_ST_RLS_NEXT; + dev->p.x = 0; + dev->p.y = 0; + TOUCH_RELEASE_NEXTSYN = 1; + MT_TRACKING_IS_UNTOUCHED = 1; } - + break; default: