From 5a94934487ea477947e24dcd4720b7cde77d3d2f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Mar 2011 14:53:26 +1000 Subject: panoramiX: consolidate common id assignment code. This adds a new FOR_NSCREENS_FORWARD_SKIP, which skips the first element and is a common idiom throughout panoramiX code. It then adds a new inline function to hide id assignment to a panoramiX resource and cleans up lots of common repeated code. Signed-off-by: Dave Airlie Reviewed-by: Daniel Stone Reviewed-by: Alan Coopersmith --- composite/compext.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'composite') diff --git a/composite/compext.c b/composite/compext.c index fbd36b538..e0d8e75e4 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -703,10 +703,7 @@ PanoramiXCompositeNameWindowPixmap (ClientPtr client) newPix->type = XRT_PIXMAP; newPix->u.pix.shared = FALSE; - newPix->info[0].id = stuff->pixmap; - - for (i = 1; i < PanoramiXNumScreens; i++) - newPix->info[i].id = FakeClientID (client->index); + panoramix_setup_ids(newPix, client, stuff->pixmap); FOR_NSCREENS(i) { rc = dixLookupResourceByType ((void **) &pWin, win->info[i].id, -- cgit v1.2.3