devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b35e10760323b3cc933892a1e593d6a50af2f1d4

commit b35e10760323b3cc933892a1e593d6a50af2f1d4
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Jun 18 10:20:07 2015 -0400

    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.mich...@samsung.com>
---
 src/lib/ecore_input_evas/ecore_input_evas.c | 15 +++++++++------
 1 file 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 938217c..b9b3082 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
      {
         //ECORE_UP or ECORE_CANCEL
         eel = _ecore_event_evas_lookup(e->multi.device, e->buttons, 
EINA_FALSE);
+        if (!eel)
+          {
+             WRN("ButtonEvent has no history.");
+             return ECORE_CALLBACK_PASS_ON;
+          }
 
-        if ((!eel) || (eel->state == ECORE_INPUT_UP) || (eel->state == 
ECORE_INPUT_CANCEL))
+        if ((eel->state == ECORE_INPUT_UP) ||
+            (eel->state == ECORE_INPUT_CANCEL))
           {
-            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 wrong history. Last state=%d", eel->state);
+             return ECORE_CALLBACK_PASS_ON;
           }
      }
 

-- 


Reply via email to