diff --git a/Xi/extinit.c b/Xi/extinit.c index 6523dcb6f..74d7a9c92 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -421,10 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) { /* All we look at is the type field */ /* This is common to all replies */ - if (rep->RepType == X_SetDeviceModifierMapping) - SRepXSetDeviceModifierMapping(client, len, - (xSetDeviceModifierMappingReply *) rep); - else if (rep->RepType == X_GetDeviceButtonMapping) + if (rep->RepType == X_GetDeviceButtonMapping) SRepXGetDeviceButtonMapping(client, len, (xGetDeviceButtonMappingReply *) rep); else if (rep->RepType == X_SetDeviceButtonMapping) diff --git a/Xi/setmmap.c b/Xi/setmmap.c index fb7e1315a..b8e703cc1 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -91,35 +91,19 @@ ProcXSetDeviceModifierMapping(ClientPtr client) if (ret == Success) ret = MappingSuccess; + if (ret != MappingSuccess && ret != MappingBusy && ret != MappingFailed) + return ret; + xSetDeviceModifierMappingReply rep = { .repType = X_Reply, .RepType = X_SetDeviceModifierMapping, .sequenceNumber = client->sequence, - .length = 0 + .success = ret, }; - if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) { - rep.success = ret; - WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply), - &rep); - return Success; + if (client->swapped) { + swaps(&rep.sequenceNumber); } - - return ret; -} - -/*********************************************************************** - * - * This procedure writes the reply for the XSetDeviceModifierMapping function, - * if the client and server have a different byte ordering. - * - */ - -void _X_COLD -SRepXSetDeviceModifierMapping(ClientPtr client, int size, - xSetDeviceModifierMappingReply * rep) -{ - swaps(&rep->sequenceNumber); - swapl(&rep->length); - WriteToClient(client, size, rep); + WriteToClient(client, sizeof(xSetDeviceModifierMappingReply), &rep); + return Success; } diff --git a/Xi/setmmap.h b/Xi/setmmap.h index f8b96a875..a7de58d3a 100644 --- a/Xi/setmmap.h +++ b/Xi/setmmap.h @@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. int ProcXSetDeviceModifierMapping(ClientPtr /* client */ ); -void SRepXSetDeviceModifierMapping(ClientPtr /* client */ , - int /* size */ , - xSetDeviceModifierMappingReply * /* rep */ - ); - #endif /* SETMMAP_H */