mesa: fix issues causing warnings on Windows
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 25 Jul 2008 14:34:54 +0000 (08:34 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 25 Jul 2008 14:34:54 +0000 (08:34 -0600)
src/mesa/main/texstore.c
src/mesa/shader/shader_api.c

index a0ea245..97fdfd3 100644 (file)
@@ -380,12 +380,14 @@ make_temp_float_image(GLcontext *ctx, GLuint dims,
             dst += srcWidth * 4;
          }
 
+         /* size after optional convolution */
+         convWidth = srcWidth;
+         convHeight = srcHeight;
+
 #if FEATURE_convolve
          /* do convolution */
          {
             GLfloat *src = tempImage + img * (srcWidth * srcHeight * 4);
-            convWidth = srcWidth;
-            convHeight = srcHeight;
             if (dims == 1) {
                ASSERT(ctx->Pixel.Convolution1DEnabled);
                _mesa_convolve_1d_image(ctx, &convWidth, src, convImage);
@@ -408,11 +410,6 @@ make_temp_float_image(GLcontext *ctx, GLuint dims,
             const GLint logComponents
                = _mesa_components_in_format(logicalBaseFormat);
             const GLfloat *src = convImage;
-
-            /* XXX: Both `convWidth' and `convHeight' are uninitialised -- windows compiler
-             *      will issue warnings for the following line.
-             *      Presumably this happens when `FEATURE_convolve' is defined to `0'.
-             */
             GLfloat *dst = tempImage + img * (convWidth * convHeight * 4);
             for (row = 0; row < convHeight; row++) {
                _mesa_pack_rgba_span_float(ctx, convWidth,
index 6423c41..5c18e55 100644 (file)
@@ -509,7 +509,7 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
    struct gl_shader_program *shProg;
    const GLint size = -1; /* unknown size */
    GLint i, oldIndex;
-   GLenum datatype;
+   GLenum datatype = GL_FLOAT_VEC4;
 
    shProg = _mesa_lookup_shader_program_err(ctx, program,
                                             "glBindAttribLocation");
@@ -539,14 +539,11 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
       oldIndex = -1;
    }
 
-   /* XXX: `datatype' is uninitialised at this point -- windows compiler
-    *      will issue a warning for the following line.
-    */
-
    /* this will replace the current value if it's already in the list */
    i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
    if (i < 0) {
       _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
+      return;
    }
 
    if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) {