Remove -Wno-int-conversion
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 7 Aug 2017 08:29:13 +0000 (18:29 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 7 Aug 2017 08:29:13 +0000 (18:29 +1000)
CMakeLists.txt
tools/quake3/q3data/md3lib.c
tools/quake3/q3data/p3dlib.c

index 65b7e26..64f0f9d 100644 (file)
@@ -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")
 
index f78390e..b4c7d93 100644 (file)
@@ -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 );
 
index 0b228e2..9de8361 100644 (file)
 #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 );