diff options
author | Chris Michael <cp.michael@samsung.com> | 2015-06-18 10:20:07 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2015-06-18 10:20:07 -0400 |
commit | b35e10760323b3cc933892a1e593d6a50af2f1d4 (patch) | |
tree | fcbcd15b0d1dece097892d375a33368e8679ff55 /src/lib/ecore_input_evas/ecore_input_evas.c | |
parent | 4e6b06dfd75f5a711d9eb61d6432bbaa220c1bfe (diff) |
ecore-input-evas: Fix Coverity CID1306803 (logically dead code)
Summary: This cleans up the _ecore_event_evas_mouse_button function.
Coverity was reporting that the state tests in the 'if' function could
not be be reached due to eel variable being null. This moves the if
(!eel) check to run before the state tests.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_input_evas/ecore_input_evas.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/ecore_input_evas/ecore_input_evas.c b/src/lib/ecore_input_evas/ecore_input_evas.c index 938217c94b..b9b3082518 100644 --- a/src/lib/ecore_input_evas/ecore_input_evas.c +++ b/src/lib/ecore_input_evas/ecore_input_evas.c | |||
@@ -459,14 +459,17 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr | |||
459 | { | 459 | { |
460 | //ECORE_UP or ECORE_CANCEL | 460 | //ECORE_UP or ECORE_CANCEL |
461 | eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, EINA_FALSE); | 461 | eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, EINA_FALSE); |
462 | if (!eel) | ||
463 | { | ||
464 | WRN("ButtonEvent has no history."); | ||
465 | return ECORE_CALLBACK_PASS_ON; | ||
466 | } | ||
462 | 467 | ||
463 | if ((!eel) || (eel->state == ECORE_INPUT_UP) || (eel->state == ECORE_INPUT_CANCEL)) | 468 | if ((eel->state == ECORE_INPUT_UP) || |
469 | (eel->state == ECORE_INPUT_CANCEL)) | ||
464 | { | 470 | { |
465 | if (!eel) | 471 | WRN("ButtonEvent has wrong history. Last state=%d", eel->state); |
466 | WRN("ButtonEvent has no history."); | 472 | return ECORE_CALLBACK_PASS_ON; |
467 | else | ||
468 | WRN("ButtonEvent has wrong history. Last state=%d", eel->state); | ||
469 | return ECORE_CALLBACK_PASS_ON; | ||
470 | } | 473 | } |
471 | } | 474 | } |
472 | 475 | ||