From 0d4051e3c7f9292d4294c975c2cc61c4c83c7cb2 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 6 Aug 2024 17:02:20 +0200 Subject: [PATCH] (submit/fixup-req-len) Xi: drop swapping request length fields The request struct's length fields aren't used anymore - we have the client->req_len field instead, which also is bigreq-compatible. Signed-off-by: Enrico Weigelt, metux IT consult --- Xi/allowev.c | 1 - Xi/chgdctl.c | 1 - Xi/chgfctl.c | 1 - Xi/chgkbd.c | 3 --- Xi/chgkmap.c | 1 - Xi/chgprop.c | 1 - Xi/chgptr.c | 3 --- Xi/closedev.c | 3 --- Xi/devbell.c | 2 -- Xi/getbmap.c | 2 -- Xi/getdctl.c | 1 - Xi/getfctl.c | 2 -- Xi/getfocus.c | 2 -- Xi/getkmap.c | 2 -- Xi/getmmap.c | 2 -- Xi/getprop.c | 1 - Xi/getselev.c | 1 - Xi/getvers.c | 1 - Xi/grabdev.c | 1 - Xi/grabdevb.c | 1 - Xi/grabdevk.c | 1 - Xi/gtmotion.c | 1 - Xi/listdev.c | 2 -- Xi/opendev.c | 2 -- Xi/queryst.c | 2 -- Xi/selectev.c | 1 - Xi/sendexev.c | 1 - Xi/setbmap.c | 2 -- Xi/setdval.c | 2 -- Xi/setfocus.c | 1 - Xi/setmmap.c | 2 -- Xi/setmode.c | 2 -- Xi/ungrdev.c | 1 - Xi/ungrdevb.c | 1 - Xi/ungrdevk.c | 1 - Xi/xiallowev.c | 1 - Xi/xibarriers.c | 1 - Xi/xichangecursor.c | 1 - Xi/xichangehierarchy.c | 2 -- Xi/xigetclientpointer.c | 1 - Xi/xigrabdev.c | 2 -- Xi/xipassivegrab.c | 2 -- Xi/xiproperty.c | 11 ----------- Xi/xiquerydevice.c | 1 - Xi/xiquerypointer.c | 1 - Xi/xiqueryversion.c | 1 - Xi/xiselectev.c | 2 -- Xi/xisetclientpointer.c | 1 - Xi/xisetdevfocus.c | 2 -- Xi/xiwarppointer.c | 1 - test/xi2/protocol-xigetselectedevents.c | 12 +++++++++++- test/xi2/protocol-xipassivegrabdevice.c | 12 +++++++++++- test/xi2/protocol-xiselectevents.c | 11 ++++++++++- test/xi2/protocol-xisetclientpointer.c | 12 +++++++++++- 54 files changed, 43 insertions(+), 88 deletions(-) diff --git a/Xi/allowev.c b/Xi/allowev.c index fc4f33be8..f54002979 100644 --- a/Xi/allowev.c +++ b/Xi/allowev.c @@ -74,7 +74,6 @@ int _X_COLD SProcXAllowDeviceEvents(ClientPtr client) { REQUEST(xAllowDeviceEventsReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); swapl(&stuff->time); return (ProcXAllowDeviceEvents(client)); diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 7a46d95fd..fbcc92077 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -77,7 +77,6 @@ SProcXChangeDeviceControl(ClientPtr client) xDeviceCtl *ctl; REQUEST(xChangeDeviceControlReq); - swaps(&stuff->length); REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl)); swaps(&stuff->control); ctl = (xDeviceCtl *) &stuff[1]; diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c index 00da2677c..7a2446491 100644 --- a/Xi/chgfctl.c +++ b/Xi/chgfctl.c @@ -75,7 +75,6 @@ int _X_COLD SProcXChangeFeedbackControl(ClientPtr client) { REQUEST(xChangeFeedbackControlReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); swapl(&stuff->mask); return (ProcXChangeFeedbackControl(client)); diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c index 4f5abd731..255d564af 100644 --- a/Xi/chgkbd.c +++ b/Xi/chgkbd.c @@ -75,9 +75,6 @@ SOFTWARE. int _X_COLD SProcXChangeKeyboardDevice(ClientPtr client) { - REQUEST(xChangeKeyboardDeviceReq); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); return (ProcXChangeKeyboardDevice(client)); } diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c index 0e015b8c9..334a4cb34 100644 --- a/Xi/chgkmap.c +++ b/Xi/chgkmap.c @@ -77,7 +77,6 @@ SProcXChangeDeviceKeyMapping(ClientPtr client) unsigned int count; REQUEST(xChangeDeviceKeyMappingReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); count = stuff->keyCodes * stuff->keySymsPerKeyCode; REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); diff --git a/Xi/chgprop.c b/Xi/chgprop.c index 718ea9358..a32be8968 100644 --- a/Xi/chgprop.c +++ b/Xi/chgprop.c @@ -77,7 +77,6 @@ int _X_COLD SProcXChangeDeviceDontPropagateList(ClientPtr client) { REQUEST(xChangeDeviceDontPropagateListReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); swapl(&stuff->window); swaps(&stuff->count); diff --git a/Xi/chgptr.c b/Xi/chgptr.c index 06047a62a..04cb49f1e 100644 --- a/Xi/chgptr.c +++ b/Xi/chgptr.c @@ -77,9 +77,6 @@ SOFTWARE. int _X_COLD SProcXChangePointerDevice(ClientPtr client) { - REQUEST(xChangePointerDeviceReq); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xChangePointerDeviceReq); return (ProcXChangePointerDevice(client)); } diff --git a/Xi/closedev.c b/Xi/closedev.c index af60d7e99..abcc9ff6f 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -73,9 +73,6 @@ SOFTWARE. int _X_COLD SProcXCloseDevice(ClientPtr client) { - REQUEST(xCloseDeviceReq); - swaps(&stuff->length); - REQUEST_SIZE_MATCH(xCloseDeviceReq); return (ProcXCloseDevice(client)); } diff --git a/Xi/devbell.c b/Xi/devbell.c index 2e2a348f9..621220403 100644 --- a/Xi/devbell.c +++ b/Xi/devbell.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXDeviceBell(ClientPtr client) { - REQUEST(xDeviceBellReq); - swaps(&stuff->length); return (ProcXDeviceBell(client)); } diff --git a/Xi/getbmap.c b/Xi/getbmap.c index ce3e9e60b..d4a56ca5e 100644 --- a/Xi/getbmap.c +++ b/Xi/getbmap.c @@ -70,8 +70,6 @@ SOFTWARE. int _X_COLD SProcXGetDeviceButtonMapping(ClientPtr client) { - REQUEST(xGetDeviceButtonMappingReq); - swaps(&stuff->length); return (ProcXGetDeviceButtonMapping(client)); } diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 149f5e14e..219ccbd8d 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -72,7 +72,6 @@ int _X_COLD SProcXGetDeviceControl(ClientPtr client) { REQUEST(xGetDeviceControlReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceControlReq); swaps(&stuff->control); return (ProcXGetDeviceControl(client)); diff --git a/Xi/getfctl.c b/Xi/getfctl.c index eea0113c1..7b57491a3 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXGetFeedbackControl(ClientPtr client) { - REQUEST(xGetFeedbackControlReq); - swaps(&stuff->length); return (ProcXGetFeedbackControl(client)); } diff --git a/Xi/getfocus.c b/Xi/getfocus.c index cf8e02449..62fa81a65 100644 --- a/Xi/getfocus.c +++ b/Xi/getfocus.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXGetDeviceFocus(ClientPtr client) { - REQUEST(xGetDeviceFocusReq); - swaps(&stuff->length); return (ProcXGetDeviceFocus(client)); } diff --git a/Xi/getkmap.c b/Xi/getkmap.c index c6db2cee2..ac8b00f53 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -74,8 +74,6 @@ SOFTWARE. int _X_COLD SProcXGetDeviceKeyMapping(ClientPtr client) { - REQUEST(xGetDeviceKeyMappingReq); - swaps(&stuff->length); return (ProcXGetDeviceKeyMapping(client)); } diff --git a/Xi/getmmap.c b/Xi/getmmap.c index 19d8eb221..bb6d34ca9 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXGetDeviceModifierMapping(ClientPtr client) { - REQUEST(xGetDeviceModifierMappingReq); - swaps(&stuff->length); return (ProcXGetDeviceModifierMapping(client)); } diff --git a/Xi/getprop.c b/Xi/getprop.c index 282831310..ea8fe8153 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -78,7 +78,6 @@ int _X_COLD SProcXGetDeviceDontPropagateList(ClientPtr client) { REQUEST(xGetDeviceDontPropagateListReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); swapl(&stuff->window); return (ProcXGetDeviceDontPropagateList(client)); diff --git a/Xi/getselev.c b/Xi/getselev.c index b85eca3ff..9c9749e2b 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -76,7 +76,6 @@ int _X_COLD SProcXGetSelectedExtensionEvents(ClientPtr client) { REQUEST(xGetSelectedExtensionEventsReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); swapl(&stuff->window); return (ProcXGetSelectedExtensionEvents(client)); diff --git a/Xi/getvers.c b/Xi/getvers.c index b0dfb675a..80b5b3510 100644 --- a/Xi/getvers.c +++ b/Xi/getvers.c @@ -74,7 +74,6 @@ int _X_COLD SProcXGetExtensionVersion(ClientPtr client) { REQUEST(xGetExtensionVersionReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); swaps(&stuff->nbytes); return (ProcXGetExtensionVersion(client)); diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 50e4564d7..9cc689d23 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -78,7 +78,6 @@ int _X_COLD SProcXGrabDevice(ClientPtr client) { REQUEST(xGrabDeviceReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); swapl(&stuff->grabWindow); swapl(&stuff->time); diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index 65eb0a9e2..1a969694b 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -76,7 +76,6 @@ int _X_COLD SProcXGrabDeviceButton(ClientPtr client) { REQUEST(xGrabDeviceButtonReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index 32d3b1cd3..fcc28175b 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -76,7 +76,6 @@ int _X_COLD SProcXGrabDeviceKey(ClientPtr client) { REQUEST(xGrabDeviceKeyReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 57a25bb2e..663a3b739 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -73,7 +73,6 @@ int _X_COLD SProcXGetDeviceMotionEvents(ClientPtr client) { REQUEST(xGetDeviceMotionEventsReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); swapl(&stuff->start); swapl(&stuff->stop); diff --git a/Xi/listdev.c b/Xi/listdev.c index c8076a62d..9a8d66cc8 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -77,8 +77,6 @@ SOFTWARE. int _X_COLD SProcXListInputDevices(ClientPtr client) { - REQUEST(xListInputDevicesReq); - swaps(&stuff->length); return (ProcXListInputDevices(client)); } diff --git a/Xi/opendev.c b/Xi/opendev.c index 3472c97dd..7cc8d7b40 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -76,8 +76,6 @@ extern CARD8 event_base[]; int _X_COLD SProcXOpenDevice(ClientPtr client) { - REQUEST(xOpenDeviceReq); - swaps(&stuff->length); return (ProcXOpenDevice(client)); } diff --git a/Xi/queryst.c b/Xi/queryst.c index 34bfa9031..8c0cff9b1 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -57,8 +57,6 @@ from The Open Group. int _X_COLD SProcXQueryDeviceState(ClientPtr client) { - REQUEST(xQueryDeviceStateReq); - swaps(&stuff->length); return (ProcXQueryDeviceState(client)); } diff --git a/Xi/selectev.c b/Xi/selectev.c index d0c331350..d329484d8 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -123,7 +123,6 @@ int _X_COLD SProcXSelectExtensionEvent(ClientPtr client) { REQUEST(xSelectExtensionEventReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); swapl(&stuff->window); swaps(&stuff->count); diff --git a/Xi/sendexev.c b/Xi/sendexev.c index 767240449..c48707b89 100644 --- a/Xi/sendexev.c +++ b/Xi/sendexev.c @@ -84,7 +84,6 @@ SProcXSendExtensionEvent(ClientPtr client) EventSwapPtr proc; REQUEST(xSendExtensionEventReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); swapl(&stuff->destination); swaps(&stuff->count); diff --git a/Xi/setbmap.c b/Xi/setbmap.c index e06c2df89..b268e6c56 100644 --- a/Xi/setbmap.c +++ b/Xi/setbmap.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXSetDeviceButtonMapping(ClientPtr client) { - REQUEST(xSetDeviceButtonMappingReq); - swaps(&stuff->length); return (ProcXSetDeviceButtonMapping(client)); } diff --git a/Xi/setdval.c b/Xi/setdval.c index 6646619ee..f2eac9f69 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXSetDeviceValuators(ClientPtr client) { - REQUEST(xSetDeviceValuatorsReq); - swaps(&stuff->length); return (ProcXSetDeviceValuators(client)); } diff --git a/Xi/setfocus.c b/Xi/setfocus.c index f0c80accc..eb7fb6991 100644 --- a/Xi/setfocus.c +++ b/Xi/setfocus.c @@ -76,7 +76,6 @@ int _X_COLD SProcXSetDeviceFocus(ClientPtr client) { REQUEST(xSetDeviceFocusReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetDeviceFocusReq); swapl(&stuff->focus); swapl(&stuff->time); diff --git a/Xi/setmmap.c b/Xi/setmmap.c index 9b8722d2c..9e5e0aff7 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -73,8 +73,6 @@ SOFTWARE. int _X_COLD SProcXSetDeviceModifierMapping(ClientPtr client) { - REQUEST(xSetDeviceModifierMappingReq); - swaps(&stuff->length); return (ProcXSetDeviceModifierMapping(client)); } diff --git a/Xi/setmode.c b/Xi/setmode.c index e7e12d4e0..f109323fe 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -71,8 +71,6 @@ SOFTWARE. int _X_COLD SProcXSetDeviceMode(ClientPtr client) { - REQUEST(xSetDeviceModeReq); - swaps(&stuff->length); return (ProcXSetDeviceMode(client)); } diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c index fd4fc0f45..6b0b5d030 100644 --- a/Xi/ungrdev.c +++ b/Xi/ungrdev.c @@ -71,7 +71,6 @@ int _X_COLD SProcXUngrabDevice(ClientPtr client) { REQUEST(xUngrabDeviceReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceReq); swapl(&stuff->time); return (ProcXUngrabDevice(client)); diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index 0f5c7913c..f87047f71 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -79,7 +79,6 @@ int _X_COLD SProcXUngrabDeviceButton(ClientPtr client) { REQUEST(xUngrabDeviceButtonReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c index 8aa797b4d..18f1c9a96 100644 --- a/Xi/ungrdevk.c +++ b/Xi/ungrdevk.c @@ -81,7 +81,6 @@ int _X_COLD SProcXUngrabDeviceKey(ClientPtr client) { REQUEST(xUngrabDeviceKeyReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); swapl(&stuff->grabWindow); swaps(&stuff->modifiers); diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index 74b512c4a..27a7e329f 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -52,7 +52,6 @@ SProcXIAllowEvents(ClientPtr client) REQUEST(xXIAllowEventsReq); REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->time); if (client->req_len > 3) { diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index da6964453..ccdc4848a 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -842,7 +842,6 @@ SProcXIBarrierReleasePointer(ClientPtr client) REQUEST(xXIBarrierReleasePointerReq); int i; - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq); swapl(&stuff->num_barriers); diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index 9f2a616d9..33147b53d 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -60,7 +60,6 @@ SProcXIChangeCursor(ClientPtr client) { REQUEST(xXIChangeCursorReq); REQUEST_SIZE_MATCH(xXIChangeCursorReq); - swaps(&stuff->length); swapl(&stuff->win); swapl(&stuff->cursor); swaps(&stuff->deviceid); diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index eea917ff6..e0bd6c498 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -131,8 +131,6 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) int _X_COLD SProcXIChangeHierarchy(ClientPtr client) { - REQUEST(xXIChangeHierarchyReq); - swaps(&stuff->length); return (ProcXIChangeHierarchy(client)); } diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c index f63d6006e..37e45ae0c 100644 --- a/Xi/xigetclientpointer.c +++ b/Xi/xigetclientpointer.c @@ -54,7 +54,6 @@ SProcXIGetClientPointer(ClientPtr client) REQUEST(xXIGetClientPointerReq); REQUEST_SIZE_MATCH(xXIGetClientPointerReq); - swaps(&stuff->length); swapl(&stuff->win); return ProcXIGetClientPointer(client); } diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 604f8c926..30812a03d 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -55,7 +55,6 @@ SProcXIGrabDevice(ClientPtr client) */ REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->grab_window); swapl(&stuff->cursor); @@ -140,7 +139,6 @@ SProcXIUngrabDevice(ClientPtr client) REQUEST(xXIUngrabDeviceReq); REQUEST_SIZE_MATCH(xXIUngrabDeviceReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->time); diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index 78147d8dd..195d71394 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -57,7 +57,6 @@ SProcXIPassiveGrabDevice(ClientPtr client) REQUEST(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->grab_window); swapl(&stuff->cursor); @@ -282,7 +281,6 @@ SProcXIPassiveUngrabDevice(ClientPtr client) REQUEST(xXIPassiveUngrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq); - swaps(&stuff->length); swapl(&stuff->grab_window); swaps(&stuff->deviceid); swapl(&stuff->detail); diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index aaafc629b..8e3b2f3f4 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -1017,10 +1017,6 @@ ProcXGetDeviceProperty(ClientPtr client) int _X_COLD SProcXListDeviceProperties(ClientPtr client) { - REQUEST(xListDevicePropertiesReq); - REQUEST_SIZE_MATCH(xListDevicePropertiesReq); - - swaps(&stuff->length); return (ProcXListDeviceProperties(client)); } @@ -1030,7 +1026,6 @@ SProcXChangeDeviceProperty(ClientPtr client) REQUEST(xChangeDevicePropertyReq); REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); - swaps(&stuff->length); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->nUnits); @@ -1043,7 +1038,6 @@ SProcXDeleteDeviceProperty(ClientPtr client) REQUEST(xDeleteDevicePropertyReq); REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); - swaps(&stuff->length); swapl(&stuff->property); return (ProcXDeleteDeviceProperty(client)); } @@ -1054,7 +1048,6 @@ SProcXGetDeviceProperty(ClientPtr client) REQUEST(xGetDevicePropertyReq); REQUEST_SIZE_MATCH(xGetDevicePropertyReq); - swaps(&stuff->length); swapl(&stuff->property); swapl(&stuff->type); swapl(&stuff->longOffset); @@ -1262,7 +1255,6 @@ SProcXIListProperties(ClientPtr client) REQUEST(xXIListPropertiesReq); REQUEST_SIZE_MATCH(xXIListPropertiesReq); - swaps(&stuff->length); swaps(&stuff->deviceid); return (ProcXIListProperties(client)); } @@ -1273,7 +1265,6 @@ SProcXIChangeProperty(ClientPtr client) REQUEST(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); swapl(&stuff->type); @@ -1287,7 +1278,6 @@ SProcXIDeleteProperty(ClientPtr client) REQUEST(xXIDeletePropertyReq); REQUEST_SIZE_MATCH(xXIDeletePropertyReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); return (ProcXIDeleteProperty(client)); @@ -1299,7 +1289,6 @@ SProcXIGetProperty(ClientPtr client) REQUEST(xXIGetPropertyReq); REQUEST_SIZE_MATCH(xXIGetPropertyReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->property); swapl(&stuff->type); diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index cd9bb39d5..dc98f7a99 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -59,7 +59,6 @@ SProcXIQueryDevice(ClientPtr client) REQUEST(xXIQueryDeviceReq); REQUEST_SIZE_MATCH(xXIQueryDeviceReq); - swaps(&stuff->length); swaps(&stuff->deviceid); return ProcXIQueryDevice(client); diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 2ac3e73a0..1be972ff1 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -68,7 +68,6 @@ SProcXIQueryPointer(ClientPtr client) REQUEST(xXIQueryPointerReq); REQUEST_SIZE_MATCH(xXIQueryPointerReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->win); return (ProcXIQueryPointer(client)); diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index dc3860a21..9cd00f0ba 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -135,7 +135,6 @@ int _X_COLD SProcXIQueryVersion(ClientPtr client) { REQUEST(xXIQueryVersionReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq); swaps(&stuff->major_version); swaps(&stuff->minor_version); diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 6d8133f3e..1690aefd0 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -122,7 +122,6 @@ SProcXISelectEvents(ClientPtr client) xXIEventMask *evmask; REQUEST(xXISelectEventsReq); - swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); swapl(&stuff->win); swaps(&stuff->num_masks); @@ -333,7 +332,6 @@ int _X_COLD SProcXIGetSelectedEvents(ClientPtr client) { REQUEST(xXIGetSelectedEventsReq); - swaps(&stuff->length); REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); swapl(&stuff->win); diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c index a865c164c..e08000465 100644 --- a/Xi/xisetclientpointer.c +++ b/Xi/xisetclientpointer.c @@ -55,7 +55,6 @@ SProcXISetClientPointer(ClientPtr client) REQUEST(xXISetClientPointerReq); REQUEST_SIZE_MATCH(xXISetClientPointerReq); - swaps(&stuff->length); swapl(&stuff->win); swaps(&stuff->deviceid); return (ProcXISetClientPointer(client)); diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c index d09aa9d5e..85980e3b0 100644 --- a/Xi/xisetdevfocus.c +++ b/Xi/xisetdevfocus.c @@ -48,7 +48,6 @@ SProcXISetFocus(ClientPtr client) REQUEST(xXISetFocusReq); REQUEST_AT_LEAST_SIZE(xXISetFocusReq); - swaps(&stuff->length); swaps(&stuff->deviceid); swapl(&stuff->focus); swapl(&stuff->time); @@ -62,7 +61,6 @@ SProcXIGetFocus(ClientPtr client) REQUEST(xXIGetFocusReq); REQUEST_AT_LEAST_SIZE(xXIGetFocusReq); - swaps(&stuff->length); swaps(&stuff->deviceid); return ProcXIGetFocus(client); diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index 1d8926935..8ca83536c 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -61,7 +61,6 @@ SProcXIWarpPointer(ClientPtr client) REQUEST(xXIWarpPointerReq); REQUEST_SIZE_MATCH(xXIWarpPointerReq); - swaps(&stuff->length); swapl(&stuff->src_win); swapl(&stuff->dst_win); swapl(&stuff->src_x); diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c index 937b52b2e..37d0467a1 100644 --- a/test/xi2/protocol-xigetselectedevents.c +++ b/test/xi2/protocol-xigetselectedevents.c @@ -141,8 +141,18 @@ request_XIGetSelectedEvents(xXIGetSelectedEventsReq * req, int error) wrapped_WriteToClient = reply_XIGetSelectedEvents; client.swapped = TRUE; + + /* MUST NOT swap req->length here ! + + The handler proc's don't use that field anymore, thus also SProc's + wont swap it. But this test program uses that field to initialize + client->req_len (see above). We previously had to swap it here, so + that SProcXIPassiveGrabDevice() will swap it back. Since that's gone + now, still swapping itself would break if this function is called + again and writing back a errornously swapped value + */ + swapl(&req->win); - swaps(&req->length); rc = SProcXIGetSelectedEvents(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c index bc9866493..007fc750b 100644 --- a/test/xi2/protocol-xipassivegrabdevice.c +++ b/test/xi2/protocol-xipassivegrabdevice.c @@ -146,7 +146,17 @@ request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq * req, assert(client_request.errorValue == errval); client_request.swapped = TRUE; - swaps(&req->length); + + /* MUST NOT swap req->length here ! + + The handler proc's don't use that field anymore, thus also SProc's + wont swap it. But this test program uses that field to initialize + client->req_len (see above). We previously had to swap it here, so + that SProcXIPassiveGrabDevice() will swap it back. Since that's gone + now, still swapping itself would break if this function is called + again and writing back a errornously swapped value + */ + swapl(&req->time); swapl(&req->grab_window); swapl(&req->cursor); diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c index 9389bd27e..8ce8fc99d 100644 --- a/test/xi2/protocol-xiselectevents.c +++ b/test/xi2/protocol-xiselectevents.c @@ -109,8 +109,17 @@ request_XISelectEvent(xXISelectEventsReq * req, int error) mask = next; } + /* MUST NOT swap req->length here ! + + The handler proc's don't use that field anymore, thus also SProc's + wont swap it. But this test program uses that field to initialize + client->req_len (see above). We previously had to swap it here, so + that SProcXIPassiveGrabDevice() will swap it back. Since that's gone + now, still swapping itself would break if this function is called + again and writing back a errornously swapped value + */ + swapl(&req->win); - swaps(&req->length); swaps(&req->num_masks); rc = SProcXISelectEvents(&client); assert(rc == error); diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c index 881fcf3f1..ad5c0ffe9 100644 --- a/test/xi2/protocol-xisetclientpointer.c +++ b/test/xi2/protocol-xisetclientpointer.c @@ -68,8 +68,18 @@ request_XISetClientPointer(xXISetClientPointerReq * req, int error) assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; + + /* MUST NOT swap req->length here ! + + The handler proc's don't use that field anymore, thus also SProc's + wont swap it. But this test program uses that field to initialize + client->req_len (see above). We previously had to swap it here, so + that SProcXIPassiveGrabDevice() will swap it back. Since that's gone + now, still swapping itself would break if this function is called + again and writing back a errornously swapped value + */ + swapl(&req->win); - swaps(&req->length); swaps(&req->deviceid); rc = SProcXISetClientPointer(&client_request); assert(rc == error);