summaryrefslogtreecommitdiff
path: root/src/renderergl1
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-03-26 16:50:03 +0000
committerTim Angus <tim@ngus.net>2013-03-27 11:33:16 +0000
commitecf45acd236aaf1a0d2b00a94a24d8f24fbceae4 (patch)
tree23d703104aa48a4533daed653d5c429f73dccb05 /src/renderergl1
parenta6e5804c1162832fa99d31c88033cbf6f1efd2f0 (diff)
Fix some of the things clang --analyze flagged
Diffstat (limited to 'src/renderergl1')
-rw-r--r--src/renderergl1/tr_backend.c12
-rw-r--r--src/renderergl1/tr_image.c1
-rw-r--r--src/renderergl1/tr_main.c4
-rw-r--r--src/renderergl1/tr_marks.c4
-rw-r--r--src/renderergl1/tr_shader.c2
-rw-r--r--src/renderergl1/tr_world.c2
6 files changed, 10 insertions, 15 deletions
diff --git a/src/renderergl1/tr_backend.c b/src/renderergl1/tr_backend.c
index f00a9257..432050b6 100644
--- a/src/renderergl1/tr_backend.c
+++ b/src/renderergl1/tr_backend.c
@@ -54,7 +54,9 @@ void GL_Bind( image_t *image ) {
}
if ( glState.currenttextures[glState.currenttmu] != texnum ) {
- image->frameUsed = tr.frameCount;
+ if ( image ) {
+ image->frameUsed = tr.frameCount;
+ }
glState.currenttextures[glState.currenttmu] = texnum;
qglBindTexture (GL_TEXTURE_2D, texnum);
}
@@ -216,7 +218,7 @@ void GL_State( unsigned long stateBits )
//
if ( diff & ( GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS ) )
{
- GLenum srcFactor, dstFactor;
+ GLenum srcFactor = GL_ONE, dstFactor = GL_ONE;
if ( stateBits & ( GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS ) )
{
@@ -250,7 +252,6 @@ void GL_State( unsigned long stateBits )
srcFactor = GL_SRC_ALPHA_SATURATE;
break;
default:
- srcFactor = GL_ONE; // to get warning to shut up
ri.Error( ERR_DROP, "GL_State: invalid src blend state bits" );
break;
}
@@ -282,7 +283,6 @@ void GL_State( unsigned long stateBits )
dstFactor = GL_ONE_MINUS_DST_ALPHA;
break;
default:
- dstFactor = GL_ONE; // to get warning to shut up
ri.Error( ERR_DROP, "GL_State: invalid dst blend state bits" );
break;
}
@@ -546,8 +546,8 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) {
// change the tess parameters if needed
// a "entityMergable" shader is a shader that can have surfaces from seperate
// entities merged into a single batch, like smoke and blood puff sprites
- if (shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
- || ( entityNum != oldEntityNum && !shader->entityMergable ) ) {
+ if ( shader != NULL && ( shader != oldShader || fogNum != oldFogNum || dlighted != oldDlighted
+ || ( entityNum != oldEntityNum && !shader->entityMergable ) ) ) {
if (oldShader != NULL) {
RB_EndSurface();
}
diff --git a/src/renderergl1/tr_image.c b/src/renderergl1/tr_image.c
index 082936a7..665038c9 100644
--- a/src/renderergl1/tr_image.c
+++ b/src/renderergl1/tr_image.c
@@ -327,7 +327,6 @@ static void ResampleTexture( unsigned *in, int inwidth, int inheight, unsigned *
for (i=0 ; i<outheight ; i++, out += outwidth) {
inrow = in + inwidth*(int)((i+0.25)*inheight/outheight);
inrow2 = in + inwidth*(int)((i+0.75)*inheight/outheight);
- frac = fracstep >> 1;
for (j=0 ; j<outwidth ; j++) {
pix1 = (byte *)inrow + p1[j];
pix2 = (byte *)inrow + p2[j];
diff --git a/src/renderergl1/tr_main.c b/src/renderergl1/tr_main.c
index 2b6ce52f..c2e32c94 100644
--- a/src/renderergl1/tr_main.c
+++ b/src/renderergl1/tr_main.c
@@ -813,10 +813,6 @@ static qboolean IsMirror( const drawSurf_t *drawSurf, int entityNum )
// translate the original plane
originalPlane.dist = originalPlane.dist + DotProduct( originalPlane.normal, tr.or.origin );
}
- else
- {
- plane = originalPlane;
- }
// locate the portal entity closest to this plane.
// origin will be the origin of the portal, origin2 will be
diff --git a/src/renderergl1/tr_marks.c b/src/renderergl1/tr_marks.c
index f85a1244..05afb16c 100644
--- a/src/renderergl1/tr_marks.c
+++ b/src/renderergl1/tr_marks.c
@@ -42,8 +42,8 @@ Out must have space for two more vertexes than in
static void R_ChopPolyBehindPlane( int numInPoints, vec3_t inPoints[MAX_VERTS_ON_POLY],
int *numOutPoints, vec3_t outPoints[MAX_VERTS_ON_POLY],
vec3_t normal, vec_t dist, vec_t epsilon) {
- float dists[MAX_VERTS_ON_POLY+4];
- int sides[MAX_VERTS_ON_POLY+4];
+ float dists[MAX_VERTS_ON_POLY+4] = { 0 };
+ int sides[MAX_VERTS_ON_POLY+4] = { 0 };
int counts[3];
float dot;
int i, j;
diff --git a/src/renderergl1/tr_shader.c b/src/renderergl1/tr_shader.c
index c6d91a0c..f6f5c80d 100644
--- a/src/renderergl1/tr_shader.c
+++ b/src/renderergl1/tr_shader.c
@@ -1591,7 +1591,7 @@ static qboolean ParseShader( char **text )
// light <value> determines flaring in q3map, not needed here
else if ( !Q_stricmp(token, "light") )
{
- token = COM_ParseExt( text, qfalse );
+ (void)COM_ParseExt( text, qfalse );
continue;
}
// cull <face>
diff --git a/src/renderergl1/tr_world.c b/src/renderergl1/tr_world.c
index 2a5c750c..d7f67ebc 100644
--- a/src/renderergl1/tr_world.c
+++ b/src/renderergl1/tr_world.c
@@ -531,7 +531,7 @@ R_ClusterPVS
==============
*/
static const byte *R_ClusterPVS (int cluster) {
- if (!tr.world || !tr.world->vis || cluster < 0 || cluster >= tr.world->numClusters ) {
+ if (!tr.world->vis || cluster < 0 || cluster >= tr.world->numClusters ) {
return tr.world->novis;
}