| 1 |
Silence compiler warnings about variables being "maybe uninitialized". |
| 2 |
--- Mesa.orig/src/mesa/swrast/s_triangle.c |
| 3 |
+++ Mesa/src/mesa/swrast/s_triangle.c |
| 4 |
@@ -534,7 +534,7 @@ |
| 5 |
#define T_SCALE theight |
| 6 |
|
| 7 |
#define SETUP_CODE \ |
| 8 |
- struct affine_info info; \ |
| 9 |
+ struct affine_info info = {0}; \ |
| 10 |
struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ |
| 11 |
struct gl_texture_object *obj = unit->Current2D; \ |
| 12 |
const GLint b = obj->BaseLevel; \ |
| 13 |
@@ -806,7 +806,7 @@ |
| 14 |
#define INTERP_TEX 1 |
| 15 |
|
| 16 |
#define SETUP_CODE \ |
| 17 |
- struct persp_info info; \ |
| 18 |
+ struct persp_info info = {0}; \ |
| 19 |
const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ |
| 20 |
const struct gl_texture_object *obj = unit->Current2D; \ |
| 21 |
const GLint b = obj->BaseLevel; \ |
| 22 |
--- Mesa.orig/src/mesa/swrast/s_tritemp.h |
| 23 |
+++ Mesa/src/mesa/swrast/s_tritemp.h |
| 24 |
@@ -201,7 +201,7 @@ |
| 25 |
#endif |
| 26 |
GLinterp vMin_fx, vMin_fy, vMid_fx, vMid_fy, vMax_fx, vMax_fy; |
| 27 |
|
| 28 |
- struct sw_span span; |
| 29 |
+ struct sw_span span = {0}; |
| 30 |
|
| 31 |
INIT_SPAN(span, GL_POLYGON, 0, 0, 0); |
| 32 |
|
| 33 |
@@ -741,14 +741,14 @@ |
| 34 |
GLfixed tLeft=0, dtOuter=0, dtInner; |
| 35 |
#endif |
| 36 |
#ifdef INTERP_TEX |
| 37 |
- GLfloat sLeft[MAX_TEXTURE_COORD_UNITS]; |
| 38 |
- GLfloat tLeft[MAX_TEXTURE_COORD_UNITS]; |
| 39 |
- GLfloat uLeft[MAX_TEXTURE_COORD_UNITS]; |
| 40 |
- GLfloat vLeft[MAX_TEXTURE_COORD_UNITS]; |
| 41 |
- GLfloat dsOuter[MAX_TEXTURE_COORD_UNITS], dsInner[MAX_TEXTURE_COORD_UNITS]; |
| 42 |
- GLfloat dtOuter[MAX_TEXTURE_COORD_UNITS], dtInner[MAX_TEXTURE_COORD_UNITS]; |
| 43 |
- GLfloat duOuter[MAX_TEXTURE_COORD_UNITS], duInner[MAX_TEXTURE_COORD_UNITS]; |
| 44 |
- GLfloat dvOuter[MAX_TEXTURE_COORD_UNITS], dvInner[MAX_TEXTURE_COORD_UNITS]; |
| 45 |
+ GLfloat sLeft[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 46 |
+ GLfloat tLeft[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 47 |
+ GLfloat uLeft[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 48 |
+ GLfloat vLeft[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 49 |
+ GLfloat dsOuter[MAX_TEXTURE_COORD_UNITS] = {0}, dsInner[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 50 |
+ GLfloat dtOuter[MAX_TEXTURE_COORD_UNITS] = {0}, dtInner[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 51 |
+ GLfloat duOuter[MAX_TEXTURE_COORD_UNITS] = {0}, duInner[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 52 |
+ GLfloat dvOuter[MAX_TEXTURE_COORD_UNITS] = {0}, dvInner[MAX_TEXTURE_COORD_UNITS] = {0}; |
| 53 |
#endif |
| 54 |
|
| 55 |
for (subTriangle=0; subTriangle<=1; subTriangle++) { |
| 56 |
--- Mesa.orig/src/mesa/swrast_setup/ss_tritmp.h |
| 57 |
+++ Mesa/src/mesa/swrast_setup/ss_tritmp.h |
| 58 |
@@ -30,14 +30,14 @@ |
| 59 |
{ |
| 60 |
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; |
| 61 |
SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; |
| 62 |
- SWvertex *v[3]; |
| 63 |
- GLfloat z[3]; |
| 64 |
+ SWvertex *v[3] = {0};; |
| 65 |
+ GLfloat z[3] = {0};; |
| 66 |
GLfloat offset; |
| 67 |
GLenum mode = GL_FILL; |
| 68 |
GLuint facing = 0; |
| 69 |
- GLchan saved_color[3][4]; |
| 70 |
- GLchan saved_spec[3][4]; |
| 71 |
- GLfloat saved_index[3]; |
| 72 |
+ GLchan saved_color[3][4] = {0}; |
| 73 |
+ GLchan saved_spec[3][4] = {0}; |
| 74 |
+ GLfloat saved_index[3] = {0};; |
| 75 |
|
| 76 |
v[0] = &verts[e0]; |
| 77 |
v[1] = &verts[e1]; |
| 78 |
--- Mesa.orig/src/mesa/swrast_setup/ss_triangle.c |
| 79 |
+++ Mesa/src/mesa/swrast_setup/ss_triangle.c |
| 80 |
@@ -56,9 +56,9 @@ |
| 81 |
SWvertex *v0 = &verts[e0]; |
| 82 |
SWvertex *v1 = &verts[e1]; |
| 83 |
SWvertex *v2 = &verts[e2]; |
| 84 |
- GLchan c[2][4]; |
| 85 |
- GLchan s[2][4]; |
| 86 |
- GLfloat i[2]; |
| 87 |
+ GLchan c[2][4] = {0}; |
| 88 |
+ GLchan s[2][4] = {0}; |
| 89 |
+ GLfloat i[2] = {0}; |
| 90 |
|
| 91 |
/* cull testing */ |
| 92 |
if (ctx->Polygon.CullFlag) { |
| 93 |
@@ -115,9 +115,9 @@ |
| 94 |
SWvertex *v0 = &verts[e0]; |
| 95 |
SWvertex *v1 = &verts[e1]; |
| 96 |
SWvertex *v2 = &verts[e2]; |
| 97 |
- GLchan c[2][4]; |
| 98 |
- GLchan s[2][4]; |
| 99 |
- GLfloat i[2]; |
| 100 |
+ GLchan c[2][4] = {0}; |
| 101 |
+ GLchan s[2][4] = {0}; |
| 102 |
+ GLfloat i[2] = {0}; |
| 103 |
|
| 104 |
/* cull testing */ |
| 105 |
if (ctx->Polygon.CullFlag) { |