diff options
author | Bruno Dilly <bdilly@profusion.mobi> | 2016-09-28 18:23:05 -0300 |
---|---|---|
committer | Bruno Dilly <bdilly@profusion.mobi> | 2016-09-28 18:23:05 -0300 |
commit | eeed0086eda16bdf4974392a80d9243defcc9831 (patch) | |
tree | d91f4ef0e0490ad16599fdbf632e2f4ffa327bf5 | |
parent | 245d69b48081c575f51c3c272d67d7aa4db88cbf (diff) | |
download | efl-devs/bdilly/uninitialized_warning.tar.gz |
elementary: refactor elm_atspi_bridge functiondevs/bdilly/uninitialized_warning
In order to avoid the following build warning:
lib/elementary/elm_atspi_bridge.c: In function
‘_children_changed_signal_send’:
lib/elementary/elm_atspi_bridge.c:3971:4: warning: ‘idx’ may
be used uninitialized in this function [-Wmaybe-uninitialized]
_bridge_signal_send(data, event->object, ATSPI_DBUS_INTERFACE_EVENT_OBJECT
A little refactoring was done to function _children_changed_signal_send.
Actually I wasn't able to see a codepath to use idx unintialized,
but this way is more clear and avoid compiler possible confusion.
-rw-r--r-- | src/lib/elementary/elm_atspi_bridge.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c index 011570ccad..51b259c3dd 100644 --- a/src/lib/elementary/elm_atspi_bridge.c +++ b/src/lib/elementary/elm_atspi_bridge.c @@ -3948,7 +3948,16 @@ _children_changed_signal_send(void *data, const Efl_Event *event) ELM_ATSPI_BRIDGE_DATA_GET_OR_RETURN(data, pd); - type = ev_data->is_added ? ATSPI_OBJECT_CHILD_ADDED : ATSPI_OBJECT_CHILD_REMOVED; + if (ev_data->is_added) + { + type = ATSPI_OBJECT_CHILD_ADDED; + atspi_desc = "add"; + } + else + { + type = ATSPI_OBJECT_CHILD_REMOVED; + atspi_desc = "remove"; + } if (!STATE_TYPE_GET(pd->object_children_broadcast_mask, type)) { @@ -3956,18 +3965,7 @@ _children_changed_signal_send(void *data, const Efl_Event *event) return; } - switch (type) - { - case ATSPI_OBJECT_CHILD_ADDED: - atspi_desc = "add"; - idx = elm_interface_atspi_accessible_index_in_parent_get(ev_data->child); - break; - case ATSPI_OBJECT_CHILD_REMOVED: - atspi_desc = "remove"; - idx = elm_interface_atspi_accessible_index_in_parent_get(ev_data->child); - break; - } - + idx = elm_interface_atspi_accessible_index_in_parent_get(ev_data->child); _bridge_signal_send(data, event->object, ATSPI_DBUS_INTERFACE_EVENT_OBJECT, &_event_obj_signals[ATSPI_OBJECT_EVENT_CHILDREN_CHANGED], atspi_desc, idx, 0, "(so)", eldbus_connection_unique_name_get(pd->a11y_bus), ev_data->child); |