Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update touch and >2GB zip files #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions libs/minzip/SysUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion libs/minzip/Zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions libs/minzip/Zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
42 changes: 21 additions & 21 deletions src/libs/input/input_translate/translate_touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down