]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
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 aa7f76a05209ab7b0e7136b9f08420a400041d2f..f1c9555a00f3c87fba00196d223fc45d4b672d2b 100644 (file)
@@ -87,12 +87,12 @@ addflags("-Wall")
 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-deprecated-declarations")
-addflags("-Wno-unused-but-set-variable")
 addflags("-Wno-missing-field-initializers")
 
 addflags_c("-Wno-int-conversion")
index db04d53e3c1a96d2a40c065ea073f06f4048d846..c4fefb8e32360a034c26a7cc49fd292e984dace3 100644 (file)
@@ -213,10 +213,10 @@ void instantiate(){
                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;
        }
@@ -227,10 +227,10 @@ void instantiate(){
                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;
        }
@@ -238,8 +238,8 @@ void instantiate(){
                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;
        }
@@ -247,8 +247,8 @@ void instantiate(){
                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;
        }
index 71d2ae1b9c18b250cae0e987d042764a7c1f8d11..c1505e073b15ac1c2b68fbf58a5fd92568dbe11e 100644 (file)
@@ -252,7 +252,7 @@ bool profile_load_buffer( const char * rc_path, const char *name, void *buffer,
                fclose( f );
        }
 
-       return true;
+       return ret;
 }
 
 int profile_load_int( const char *filename, const char *section, const char *key, int default_value ){
index 940b938b65f5f8e39ab743eabcf0f2f0528dacd2..901b4f2c819f6d9373f57de94fe18e5f728e3b50 100644 (file)
@@ -1167,7 +1167,7 @@ void idFixedPosition::parse( const char *( *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 );
@@ -1176,7 +1176,7 @@ void idFixedPosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
@@ -1213,7 +1213,7 @@ void idInterpolatedPosition::parse( const char *( *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 );
@@ -1226,7 +1226,7 @@ void idInterpolatedPosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
@@ -1264,7 +1264,7 @@ void idSplinePosition::parse( const char *( *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 );
                        }
@@ -1272,7 +1272,7 @@ void idSplinePosition::parse( const char *( *text )  ) {
                                Com_UngetToken();
                                idCameraPosition::parseToken( key.c_str(), text );
                        }
-                       token = Com_Parse( text );
+                       Com_Parse( text );
 
                } while ( 1 );
 
index 62fdaedc50f6f5905beb1b22977841568ab7d0bb..2d8554e781e3e80a306f84cfece88463dcad6e97 100644 (file)
@@ -475,6 +475,7 @@ void TestStringClass
        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"
@@ -483,6 +484,7 @@ void TestStringClass
        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
index b11d355bce45c1a42df4f4df3644b1071747c13a..cdfdd8fbaffb4882128595f9fea1e66ea31e3690 100644 (file)
@@ -208,6 +208,7 @@ virtual void exportXML( XMLImporter& importer ){
                xmlFreeParserCtxt( ctxt );
        }
 
+       (void) wellFormed;
        //return wellFormed;
 }
 private:
index dbde66c14193bd5d5933885922ff0125ff8323dc..0e89e92118079f6a530f858a4e811b61d653eebc 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 ) ) );
-       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 );
 }
 };
index 138151a2f62c81de5270f9188ff211d53c59a745..d36bd57a7727fd69489ecdb50b3ccfaf40b9ac5a 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
+               (void) iAlp;
                *oAlp = 255;
 #else
                *oAlp = iAlp;
index 2731e15ad2003a4462331e2b5488ca55c5d0a8b0..732755476a5245bf40084d90b9b44b502c8bd4a4 100644 (file)
@@ -91,7 +91,7 @@ typedef struct
 Image* LoadHLWBuff( byte* buffer ){
        byte *buf_p;
        unsigned long mipdatasize;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
        int row, column;
        byte *palette;
@@ -108,7 +108,6 @@ Image* LoadHLWBuff( byte* buffer ){
 
        columns = lpMip->width;
        rows = lpMip->height;
-       numPixels = columns * rows;
 
        RGBAImage* image = new RGBAImage( columns, rows );
 
index 51dbfd7e916409764e448fc21e1f169bd2873534..a9d5a71bf1ad79d32d7850a0e8addd0a5877a3fa 100644 (file)
@@ -138,7 +138,6 @@ static const byte quakepalette[768] =
 Image* LoadMIPBuff( byte* buffer ){
        byte *buf_p;
        int palettelength;
-       unsigned long mipdatasize;
        int columns, rows, numPixels;
        byte *pixbuf;
        int i;
@@ -158,7 +157,7 @@ Image* LoadMIPBuff( byte* buffer ){
                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 ) {
index b6347ec480f9444f95f84977d56e3aad372c552c..6e469562789fb33d62512d417b957431259c6494 100644 (file)
@@ -102,7 +102,7 @@ typedef struct {
 
 Image* LoadIDSPBuff( byte *buffer ){
        byte *buf_p;
-       int columns, rows, numPixels;
+       int columns, rows;
        byte *pixbuf;
 
        int row, column;
@@ -159,8 +159,6 @@ Image* LoadIDSPBuff( byte *buffer ){
        // palette = buffer+mipdatasize+2;
        // buf_p = buffer+lpMip->offsets[0];
 
-       numPixels = columns * rows;
-
        RGBAImage* image = new RGBAImage( columns, rows );
 
 #ifdef DEBUG
index b4dab4d0ac2d8599a0a75720c5c9e5e8e1d7729b..066adfcd385e58eb70f7a5ab4034d5a8c1d7b404 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 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 );
index e1f09679943503c9c8713911cb84602e4ac573b1..005ab9b8893ce4607cceba0682a3df9de344b067 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 ){
-       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 ) {
index 9214550a8a517452aea9e26c0aaf782850c2ab8a..8bc0fc8d6b2eb0ddddfb1e803bb386cd301e49a2 100644 (file)
@@ -294,10 +294,7 @@ void SwapBSPFile( void ) {
    =============
  */
 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" );
index 6de25fdc9f6f8c06770e2dc1f1c2369fc8025c86..54e75e4f3de759dae23fca597ba41949b1fd4479 100644 (file)
@@ -381,11 +381,9 @@ byte AveragePixels( int count ){
        int pix;
        int bestcolor;
        byte    *pal;
-       int fullbright;
 
        vis = 0;
        r = g = b = 0;
-       fullbright = 0;
        for ( i = 0 ; i < count ; i++ )
        {
                pix = pixdata[i];
index 65fde8580109fbc4e1e5da89aad48f7e095267ee..5f4d20263e0eae1bfa832e99e628f9313f77538e 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       *pbasevert;
 
 /*
     //
@@ -618,8 +617,6 @@ static void CopyTrianglesToBaseTriangles( triangle_t *ptri, int numtri, baseTria
 
                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 );
 
@@ -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!" );
index 3dcf5f55493745ad312d621de8a4ccf1302bfb6d..c8c6e4f433fe2d067615dea3bac49fba8963c341 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 ] );
                        }
-                       #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 */