diff options
author | marha <marha@users.sourceforge.net> | 2011-10-05 17:44:57 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-10-05 17:44:57 +0200 |
commit | 8af87a5b60e37ae84fdd759e2c1602be38be4905 (patch) | |
tree | 2e621c7fbdc4dfe9eb8d733af4cc232bc03643d4 /xorg-server/dix/inpututils.c | |
parent | 8238de0fe0c28bd54b3e6cdd1fc94513cf21d3cc (diff) | |
parent | f7025b4baa1ba35ee796785641f04eac5bedb0a6 (diff) | |
download | vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.gz vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.tar.bz2 vcxsrv-8af87a5b60e37ae84fdd759e2c1602be38be4905.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/glapi.h
mesalib/src/mesa/main/syncobj.h
xorg-server/dix/events.c
xorg-server/dix/getevents.c
xorg-server/include/misc.h
Diffstat (limited to 'xorg-server/dix/inpututils.c')
-rw-r--r-- | xorg-server/dix/inpututils.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c index 7aeb1e516..0a3d3d8b4 100644 --- a/xorg-server/dix/inpututils.c +++ b/xorg-server/dix/inpututils.c @@ -497,10 +497,10 @@ valuator_mask_isset(const ValuatorMask *mask, int valuator) } /** - * Set the valuator to the given data. + * Set the valuator to the given floating-point data. */ void -valuator_mask_set(ValuatorMask *mask, int valuator, int data) +valuator_mask_set_double(ValuatorMask *mask, int valuator, double data) { mask->last_bit = max(valuator, mask->last_bit); SetBit(mask->mask, valuator); @@ -508,13 +508,33 @@ valuator_mask_set(ValuatorMask *mask, int valuator, int data) } /** - * Return the requested valuator value. If the mask bit is not set for the - * given valuator, the returned value is undefined. + * Set the valuator to the given integer data. + */ +void +valuator_mask_set(ValuatorMask *mask, int valuator, int data) +{ + valuator_mask_set_double(mask, valuator, data); +} + +/** + * Return the requested valuator value as a double. If the mask bit is not + * set for the given valuator, the returned value is undefined. + */ +double +valuator_mask_get_double(const ValuatorMask *mask, int valuator) +{ + return mask->valuators[valuator]; +} + +/** + * Return the requested valuator value as an integer, rounding towards zero. + * If the mask bit is not set for the given valuator, the returned value is + * undefined. */ int valuator_mask_get(const ValuatorMask *mask, int valuator) { - return mask->valuators[valuator]; + return trunc(valuator_mask_get_double(mask, valuator)); } /** @@ -527,7 +547,7 @@ valuator_mask_unset(ValuatorMask *mask, int valuator) int i, lastbit = -1; ClearBit(mask->mask, valuator); - mask->valuators[valuator] = 0; + mask->valuators[valuator] = 0.0; for (i = 0; i <= mask->last_bit; i++) if (valuator_mask_isset(mask, i)) |