summaryrefslogtreecommitdiff
path: root/package/input-tools
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2009-01-18 10:53:06 +0000
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2009-01-18 10:53:06 +0000
commitebca742682a33f59b4a84154fd948835d01dae18 (patch)
tree860293ee6842c783a2e547fceb17713c0180085a /package/input-tools
parent6da70de5034ae3933c6d072378a8860078686200 (diff)
Change use of rint, which is only supported for X86 in uClibc to generic rounding
Diffstat (limited to 'package/input-tools')
-rw-r--r--package/input-tools/joystick-20051019-rint.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/package/input-tools/joystick-20051019-rint.patch b/package/input-tools/joystick-20051019-rint.patch
new file mode 100644
index 000000000..b2aa13f76
--- /dev/null
+++ b/package/input-tools/joystick-20051019-rint.patch
@@ -0,0 +1,18 @@
+diff -urN joystick-20051019.orig/utils/jscal.c joystick-20051019/utils/jscal.c
+--- joystick-20051019.orig/utils/jscal.c 2004-10-19 09:51:52.000000000 +0200
++++ joystick-20051019/utils/jscal.c 2009-01-18 10:48:50.000000000 +0100
+@@ -141,10 +141,10 @@
+ c = 32767.0 / (inputs.cmin[1] - inputs.cmax[0]);
+ d = 32767.0 / (inputs.cmin[2] - inputs.cmax[1]);
+
+- results[0] = rint(a);
+- results[1] = rint(b);
+- results[2] = rint(c*16384.0);
+- results[3] = rint(d*16384.0);
++ results[0] = (int) (a + 0.5);
++ results[1] = (int) (b + 0.5);
++ results[2] = (int) (c*16384.0 + 0.5);
++ results[3] = (int) (d*16384.0 + 0.5);
+
+ return 1;
+ }