diff options
Diffstat (limited to 'android/utils')
-rw-r--r-- | android/utils/mapfile.c | 10 | ||||
-rw-r--r-- | android/utils/mapfile.h | 2 | ||||
-rw-r--r-- | android/utils/system.c | 2 | ||||
-rw-r--r-- | android/utils/timezone.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/android/utils/mapfile.c b/android/utils/mapfile.c index 102dfd8..61b57c4 100644 --- a/android/utils/mapfile.c +++ b/android/utils/mapfile.c @@ -88,7 +88,7 @@ mapfile_open(const char* path, int oflag, int share_mode) int file_handle = open(path, oflag, share_mode); #endif // WIN32 - return (MapFile*)file_handle; + return (MapFile*)(ptrdiff_t)file_handle; } int @@ -102,7 +102,7 @@ mapfile_close(MapFile* handle) return -1; } #else // WIN32 - return close((int)handle); + return close((int)(ptrdiff_t)handle); #endif // WIN32 } @@ -122,7 +122,7 @@ mapfile_read(MapFile* handle, void* buf, size_t nbyte) #else // WIN32 ssize_t ret; do { - ret = read((int)handle, buf, nbyte); + ret = read((int)(ptrdiff_t)handle, buf, nbyte); } while (ret < 0 && errno == EINTR); return ret; #endif // WIN32 @@ -142,7 +142,7 @@ mapfile_read_at(MapFile* handle, size_t offset, void* buf, size_t nbyte) } return mapfile_read(handle, buf, nbyte); #else // WIN32 - ssize_t res = lseek((int)handle, offset, SEEK_SET); + ssize_t res = lseek((int)(ptrdiff_t)handle, offset, SEEK_SET); return res >= 0 ? mapfile_read(handle, buf, nbyte) : res; #endif // WIN32 } @@ -223,7 +223,7 @@ mapfile_map(MapFile* handle, } #else // WIN32 mapped_at = - mmap(0, map_size, PROT_READ, MAP_SHARED, (int)handle, map_offset); + mmap(0, map_size, PROT_READ, MAP_SHARED, (int)(ptrdiff_t)handle, map_offset); if (mapped_at == MAP_FAILED) { return NULL; } diff --git a/android/utils/mapfile.h b/android/utils/mapfile.h index c125337..18f8845 100644 --- a/android/utils/mapfile.h +++ b/android/utils/mapfile.h @@ -39,7 +39,7 @@ typedef struct MapFile MapFile; static inline int mapfile_is_valid(MapFile* handle) { - return (int)handle != -1; + return handle != (void*)(ptrdiff_t)-1; } /* Opens file in selected mode. diff --git a/android/utils/system.c b/android/utils/system.c index 8443877..5b20b4b 100644 --- a/android/utils/system.c +++ b/android/utils/system.c @@ -66,7 +66,7 @@ android_realloc( void* block, size_t size ) if (block2 != NULL) return block2; - fprintf(stderr, "PANIC: not enough memory to reallocate %d bytes\n", size); + fprintf(stderr, "PANIC: not enough memory to reallocate %lld bytes\n", (uint64_t)size); exit(1); return NULL; } diff --git a/android/utils/timezone.c b/android/utils/timezone.c index 2707e2e..1b99917 100644 --- a/android/utils/timezone.c +++ b/android/utils/timezone.c @@ -185,7 +185,7 @@ compare_timezone_to_localtime( ScanDataRec* scan, } if ( st.st_size != scan->localtime_st.st_size ) { - D( " size mistmatch (%lld != %lld)\n", st.st_size, scan->localtime_st.st_size ); + D( " size mistmatch (%zd != %zd)\n", (size_t)st.st_size, (size_t)scan->localtime_st.st_size ); return 0; } |