From 7d026177ad6e572fe43bd70cebf7b529c739a5e7 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 25 Aug 2014 14:48:49 +0100 Subject: [PATCH] Fix assorted warnings --- code/botlib/be_aas_reach.c | 4 +- code/botlib/be_aas_route.c | 4 +- code/opus-1.1/silk/float/solve_LS_FLP.c | 2 +- code/opusfile-0.5/src/opusfile.c | 6 +- code/renderercommon/qgl.h | 4 +- code/renderergl2/tr_extensions.c | 4 +- code/renderergl2/tr_image.c | 106 ------------------------ 7 files changed, 12 insertions(+), 118 deletions(-) diff --git a/code/botlib/be_aas_reach.c b/code/botlib/be_aas_reach.c index ed9ff76d..e23083e3 100644 --- a/code/botlib/be_aas_reach.c +++ b/code/botlib/be_aas_reach.c @@ -2108,7 +2108,7 @@ int AAS_Reachability_Jump(int area1num, int area2num) int stopevent, areas[10], numareas; float phys_jumpvel, maxjumpdistance, maxjumpheight, height, bestdist, speed; vec_t *v1, *v2, *v3, *v4; - vec3_t beststart, beststart2, bestend, bestend2; + vec3_t beststart, beststart2 = {0}, bestend, bestend2 = {0}; vec3_t teststart, testend, dir, velocity, cmdmove, up = {0, 0, 1}, sidewards; aas_area_t *area1, *area2; aas_face_t *face1, *face2; @@ -3152,7 +3152,7 @@ aas_lreachability_t *AAS_FindFaceReachabilities(vec3_t *facepoints, int numpoint int facenum, edgenum, bestfacenum; float *v1, *v2, *v3, *v4; float bestdist, speed, hordist, dist; - vec3_t beststart, beststart2, bestend, bestend2, tmp, hordir, testpoint; + vec3_t beststart, beststart2 = {0}, bestend, bestend2 = {0}, tmp, hordir, testpoint; aas_lreachability_t *lreach, *lreachabilities; aas_area_t *area; aas_face_t *face; diff --git a/code/botlib/be_aas_route.c b/code/botlib/be_aas_route.c index d4287a04..bad375d4 100644 --- a/code/botlib/be_aas_route.c +++ b/code/botlib/be_aas_route.c @@ -1770,7 +1770,7 @@ int AAS_AreaRouteToGoalArea(int areanum, vec3_t origin, int goalareanum, int tra //=========================================================================== int AAS_AreaTravelTimeToGoalArea(int areanum, vec3_t origin, int goalareanum, int travelflags) { - int traveltime, reachnum; + int traveltime, reachnum = 0; if (AAS_AreaRouteToGoalArea(areanum, origin, goalareanum, travelflags, &traveltime, &reachnum)) { @@ -1786,7 +1786,7 @@ int AAS_AreaTravelTimeToGoalArea(int areanum, vec3_t origin, int goalareanum, in //=========================================================================== int AAS_AreaReachabilityToGoalArea(int areanum, vec3_t origin, int goalareanum, int travelflags) { - int traveltime, reachnum; + int traveltime, reachnum = 0; if (AAS_AreaRouteToGoalArea(areanum, origin, goalareanum, travelflags, &traveltime, &reachnum)) { diff --git a/code/opus-1.1/silk/float/solve_LS_FLP.c b/code/opus-1.1/silk/float/solve_LS_FLP.c index 7c90d665..b35f0a57 100644 --- a/code/opus-1.1/silk/float/solve_LS_FLP.c +++ b/code/opus-1.1/silk/float/solve_LS_FLP.c @@ -163,7 +163,7 @@ static OPUS_INLINE void silk_LDL_FLP( opus_int i, j, k, loop_count, err = 1; silk_float *ptr1, *ptr2; double temp, diag_min_value; - silk_float v[ MAX_MATRIX_SIZE ], D[ MAX_MATRIX_SIZE ]; /* temp arrays*/ + silk_float v[ MAX_MATRIX_SIZE ] = { 0 }, D[ MAX_MATRIX_SIZE ]; /* temp arrays*/ silk_assert( M <= MAX_MATRIX_SIZE ); diff --git a/code/opusfile-0.5/src/opusfile.c b/code/opusfile-0.5/src/opusfile.c index 392ddb29..aaabdd1c 100644 --- a/code/opusfile-0.5/src/opusfile.c +++ b/code/opusfile-0.5/src/opusfile.c @@ -1715,7 +1715,7 @@ opus_int64 op_raw_total(const OggOpusFile *_of,int _li){ ogg_int64_t op_pcm_total(const OggOpusFile *_of,int _li){ OggOpusLink *links; - ogg_int64_t diff; + ogg_int64_t diff=0; int nlinks; nlinks=_of->nlinks; if(OP_UNLIKELY(_of->ready_state> 1; - outHeight = inHeight >> 1; - temp = ri.Hunk_AllocateTempMemory( outWidth * outHeight * 4 ); - - inWidthMask = inWidth - 1; - inHeightMask = inHeight - 1; - - for ( i = 0 ; i < outHeight ; i++ ) { - for ( j = 0 ; j < outWidth ; j++ ) { - outpix = (byte *) ( temp + i * outWidth + j ); - for ( k = 0 ; k < 4 ; k++ ) { - total = - 1 * (&in[ 4*(((i*2-1)&inHeightMask)*inWidth + ((j*2-1)&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2-1)&inHeightMask)*inWidth + ((j*2 )&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2-1)&inHeightMask)*inWidth + ((j*2+1)&inWidthMask)) ])[k] + - 1 * (&in[ 4*(((i*2-1)&inHeightMask)*inWidth + ((j*2+2)&inWidthMask)) ])[k] + - - 2 * (&in[ 4*(((i*2 )&inHeightMask)*inWidth + ((j*2-1)&inWidthMask)) ])[k] + - 4 * (&in[ 4*(((i*2 )&inHeightMask)*inWidth + ((j*2 )&inWidthMask)) ])[k] + - 4 * (&in[ 4*(((i*2 )&inHeightMask)*inWidth + ((j*2+1)&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2 )&inHeightMask)*inWidth + ((j*2+2)&inWidthMask)) ])[k] + - - 2 * (&in[ 4*(((i*2+1)&inHeightMask)*inWidth + ((j*2-1)&inWidthMask)) ])[k] + - 4 * (&in[ 4*(((i*2+1)&inHeightMask)*inWidth + ((j*2 )&inWidthMask)) ])[k] + - 4 * (&in[ 4*(((i*2+1)&inHeightMask)*inWidth + ((j*2+1)&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2+1)&inHeightMask)*inWidth + ((j*2+2)&inWidthMask)) ])[k] + - - 1 * (&in[ 4*(((i*2+2)&inHeightMask)*inWidth + ((j*2-1)&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2+2)&inHeightMask)*inWidth + ((j*2 )&inWidthMask)) ])[k] + - 2 * (&in[ 4*(((i*2+2)&inHeightMask)*inWidth + ((j*2+1)&inWidthMask)) ])[k] + - 1 * (&in[ 4*(((i*2+2)&inHeightMask)*inWidth + ((j*2+2)&inWidthMask)) ])[k]; - outpix[k] = total / 36; - } - } - } - - Com_Memcpy( in, temp, outWidth * outHeight * 4 ); - ri.Hunk_FreeTempMemory( temp ); -} - - static void R_MipMapsRGB( byte *in, int inWidth, int inHeight) { int i, j, k; @@ -1371,54 +1313,6 @@ static void R_MipMapsRGB( byte *in, int inWidth, int inHeight) ri.Hunk_FreeTempMemory( temp ); } -/* -================ -R_MipMap - -Operates in place, quartering the size of the texture -================ -*/ -static void R_MipMap (byte *in, int width, int height) { - int i, j; - byte *out; - int row; - - if ( !r_simpleMipMaps->integer ) { - R_MipMap2( in, width, height ); - return; - } - - if ( width == 1 && height == 1 ) { - return; - } - - row = width * 4; - out = in; - width >>= 1; - height >>= 1; - - if ( width == 0 || height == 0 ) { - width += height; // get largest - for (i=0 ; i>1; - out[1] = ( in[1] + in[5] )>>1; - out[2] = ( in[2] + in[6] )>>1; - out[3] = ( in[3] + in[7] )>>1; - } - return; - } - - for (i=0 ; i>2; - out[1] = (in[1] + in[5] + in[row+1] + in[row+5])>>2; - out[2] = (in[2] + in[6] + in[row+2] + in[row+6])>>2; - out[3] = (in[3] + in[7] + in[row+3] + in[row+7])>>2; - } - } -} - - static void R_MipMapLuminanceAlpha (const byte *in, byte *out, int width, int height) { int i, j, row;