mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
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 <airlied@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -44,7 +44,7 @@ Equipment Corporation.
|
||||
#include <X11/extensions/panoramiXproto.h>
|
||||
#undef _PANORAMIX_SERVER
|
||||
#include "gcstruct.h"
|
||||
|
||||
#include "dixstruct.h"
|
||||
|
||||
typedef struct _PanoramiXInfo {
|
||||
XID id ;
|
||||
@@ -70,6 +70,7 @@ typedef struct {
|
||||
} PanoramiXRes;
|
||||
|
||||
#define FOR_NSCREENS_FORWARD(j) for(j = 0; j < PanoramiXNumScreens; j++)
|
||||
#define FOR_NSCREENS_FORWARD_SKIP(j) for(j = 1; j < PanoramiXNumScreens; j++)
|
||||
#define FOR_NSCREENS_BACKWARD(j) for(j = PanoramiXNumScreens - 1; j >= 0; j--)
|
||||
#define FOR_NSCREENS(j) FOR_NSCREENS_FORWARD(j)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user