From bd3b391bed8ee346345eb1aa230033980ecb6504 Mon Sep 17 00:00:00 2001
From: David Maciejak <david.maciejak@gmail.com>
Date: Wed, 28 May 2014 12:21:22 +0700
Subject: [PATCH] WINGs: fix duplicate if/else branch in W_LookupString

cppcheck is reporting the msg below:

[../WINGs/winputmethod.c:215] -> [../WINGs/winputmethod.c:209]:
(style) Found duplicate branches for 'if' and 'else'.

The patch is fixing it by setting a default return call.
---
 WINGs/winputmethod.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/WINGs/winputmethod.c b/WINGs/winputmethod.c
index 7d3aae0..26bc4a1 100644
--- a/WINGs/winputmethod.c
+++ b/WINGs/winputmethod.c
@@ -199,20 +199,15 @@ void W_SetPreeditPositon(W_View * view, int x, int y)
 	}
 }
 
-int
-W_LookupString(W_View * view, XKeyPressedEvent * event, char *buffer, int buflen, KeySym * keysym, Status * status)
+int W_LookupString(W_View * view, XKeyPressedEvent * event, char *buffer, int buflen, KeySym * keysym, Status * status)
 {
 	WMScreen *scr = W_VIEW_SCREEN(view);
 
 	XSetInputFocus(scr->display, view->window, RevertToParent, CurrentTime);
 
-	if (view->xic) {
 #ifdef X_HAVE_UTF8_STRING
+	if (view->xic)
 		return Xutf8LookupString(view->xic, event, buffer, buflen, keysym, status);
-#else
-		return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
 #endif
-	} else {
-		return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
-	}
+	return XLookupString(event, buffer, buflen, keysym, (XComposeStatus *) status);
 }
-- 
1.8.3.2

