From 9d3391e35085d1477003493f796337e6e22ddf4f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 1 Mar 2016 13:19:08 +0900 Subject: [PATCH] edje entry: fix gcc warnings about possibly uninitialized variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this fixes warnings from gcc specifically: lib/edje/edje_entry.c: In function ‘_edje_entry_imf_cursor_info_set’: lib/edje/edje_entry.c:4104:4: warning: ‘dir’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_bidi_direction_set(en->imf_context, (Ecore_IMF_BiDi_Direction)dir); ^ lib/edje/edje_entry.c:4099:24: note: ‘dir’ was declared here Evas_BiDi_Direction dir; ^ lib/edje/edje_entry.c:4103:4: warning: ‘ch’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:27: note: ‘ch’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cw’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:23: note: ‘cw’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cy’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:19: note: ‘cy’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cx’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:15: note: ‘cx’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c: In function ‘_edje_part_move_cb’: lib/edje/edje_entry.c:4104:4: warning: ‘dir’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_bidi_direction_set(en->imf_context, (Ecore_IMF_BiDi_Direction)dir); ^ lib/edje/edje_entry.c:4099:24: note: ‘dir’ was declared here Evas_BiDi_Direction dir; ^ lib/edje/edje_entry.c:4103:4: warning: ‘ch’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:27: note: ‘ch’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cw’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:23: note: ‘cw’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cy’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:19: note: ‘cy’ was declared here Evas_Coord cx, cy, cw, ch; ^ lib/edje/edje_entry.c:4103:4: warning: ‘cx’ may be used uninitialized in this function [-Wmaybe-uninitialized] ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); ^ lib/edje/edje_entry.c:4098:15: note: ‘cx’ was declared here Evas_Coord cx, cy, cw, ch; ^ and the likes... --- src/lib/edje/edje_entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 34f98a01f3..c724d9d0d0 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -4095,8 +4095,8 @@ static void _edje_entry_imf_cursor_location_set(Entry *en) { #ifdef HAVE_ECORE_IMF - Evas_Coord cx, cy, cw, ch; - Evas_BiDi_Direction dir; + Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; + Evas_BiDi_Direction dir = 0; if (!en || !en->rp || !en->imf_context) return; _edje_entry_cursor_geometry_get(en->rp, &cx, &cy, &cw, &ch, &dir);