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>
This commit is contained in:
Chris Michael 2015-06-18 10:20:07 -04:00
parent 4e6b06dfd7
commit b35e107603
1 changed files with 10 additions and 7 deletions

View File

@ -459,14 +459,17 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
{
//ECORE_UP or ECORE_CANCEL
eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, EINA_FALSE);
if ((!eel) || (eel->state == ECORE_INPUT_UP) || (eel->state == ECORE_INPUT_CANCEL))
if (!eel)
{
if (!eel)
WRN("ButtonEvent has no history.");
else
WRN("ButtonEvent has wrong history. Last state=%d", eel->state);
return ECORE_CALLBACK_PASS_ON;
WRN("ButtonEvent has no history.");
return ECORE_CALLBACK_PASS_ON;
}
if ((eel->state == ECORE_INPUT_UP) ||
(eel->state == ECORE_INPUT_CANCEL))
{
WRN("ButtonEvent has wrong history. Last state=%d", eel->state);
return ECORE_CALLBACK_PASS_ON;
}
}