aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/devices.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-28 12:47:32 +0000
committermarha <marha@users.sourceforge.net>2011-02-28 12:47:32 +0000
commit717b1a4e21b372e1343e33ae9348fbe5c6f8d7ed (patch)
tree1512dddc255b89d5d3ec35bfc541a357184a7d7f /xorg-server/dix/devices.c
parent46ff5affddfec90a099d55945ab2f857a5a75e57 (diff)
parentfeee2b5ceb37101bd1c4162e49805e6ad63e28ae (diff)
downloadvcxsrv-717b1a4e21b372e1343e33ae9348fbe5c6f8d7ed.tar.gz
vcxsrv-717b1a4e21b372e1343e33ae9348fbe5c6f8d7ed.tar.bz2
vcxsrv-717b1a4e21b372e1343e33ae9348fbe5c6f8d7ed.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix/devices.c')
-rw-r--r--xorg-server/dix/devices.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 1bf73b992..1c2cc9807 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -1233,6 +1233,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
{
int i;
ValuatorClassPtr valc;
+ union align_u { ValuatorClassRec valc; double d; } *align;
if (!dev)
return FALSE;
@@ -1245,12 +1246,13 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
numAxes = MAX_VALUATORS;
}
- valc = (ValuatorClassPtr)calloc(1, sizeof(ValuatorClassRec) +
- numAxes * sizeof(AxisInfo) +
- numAxes * sizeof(double));
- if (!valc)
+ align = (union align_u *) calloc(1, sizeof(union align_u) +
+ numAxes * sizeof(double) +
+ numAxes * sizeof(AxisInfo));
+ if (!align)
return FALSE;
+ valc = &align->valc;
valc->sourceid = dev->id;
valc->motion = NULL;
valc->first_motion = 0;
@@ -1259,8 +1261,8 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
valc->numAxes = numAxes;
- valc->axes = (AxisInfoPtr)(valc + 1);
- valc->axisVal = (double *)(valc->axes + numAxes);
+ valc->axisVal = (double *)(align + 1);
+ valc->axes = (AxisInfoPtr)(valc->axisVal + numAxes);
if (mode & OutOfProximity)
InitProximityClassDeviceStruct(dev);