On Sun, Sep 25, 2011 at 08:44:26PM +0200, Max Schwarz wrote: > (1UL << 32) evaluates to 0 (at least here), so do the > fraction calculation in two steps as in libXi. Fractions on xXIRawEvent > were not multiplied at all, which also gave 0 as result. > > Signed-off-by: Max Schwarz <[email protected]> > --- > Hi, > > I noticed a problem (see patch) with Daniel Stone's patch > [PATCH 22/28] Input: Make DeviceEvent use doubles internally > from june. > I'm CCing Peter as well, as I noticed the problem on his next-all > branch. The patch is based on there. > > Best regards, > Max > > dix/eventconvert.c | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/dix/eventconvert.c b/dix/eventconvert.c > index 9cc177e..9eb0771 100644 > --- a/dix/eventconvert.c > +++ b/dix/eventconvert.c > @@ -635,7 +635,7 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) > SetBit(ptr, i); > axisval->integral = trunc(ev->valuators.data[i]); > axisval->frac = (ev->valuators.data[i] - axisval->integral) * > - (1UL << 32); > + (1 << 16) * (1 << 16); > axisval++; > } > } > @@ -679,10 +679,12 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) > { > SetBit(ptr, i); > axisval->integral = trunc(ev->valuators.data[i]); > - axisval->frac = ev->valuators.data[i] - axisval->integral; > + axisval->frac = (ev->valuators.data[i] - axisval->integral) * > + (1 << 16) * (1 << 16); > axisval_raw->integral = trunc(ev->valuators.data_raw[i]); > - axisval_raw->frac = ev->valuators.data_raw[i] - > - axisval_raw->integral; > + axisval_raw->frac = > + (ev->valuators.data_raw[i] - axisval_raw->integral) * > + (1 << 16) * (1 << 16); > axisval++; > axisval_raw++; > } > -- > 1.7.4.1
merged, thank you Cheers, Peter _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
