summaryrefslogtreecommitdiff
path: root/package/input-tools/input-tools-20051019-rint.patch
diff options
context:
space:
mode:
authorMartin Banky <martin.banky@gmail.com>2010-12-12 22:53:47 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2010-12-13 22:57:01 +0100
commitfbda1203878e597fdfc7382664eaa80416d116d2 (patch)
treee88f196a5533018b5bac3a8dac7c12fc6eec10c3 /package/input-tools/input-tools-20051019-rint.patch
parent600d1f8af316c3a3ba3bbf4175e25a91be27e7a3 (diff)
input-tools: convert to gentargets
Signed-off-by: Martin Banky <Martin.Banky@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/input-tools/input-tools-20051019-rint.patch')
-rw-r--r--package/input-tools/input-tools-20051019-rint.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/package/input-tools/input-tools-20051019-rint.patch b/package/input-tools/input-tools-20051019-rint.patch
new file mode 100644
index 000000000..b2aa13f76
--- /dev/null
+++ b/package/input-tools/input-tools-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;
+ }