dix: write out X_SetModifierMapping reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									5620ee1752
								
							
						
					
					
						commit
						4664c1a6f8
					
				| 
						 | 
					@ -1770,7 +1770,6 @@ BadDeviceMap(BYTE * buff, int length, unsigned low, unsigned high, XID *errval)
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
ProcSetModifierMapping(ClientPtr client)
 | 
					ProcSetModifierMapping(ClientPtr client)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    xSetModifierMappingReply rep;
 | 
					 | 
				
			||||||
    int rc;
 | 
					    int rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    REQUEST(xSetModifierMappingReq);
 | 
					    REQUEST(xSetModifierMappingReq);
 | 
				
			||||||
| 
						 | 
					@ -1780,11 +1779,6 @@ ProcSetModifierMapping(ClientPtr client)
 | 
				
			||||||
                            bytes_to_int32(sizeof(xSetModifierMappingReq))))
 | 
					                            bytes_to_int32(sizeof(xSetModifierMappingReq))))
 | 
				
			||||||
        return BadLength;
 | 
					        return BadLength;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rep = (xSetModifierMappingReply) {
 | 
					 | 
				
			||||||
        .type = X_Reply,
 | 
					 | 
				
			||||||
        .sequenceNumber = client->sequence,
 | 
					 | 
				
			||||||
        .length = 0
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
 | 
					    rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
 | 
				
			||||||
                       stuff->numKeyPerModifier);
 | 
					                       stuff->numKeyPerModifier);
 | 
				
			||||||
| 
						 | 
					@ -1793,9 +1787,17 @@ ProcSetModifierMapping(ClientPtr client)
 | 
				
			||||||
    if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
 | 
					    if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
 | 
				
			||||||
        return rc;
 | 
					        return rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rep.success = rc;
 | 
					    xSetModifierMappingReply rep = {
 | 
				
			||||||
 | 
					        .type = X_Reply,
 | 
				
			||||||
 | 
					        .sequenceNumber = client->sequence,
 | 
				
			||||||
 | 
					        .length = 0,
 | 
				
			||||||
 | 
					        .success = rc,
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
 | 
					    if (client->swapped) {
 | 
				
			||||||
 | 
					        swaps(&rep.sequenceNumber);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    WriteToClient(client, sizeof(rep), &rep);
 | 
				
			||||||
    return Success;
 | 
					    return Success;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -830,7 +830,7 @@ ReplySwapPtr ReplySwapVector[256] = {
 | 
				
			||||||
    ReplyNotSwappd,                             /* 115 */
 | 
					    ReplyNotSwappd,                             /* 115 */
 | 
				
			||||||
    (ReplySwapPtr) SGenericReply,               /* SetPointerMapping */
 | 
					    (ReplySwapPtr) SGenericReply,               /* SetPointerMapping */
 | 
				
			||||||
    (ReplySwapPtr) SGetPointerMappingReply,
 | 
					    (ReplySwapPtr) SGetPointerMappingReply,
 | 
				
			||||||
    (ReplySwapPtr) SGenericReply,               /* SetModifierMapping */
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    (ReplySwapPtr) SGetModifierMappingReply,    /* 119 */
 | 
					    (ReplySwapPtr) SGetModifierMappingReply,    /* 119 */
 | 
				
			||||||
    ReplyNotSwappd,                             /* 120 */
 | 
					    ReplyNotSwappd,                             /* 120 */
 | 
				
			||||||
    ReplyNotSwappd,                             /* 121 */
 | 
					    ReplyNotSwappd,                             /* 121 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue