X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Finput-tools%2F0001-rint.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Finput-tools%2F0001-rint.patch;h=b2aa13f760bf4009d4fde3612c9121038e4e9477;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/input-tools/0001-rint.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/input-tools/0001-rint.patch new file mode 100644 index 0000000..b2aa13f --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/input-tools/0001-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; + }