Remove -Wno-unused-but-set-variable
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 6 Aug 2017 09:24:03 +0000 (19:24 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 6 Aug 2017 09:24:03 +0000 (19:24 +1000)
17 files changed:
CMakeLists.txt
libs/generic/callback.cpp
libs/profile/profile.cpp
libs/splines/splines.cpp
libs/splines/util_str.cpp
libs/xml/xmlparser.h
plugins/entity/light.cpp
plugins/image/jpeg.cpp
plugins/imagehl/hlw.cpp
plugins/imagehl/mip.cpp
plugins/imagehl/sprite.cpp
radiant/brush_primit.cpp
radiant/camwindow.cpp
tools/quake3/common/bspfile.c
tools/quake3/q3data/images.c
tools/quake3/q3data/models.c
tools/quake3/q3map2/surface.c

index aa7f76a..f1c9555 100644 (file)
@@ -87,12 +87,12 @@ addflags("-Wall")
 addflags("-Wextra")
 addflags("-pedantic")
 
 addflags("-Wextra")
 addflags("-pedantic")
 
+addflags_c("-Wno-deprecated-declarations") # vfs.c: g_strdown
+
 addflags("-Wno-sign-compare")
 addflags("-Wno-unused-function")
 addflags("-Wno-unused-variable")
 addflags("-Wno-unused-parameter")
 addflags("-Wno-sign-compare")
 addflags("-Wno-unused-function")
 addflags("-Wno-unused-variable")
 addflags("-Wno-unused-parameter")
-addflags("-Wno-deprecated-declarations")
-addflags("-Wno-unused-but-set-variable")
 addflags("-Wno-missing-field-initializers")
 
 addflags_c("-Wno-int-conversion")
 addflags("-Wno-missing-field-initializers")
 
 addflags_c("-Wno-int-conversion")
index db04d53..c4fefb8 100644 (file)
@@ -213,10 +213,10 @@ void instantiate(){
                b = makeCallback0( Test::Test0(), test );
                Callback c = Test::Test0ConstCaller( testconst );
                c = makeCallback0( Test::Test0Const(), test );
                b = makeCallback0( Test::Test0(), test );
                Callback c = Test::Test0ConstCaller( testconst );
                c = makeCallback0( Test::Test0Const(), test );
-               Callback d = Test0Caller( test );
-               Callback e = Test0ConstCaller( testconst );
-               Callback f = Test0PCaller( &test );
-               Callback g = Test0ConstPCaller( &testconst );
+               Test0Caller{ test };
+               Test0ConstCaller{ testconst };
+               Test0PCaller{ &test };
+               Test0ConstPCaller{ &testconst };
                a();
                bool u = a != b;
        }
                a();
                bool u = a != b;
        }
@@ -227,10 +227,10 @@ void instantiate(){
                b = makeCallback1( Test::Test1(), test );
                TestCallback1 c = Test::Test1ConstCaller( testconst );
                c = makeCallback1( Test::Test1Const(), test );
                b = makeCallback1( Test::Test1(), test );
                TestCallback1 c = Test::Test1ConstCaller( testconst );
                c = makeCallback1( Test::Test1Const(), test );
-               TestCallback1 d = Test1Caller( test );
-               TestCallback1 e = Test1ConstCaller( testconst );
-               TestCallback1 f = Test1PCaller( &test );
-               TestCallback1 g = Test1ConstPCaller( &testconst );
+               Test1Caller{ test };
+               Test1ConstCaller{ testconst };
+               Test1PCaller{ &test };
+               Test1ConstPCaller{ &testconst };
                a( A1() );
                bool u = a != b;
        }
                a( A1() );
                bool u = a != b;
        }
@@ -238,8 +238,8 @@ void instantiate(){
                typedef Callback2<A1, A2> TestCallback2;
                TestCallback2 a = makeStatelessCallback2( Test2Free() );
                TestCallback2 b = makeCallback2( Test2(), test );
                typedef Callback2<A1, A2> TestCallback2;
                TestCallback2 a = makeStatelessCallback2( Test2Free() );
                TestCallback2 b = makeCallback2( Test2(), test );
-               TestCallback2 c = makeCallback2( Test::Test2(), test );
-               TestCallback2 d = makeCallback2( Test::Test2Const(), test );
+               makeCallback2( Test::Test2(), test );
+               makeCallback2( Test::Test2Const(), test );
                a( A1(), A2() );
                bool u = a != b;
        }
                a( A1(), A2() );
                bool u = a != b;
        }
@@ -247,8 +247,8 @@ void instantiate(){
                typedef Callback3<A1, A2, A3> TestCallback3;
                TestCallback3 a = makeStatelessCallback3( Test3Free() );
                TestCallback3 b = makeCallback3( Test3(), test );
                typedef Callback3<A1, A2, A3> TestCallback3;
                TestCallback3 a = makeStatelessCallback3( Test3Free() );
                TestCallback3 b = makeCallback3( Test3(), test );
-               TestCallback3 c = makeCallback3( Test::Test3(), test );
-               TestCallback3 d = makeCallback3( Test::Test3Const(), test );
+               makeCallback3( Test::Test3(), test );
+               makeCallback3( Test::Test3Const(), test );
                a( A1(), A2(), A3() );
                bool u = a != b;
        }
                a( A1(), A2(), A3() );
                bool u = a != b;
        }
index 71d2ae1..c1505e0 100644 (file)
@@ -252,7 +252,7 @@ bool profile_load_buffer( const char * rc_path, const char *name, void *buffer,
                fclose( f );
        }
 
                fclose( f );
        }
 
-       return true;
+       return ret;
 }
 
 int profile_load_int( const char *filename, const char *section, const char *key, int default_value ){
 }
 
 int profile_load_int( const char *filename, const char *section, const char *key, int default_value ){
index 940b938..901b4f2 100644 (file)
@@ -1167,7 +1167,7 @@ void idFixedPosition::parse( const char *( *text )  ) {
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
-                       const char *token = Com_Parse( text );
+                       Com_Parse( text );
                        if ( Q_stricmp( key.c_str(), "pos" ) == 0 ) {
                                Com_UngetToken();
                                Com_Parse1DMatrix( text, 3, pos );
                        if ( Q_stricmp( key.c_str(), "pos" ) == 0 ) {
                                Com_UngetToken();
                                Com_Parse1DMatrix( text, 3, pos );
@@ -1176,7 +1176,7 @@ void idFixedPosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
 
                } while ( 1 );
 
@@ -1213,7 +1213,7 @@ void idInterpolatedPosition::parse( const char *( *text )  ) {
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
-                       const char *token = Com_Parse( text );
+                       Com_Parse( text );
                        if ( Q_stricmp( key.c_str(), "startPos" ) == 0 ) {
                                Com_UngetToken();
                                Com_Parse1DMatrix( text, 3, startPos );
                        if ( Q_stricmp( key.c_str(), "startPos" ) == 0 ) {
                                Com_UngetToken();
                                Com_Parse1DMatrix( text, 3, startPos );
@@ -1226,7 +1226,7 @@ void idInterpolatedPosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
 
                } while ( 1 );
 
@@ -1264,7 +1264,7 @@ void idSplinePosition::parse( const char *( *text )  ) {
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
                        Com_UngetToken();
                        idStr key = Com_ParseOnLine( text );
 
-                       const char *token = Com_Parse( text );
+                       Com_Parse( text );
                        if ( Q_stricmp( key.c_str(), "target" ) == 0 ) {
                                target.parse( text );
                        }
                        if ( Q_stricmp( key.c_str(), "target" ) == 0 ) {
                                target.parse( text );
                        }
@@ -1272,7 +1272,7 @@ void idSplinePosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
 
                } while ( 1 );
 
index 62fdaed..2d8554e 100644 (file)
@@ -475,6 +475,7 @@ void TestStringClass
        void
 ){
        char ch;                            // ch == ?
        void
 ){
        char ch;                            // ch == ?
+       (void) ch;
        idStr   *t;                         // t == ?
        idStr a;                                // a.len == 0, a.data == "\0"
        idStr b;                                // b.len == 0, b.data == "\0"
        idStr   *t;                         // t == ?
        idStr a;                                // a.len == 0, a.data == "\0"
        idStr b;                                // b.len == 0, b.data == "\0"
@@ -483,6 +484,7 @@ void TestStringClass
        idStr e( reinterpret_cast<const char *>( NULL ) );
        // e.len == 0, e.data == "\0"                                   ASSERT!
        int i;                              // i == ?
        idStr e( reinterpret_cast<const char *>( NULL ) );
        // e.len == 0, e.data == "\0"                                   ASSERT!
        int i;                              // i == ?
+       (void) i;
 
        i = a.length();                 // i == 0
        i = c.length();                 // i == 4
 
        i = a.length();                 // i == 0
        i = c.length();                 // i == 4
index b11d355..cdfdd8f 100644 (file)
@@ -208,6 +208,7 @@ virtual void exportXML( XMLImporter& importer ){
                xmlFreeParserCtxt( ctxt );
        }
 
                xmlFreeParserCtxt( ctxt );
        }
 
+       (void) wellFormed;
        //return wellFormed;
 }
 private:
        //return wellFormed;
 }
 private:
index dbde66c..0e89e92 100644 (file)
@@ -648,8 +648,8 @@ void render( RenderStateFlags state ) const {
        points[5] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[5], 1 ) ) );
        points[6] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[6], 1 ) ) );
        points[7] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[7], 1 ) ) );
        points[5] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[5], 1 ) ) );
        points[6] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[6], 1 ) ) );
        points[7] = vector4_projected( matrix4_transformed_vector4( unproject, Vector4( points[7], 1 ) ) );
-       Vector4 test1 = matrix4_transformed_vector4( unproject, Vector4( 0.5f, 0.5f, 0.5f, 1 ) );
-       Vector3 test2 = vector4_projected( test1 );
+//     Vector4 test1 = matrix4_transformed_vector4( unproject, Vector4( 0.5f, 0.5f, 0.5f, 1 ) );
+//     Vector3 test2 = vector4_projected( test1 );
        aabb_draw_wire( points );
 }
 };
        aabb_draw_wire( points );
 }
 };
index 138151a..d36bd57 100644 (file)
@@ -316,6 +316,7 @@ static void j_putRGBAScanline( unsigned char* jpegline, int widthPix, unsigned c
 
                //!\todo fix jpeglib, it leaves alpha channel uninitialised
 #if 1
 
                //!\todo fix jpeglib, it leaves alpha channel uninitialised
 #if 1
+               (void) iAlp;
                *oAlp = 255;
 #else
                *oAlp = iAlp;
                *oAlp = 255;
 #else
                *oAlp = iAlp;
index 2731e15..7327554 100644 (file)
@@ -91,7 +91,7 @@ typedef struct
 Image* LoadHLWBuff( byte* buffer ){
        byte *buf_p;
        unsigned long mipdatasize;
 Image* LoadHLWBuff( byte* buffer ){
        byte *buf_p;
        unsigned long mipdatasize;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
        int row, column;
        byte *palette;
        byte *pixbuf;
        int row, column;
        byte *palette;
@@ -108,7 +108,6 @@ Image* LoadHLWBuff( byte* buffer ){
 
        columns = lpMip->width;
        rows = lpMip->height;
 
        columns = lpMip->width;
        rows = lpMip->height;
-       numPixels = columns * rows;
 
        RGBAImage* image = new RGBAImage( columns, rows );
 
 
        RGBAImage* image = new RGBAImage( columns, rows );
 
index 51dbfd7..a9d5a71 100644 (file)
@@ -138,7 +138,6 @@ static const byte quakepalette[768] =
 Image* LoadMIPBuff( byte* buffer ){
        byte *buf_p;
        int palettelength;
 Image* LoadMIPBuff( byte* buffer ){
        byte *buf_p;
        int palettelength;
-       unsigned long mipdatasize;
        int columns, rows, numPixels;
        byte *pixbuf;
        int i;
        int columns, rows, numPixels;
        byte *pixbuf;
        int i;
@@ -158,7 +157,7 @@ Image* LoadMIPBuff( byte* buffer ){
                return 0;
        }
 
                return 0;
        }
 
-       mipdatasize = GET_MIP_DATA_SIZE( columns, rows );
+//     unsigned long mipdatasize = GET_MIP_DATA_SIZE( columns, rows );
 
        palettelength = vfsLoadFile( "gfx/palette.lmp", (void **) &loadedpalette );
        if ( palettelength == 768 ) {
 
        palettelength = vfsLoadFile( "gfx/palette.lmp", (void **) &loadedpalette );
        if ( palettelength == 768 ) {
index b6347ec..6e46956 100644 (file)
@@ -102,7 +102,7 @@ typedef struct {
 
 Image* LoadIDSPBuff( byte *buffer ){
        byte *buf_p;
 
 Image* LoadIDSPBuff( byte *buffer ){
        byte *buf_p;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
 
        int row, column;
        byte *pixbuf;
 
        int row, column;
@@ -159,8 +159,6 @@ Image* LoadIDSPBuff( byte *buffer ){
        // palette = buffer+mipdatasize+2;
        // buf_p = buffer+lpMip->offsets[0];
 
        // palette = buffer+mipdatasize+2;
        // buf_p = buffer+lpMip->offsets[0];
 
-       numPixels = columns * rows;
-
        RGBAImage* image = new RGBAImage( columns, rows );
 
 #ifdef DEBUG
        RGBAImage* image = new RGBAImage( columns, rows );
 
 #ifdef DEBUG
index b4dab4d..066adfc 100644 (file)
@@ -1253,8 +1253,6 @@ inline Matrix4 matrix4_reflection_for_plane45( const Plane3& plane, const Vector
 
        Matrix4 swap = matrix4_swap_axes( first, second );
 
 
        Matrix4 swap = matrix4_swap_axes( first, second );
 
-       Matrix4 tmp = matrix4_reflection_for_plane( plane );
-
        swap.tx() = -static_cast<float>( -2 * plane.a * plane.d );
        swap.ty() = -static_cast<float>( -2 * plane.b * plane.d );
        swap.tz() = -static_cast<float>( -2 * plane.c * plane.d );
        swap.tx() = -static_cast<float>( -2 * plane.a * plane.d );
        swap.ty() = -static_cast<float>( -2 * plane.b * plane.d );
        swap.tz() = -static_cast<float>( -2 * plane.c * plane.d );
index e1f0967..005ab9b 100644 (file)
@@ -322,17 +322,8 @@ void Camera_FreeMove( camera_t& camera, int dx, int dy ){
 }
 
 void Cam_MouseControl( camera_t& camera, int x, int y ){
 }
 
 void Cam_MouseControl( camera_t& camera, int x, int y ){
-       int xl, xh;
-       int yl, yh;
-       float xf, yf;
-
-       xf = (float)( x - camera.width / 2 ) / ( camera.width / 2 );
-       yf = (float)( y - camera.height / 2 ) / ( camera.height / 2 );
-
-       xl = camera.width / 3;
-       xh = xl * 2;
-       yl = camera.height / 3;
-       yh = yl * 2;
+       float xf = (float)( x - camera.width / 2 ) / ( camera.width / 2 );
+       float yf = (float)( y - camera.height / 2 ) / ( camera.height / 2 );
 
        xf *= 1.0f - fabsf( yf );
        if ( xf < 0 ) {
 
        xf *= 1.0f - fabsf( yf );
        if ( xf < 0 ) {
index 9214550..8bc0fc8 100644 (file)
@@ -294,10 +294,7 @@ void SwapBSPFile( void ) {
    =============
  */
 int GetLumpElements( dheader_t  *header, int lump, int size ) {
    =============
  */
 int GetLumpElements( dheader_t  *header, int lump, int size ) {
-       int length, ofs;
-
-       length = header->lumps[lump].filelen;
-       ofs = header->lumps[lump].fileofs;
+       int length = header->lumps[lump].filelen;
 
        if ( length % size ) {
                Error( "LoadBSPFile: odd lump size" );
 
        if ( length % size ) {
                Error( "LoadBSPFile: odd lump size" );
index 6de25fd..54e75e4 100644 (file)
@@ -381,11 +381,9 @@ byte AveragePixels( int count ){
        int pix;
        int bestcolor;
        byte    *pal;
        int pix;
        int bestcolor;
        byte    *pal;
-       int fullbright;
 
        vis = 0;
        r = g = b = 0;
 
        vis = 0;
        r = g = b = 0;
-       fullbright = 0;
        for ( i = 0 ; i < count ; i++ )
        {
                pix = pixdata[i];
        for ( i = 0 ; i < count ; i++ )
        {
                pix = pixdata[i];
index 65fde85..5f4d202 100644 (file)
@@ -559,7 +559,6 @@ static void CopyTrianglesToBaseTriangles( triangle_t *ptri, int numtri, baseTria
 //     float           s_scale, t_scale;
 //     float           scale;
 //     vec3_t          mins, maxs;
 //     float           s_scale, t_scale;
 //     float           scale;
 //     vec3_t          mins, maxs;
-       float       *pbasevert;
 
 /*
     //
 
 /*
     //
@@ -618,8 +617,6 @@ static void CopyTrianglesToBaseTriangles( triangle_t *ptri, int numtri, baseTria
 
                for ( j = 0 ; j < 3 ; j++ )
                {
 
                for ( j = 0 ; j < 3 ; j++ )
                {
-                       pbasevert = ptri->verts[j];
-
                        VectorCopy( ptri->verts[j], bTri->v[j].xyz );
                        VectorCopy( ptri->normals[j], bTri->v[j].normal );
 
                        VectorCopy( ptri->verts[j], bTri->v[j].xyz );
                        VectorCopy( ptri->normals[j], bTri->v[j].normal );
 
@@ -1905,8 +1902,9 @@ static void ConvertASE( const char *filename, int type, qboolean grabAnims ){
                        }
                }
 
                        }
                }
 
-               if ( !tagWeapon ) {
-                       Error( "Missing tag_weapon!" );
+               if ( !tagHead ) {
+                       // todo: was never being checked; should we error now that it is?
+                       // Error( "Missing tag_head!" );
                }
                if ( !tagTorso ) {
                        Error( "Missing tag_torso!" );
                }
                if ( !tagTorso ) {
                        Error( "Missing tag_torso!" );
index 3dcf5f5..c8c6e4f 100644 (file)
@@ -2183,7 +2183,8 @@ int FilterWindingIntoTree_r( winding_t *w, mapDrawSurface_t *ds, node_t *node ){
                        if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) {
                                return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
                        }
                        if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) {
                                return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] );
                        }
-                       #else
+            #else
+                       (void) plane2;
                        /* div0: this is the cholera (doesn't hit enough) */
 
                        /* the drawsurf might have an associated plane, if so, force a filter here */
                        /* div0: this is the cholera (doesn't hit enough) */
 
                        /* the drawsurf might have an associated plane, if so, force a filter here */