From: TimePath Date: Mon, 7 Aug 2017 08:29:13 +0000 (+1000) Subject: Remove -Wno-int-conversion X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03be668aca6168191b9adca7aec905c01c436146;p=xonotic%2Fnetradiant.git Remove -Wno-int-conversion --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 65b7e26a..64f0f9da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,6 @@ addflags("-Wno-unused-variable") addflags("-Wno-unused-parameter") addflags("-Wno-missing-field-initializers") -addflags_c("-Wno-int-conversion") addflags_c("-Wno-pointer-to-int-cast") addflags_c("-Wno-incompatible-pointer-types") diff --git a/tools/quake3/q3data/md3lib.c b/tools/quake3/q3data/md3lib.c index f78390ef..b4c7d93f 100644 --- a/tools/quake3/q3data/md3lib.c +++ b/tools/quake3/q3data/md3lib.c @@ -26,7 +26,9 @@ #include "md3lib.h" #if defined ( __linux__ ) || defined ( __APPLE__ ) -#define filelength Q_filelength +#define filelength(f) Q_filelength(f) +#else +#define filelength(f) filelength(fileno(f)) #endif /* @@ -149,8 +151,8 @@ void MD3_Dump( const char *filename ){ Error( "Unable to open '%s'\n", filename ); } - fileSize = filelength( fileno( fp ) ); - _buffer = malloc( filelength( fileno( fp ) ) ); + fileSize = filelength( fp ); + _buffer = malloc( fileSize ); fread( _buffer, fileSize, 1, fp ); fclose( fp ); diff --git a/tools/quake3/q3data/p3dlib.c b/tools/quake3/q3data/p3dlib.c index 0b228e2f..9de83614 100644 --- a/tools/quake3/q3data/p3dlib.c +++ b/tools/quake3/q3data/p3dlib.c @@ -33,8 +33,10 @@ #if defined ( __linux__ ) || defined ( __APPLE__ ) #include "cmdlib.h" #define _strcmpi Q_stricmp - #define filelength Q_filelength #define strlwr strlower + #define filelength(f) Q_filelength(f) +#else + #define filelength(f) filelength(fileno(f)) #endif typedef struct { @@ -68,7 +70,7 @@ int P3DLoad( const char *filename ){ memset( &p3d, 0, sizeof( p3d ) ); - p3d.len = filelength( fileno( fp ) ); + p3d.len = filelength( fp ); p3d.curpos = p3d.buffer = malloc( p3d.len );