summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-02-03 19:21:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-02-04 15:24:15 +1000
commitb6fd73d4f79b4731caee4dc72e9f6fcecd2b5161 (patch)
tree192101e9da5ea826cb4dcf328619259ee2c56648
parentbc7db7f1ef57beab2a149ca9589cea08f5e69af2 (diff)
Compress button counting statement
No functional change, just compressing several lines into one. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
-rw-r--r--src/xf86Wacom.c7
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 */