[PATCH 2/5] panoramiX: convert 0->panoramiXNumScreens loops to macro

Alan Coopersmith alan.coopersmith at oracle.com
Wed Mar 9 10:55:57 PST 2011


On 03/ 8/11 09:29 PM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This just uses the FOR_NSCREENS macro instead.

Looks like a couple of the 1->n loop conversions to FOR_NSCREENS_FORWARD_SKIP
snuck in from patch 3 as well:

> @@ -740,7 +740,7 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
>      int j, k;
>      Bool found = FALSE;
>  
> -    for (j = 1; j < PanoramiXNumScreens; j++) {
> +    FOR_NSCREENS_FORWARD_SKIP(j) {
>  	pScreen = screenInfo.screens[j];
>  	for (k = 0; k < pScreen->numDepths; k++) {
>  	    if (pScreen->allowedDepths[k].depth == pDepth->depth) {


> @@ -773,7 +773,7 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
>      int j, k;
>      Bool found = FALSE;
>  
> -    for (j = 1; j < PanoramiXNumScreens; j++) {
> +    FOR_NSCREENS_FORWARD_SKIP(j) {
>  	pScreen = screenInfo.screens[j];
>  	found = FALSE;
>  

> diff --git a/Xext/shm.c b/Xext/shm.c
> index 6294720..b08af82 100644
> --- a/Xext/shm.c
> +++ b/Xext/shm.c
> @@ -848,7 +848,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
>  	return BadAlloc;
>  
>      drawables[0] = pDraw;
> -    for(i = 1; i < PanoramiXNumScreens; i++) {
> +    FOR_NSCREENS_FORWARD_SKIP(i) {
>  	rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0, 
>  			       DixReadAccess);
>  	if (rc != Success)

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list