(!1601) Xext: xres: ProcXResQueryClients() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is sufficient. That's also easing further simplifications in upcoming commits. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									032200f1de
								
							
						
					
					
						commit
						43418c8930
					
				
							
								
								
									
										15
									
								
								Xext/xres.c
								
								
								
								
							
							
						
						
									
										15
									
								
								Xext/xres.c
								
								
								
								
							|  | @ -242,21 +242,22 @@ ProcXResQueryClients(ClientPtr client) | |||
|     } | ||||
|     WriteToClient(client, sizeof(xXResQueryClientsReply), &rep); | ||||
| 
 | ||||
|     if (num_clients) { | ||||
|         xXResClient scratch; | ||||
|     xXResClient scratch[num_clients]; | ||||
| 
 | ||||
|     if (num_clients) { | ||||
|         for (i = 0; i < num_clients; i++) { | ||||
|             scratch.resource_base = clients[current_clients[i]]->clientAsMask; | ||||
|             scratch.resource_mask = RESOURCE_ID_MASK; | ||||
|             scratch[i].resource_base = clients[current_clients[i]]->clientAsMask; | ||||
|             scratch[i].resource_mask = RESOURCE_ID_MASK; | ||||
| 
 | ||||
|             if (client->swapped) { | ||||
|                 swapl(&scratch.resource_base); | ||||
|                 swapl(&scratch.resource_mask); | ||||
|                 swapl(&scratch[i].resource_base); | ||||
|                 swapl(&scratch[i].resource_mask); | ||||
|             } | ||||
|             WriteToClient(client, sz_xXResClient, &scratch); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     WriteToClient(client, sizeof(scratch), scratch); | ||||
| 
 | ||||
|     return Success; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue