xkb: fix use of uninitialized variable.

And some cosmetic changes to use stuff->change consistently.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
This commit is contained in:
Kim Woelders 2008-09-22 08:37:29 +09:30 committed by Peter Hutterer
parent 2b266eda6e
commit 8c46505d7d

View File

@ -6423,13 +6423,10 @@ static int
_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, _XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev,
xkbSetDeviceInfoReq *stuff) xkbSetDeviceInfoReq *stuff)
{ {
unsigned change;
char *wire; char *wire;
change = stuff->change;
wire= (char *)&stuff[1]; wire= (char *)&stuff[1];
if (change&XkbXI_ButtonActionsMask) { if (stuff->change&XkbXI_ButtonActionsMask) {
if (!dev->button) { if (!dev->button) {
client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass); client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass);
return XkbKeyboardErrorCode; return XkbKeyboardErrorCode;
@ -6458,14 +6455,13 @@ static int
_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev,
xkbSetDeviceInfoReq *stuff) xkbSetDeviceInfoReq *stuff)
{ {
unsigned change;
char *wire; char *wire;
xkbExtensionDeviceNotify ed; xkbExtensionDeviceNotify ed;
bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify)); bzero((char *)&ed,SIZEOF(xkbExtensionDeviceNotify));
ed.deviceID= dev->id; ed.deviceID= dev->id;
wire= (char *)&stuff[1]; wire= (char *)&stuff[1];
if (change&XkbXI_ButtonActionsMask) { if (stuff->change&XkbXI_ButtonActionsMask) {
int nBtns,sz,i; int nBtns,sz,i;
XkbAction * acts; XkbAction * acts;
DeviceIntPtr kbd; DeviceIntPtr kbd;
@ -6495,8 +6491,8 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev,
} }
if (stuff->change&XkbXI_IndicatorsMask) { if (stuff->change&XkbXI_IndicatorsMask) {
int status= Success; int status= Success;
wire= SetDeviceIndicators(wire,dev,change,stuff->nDeviceLedFBs, wire= SetDeviceIndicators(wire,dev,stuff->change,
&status,client,&ed); stuff->nDeviceLedFBs, &status,client,&ed);
if (status!=Success) if (status!=Success)
return status; return status;
} }
@ -6508,7 +6504,6 @@ _XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev,
int int
ProcXkbSetDeviceInfo(ClientPtr client) ProcXkbSetDeviceInfo(ClientPtr client)
{ {
unsigned int change;
DeviceIntPtr dev; DeviceIntPtr dev;
int rc; int rc;
@ -6518,10 +6513,8 @@ ProcXkbSetDeviceInfo(ClientPtr client)
if (!(client->xkbClientFlags&_XkbClientInitialized)) if (!(client->xkbClientFlags&_XkbClientInitialized))
return BadAccess; return BadAccess;
change = stuff->change;
CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess);
CHK_MASK_LEGAL(0x01,change,XkbXI_AllFeaturesMask); CHK_MASK_LEGAL(0x01,stuff->change,XkbXI_AllFeaturesMask);
rc = _XkbSetDeviceInfoCheck(client, dev, stuff); rc = _XkbSetDeviceInfoCheck(client, dev, stuff);