[PATCH 5/5] wined3d: Fix an uninitialised variable warning.

Henri Verbeet hverbeet at gmail.com
Tue May 5 12:28:46 CDT 2020


On Tue, 5 May 2020 at 17:17, Zhiyi Zhang <zzhang at codeweavers.com> wrote:
> @@ -257,7 +257,7 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
>      };
>
>      GLint type, name, samples, width, height, old_texture, level, face, fmt, tex_target;
> -    const char *tex_type_str;
> +    const char *tex_type_str = NULL;
>      unsigned int i;
>
>      gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment,
> @@ -310,8 +310,6 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G
>          }
>          else
>          {
> -            tex_type_str = NULL;
> -
>              for (i = 0; i < ARRAY_SIZE(texture_type); ++i)
>              {
>                  if (!gl_info->supported[texture_type[i].extension])
> --
This is fine, but I have to wonder, are you using an unusual compiler
or compile flags? The code doesn't seem all that complicated, and at
least my version of gcc is able to figure out that the variable is
initialised on all paths.



More information about the wine-devel mailing list