Skip to content

Commit

Permalink
set some possibly uninitialised vars to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangray committed May 2, 2013
1 parent 89e2c9f commit 6bc56bd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CODE-mp/botlib/be_aas_reach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,8 @@ int AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(int area1num, int area2
float length, ground_bestlength, water_bestlength, ground_bestdist, water_bestdist;
vec3_t v1, v2, v3, v4, tmpv, p1area1, p1area2, p2area1, p2area2;
vec3_t normal, ort, edgevec, start, end, dir;
vec3_t ground_beststart, ground_bestend, ground_bestnormal;
vec3_t water_beststart, water_bestend, water_bestnormal;
vec3_t ground_beststart = {0, 0, 0}, ground_bestend = {0, 0, 0}, ground_bestnormal = {0, 0, 0};
vec3_t water_beststart = {0, 0, 0}, water_bestend = {0, 0, 0}, water_bestnormal = {0, 0, 0};
vec3_t invgravity = {0, 0, 1};
vec3_t testpoint;
aas_plane_t *plane;
Expand Down Expand Up @@ -2368,7 +2368,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num)
float face1area, face2area, bestface1area, bestface2area;
float phys_jumpvel, maxjumpheight;
vec3_t area1point, area2point, v1, v2, up = {0, 0, 1};
vec3_t mid, lowestpoint, start, end, sharededgevec, dir;
vec3_t mid, lowestpoint = {0, 0}, start, end, sharededgevec, dir;
aas_area_t *area1, *area2;
aas_face_t *face1, *face2, *ladderface1, *ladderface2;
aas_plane_t *plane1, *plane2;
Expand Down
10 changes: 10 additions & 0 deletions CODE-mp/qcommon/RoffSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,11 @@ qboolean CROFFSystem::ApplyROFF( SROFFEntity *roff_ent, CROFFSystem::CROFF *roff
origin = originTemp;
VM_Call( cgvm, CG_GET_ANGLES, roff_ent->mEntID, angleTemp );
angle = angleTemp;
#else
originTrajectory = NULL;
angleTrajectory = NULL;
origin = NULL;
angle = NULL;
#endif
}
else
Expand Down Expand Up @@ -952,6 +957,11 @@ qboolean CROFFSystem::ClearLerp( SROFFEntity *roff_ent )
origin = originTemp;
VM_Call( cgvm, CG_GET_ANGLES, roff_ent->mEntID, angleTemp );
angle = angleTemp;
#else
originTrajectory = NULL;
angleTrajectory = NULL;
origin = NULL;
angle = NULL;
#endif
}
else
Expand Down
2 changes: 1 addition & 1 deletion CODE-mp/qcommon/cm_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
float offset, enterFrac, leaveFrac, t;
patchPlane_t *planes;
facet_t *facet;
float plane[4], bestplane[4];
float plane[4], bestplane[4] = {0, 0, 0, 0};
vec3_t startp, endp;
#ifndef BSPC
static cvar_t *cv;
Expand Down
2 changes: 1 addition & 1 deletion CODE-mp/renderer/tr_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void R_LoadLightmaps( lump_t *l, const char *psMapName ) {
float g = buf_p[j*3+1];
float b = buf_p[j*3+2];
float intensity;
float out[3];
float out[3] = {0, 0, 0};

intensity = 0.33f * r + 0.685f * g + 0.063f * b;

Expand Down
2 changes: 2 additions & 0 deletions CODE-mp/renderer/tr_shade_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,8 @@ void RB_CalcFogTexCoords( float *st ) {
eyeT = DotProduct( backEnd.ori.viewOrigin, fogDepthVector ) + fogDepthVector[3];
} else {
eyeT = 1; // non-surface fog always has eye inside
fogDepthVector[0] = fogDepthVector[1] = fogDepthVector[2] = 0.0f;
fogDepthVector[3] = 1.0f;
}

// see if the viewpoint is outside
Expand Down

0 comments on commit 6bc56bd

Please sign in to comment.