From 5ca7344436d299618b135d11fda080b76a38da05 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 19 Dec 2016 19:17:23 +0100 Subject: [PATCH] Get rid of more implicit memsets --- gfx/common/x11_common.c | 2 +- gfx/video_shader_parse.c | 25 ++++++++++++++----------- gfx/video_thread_wrapper.c | 18 ++++++++++++++++-- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index b713929203..fd3ccdf0fc 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -269,7 +269,7 @@ void x11_move_window(Display *dpy, Window win, int x, int y, static void x11_set_window_class(Display *dpy, Window win) { - XClassHint hint = {0}; + XClassHint hint; hint.res_name = (char*)"retroarch"; /* Broken header. */ hint.res_class = (char*)"retroarch"; diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index e699776c42..07ca73f24c 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -123,22 +123,25 @@ static bool video_shader_parse_pass(config_file_t *conf, char wrap_mode[64]; char frame_count_mod_buf[64]; char srgb_output_buf[64]; - char fp_fbo_buf[64] = {0}; - char mipmap_buf[64] = {0}; - char alias_buf[64] = {0}; - char scale_name_buf[64] = {0}; - char attr_name_buf[64] = {0}; - char scale_type[64] = {0}; - char scale_type_x[64] = {0}; - char scale_type_y[64] = {0}; - char frame_count_mod[64] = {0}; + char fp_fbo_buf[64]; + char mipmap_buf[64]; + char alias_buf[64]; + char scale_name_buf[64]; + char attr_name_buf[64]; + char scale_type[64]; + char scale_type_x[64]; + char scale_type_y[64]; + char frame_count_mod[64]; struct gfx_fbo_scale *scale = NULL; bool tmp_bool = false; float fattr = 0.0f; int iattr = 0; - tmp_str[0] = shader_name[0] = filter_name_buf[0] = - wrap_name_buf[0] = wrap_mode[0] = frame_count_mod_buf[0] = '\0'; + fp_fbo_buf[0] = mipmap_buf[0] = alias_buf[0] = + scale_name_buf[0] = attr_name_buf[0] = scale_type[0] = + scale_type_x[0] = scale_type_y[0] = frame_count_mod[0] = + tmp_str[0] = shader_name[0] = filter_name_buf[0] = + wrap_name_buf[0] = wrap_mode[0] = frame_count_mod_buf[0] = '\0'; srgb_output_buf[0] = '\0'; /* Source */ diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 7ea5ff254f..cad24dd3cd 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -365,7 +365,14 @@ static bool video_thread_handle_packet( case CMD_READ_VIEWPORT: { - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; thr->driver->viewport_info(thr->driver_data, &vp); @@ -587,11 +594,18 @@ static void video_thread_loop(void *data) if (updated) { + struct video_viewport vp; bool ret = false; bool alive = false; bool focus = false; bool has_windowed = true; - struct video_viewport vp = {0}; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; slock_lock(thr->frame.lock);