diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-08-19 09:28:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-04 08:10:36 +1000 |
commit | 342a38c9c1aa6291d51485de00880359eee95588 (patch) | |
tree | 19a0e968fed45c492eec03f59dcc511f4702b9ec | |
parent | c9527bdcb01f9484b66147d6a4a33b499d54ee99 (diff) |
Remove abysmal misuse of ternary operator.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Christoph Brill <egore911@egore911.de>
-rw-r--r-- | src/synaptics.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index f84f684..c56b0e0 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -1239,10 +1239,14 @@ SynapticsDetectFinger(SynapticsPrivate *priv, struct SynapticsHwState *hw) int finger; /* finger detection thru pressure and threshold */ - finger = ((hw->z > para->finger_press) && priv->finger_state < FS_PRESSED) ? FS_PRESSED - : ((hw->z > para->finger_high) && priv->finger_state < FS_TOUCHED) ? FS_TOUCHED - : ((hw->z < para->finger_low) && priv->finger_state > FS_UNTOUCHED) ? FS_UNTOUCHED - : priv->finger_state; + if (hw->z > para->finger_press && priv->finger_state < FS_PRESSED) + finger = FS_PRESSED; + else if (hw->z > para->finger_high && priv->finger_state < FS_TOUCHED) + finger = FS_TOUCHED; + else if (hw->z < para->finger_low && priv->finger_state > FS_UNTOUCHED) + finger = FS_UNTOUCHED; + else + finger = priv->finger_state; if (!para->palm_detect) return finger; |