(!1893) dix: write out X_GetModifierMapping 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
							
								
									35d97a229b
								
							
						
					
					
						commit
						a1c593307f
					
				|  | @ -1793,7 +1793,6 @@ ProcSetModifierMapping(ClientPtr client) | ||||||
| int | int | ||||||
| ProcGetModifierMapping(ClientPtr client) | ProcGetModifierMapping(ClientPtr client) | ||||||
| { | { | ||||||
|     xGetModifierMappingReply rep; |  | ||||||
|     int max_keys_per_mod = 0; |     int max_keys_per_mod = 0; | ||||||
|     KeyCode *modkeymap = NULL; |     KeyCode *modkeymap = NULL; | ||||||
| 
 | 
 | ||||||
|  | @ -1802,7 +1801,7 @@ ProcGetModifierMapping(ClientPtr client) | ||||||
|     generate_modkeymap(client, PickKeyboard(client), &modkeymap, |     generate_modkeymap(client, PickKeyboard(client), &modkeymap, | ||||||
|                        &max_keys_per_mod); |                        &max_keys_per_mod); | ||||||
| 
 | 
 | ||||||
|     rep = (xGetModifierMappingReply) { |     xGetModifierMappingReply rep = { | ||||||
|         .type = X_Reply, |         .type = X_Reply, | ||||||
|         .numKeyPerModifier = max_keys_per_mod, |         .numKeyPerModifier = max_keys_per_mod, | ||||||
|         .sequenceNumber = client->sequence, |         .sequenceNumber = client->sequence, | ||||||
|  | @ -1810,7 +1809,12 @@ ProcGetModifierMapping(ClientPtr client) | ||||||
|         .length = max_keys_per_mod << 1 |         .length = max_keys_per_mod << 1 | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep); |     if (client->swapped) { | ||||||
|  |         swaps(&rep.sequenceNumber); | ||||||
|  |         swapl(&rep.length); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     WriteToClient(client, sizeof(rep), &rep); | ||||||
|     WriteToClient(client, max_keys_per_mod * 8, modkeymap); |     WriteToClient(client, max_keys_per_mod * 8, modkeymap); | ||||||
| 
 | 
 | ||||||
|     free(modkeymap); |     free(modkeymap); | ||||||
|  |  | ||||||
|  | @ -553,15 +553,6 @@ SGetPointerMappingReply(ClientPtr pClient, int size, | ||||||
|     WriteToClient(pClient, size, pRep); |     WriteToClient(pClient, size, pRep); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void _X_COLD |  | ||||||
| SGetModifierMappingReply(ClientPtr pClient, int size, |  | ||||||
|                          xGetModifierMappingReply * pRep) |  | ||||||
| { |  | ||||||
|     swaps(&pRep->sequenceNumber); |  | ||||||
|     swapl(&pRep->length); |  | ||||||
|     WriteToClient(pClient, size, pRep); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void _X_COLD | void _X_COLD | ||||||
| SGetKeyboardControlReply(ClientPtr pClient, int size, | SGetKeyboardControlReply(ClientPtr pClient, int size, | ||||||
|                          xGetKeyboardControlReply * pRep) |                          xGetKeyboardControlReply * pRep) | ||||||
|  |  | ||||||
|  | @ -834,7 +834,7 @@ ReplySwapPtr ReplySwapVector[256] = { | ||||||
|     (ReplySwapPtr) SGenericReply,               /* SetPointerMapping */ |     (ReplySwapPtr) SGenericReply,               /* SetPointerMapping */ | ||||||
|     (ReplySwapPtr) SGetPointerMappingReply, |     (ReplySwapPtr) SGetPointerMappingReply, | ||||||
|     ReplyNotSwappd, |     ReplyNotSwappd, | ||||||
|     (ReplySwapPtr) SGetModifierMappingReply,    /* 119 */ |     ReplyNotSwappd,                             /* 119 */ | ||||||
|     ReplyNotSwappd,                             /* 120 */ |     ReplyNotSwappd,                             /* 120 */ | ||||||
|     ReplyNotSwappd,                             /* 121 */ |     ReplyNotSwappd,                             /* 121 */ | ||||||
|     ReplyNotSwappd,                             /* 122 */ |     ReplyNotSwappd,                             /* 122 */ | ||||||
|  |  | ||||||
|  | @ -164,11 +164,6 @@ extern void SGetPointerMappingReply(ClientPtr /* pClient */ , | ||||||
|                                     xGetPointerMappingReply * |                                     xGetPointerMappingReply * | ||||||
|                                     /* pRep */ ); |                                     /* pRep */ ); | ||||||
| 
 | 
 | ||||||
| extern void SGetModifierMappingReply(ClientPtr /* pClient */ , |  | ||||||
|                                      int /* size */ , |  | ||||||
|                                      xGetModifierMappingReply * |  | ||||||
|                                      /* pRep */ ); |  | ||||||
| 
 |  | ||||||
| extern void SGetKeyboardControlReply(ClientPtr /* pClient */ , | extern void SGetKeyboardControlReply(ClientPtr /* pClient */ , | ||||||
|                                      int /* size */ , |                                      int /* size */ , | ||||||
|                                      xGetKeyboardControlReply * |                                      xGetKeyboardControlReply * | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue