XI: directly write out X_GetDeviceModifierMapping reply
Write out X_GetDeviceModifierMapping the reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									7f36272a3d
								
							
						
					
					
						commit
						37c5d6bff2
					
				| 
						 | 
					@ -421,10 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /* All we look at is the type field */
 | 
					    /* All we look at is the type field */
 | 
				
			||||||
    /* This is common to all replies    */
 | 
					    /* This is common to all replies    */
 | 
				
			||||||
    if (rep->RepType == X_GetDeviceModifierMapping)
 | 
					    if (rep->RepType == X_SetDeviceModifierMapping)
 | 
				
			||||||
        SRepXGetDeviceModifierMapping(client, len,
 | 
					 | 
				
			||||||
                                      (xGetDeviceModifierMappingReply *) rep);
 | 
					 | 
				
			||||||
    else if (rep->RepType == X_SetDeviceModifierMapping)
 | 
					 | 
				
			||||||
        SRepXSetDeviceModifierMapping(client, len,
 | 
					        SRepXSetDeviceModifierMapping(client, len,
 | 
				
			||||||
                                      (xSetDeviceModifierMappingReply *) rep);
 | 
					                                      (xSetDeviceModifierMappingReply *) rep);
 | 
				
			||||||
    else if (rep->RepType == X_GetDeviceButtonMapping)
 | 
					    else if (rep->RepType == X_GetDeviceButtonMapping)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										22
									
								
								Xi/getmmap.c
								
								
								
								
							
							
						
						
									
										22
									
								
								Xi/getmmap.c
								
								
								
								
							| 
						 | 
					@ -92,26 +92,14 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
 | 
				
			||||||
        .length = max_keys_per_mod << 1
 | 
					        .length = max_keys_per_mod << 1
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
 | 
					    if (client->swapped) {
 | 
				
			||||||
 | 
					        swaps(&rep.sequenceNumber);
 | 
				
			||||||
 | 
					        swapl(&rep.length);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    WriteToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
 | 
				
			||||||
    WriteToClient(client, max_keys_per_mod * 8, modkeymap);
 | 
					    WriteToClient(client, max_keys_per_mod * 8, modkeymap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    free(modkeymap);
 | 
					    free(modkeymap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return Success;
 | 
					    return Success;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
/***********************************************************************
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * This procedure writes the reply for the XGetDeviceModifierMapping function,
 | 
					 | 
				
			||||||
 * if the client and server have a different byte ordering.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void _X_COLD
 | 
					 | 
				
			||||||
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
 | 
					 | 
				
			||||||
                              xGetDeviceModifierMappingReply * rep)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    swaps(&rep->sequenceNumber);
 | 
					 | 
				
			||||||
    swapl(&rep->length);
 | 
					 | 
				
			||||||
    WriteToClient(client, size, rep);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
				
			||||||
int ProcXGetDeviceModifierMapping(ClientPtr     /* client */
 | 
					int ProcXGetDeviceModifierMapping(ClientPtr     /* client */
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void SRepXGetDeviceModifierMapping(ClientPtr /* client */ ,
 | 
					 | 
				
			||||||
                                   int /* size */ ,
 | 
					 | 
				
			||||||
                                   xGetDeviceModifierMappingReply *     /* rep */
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif                          /* GETMMAP_H */
 | 
					#endif                          /* GETMMAP_H */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue