No functional change, just compressing several lines into one.

Signed-off-by: Peter Hutterer <[email protected]>
---
This is really just a preparation patch for the fix to bug 4557 that needs
to use the same line.

 src/xf86Wacom.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index d1c149f..b04e06d 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -375,12 +375,7 @@ static int wcmDevInit(DeviceIntPtr pWcm)
 
        /* if more than 3 buttons, offset by the four scroll buttons,
         * otherwise, alloc 7 buttons for scroll wheel. */
-       nbbuttons = (nbbuttons > 3) ? nbbuttons + 4 : 7;
-
-       /* make sure nbbuttons stays in the range */
-       if (nbbuttons > WCM_MAX_BUTTONS)
-               nbbuttons = WCM_MAX_BUTTONS;
-
+       nbbuttons = min(max(nbbuttons + 4, 7), WCM_MAX_BUTTONS);
        nbkeys = nbbuttons;         /* Same number of keys since any button may 
be 
                                     * configured as an either mouse button or 
key */
 
-- 
1.7.7.5

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to