diff --git a/Quake/sys.h b/Quake/sys.h index 81cf5f44..9c576e82 100644 --- a/Quake/sys.h +++ b/Quake/sys.h @@ -30,7 +30,7 @@ void Sys_Init (void); // file IO // -typedef long long qfileofs_t; +typedef int64_t qfileofs_t; int Sys_fseek (FILE *file, qfileofs_t ofs, int origin); qfileofs_t Sys_ftell (FILE *file); diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c index 5ef67329..3c468997 100644 --- a/Quake/sys_sdl_unix.c +++ b/Quake/sys_sdl_unix.c @@ -51,12 +51,12 @@ COMPILE_TIME_ASSERT (CHECK_LARGE_FILE_SUPPORT, sizeof (off_t) >= sizeof (qfileof int Sys_fseek (FILE *file, qfileofs_t ofs, int origin) { - return fseeko (file, ofs, origin); + return fseeko (file, (off_t)ofs, origin); } qfileofs_t Sys_ftell (FILE *file) { - return ftello (file); + return (qfileofs_t)ftello (file); } int Sys_FileType (const char *path) diff --git a/Quake/sys_sdl_win.c b/Quake/sys_sdl_win.c index 41d427df..ced949e6 100644 --- a/Quake/sys_sdl_win.c +++ b/Quake/sys_sdl_win.c @@ -55,14 +55,16 @@ static HANDLE hinput, houtput; static char cwd[1024]; static double counter_freq; +COMPILE_TIME_ASSERT (CHECK_LARGE_FILE_SUPPORT, sizeof (long long) >= sizeof (qfileofs_t)); + int Sys_fseek (FILE *file, qfileofs_t ofs, int origin) { - return _fseeki64 (file, ofs, origin); + return _fseeki64 (file, (long long)ofs, origin); } qfileofs_t Sys_ftell (FILE *file) { - return _ftelli64 (file); + return (qfileofs_t)_ftelli64 (file); } static void Sys_GetBasedir (char *argv0, char *dst, size_t dstsize)