From: Alex Henrie Subject: [PATCH] wined3d: Avoid double initialization. Message-Id: <1447397153-28301-2-git-send-email-alexhenrie24@gmail.com> Date: Thu, 12 Nov 2015 23:45:53 -0700 In-Reply-To: <1447397153-28301-1-git-send-email-alexhenrie24@gmail.com> References: <1447397153-28301-1-git-send-email-alexhenrie24@gmail.com> Cc: Henri Verbeet Signed-off-by: Alex Henrie --- dlls/wined3d/arb_program_shader.c | 4 ++-- dlls/wined3d/buffer.c | 4 ++-- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/glsl_shader.c | 10 ++++------ dlls/wined3d/state.c | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index dfebc81..68f4614 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5417,8 +5417,8 @@ static void get_loop_control_const(const struct wined3d_shader_instruction *ins, static void record_instruction(struct list *list, const struct wined3d_shader_instruction *ins) { unsigned int i; - struct wined3d_shader_dst_param *dst_param = NULL; - struct wined3d_shader_src_param *src_param = NULL, *rel_addr = NULL; + struct wined3d_shader_dst_param *dst_param; + struct wined3d_shader_src_param *src_param = NULL, *rel_addr; struct recorded_instruction *rec = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*rec)); if(!rec) { diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index ba4ed5d..d20931b 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -650,7 +650,7 @@ drop_query: static void buffer_direct_upload(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info, DWORD flags) { BYTE *map; - UINT start = 0, len = 0; + UINT start, len; /* This potentially invalidates the element array buffer binding, but the * caller always takes care of this. */ @@ -722,7 +722,7 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte { DWORD flags = buffer->flags & (WINED3D_BUFFER_SYNC | WINED3D_BUFFER_DISCARD); struct wined3d_device *device = buffer->resource.device; - UINT start = 0, end = 0, len = 0, vertices; + UINT start, end, len, vertices; const struct wined3d_gl_info *gl_info; BOOL decl_changed = FALSE; unsigned int i, j; diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 3761830..ff62850 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -99,7 +99,7 @@ static void drawStridedSlow(const struct wined3d_device *device, struct wined3d_ const struct wined3d_stream_info *si, UINT NumVertexes, GLenum glPrimType, const void *idxData, UINT idxSize, UINT startIdx) { - unsigned int textureNo = 0; + unsigned int textureNo; const WORD *pIdxBufS = NULL; const DWORD *pIdxBufL = NULL; UINT vx_index; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 44e7090..05795fd 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1284,7 +1284,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context const struct wined3d_gl_info *gl_info = context->gl_info; struct shader_glsl_priv *priv = shader_priv; float position_fixup[4]; - DWORD update_mask = 0; + DWORD update_mask; struct glsl_shader_prog_link *prog = ctx_data->glsl_program; UINT constant_version; @@ -2067,8 +2067,6 @@ static const char * const shift_glsl_tab[] = { static void shader_glsl_gen_modifier(enum wined3d_shader_src_modifier src_modifier, const char *in_reg, const char *in_regswizzle, char *out_str) { - out_str[0] = 0; - switch (src_modifier) { case WINED3DSPSM_DZ: /* Need to handle this in the instructions itself (texld & texcrd). */ @@ -3109,7 +3107,7 @@ static void shader_glsl_dot(const struct wined3d_shader_instruction *ins) struct glsl_src_param src0_param; struct glsl_src_param src1_param; DWORD dst_write_mask, src_write_mask; - unsigned int dst_size = 0; + unsigned int dst_size; dst_write_mask = shader_glsl_append_dst(buffer, ins); dst_size = shader_glsl_get_write_mask_size(dst_write_mask); @@ -4962,7 +4960,7 @@ static GLuint generate_param_reorder_function(struct shader_glsl_priv *priv, BOOL per_vertex_point_size, const struct wined3d_gl_info *gl_info) { struct wined3d_string_buffer *buffer = &priv->shader_buffer; - GLuint ret = 0; + GLuint ret; DWORD ps_major = ps ? ps->reg_maps.shader_version.major : 0; unsigned int i; const char *semantic_name; @@ -6887,7 +6885,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const struct wined3d_shader *vshader = NULL; struct wined3d_shader *gshader = NULL; struct wined3d_shader *pshader = NULL; - GLuint program_id = 0; + GLuint program_id; GLuint reorder_shader_id = 0; unsigned int i; GLuint vs_id = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 2be3cab..1aefa60 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3198,7 +3198,7 @@ static void load_tex_coords(const struct wined3d_context *context, const struct { const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int mapped_stage = 0; - unsigned int textureNo = 0; + unsigned int textureNo; for (textureNo = 0; textureNo < context->d3d_info->limits.ffp_blend_stages; ++textureNo) { -- 2.6.2