summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-09-15 13:47:09 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-09-15 13:50:56 +1000
commit35b9472a189c88415fed137fb4c62a5081caaea5 (patch)
treecf8f32259550836744aaadd70a2c0de6873da73a
parent486322116d70365c2e2a1d9f45830057fa03153e (diff)
Remove unused fraction calculations
hw.x and the motion history are integers so our deltas are always integers. It's a bit pointless to split them into the fractional and integral part. obsolete since defc1d008e5674306a or so Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c20
-rw-r--r--src/synapticsstr.h1
2 files changed, 0 insertions, 21 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index bdc9605..c7ba9ad 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2198,28 +2198,8 @@ static void
get_delta(SynapticsPrivate *priv, const struct SynapticsHwState *hw,
enum EdgeType edge, double *dx, double *dy)
{
- double integral;
- double tmpf;
-
*dx = hw->x - HIST(0).x;
*dy = hw->y - HIST(0).y;
-
- /* report edge speed as synthetic motion. Of course, it would be
- * cooler to report floats than to buffer, but anyway. */
-
- /* FIXME: When these values go NaN, bad things happen. Root cause is unknown
- * thus far though. */
- if (isnan(priv->frac_x))
- priv->frac_x = 0;
- if (isnan(priv->frac_y))
- priv->frac_y = 0;
-
- tmpf = *dx + priv->frac_x;
- priv->frac_x = modf(tmpf, &integral);
- *dx = integral;
- tmpf = *dy + priv->frac_y;
- priv->frac_y = modf(tmpf, &integral);
- *dy = integral;
}
/* Vector length, but not sqrt'ed, we only need it for comparison */
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 905b78b..33524e5 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -288,7 +288,6 @@ struct _SynapticsPrivateRec {
Bool circ_scroll_on; /* Keeps track of currently active scroll modes */
Bool circ_scroll_vert; /* True: Generate vertical scroll events
False: Generate horizontal events */
- double frac_x, frac_y; /* absolute -> relative fraction */
enum MidButtonEmulation mid_emu_state; /* emulated 3rd button */
int repeatButtons; /* buttons for repeat */
int nextRepeat; /* Time when to trigger next auto repeat event */