Commit b943cfe2 authored by Mike Gabriel's avatar Mike Gabriel

Drop trailing whitespaces (randr extension)

sed -i "s/[ ]\+$//g" randr/*.{c,h} happy reviewing... git diff -w is an empty diff.
parent e2b0f279
...@@ -46,7 +46,7 @@ typedef struct _PanoramiXQueryVersion { ...@@ -46,7 +46,7 @@ typedef struct _PanoramiXQueryVersion {
CARD16 length B16; CARD16 length B16;
CARD8 clientMajor; CARD8 clientMajor;
CARD8 clientMinor; CARD8 clientMinor;
CARD16 unused B16; CARD16 unused B16;
} xPanoramiXQueryVersionReq; } xPanoramiXQueryVersionReq;
#define sz_xPanoramiXQueryVersionReq 8 #define sz_xPanoramiXQueryVersionReq 8
...@@ -189,4 +189,4 @@ typedef struct { ...@@ -189,4 +189,4 @@ typedef struct {
} xXineramaScreenInfo; } xXineramaScreenInfo;
#define sz_XineramaScreenInfo 8 #define sz_XineramaScreenInfo 8
#endif #endif
...@@ -112,7 +112,7 @@ static void ...@@ -112,7 +112,7 @@ static void
RRResetProc (ExtensionEntry *extEntry) RRResetProc (ExtensionEntry *extEntry)
{ {
} }
static Bool static Bool
RRCloseScreen (int i, ScreenPtr pScreen) RRCloseScreen (int i, ScreenPtr pScreen)
{ {
...@@ -124,12 +124,12 @@ RRCloseScreen (int i, ScreenPtr pScreen) ...@@ -124,12 +124,12 @@ RRCloseScreen (int i, ScreenPtr pScreen)
RRCrtcDestroy (pScrPriv->crtcs[j]); RRCrtcDestroy (pScrPriv->crtcs[j]);
for (j = pScrPriv->numOutputs - 1; j >= 0; j--) for (j = pScrPriv->numOutputs - 1; j >= 0; j--)
RROutputDestroy (pScrPriv->outputs[j]); RROutputDestroy (pScrPriv->outputs[j]);
xfree (pScrPriv->crtcs); xfree (pScrPriv->crtcs);
xfree (pScrPriv->outputs); xfree (pScrPriv->outputs);
xfree (pScrPriv); xfree (pScrPriv);
RRNScreens -= 1; /* ok, one fewer screen with RandR running */ RRNScreens -= 1; /* ok, one fewer screen with RandR running */
return (*pScreen->CloseScreen) (i, pScreen); return (*pScreen->CloseScreen) (i, pScreen);
} }
static void static void
...@@ -261,7 +261,7 @@ Bool RRScreenInit(ScreenPtr pScreen) ...@@ -261,7 +261,7 @@ Bool RRScreenInit(ScreenPtr pScreen)
pScrPriv->rrGetInfo = 0; pScrPriv->rrGetInfo = 0;
pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width; pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width;
pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height; pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height;
pScrPriv->width = pScreen->width; pScrPriv->width = pScreen->width;
pScrPriv->height = pScreen->height; pScrPriv->height = pScreen->height;
pScrPriv->mmWidth = pScreen->mmWidth; pScrPriv->mmWidth = pScreen->mmWidth;
...@@ -271,7 +271,7 @@ Bool RRScreenInit(ScreenPtr pScreen) ...@@ -271,7 +271,7 @@ Bool RRScreenInit(ScreenPtr pScreen)
pScrPriv->rrCrtcSet = NULL; pScrPriv->rrCrtcSet = NULL;
pScrPriv->rrCrtcSetGamma = NULL; pScrPriv->rrCrtcSetGamma = NULL;
#endif #endif
#if RANDR_10_INTERFACE #if RANDR_10_INTERFACE
pScrPriv->rrSetConfig = 0; pScrPriv->rrSetConfig = 0;
pScrPriv->rotations = RR_Rotate_0; pScrPriv->rotations = RR_Rotate_0;
pScrPriv->reqWidth = pScreen->width; pScrPriv->reqWidth = pScreen->width;
...@@ -282,7 +282,7 @@ Bool RRScreenInit(ScreenPtr pScreen) ...@@ -282,7 +282,7 @@ Bool RRScreenInit(ScreenPtr pScreen)
pScrPriv->rate = 0; pScrPriv->rate = 0;
pScrPriv->size = 0; pScrPriv->size = 0;
#endif #endif
/* /*
* This value doesn't really matter -- any client must call * This value doesn't really matter -- any client must call
* GetScreenInfo before reading it which will automatically update * GetScreenInfo before reading it which will automatically update
...@@ -290,14 +290,14 @@ Bool RRScreenInit(ScreenPtr pScreen) ...@@ -290,14 +290,14 @@ Bool RRScreenInit(ScreenPtr pScreen)
*/ */
pScrPriv->lastSetTime = currentTime; pScrPriv->lastSetTime = currentTime;
pScrPriv->lastConfigTime = currentTime; pScrPriv->lastConfigTime = currentTime;
wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen);
pScrPriv->numOutputs = 0; pScrPriv->numOutputs = 0;
pScrPriv->outputs = NULL; pScrPriv->outputs = NULL;
pScrPriv->numCrtcs = 0; pScrPriv->numCrtcs = 0;
pScrPriv->crtcs = NULL; pScrPriv->crtcs = NULL;
RRNScreens += 1; /* keep count of screens that implement randr */ RRNScreens += 1; /* keep count of screens that implement randr */
return TRUE; return TRUE;
} }
...@@ -380,7 +380,7 @@ RRExtensionInit (void) ...@@ -380,7 +380,7 @@ RRExtensionInit (void)
return; return;
RRErrorBase = extEntry->errorBase; RRErrorBase = extEntry->errorBase;
RREventBase = extEntry->eventBase; RREventBase = extEntry->eventBase;
EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr)
SRRScreenChangeNotifyEvent; SRRScreenChangeNotifyEvent;
EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr)
SRRNotifyEvent; SRRNotifyEvent;
...@@ -402,7 +402,7 @@ TellChanged (WindowPtr pWin, void * value) ...@@ -402,7 +402,7 @@ TellChanged (WindowPtr pWin, void * value)
if (!pHead) if (!pHead)
return WT_WALKCHILDREN; return WT_WALKCHILDREN;
for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
{ {
client = pRREvent->client; client = pRREvent->client;
if (client == serverClient || client->clientGone) if (client == serverClient || client->clientGone)
...@@ -442,7 +442,7 @@ RRTellChanged (ScreenPtr pScreen) ...@@ -442,7 +442,7 @@ RRTellChanged (ScreenPtr pScreen)
{ {
rrScrPriv (pScreen); rrScrPriv (pScreen);
int i; int i;
if (pScrPriv->changed) if (pScrPriv->changed)
{ {
UpdateCurrentTime (); UpdateCurrentTime ();
...@@ -476,7 +476,7 @@ RRFirstOutput (ScreenPtr pScreen) ...@@ -476,7 +476,7 @@ RRFirstOutput (ScreenPtr pScreen)
rrScrPriv(pScreen); rrScrPriv(pScreen);
RROutputPtr output; RROutputPtr output;
int i, j; int i, j;
for (i = 0; i < pScrPriv->numCrtcs; i++) for (i = 0; i < pScrPriv->numCrtcs; i++)
{ {
RRCrtcPtr crtc = pScrPriv->crtcs[i]; RRCrtcPtr crtc = pScrPriv->crtcs[i];
......
...@@ -65,7 +65,7 @@ typedef struct { ...@@ -65,7 +65,7 @@ typedef struct {
} xScreenSizes; } xScreenSizes;
#define sz_xScreenSizes 8 #define sz_xScreenSizes 8
/* /*
* requests and replies * requests and replies
*/ */
...@@ -100,7 +100,7 @@ typedef struct { ...@@ -100,7 +100,7 @@ typedef struct {
} xRRGetScreenInfoReq; } xRRGetScreenInfoReq;
#define sz_xRRGetScreenInfoReq 8 #define sz_xRRGetScreenInfoReq 8
/* /*
* the xRRScreenInfoReply structure is followed by: * the xRRScreenInfoReply structure is followed by:
* *
* the size information * the size information
...@@ -155,7 +155,7 @@ typedef struct { ...@@ -155,7 +155,7 @@ typedef struct {
CARD8 status; CARD8 status;
CARD16 sequenceNumber B16; CARD16 sequenceNumber B16;
CARD32 length B32; CARD32 length B32;
Time newTimestamp B32; Time newTimestamp B32;
Time newConfigTimestamp B32; Time newConfigTimestamp B32;
Window root; Window root;
CARD16 subpixelOrder B16; CARD16 subpixelOrder B16;
...@@ -289,7 +289,7 @@ typedef struct { ...@@ -289,7 +289,7 @@ typedef struct {
CARD8 randrReqType; CARD8 randrReqType;
CARD16 length B16; CARD16 length B16;
RROutput output B32; RROutput output B32;
} xRRListOutputPropertiesReq; } xRRListOutputPropertiesReq;
#define sz_xRRListOutputPropertiesReq 8 #define sz_xRRListOutputPropertiesReq 8
typedef struct { typedef struct {
...@@ -313,7 +313,7 @@ typedef struct { ...@@ -313,7 +313,7 @@ typedef struct {
CARD16 length B16; CARD16 length B16;
RROutput output B32; RROutput output B32;
Atom property B32; Atom property B32;
} xRRQueryOutputPropertyReq; } xRRQueryOutputPropertyReq;
#define sz_xRRQueryOutputPropertyReq 12 #define sz_xRRQueryOutputPropertyReq 12
typedef struct { typedef struct {
...@@ -342,7 +342,7 @@ typedef struct { ...@@ -342,7 +342,7 @@ typedef struct {
BOOL pending; BOOL pending;
BOOL range; BOOL range;
CARD16 pad B16; CARD16 pad B16;
} xRRConfigureOutputPropertyReq; } xRRConfigureOutputPropertyReq;
#define sz_xRRConfigureOutputPropertyReq 16 #define sz_xRRConfigureOutputPropertyReq 16
typedef struct { typedef struct {
...@@ -407,7 +407,7 @@ typedef struct { ...@@ -407,7 +407,7 @@ typedef struct {
CARD16 length B16; CARD16 length B16;
Window window B32; Window window B32;
xRRModeInfo modeInfo; xRRModeInfo modeInfo;
} xRRCreateModeReq; } xRRCreateModeReq;
#define sz_xRRCreateModeReq 40 #define sz_xRRCreateModeReq 40
typedef struct { typedef struct {
...@@ -456,7 +456,7 @@ typedef struct { ...@@ -456,7 +456,7 @@ typedef struct {
CARD16 length B16; CARD16 length B16;
RRCrtc crtc B32; RRCrtc crtc B32;
Time configTimestamp B32; Time configTimestamp B32;
} xRRGetCrtcInfoReq; } xRRGetCrtcInfoReq;
#define sz_xRRGetCrtcInfoReq 12 #define sz_xRRGetCrtcInfoReq 12
typedef struct { typedef struct {
...@@ -489,7 +489,7 @@ typedef struct { ...@@ -489,7 +489,7 @@ typedef struct {
RRMode mode B32; RRMode mode B32;
Rotation rotation B16; Rotation rotation B16;
CARD16 pad B16; CARD16 pad B16;
} xRRSetCrtcConfigReq; } xRRSetCrtcConfigReq;
#define sz_xRRSetCrtcConfigReq 28 #define sz_xRRSetCrtcConfigReq 28
typedef struct { typedef struct {
...@@ -511,7 +511,7 @@ typedef struct { ...@@ -511,7 +511,7 @@ typedef struct {
CARD8 randrReqType; CARD8 randrReqType;
CARD16 length B16; CARD16 length B16;
RRCrtc crtc B32; RRCrtc crtc B32;
} xRRGetCrtcGammaSizeReq; } xRRGetCrtcGammaSizeReq;
#define sz_xRRGetCrtcGammaSizeReq 8 #define sz_xRRGetCrtcGammaSizeReq 8
typedef struct { typedef struct {
...@@ -534,7 +534,7 @@ typedef struct { ...@@ -534,7 +534,7 @@ typedef struct {
CARD8 randrReqType; CARD8 randrReqType;
CARD16 length B16; CARD16 length B16;
RRCrtc crtc B32; RRCrtc crtc B32;
} xRRGetCrtcGammaReq; } xRRGetCrtcGammaReq;
#define sz_xRRGetCrtcGammaReq 8 #define sz_xRRGetCrtcGammaReq 8
typedef struct { typedef struct {
......
...@@ -68,7 +68,7 @@ extern int RREventBase, RRErrorBase; ...@@ -68,7 +68,7 @@ extern int RREventBase, RRErrorBase;
extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr); extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr);
extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr); extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
/* /*
* Modeline for a monitor. Name follows directly after this struct * Modeline for a monitor. Name follows directly after this struct
*/ */
...@@ -184,7 +184,7 @@ typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations); ...@@ -184,7 +184,7 @@ typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen); typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
/* These are for 1.0 compatibility */ /* These are for 1.0 compatibility */
typedef struct _rrRefresh { typedef struct _rrRefresh {
CARD16 rate; CARD16 rate;
RRModePtr mode; RRModePtr mode;
...@@ -225,7 +225,7 @@ typedef struct _rrScrPriv { ...@@ -225,7 +225,7 @@ typedef struct _rrScrPriv {
RROutputValidateModeProcPtr rrOutputValidateMode; RROutputValidateModeProcPtr rrOutputValidateMode;
RRModeDestroyProcPtr rrModeDestroy; RRModeDestroyProcPtr rrModeDestroy;
#endif #endif
/* /*
* Private part of the structure; not considered part of the ABI * Private part of the structure; not considered part of the ABI
*/ */
...@@ -257,10 +257,10 @@ typedef struct _rrScrPriv { ...@@ -257,10 +257,10 @@ typedef struct _rrScrPriv {
*/ */
Rotation rotations; Rotation rotations;
CARD16 reqWidth, reqHeight; CARD16 reqWidth, reqHeight;
int nSizes; int nSizes;
RRScreenSizePtr pSizes; RRScreenSizePtr pSizes;
Rotation rotation; Rotation rotation;
int rate; int rate;
int size; int size;
...@@ -344,8 +344,8 @@ extern RESTYPE RRCrtcType, RRModeType, RROutputType; ...@@ -344,8 +344,8 @@ extern RESTYPE RRCrtcType, RRModeType, RROutputType;
#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient)
#define DixUnknownAccess SecurityUnknownAccess #define DixUnknownAccess SecurityUnknownAccess
#define DixReadAccess SecurityReadAccess #define DixReadAccess SecurityReadAccess
#define DixWriteAccess SecurityWriteAccess #define DixWriteAccess SecurityWriteAccess
#define DixDestroyAccess SecurityDestroyAccess #define DixDestroyAccess SecurityDestroyAccess
#endif #endif
...@@ -390,11 +390,11 @@ RRScreenSizeSet (ScreenPtr pScreen, ...@@ -390,11 +390,11 @@ RRScreenSizeSet (ScreenPtr pScreen,
*/ */
void void
RRSendConfigNotify (ScreenPtr pScreen); RRSendConfigNotify (ScreenPtr pScreen);
/* /*
* screen dispatch * screen dispatch
*/ */
int int
ProcRRGetScreenSizeRange (ClientPtr client); ProcRRGetScreenSizeRange (ClientPtr client);
int int
...@@ -414,7 +414,7 @@ ProcRRGetScreenInfo (ClientPtr client); ...@@ -414,7 +414,7 @@ ProcRRGetScreenInfo (ClientPtr client);
*/ */
void void
RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen); RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen);
/* mirandr.c */ /* mirandr.c */
Bool Bool
miRandRInit (ScreenPtr pScreen); miRandRInit (ScreenPtr pScreen);
...@@ -488,7 +488,7 @@ RRVerticalRefresh (xRRModeInfo *mode); ...@@ -488,7 +488,7 @@ RRVerticalRefresh (xRRModeInfo *mode);
RRScreenSizePtr RRScreenSizePtr
RRRegisterSize (ScreenPtr pScreen, RRRegisterSize (ScreenPtr pScreen,
short width, short width,
short height, short height,
short mmWidth, short mmWidth,
short mmHeight); short mmHeight);
...@@ -556,7 +556,7 @@ RRCrtcNotify (RRCrtcPtr crtc, ...@@ -556,7 +556,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
void void
RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc); RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc);
/* /*
* Request that the Crtc be reconfigured * Request that the Crtc be reconfigured
*/ */
...@@ -663,13 +663,13 @@ RRModeDestroy (RRModePtr mode); ...@@ -663,13 +663,13 @@ RRModeDestroy (RRModePtr mode);
*/ */
RRModePtr * RRModePtr *
RRModesForScreen (ScreenPtr pScreen, int *num_ret); RRModesForScreen (ScreenPtr pScreen, int *num_ret);
/* /*
* Initialize mode type * Initialize mode type
*/ */
Bool Bool
RRModeInit (void); RRModeInit (void);
int int
ProcRRCreateMode (ClientPtr client); ProcRRCreateMode (ClientPtr client);
...@@ -757,7 +757,7 @@ ProcRRGetOutputInfo (ClientPtr client); ...@@ -757,7 +757,7 @@ ProcRRGetOutputInfo (ClientPtr client);
*/ */
Bool Bool
RROutputInit (void); RROutputInit (void);
/* rrpointer.c */ /* rrpointer.c */
void void
RRPointerMoved (ScreenPtr pScreen, int x, int y); RRPointerMoved (ScreenPtr pScreen, int x, int y);
...@@ -775,13 +775,13 @@ RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending); ...@@ -775,13 +775,13 @@ RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);
RRPropertyPtr RRPropertyPtr
RRQueryOutputProperty (RROutputPtr output, Atom property); RRQueryOutputProperty (RROutputPtr output, Atom property);
void void
RRDeleteOutputProperty (RROutputPtr output, Atom property); RRDeleteOutputProperty (RROutputPtr output, Atom property);
Bool Bool
RRPostPendingProperties (RROutputPtr output); RRPostPendingProperties (RROutputPtr output);
int int
RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
int format, int mode, unsigned long len, int format, int mode, unsigned long len,
...@@ -816,17 +816,17 @@ RRXineramaExtensionInit(void); ...@@ -816,17 +816,17 @@ RRXineramaExtensionInit(void);
#endif /* _RANDRSTR_H_ */ #endif /* _RANDRSTR_H_ */
/* /*
randr extension implementation structure randr extension implementation structure
Query state: Query state:
ProcRRGetScreenInfo/ProcRRGetScreenResources ProcRRGetScreenInfo/ProcRRGetScreenResources
RRGetInfo RRGetInfo
• Request configuration from driver, either 1.0 or 1.2 style • Request configuration from driver, either 1.0 or 1.2 style
• These functions only record state changes, all • These functions only record state changes, all
other actions are pended until RRTellChanged is called other actions are pended until RRTellChanged is called
->rrGetInfo ->rrGetInfo
1.0: 1.0:
RRRegisterSize RRRegisterSize
...@@ -841,15 +841,15 @@ Query state: ...@@ -841,15 +841,15 @@ Query state:
RROutputSetSubpixelOrder RROutputSetSubpixelOrder
RROutputSetClones RROutputSetClones
RRCrtcNotify RRCrtcNotify
• Must delay scanning configuration until after ->rrGetInfo returns • Must delay scanning configuration until after ->rrGetInfo returns
because some drivers will call SetCurrentConfig in the middle because some drivers will call SetCurrentConfig in the middle
of the ->rrGetInfo operation. of the ->rrGetInfo operation.
1.0: 1.0:
• Scan old configuration, mirror to new structures • Scan old configuration, mirror to new structures
RRScanOldConfig RRScanOldConfig
RRCrtcCreate RRCrtcCreate
RROutputCreate RROutputCreate
...@@ -859,16 +859,16 @@ Query state: ...@@ -859,16 +859,16 @@ Query state:
RROldModeAdd • This adds modes one-at-a-time RROldModeAdd • This adds modes one-at-a-time
RRModeGet RRModeGet
RRCrtcNotify RRCrtcNotify
• send events, reset pointer if necessary • send events, reset pointer if necessary
RRTellChanged RRTellChanged
WalkTree (sending events) WalkTree (sending events)
• when layout has changed: • when layout has changed:
RRPointerScreenConfigured RRPointerScreenConfigured
RRSendConfigNotify RRSendConfigNotify
Asynchronous state setting (1.2 only) Asynchronous state setting (1.2 only)
When setting state asynchronously, the driver invokes the When setting state asynchronously, the driver invokes the
->rrGetInfo function and then calls RRTellChanged to flush ->rrGetInfo function and then calls RRTellChanged to flush
......
...@@ -55,7 +55,7 @@ RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged) ...@@ -55,7 +55,7 @@ RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged)
if (pScreen) if (pScreen)
{ {
rrScrPriv(pScreen); rrScrPriv(pScreen);
pScrPriv->changed = TRUE; pScrPriv->changed = TRUE;
/* /*
* Send ConfigureNotify on any layout change * Send ConfigureNotify on any layout change
...@@ -77,19 +77,19 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate) ...@@ -77,19 +77,19 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate)
if (!RRInit()) if (!RRInit())
return NULL; return NULL;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
/* make space for the crtc pointer */ /* make space for the crtc pointer */
if (pScrPriv->numCrtcs) if (pScrPriv->numCrtcs)
crtcs = xrealloc (pScrPriv->crtcs, crtcs = xrealloc (pScrPriv->crtcs,
(pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr)); (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr));
else else
crtcs = xalloc (sizeof (RRCrtcPtr)); crtcs = xalloc (sizeof (RRCrtcPtr));
if (!crtcs) if (!crtcs)
return FALSE; return FALSE;
pScrPriv->crtcs = crtcs; pScrPriv->crtcs = crtcs;
crtc = xcalloc (1, sizeof (RRCrtcRec)); crtc = xcalloc (1, sizeof (RRCrtcRec));
if (!crtc) if (!crtc)
return NULL; return NULL;
...@@ -113,7 +113,7 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate) ...@@ -113,7 +113,7 @@ RRCrtcCreate (ScreenPtr pScreen, void *devPrivate)
/* attach the screen and crtc together */ /* attach the screen and crtc together */
crtc->pScreen = pScreen; crtc->pScreen = pScreen;
pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc; pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc;
return crtc; return crtc;
} }
...@@ -140,7 +140,7 @@ RRCrtcNotify (RRCrtcPtr crtc, ...@@ -140,7 +140,7 @@ RRCrtcNotify (RRCrtcPtr crtc,
RROutputPtr *outputs) RROutputPtr *outputs)
{ {
int i, j; int i, j;
/* /*
* Check to see if any of the new outputs were * Check to see if any of the new outputs were
* not in the old list and mark them as changed * not in the old list and mark them as changed
...@@ -241,7 +241,7 @@ RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc) ...@@ -241,7 +241,7 @@ RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc)
rrScrPriv (pScreen); rrScrPriv (pScreen);
xRRCrtcChangeNotifyEvent ce; xRRCrtcChangeNotifyEvent ce;
RRModePtr mode = crtc->mode; RRModePtr mode = crtc->mode;
ce.type = RRNotify + RREventBase; ce.type = RRNotify + RREventBase;
ce.subCode = RRNotify_CrtcChange; ce.subCode = RRNotify_CrtcChange;
ce.sequenceNumber = client->sequence; ce.sequenceNumber = client->sequence;
...@@ -316,7 +316,7 @@ RRCrtcSet (RRCrtcPtr crtc, ...@@ -316,7 +316,7 @@ RRCrtcSet (RRCrtcPtr crtc,
#if RANDR_12_INTERFACE #if RANDR_12_INTERFACE
if (pScrPriv->rrCrtcSet) if (pScrPriv->rrCrtcSet)
{ {
ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y, ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y,
rotation, numOutputs, outputs); rotation, numOutputs, outputs);
} }
else else
...@@ -394,7 +394,7 @@ RRCrtcDestroyResource (void * value, XID pid) ...@@ -394,7 +394,7 @@ RRCrtcDestroyResource (void * value, XID pid)
{ {
rrScrPriv(pScreen); rrScrPriv(pScreen);
int i; int i;
for (i = 0; i < pScrPriv->numCrtcs; i++) for (i = 0; i < pScrPriv->numCrtcs; i++)
{ {
if (pScrPriv->crtcs[i] == crtc) if (pScrPriv->crtcs[i] == crtc)
...@@ -428,7 +428,7 @@ RRCrtcGammaSet (RRCrtcPtr crtc, ...@@ -428,7 +428,7 @@ RRCrtcGammaSet (RRCrtcPtr crtc,
#if RANDR_12_INTERFACE #if RANDR_12_INTERFACE
ScreenPtr pScreen = crtc->pScreen; ScreenPtr pScreen = crtc->pScreen;
#endif #endif
memcpy (crtc->gammaRed, red, crtc->gammaSize * sizeof (CARD16)); memcpy (crtc->gammaRed, red, crtc->gammaSize * sizeof (CARD16));
memcpy (crtc->gammaGreen, green, crtc->gammaSize * sizeof (CARD16)); memcpy (crtc->gammaGreen, green, crtc->gammaSize * sizeof (CARD16));
memcpy (crtc->gammaBlue, blue, crtc->gammaSize * sizeof (CARD16)); memcpy (crtc->gammaBlue, blue, crtc->gammaSize * sizeof (CARD16));
...@@ -538,7 +538,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -538,7 +538,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
RROutput *possible; RROutput *possible;
int i, j, k, n; int i, j, k, n;
int width, height; int width, height;
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
crtc = LookupCrtc(client, stuff->crtc, DixReadAccess); crtc = LookupCrtc(client, stuff->crtc, DixReadAccess);
...@@ -552,7 +552,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -552,7 +552,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
mode = crtc->mode; mode = crtc->mode;
rep.type = X_Reply; rep.type = X_Reply;
rep.status = RRSetConfigSuccess; rep.status = RRSetConfigSuccess;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
...@@ -573,7 +573,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -573,7 +573,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
if (pScrPriv->outputs[i]->crtcs[j] == crtc) if (pScrPriv->outputs[i]->crtcs[j] == crtc)
k++; k++;
rep.nPossibleOutput = k; rep.nPossibleOutput = k;
rep.length = rep.nOutput + rep.nPossibleOutput; rep.length = rep.nOutput + rep.nPossibleOutput;
extraLen = rep.length << 2; extraLen = rep.length << 2;
...@@ -588,7 +588,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -588,7 +588,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
outputs = (RROutput *) extra; outputs = (RROutput *) extra;
possible = (RROutput *) (outputs + rep.nOutput); possible = (RROutput *) (outputs + rep.nOutput);
for (i = 0; i < crtc->numOutputs; i++) for (i = 0; i < crtc->numOutputs; i++)
{ {
outputs[i] = crtc->outputs[i]->id; outputs[i] = crtc->outputs[i]->id;
...@@ -605,7 +605,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -605,7 +605,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
swapl (&possible[k], n); swapl (&possible[k], n);
k++; k++;
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n); swapl(&rep.length, n);
...@@ -626,7 +626,7 @@ ProcRRGetCrtcInfo (ClientPtr client) ...@@ -626,7 +626,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
WriteToClient (client, extraLen, (char *) extra); WriteToClient (client, extraLen, (char *) extra);
xfree (extra); xfree (extra);
} }
return client->noClientException; return client->noClientException;
} }
...@@ -645,10 +645,10 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -645,10 +645,10 @@ ProcRRSetCrtcConfig (ClientPtr client)
TimeStamp time; TimeStamp time;
Rotation rotation; Rotation rotation;
int i, j; int i, j;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2));
crtc = LookupIDByType (stuff->crtc, RRCrtcType); crtc = LookupIDByType (stuff->crtc, RRCrtcType);
if (!crtc) if (!crtc)
{ {
...@@ -680,7 +680,7 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -680,7 +680,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
} }
else else
outputs = NULL; outputs = NULL;
outputIds = (RROutput *) (stuff + 1); outputIds = (RROutput *) (stuff + 1);
for (i = 0; i < numOutputs; i++) for (i = 0; i < numOutputs; i++)
{ {
...@@ -705,7 +705,7 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -705,7 +705,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
/* validate mode for this output */ /* validate mode for this output */
for (j = 0; j < outputs[i]->numModes + outputs[i]->numUserModes; j++) for (j = 0; j < outputs[i]->numModes + outputs[i]->numUserModes; j++)
{ {
RRModePtr m = (j < outputs[i]->numModes ? RRModePtr m = (j < outputs[i]->numModes ?
outputs[i]->modes[j] : outputs[i]->modes[j] :
outputs[i]->userModes[j - outputs[i]->numModes]); outputs[i]->userModes[j - outputs[i]->numModes]);
if (m == mode) if (m == mode)
...@@ -742,16 +742,16 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -742,16 +742,16 @@ ProcRRSetCrtcConfig (ClientPtr client)
pScreen = crtc->pScreen; pScreen = crtc->pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
time = ClientTimeToServerTime(stuff->timestamp); time = ClientTimeToServerTime(stuff->timestamp);
if (!pScrPriv) if (!pScrPriv)
{ {
time = currentTime; time = currentTime;
rep.status = RRSetConfigFailed; rep.status = RRSetConfigFailed;
goto sendReply; goto sendReply;
} }
/* /*
* Validate requested rotation * Validate requested rotation
*/ */
...@@ -786,7 +786,7 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -786,7 +786,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
xfree (outputs); xfree (outputs);
return BadMatch; return BadMatch;
} }
#ifdef RANDR_12_INTERFACE #ifdef RANDR_12_INTERFACE
/* /*
* Check screen size bounds if the DDX provides a 1.2 interface * Check screen size bounds if the DDX provides a 1.2 interface
...@@ -810,7 +810,7 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -810,7 +810,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
xfree (outputs); xfree (outputs);
return BadValue; return BadValue;
} }
if (stuff->y + source_height > pScreen->height) if (stuff->y + source_height > pScreen->height)
{ {
client->errorValue = stuff->y; client->errorValue = stuff->y;
...@@ -821,7 +821,7 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -821,7 +821,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
} }
#endif #endif
} }
/* /*
* Make sure the requested set-time is not older than * Make sure the requested set-time is not older than
* the last set-time * the last set-time
...@@ -840,18 +840,18 @@ ProcRRSetCrtcConfig (ClientPtr client) ...@@ -840,18 +840,18 @@ ProcRRSetCrtcConfig (ClientPtr client)
} }
rep.status = RRSetConfigSuccess; rep.status = RRSetConfigSuccess;
pScrPriv->lastSetTime = time; pScrPriv->lastSetTime = time;
sendReply: sendReply:
if (outputs) if (outputs)
xfree (outputs); xfree (outputs);
rep.type = X_Reply; rep.type = X_Reply;
/* rep.status has already been filled in */ /* rep.status has already been filled in */
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
if (client->swapped) if (client->swapped)
{ {
int n; int n;
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
...@@ -859,7 +859,7 @@ sendReply: ...@@ -859,7 +859,7 @@ sendReply:
swapl(&rep.newTimestamp, n); swapl(&rep.newTimestamp, n);
} }
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep);
return client->noClientException; return client->noClientException;
} }
...@@ -875,7 +875,7 @@ ProcRRGetCrtcGammaSize (ClientPtr client) ...@@ -875,7 +875,7 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
reply.type = X_Reply; reply.type = X_Reply;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
reply.length = 0; reply.length = 0;
...@@ -898,14 +898,14 @@ ProcRRGetCrtcGamma (ClientPtr client) ...@@ -898,14 +898,14 @@ ProcRRGetCrtcGamma (ClientPtr client)
int n; int n;
unsigned long len; unsigned long len;
char *extra; char *extra;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
crtc = LookupCrtc (client, stuff->crtc, DixReadAccess); crtc = LookupCrtc (client, stuff->crtc, DixReadAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
len = crtc->gammaSize * 3 * 2; len = crtc->gammaSize * 3 * 2;
if (crtc->gammaSize) { if (crtc->gammaSize) {
extra = xalloc(len); extra = xalloc(len);
if (!extra) if (!extra)
...@@ -939,23 +939,23 @@ ProcRRSetCrtcGamma (ClientPtr client) ...@@ -939,23 +939,23 @@ ProcRRSetCrtcGamma (ClientPtr client)
RRCrtcPtr crtc; RRCrtcPtr crtc;
unsigned long len; unsigned long len;
CARD16 *red, *green, *blue; CARD16 *red, *green, *blue;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess); crtc = LookupCrtc (client, stuff->crtc, DixWriteAccess);
if (!crtc) if (!crtc)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2); len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2);
if (len < (stuff->size * 3 + 1) >> 1) if (len < (stuff->size * 3 + 1) >> 1)
return BadLength; return BadLength;
if (stuff->size != crtc->gammaSize) if (stuff->size != crtc->gammaSize)
return BadMatch; return BadMatch;
red = (CARD16 *) (stuff + 1); red = (CARD16 *) (stuff + 1);
green = red + crtc->gammaSize; green = red + crtc->gammaSize;
blue = green + crtc->gammaSize; blue = green + crtc->gammaSize;
RRCrtcGammaSet (crtc, red, green, blue); RRCrtcGammaSet (crtc, red, green, blue);
return Success; return Success;
......
...@@ -90,13 +90,13 @@ ProcRRSelectInput (ClientPtr client) ...@@ -90,13 +90,13 @@ ProcRRSelectInput (ClientPtr client)
if (stuff->enable & (RRScreenChangeNotifyMask| if (stuff->enable & (RRScreenChangeNotifyMask|
RRCrtcChangeNotifyMask| RRCrtcChangeNotifyMask|
RROutputChangeNotifyMask)) RROutputChangeNotifyMask))
{ {
ScreenPtr pScreen = pWin->drawable.pScreen; ScreenPtr pScreen = pWin->drawable.pScreen;
rrScrPriv (pScreen); rrScrPriv (pScreen);
pRREvent = NULL; pRREvent = NULL;
if (pHead) if (pHead)
{ {
/* check for existing entry. */ /* check for existing entry. */
for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next)
...@@ -148,16 +148,16 @@ ProcRRSelectInput (ClientPtr client) ...@@ -148,16 +148,16 @@ ProcRRSelectInput (ClientPtr client)
if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask)) if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask))
{ {
pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum];
if (CompareTimeStamps (pTimes->setTime, if (CompareTimeStamps (pTimes->setTime,
pScrPriv->lastSetTime) != 0 || pScrPriv->lastSetTime) != 0 ||
CompareTimeStamps (pTimes->configTime, CompareTimeStamps (pTimes->configTime,
pScrPriv->lastConfigTime) != 0) pScrPriv->lastConfigTime) != 0)
{ {
RRDeliverScreenEvent (client, pWin, pScreen); RRDeliverScreenEvent (client, pWin, pScreen);
} }
} }
} }
else if (stuff->enable == 0) else if (stuff->enable == 0)
{ {
/* delete the interest */ /* delete the interest */
if (pHead) { if (pHead) {
...@@ -177,7 +177,7 @@ ProcRRSelectInput (ClientPtr client) ...@@ -177,7 +177,7 @@ ProcRRSelectInput (ClientPtr client)
} }
} }
} }
else else
{ {
client->errorValue = stuff->enable; client->errorValue = stuff->enable;
return BadValue; return BadValue;
......
...@@ -33,10 +33,10 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh) ...@@ -33,10 +33,10 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
RRModePtr mode; RRModePtr mode;
int i; int i;
RRModePtr *modes; RRModePtr *modes;
memset (&modeInfo, '\0', sizeof (modeInfo)); memset (&modeInfo, '\0', sizeof (modeInfo));
sprintf (name, "%dx%d", size->width, size->height); sprintf (name, "%dx%d", size->width, size->height);
modeInfo.width = size->width; modeInfo.width = size->width;
modeInfo.height = size->height; modeInfo.height = size->height;
modeInfo.hTotal = size->width; modeInfo.hTotal = size->width;
...@@ -53,9 +53,9 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh) ...@@ -53,9 +53,9 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
RRModeDestroy (mode); RRModeDestroy (mode);
return mode; return mode;
} }
if (output->numModes) if (output->numModes)
modes = xrealloc (output->modes, modes = xrealloc (output->modes,
(output->numModes + 1) * sizeof (RRModePtr)); (output->numModes + 1) * sizeof (RRModePtr));
else else
modes = xalloc (sizeof (RRModePtr)); modes = xalloc (sizeof (RRModePtr));
...@@ -84,7 +84,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) ...@@ -84,7 +84,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT;
CARD16 maxWidth = 0, maxHeight = 0; CARD16 maxWidth = 0, maxHeight = 0;
CARD16 width, height; CARD16 width, height;
/* /*
* First time through, create a crtc and output and hook * First time through, create a crtc and output and hook
* them together * them together
...@@ -131,7 +131,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) ...@@ -131,7 +131,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
for (r = 0; r < size->nRates; r++) for (r = 0; r < size->nRates; r++)
{ {
mode = RROldModeAdd (output, size, size->pRates[r].rate); mode = RROldModeAdd (output, size, size->pRates[r].rate);
if (i == pScrPriv->size && if (i == pScrPriv->size &&
size->pRates[r].rate == pScrPriv->rate) size->pRates[r].rate == pScrPriv->rate)
{ {
newMode = mode; newMode = mode;
...@@ -150,12 +150,12 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) ...@@ -150,12 +150,12 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
xfree (pScrPriv->pSizes); xfree (pScrPriv->pSizes);
pScrPriv->pSizes = NULL; pScrPriv->pSizes = NULL;
pScrPriv->nSizes = 0; pScrPriv->nSizes = 0;
/* find size bounds */ /* find size bounds */
for (i = 0; i < output->numModes + output->numUserModes; i++) for (i = 0; i < output->numModes + output->numUserModes; i++)
{ {
mode = (i < output->numModes ? mode = (i < output->numModes ?
output->modes[i] : output->modes[i] :
output->userModes[i-output->numModes]); output->userModes[i-output->numModes]);
width = mode->mode.width; width = mode->mode.width;
height = mode->mode.height; height = mode->mode.height;
...@@ -189,11 +189,11 @@ RRGetInfo (ScreenPtr pScreen) ...@@ -189,11 +189,11 @@ RRGetInfo (ScreenPtr pScreen)
pScrPriv->outputs[i]->changed = FALSE; pScrPriv->outputs[i]->changed = FALSE;
for (i = 0; i < pScrPriv->numCrtcs; i++) for (i = 0; i < pScrPriv->numCrtcs; i++)
pScrPriv->crtcs[i]->changed = FALSE; pScrPriv->crtcs[i]->changed = FALSE;
rotations = 0; rotations = 0;
pScrPriv->changed = FALSE; pScrPriv->changed = FALSE;
pScrPriv->configChanged = FALSE; pScrPriv->configChanged = FALSE;
if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations))
return FALSE; return FALSE;
...@@ -251,7 +251,7 @@ RRScreenSizeMatches (RRScreenSizePtr a, ...@@ -251,7 +251,7 @@ RRScreenSizeMatches (RRScreenSizePtr a,
RRScreenSizePtr RRScreenSizePtr
RRRegisterSize (ScreenPtr pScreen, RRRegisterSize (ScreenPtr pScreen,
short width, short width,
short height, short height,
short mmWidth, short mmWidth,
short mmHeight) short mmHeight)
...@@ -263,7 +263,7 @@ RRRegisterSize (ScreenPtr pScreen, ...@@ -263,7 +263,7 @@ RRRegisterSize (ScreenPtr pScreen,
if (!pScrPriv) if (!pScrPriv)
return 0; return 0;
tmp.id = 0; tmp.id = 0;
tmp.width = width; tmp.width = width;
tmp.height= height; tmp.height= height;
...@@ -293,7 +293,7 @@ Bool RRRegisterRate (ScreenPtr pScreen, ...@@ -293,7 +293,7 @@ Bool RRRegisterRate (ScreenPtr pScreen,
if (!pScrPriv) if (!pScrPriv)
return FALSE; return FALSE;
for (i = 0; i < pSize->nRates; i++) for (i = 0; i < pSize->nRates; i++)
if (pSize->pRates[i].rate == rate) if (pSize->pRates[i].rate == rate)
return TRUE; return TRUE;
......
...@@ -72,7 +72,7 @@ RRModeCreate (xRRModeInfo *modeInfo, ...@@ -72,7 +72,7 @@ RRModeCreate (xRRModeInfo *modeInfo,
ScreenPtr userScreen) ScreenPtr userScreen)
{ {
RRModePtr mode, *newModes; RRModePtr mode, *newModes;
if (!RRInit ()) if (!RRInit ())
return NULL; return NULL;
...@@ -178,7 +178,7 @@ RRModeCreateUser (ScreenPtr pScreen, ...@@ -178,7 +178,7 @@ RRModeCreateUser (ScreenPtr pScreen,
*error = BadName; *error = BadName;
return NULL; return NULL;
} }
mode = RRModeCreate (modeInfo, name, pScreen); mode = RRModeCreate (modeInfo, name, pScreen);
if (!mode) if (!mode)
{ {
...@@ -200,7 +200,7 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret) ...@@ -200,7 +200,7 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret)
screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr));
if (!screen_modes) if (!screen_modes)
return NULL; return NULL;
/* /*
* Add modes from all outputs * Add modes from all outputs
*/ */
...@@ -211,8 +211,8 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret) ...@@ -211,8 +211,8 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret)
for (m = 0; m < output->numModes + output->numUserModes; m++) for (m = 0; m < output->numModes + output->numUserModes; m++)
{ {
RRModePtr mode = (m < output->numModes ? RRModePtr mode = (m < output->numModes ?
output->modes[m] : output->modes[m] :
output->userModes[m-output->numModes]); output->userModes[m-output->numModes]);
for (n = 0; n < num_screen_modes; n++) for (n = 0; n < num_screen_modes; n++)
if (screen_modes[n] == mode) if (screen_modes[n] == mode)
...@@ -255,7 +255,7 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret) ...@@ -255,7 +255,7 @@ RRModesForScreen (ScreenPtr pScreen, int *num_ret)
if (n == num_screen_modes) if (n == num_screen_modes)
screen_modes[num_screen_modes++] = mode; screen_modes[num_screen_modes++] = mode;
} }
*num_ret = num_screen_modes; *num_ret = num_screen_modes;
return screen_modes; return screen_modes;
} }
...@@ -264,7 +264,7 @@ void ...@@ -264,7 +264,7 @@ void
RRModeDestroy (RRModePtr mode) RRModeDestroy (RRModePtr mode)
{ {
int m; int m;
if (--mode->refcnt > 0) { if (--mode->refcnt > 0) {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "RRModeDestroy: mode [%s] ([%p]) refcnt [%d -> %d]\n", mode->name, mode, mode->refcnt + 1, mode->refcnt); fprintf(stderr, "RRModeDestroy: mode [%s] ([%p]) refcnt [%d -> %d]\n", mode->name, mode, mode->refcnt + 1, mode->refcnt);
...@@ -286,7 +286,7 @@ RRModeDestroy (RRModePtr mode) ...@@ -286,7 +286,7 @@ RRModeDestroy (RRModePtr mode)
break; break;
} }
} }
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "RRModeDestroy: destroyed mode [%s] ([%p])\n", mode->name, mode); fprintf(stderr, "RRModeDestroy: destroyed mode [%s] ([%p])\n", mode->name, mode);
#endif #endif
...@@ -327,7 +327,7 @@ ProcRRCreateMode (ClientPtr client) ...@@ -327,7 +327,7 @@ ProcRRCreateMode (ClientPtr client)
char *name; char *name;
int error, rc; int error, rc;
RRModePtr mode; RRModePtr mode;
REQUEST_AT_LEAST_SIZE (xRRCreateModeReq); REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
...@@ -339,7 +339,7 @@ ProcRRCreateMode (ClientPtr client) ...@@ -339,7 +339,7 @@ ProcRRCreateMode (ClientPtr client)
return rc; return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
modeInfo = &stuff->modeInfo; modeInfo = &stuff->modeInfo;
name = (char *) (stuff + 1); name = (char *) (stuff + 1);
units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2)); units_after = (stuff->length - (sizeof (xRRCreateModeReq) >> 2));
...@@ -375,7 +375,7 @@ ProcRRDestroyMode (ClientPtr client) ...@@ -375,7 +375,7 @@ ProcRRDestroyMode (ClientPtr client)
{ {
REQUEST(xRRDestroyModeReq); REQUEST(xRRDestroyModeReq);
RRModePtr mode; RRModePtr mode;
REQUEST_SIZE_MATCH(xRRDestroyModeReq); REQUEST_SIZE_MATCH(xRRDestroyModeReq);
mode = LookupIDByType (stuff->mode, RRModeType); mode = LookupIDByType (stuff->mode, RRModeType);
if (!mode) if (!mode)
...@@ -397,7 +397,7 @@ ProcRRAddOutputMode (ClientPtr client) ...@@ -397,7 +397,7 @@ ProcRRAddOutputMode (ClientPtr client)
REQUEST(xRRAddOutputModeReq); REQUEST(xRRAddOutputModeReq);
RRModePtr mode; RRModePtr mode;
RROutputPtr output; RROutputPtr output;
REQUEST_SIZE_MATCH(xRRAddOutputModeReq); REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
output = LookupOutput(client, stuff->output, DixReadAccess); output = LookupOutput(client, stuff->output, DixReadAccess);
...@@ -406,14 +406,14 @@ ProcRRAddOutputMode (ClientPtr client) ...@@ -406,14 +406,14 @@ ProcRRAddOutputMode (ClientPtr client)
client->errorValue = stuff->output; client->errorValue = stuff->output;
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
} }
mode = LookupIDByType (stuff->mode, RRModeType); mode = LookupIDByType (stuff->mode, RRModeType);
if (!mode) if (!mode)
{ {
client->errorValue = stuff->mode; client->errorValue = stuff->mode;
return RRErrorBase + BadRRMode; return RRErrorBase + BadRRMode;
} }
return RROutputAddUserMode (output, mode); return RROutputAddUserMode (output, mode);
} }
...@@ -423,7 +423,7 @@ ProcRRDeleteOutputMode (ClientPtr client) ...@@ -423,7 +423,7 @@ ProcRRDeleteOutputMode (ClientPtr client)
REQUEST(xRRDeleteOutputModeReq); REQUEST(xRRDeleteOutputModeReq);
RRModePtr mode; RRModePtr mode;
RROutputPtr output; RROutputPtr output;
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
output = LookupOutput(client, stuff->output, DixReadAccess); output = LookupOutput(client, stuff->output, DixReadAccess);
...@@ -432,13 +432,13 @@ ProcRRDeleteOutputMode (ClientPtr client) ...@@ -432,13 +432,13 @@ ProcRRDeleteOutputMode (ClientPtr client)
client->errorValue = stuff->output; client->errorValue = stuff->output;
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
} }
mode = LookupIDByType (stuff->mode, RRModeType); mode = LookupIDByType (stuff->mode, RRModeType);
if (!mode) if (!mode)
{ {
client->errorValue = stuff->mode; client->errorValue = stuff->mode;
return RRErrorBase + BadRRMode; return RRErrorBase + BadRRMode;
} }
return RROutputDeleteUserMode (output, mode); return RROutputDeleteUserMode (output, mode);
} }
...@@ -32,7 +32,7 @@ void ...@@ -32,7 +32,7 @@ void
RROutputChanged (RROutputPtr output, Bool configChanged) RROutputChanged (RROutputPtr output, Bool configChanged)
{ {
ScreenPtr pScreen = output->pScreen; ScreenPtr pScreen = output->pScreen;
output->changed = TRUE; output->changed = TRUE;
if (pScreen) if (pScreen)
{ {
...@@ -59,11 +59,11 @@ RROutputCreate (ScreenPtr pScreen, ...@@ -59,11 +59,11 @@ RROutputCreate (ScreenPtr pScreen,
if (!RRInit()) if (!RRInit())
return NULL; return NULL;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
if (pScrPriv->numOutputs) if (pScrPriv->numOutputs)
outputs = xrealloc (pScrPriv->outputs, outputs = xrealloc (pScrPriv->outputs,
(pScrPriv->numOutputs + 1) * sizeof (RROutputPtr)); (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
else else
outputs = xalloc (sizeof (RROutputPtr)); outputs = xalloc (sizeof (RROutputPtr));
...@@ -71,7 +71,7 @@ RROutputCreate (ScreenPtr pScreen, ...@@ -71,7 +71,7 @@ RROutputCreate (ScreenPtr pScreen,
return FALSE; return FALSE;
pScrPriv->outputs = outputs; pScrPriv->outputs = outputs;
output = xalloc (sizeof (RROutputRec) + nameLength + 1); output = xalloc (sizeof (RROutputRec) + nameLength + 1);
if (!output) if (!output)
return NULL; return NULL;
...@@ -99,7 +99,7 @@ RROutputCreate (ScreenPtr pScreen, ...@@ -99,7 +99,7 @@ RROutputCreate (ScreenPtr pScreen,
output->pendingProperties = FALSE; output->pendingProperties = FALSE;
output->changed = FALSE; output->changed = FALSE;
output->devPrivate = devPrivate; output->devPrivate = devPrivate;
if (!AddResource (output->id, RROutputType, (void *) output)) if (!AddResource (output->id, RROutputType, (void *) output))
return NULL; return NULL;
...@@ -232,7 +232,7 @@ RROutputDeleteUserMode (RROutputPtr output, ...@@ -232,7 +232,7 @@ RROutputDeleteUserMode (RROutputPtr output,
RRModePtr mode) RRModePtr mode)
{ {
int m; int m;
/* Find this mode in the user mode list */ /* Find this mode in the user mode list */
for (m = 0; m < output->numUserModes; m++) for (m = 0; m < output->numUserModes; m++)
{ {
...@@ -334,7 +334,7 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) ...@@ -334,7 +334,7 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
xRROutputChangeNotifyEvent oe; xRROutputChangeNotifyEvent oe;
RRCrtcPtr crtc = output->crtc; RRCrtcPtr crtc = output->crtc;
RRModePtr mode = crtc ? crtc->mode : 0; RRModePtr mode = crtc ? crtc->mode : 0;
oe.type = RRNotify + RREventBase; oe.type = RRNotify + RREventBase;
oe.subCode = RRNotify_OutputChange; oe.subCode = RRNotify_OutputChange;
oe.sequenceNumber = client->sequence; oe.sequenceNumber = client->sequence;
...@@ -379,7 +379,7 @@ RROutputDestroyResource (void * value, XID pid) ...@@ -379,7 +379,7 @@ RROutputDestroyResource (void * value, XID pid)
{ {
rrScrPriv(pScreen); rrScrPriv(pScreen);
int i; int i;
for (i = 0; i < pScrPriv->numOutputs; i++) for (i = 0; i < pScrPriv->numOutputs; i++)
{ {
if (pScrPriv->outputs[i] == output) if (pScrPriv->outputs[i] == output)
...@@ -397,7 +397,7 @@ RROutputDestroyResource (void * value, XID pid) ...@@ -397,7 +397,7 @@ RROutputDestroyResource (void * value, XID pid)
RRModeDestroy (output->modes[m]); RRModeDestroy (output->modes[m]);
xfree (output->modes); xfree (output->modes);
} }
for (m = 0; m < output->numUserModes; m++) for (m = 0; m < output->numUserModes; m++)
RRModeDestroy (output->userModes[m]); RRModeDestroy (output->userModes[m]);
if (output->userModes) if (output->userModes)
...@@ -442,7 +442,7 @@ ProcRRGetOutputInfo (ClientPtr client) ...@@ -442,7 +442,7 @@ ProcRRGetOutputInfo (ClientPtr client)
RROutput *clones; RROutput *clones;
char *name; char *name;
int i, n; int i, n;
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
output = LookupOutput(client, stuff->output, DixReadAccess); output = LookupOutput(client, stuff->output, DixReadAccess);
...@@ -470,8 +470,8 @@ ProcRRGetOutputInfo (ClientPtr client) ...@@ -470,8 +470,8 @@ ProcRRGetOutputInfo (ClientPtr client)
rep.nPreferred = output->numPreferred; rep.nPreferred = output->numPreferred;
rep.nClones = output->numClones; rep.nClones = output->numClones;
rep.nameLength = output->nameLength; rep.nameLength = output->nameLength;
extraLen = ((output->numCrtcs + extraLen = ((output->numCrtcs +
output->numModes + output->numUserModes + output->numModes + output->numUserModes +
output->numClones + output->numClones +
((rep.nameLength + 3) >> 2)) << 2); ((rep.nameLength + 3) >> 2)) << 2);
...@@ -490,7 +490,7 @@ ProcRRGetOutputInfo (ClientPtr client) ...@@ -490,7 +490,7 @@ ProcRRGetOutputInfo (ClientPtr client)
modes = (RRMode *) (crtcs + output->numCrtcs); modes = (RRMode *) (crtcs + output->numCrtcs);
clones = (RROutput *) (modes + output->numModes + output->numUserModes); clones = (RROutput *) (modes + output->numModes + output->numUserModes);
name = (char *) (clones + output->numClones); name = (char *) (clones + output->numClones);
for (i = 0; i < output->numCrtcs; i++) for (i = 0; i < output->numCrtcs; i++)
{ {
crtcs[i] = output->crtcs[i]->id; crtcs[i] = output->crtcs[i]->id;
...@@ -531,6 +531,6 @@ ProcRRGetOutputInfo (ClientPtr client) ...@@ -531,6 +531,6 @@ ProcRRGetOutputInfo (ClientPtr client)
WriteToClient (client, extraLen, (char *) extra); WriteToClient (client, extraLen, (char *) extra);
xfree (extra); xfree (extra);
} }
return client->noClientException; return client->noClientException;
} }
...@@ -109,7 +109,7 @@ RRPointerMoved (ScreenPtr pScreen, int x, int y) ...@@ -109,7 +109,7 @@ RRPointerMoved (ScreenPtr pScreen, int x, int y)
/* Check last known CRTC */ /* Check last known CRTC */
if (pointerCrtc && RRCrtcContainsPosition (pointerCrtc, x, y)) if (pointerCrtc && RRCrtcContainsPosition (pointerCrtc, x, y))
return; return;
/* Check all CRTCs */ /* Check all CRTCs */
for (c = 0; c < pScrPriv->numCrtcs; c++) for (c = 0; c < pScrPriv->numCrtcs; c++)
{ {
......
...@@ -187,20 +187,20 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, ...@@ -187,20 +187,20 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
old_data = NULL; old_data = NULL;
break; break;
case PropModeAppend: case PropModeAppend:
new_data = (void *) (((char *) new_value.data) + new_data = (void *) (((char *) new_value.data) +
(prop_value->size * size_in_bytes)); (prop_value->size * size_in_bytes));
old_data = new_value.data; old_data = new_value.data;
break; break;
case PropModePrepend: case PropModePrepend:
new_data = new_value.data; new_data = new_value.data;
old_data = (void *) (((char *) new_value.data) + old_data = (void *) (((char *) new_value.data) +
(prop_value->size * size_in_bytes)); (prop_value->size * size_in_bytes));
break; break;
} }
if (new_data) if (new_data)
memcpy ((char *) new_data, (char *) value, len * size_in_bytes); memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
if (old_data) if (old_data)
memcpy ((char *) old_data, (char *) prop_value->data, memcpy ((char *) old_data, (char *) prop_value->data,
prop_value->size * size_in_bytes); prop_value->size * size_in_bytes);
if (pending && pScrPriv->rrOutputSetProperty && if (pending && pScrPriv->rrOutputSetProperty &&
...@@ -253,7 +253,7 @@ RRPostPendingProperties (RROutputPtr output) ...@@ -253,7 +253,7 @@ RRPostPendingProperties (RROutputPtr output)
if (!output->pendingProperties) if (!output->pendingProperties)
return TRUE; return TRUE;
output->pendingProperties = FALSE; output->pendingProperties = FALSE;
for (property = output->properties; property; property = property->next) for (property = output->properties; property; property = property->next)
{ {
...@@ -289,13 +289,13 @@ RRPropertyPtr ...@@ -289,13 +289,13 @@ RRPropertyPtr
RRQueryOutputProperty (RROutputPtr output, Atom property) RRQueryOutputProperty (RROutputPtr output, Atom property)
{ {
RRPropertyPtr prop; RRPropertyPtr prop;
for (prop = output->properties; prop; prop = prop->next) for (prop = output->properties; prop; prop = prop->next)
if (prop->propertyName == property) if (prop->propertyName == property)
return prop; return prop;
return NULL; return NULL;
} }
RRPropertyValuePtr RRPropertyValuePtr
RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending) RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending)
{ {
...@@ -326,7 +326,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property, ...@@ -326,7 +326,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property,
add = TRUE; add = TRUE;
} else if (prop->immutable && !immutable) } else if (prop->immutable && !immutable)
return(BadAccess); return(BadAccess);
/* /*
* ranges must have even number of values * ranges must have even number of values
*/ */
...@@ -338,7 +338,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property, ...@@ -338,7 +338,7 @@ RRConfigureOutputProperty (RROutputPtr output, Atom property,
return BadAlloc; return BadAlloc;
if (num_values) if (num_values)
memcpy (new_values, values, num_values * sizeof (INT32)); memcpy (new_values, values, num_values * sizeof (INT32));
/* /*
* Property moving from pending to non-pending * Property moving from pending to non-pending
* loses any pending values * loses any pending values
...@@ -375,11 +375,11 @@ ProcRRListOutputProperties (ClientPtr client) ...@@ -375,11 +375,11 @@ ProcRRListOutputProperties (ClientPtr client)
int numProps = 0; int numProps = 0;
RROutputPtr output; RROutputPtr output;
RRPropertyPtr prop; RRPropertyPtr prop;
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
output = LookupOutput (client, stuff->output, DixReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
...@@ -393,7 +393,7 @@ ProcRRListOutputProperties (ClientPtr client) ...@@ -393,7 +393,7 @@ ProcRRListOutputProperties (ClientPtr client)
rep.length = (numProps * sizeof(Atom)) >> 2; rep.length = (numProps * sizeof(Atom)) >> 2;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.nAtoms = numProps; rep.nAtoms = numProps;
if (client->swapped) if (client->swapped)
{ {
int n; int n;
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber, n);
...@@ -422,18 +422,18 @@ ProcRRQueryOutputProperty (ClientPtr client) ...@@ -422,18 +422,18 @@ ProcRRQueryOutputProperty (ClientPtr client)
RROutputPtr output; RROutputPtr output;
RRPropertyPtr prop; RRPropertyPtr prop;
char *extra; char *extra;
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
output = LookupOutput (client, stuff->output, DixReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
prop = RRQueryOutputProperty (output, stuff->property); prop = RRQueryOutputProperty (output, stuff->property);
if (!prop) if (!prop)
return BadName; return BadName;
if (prop->num_valid) { if (prop->num_valid) {
extra = xalloc(prop->num_valid * sizeof(INT32)); extra = xalloc(prop->num_valid * sizeof(INT32));
if (!extra) if (!extra)
...@@ -445,7 +445,7 @@ ProcRRQueryOutputProperty (ClientPtr client) ...@@ -445,7 +445,7 @@ ProcRRQueryOutputProperty (ClientPtr client)
rep.pending = prop->is_pending; rep.pending = prop->is_pending;
rep.range = prop->range; rep.range = prop->range;
rep.immutable = prop->immutable; rep.immutable = prop->immutable;
if (client->swapped) if (client->swapped)
{ {
int n; int n;
swaps (&rep.sequenceNumber, n); swaps (&rep.sequenceNumber, n);
...@@ -469,18 +469,18 @@ ProcRRConfigureOutputProperty (ClientPtr client) ...@@ -469,18 +469,18 @@ ProcRRConfigureOutputProperty (ClientPtr client)
REQUEST(xRRConfigureOutputPropertyReq); REQUEST(xRRConfigureOutputPropertyReq);
RROutputPtr output; RROutputPtr output;
int num_valid; int num_valid;
REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq); REQUEST_AT_LEAST_SIZE(xRRConfigureOutputPropertyReq);
output = LookupOutput (client, stuff->output, DixReadAccess); output = LookupOutput (client, stuff->output, DixReadAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
num_valid = stuff->length - (sizeof (xRRConfigureOutputPropertyReq) >> 2); num_valid = stuff->length - (sizeof (xRRConfigureOutputPropertyReq) >> 2);
return RRConfigureOutputProperty (output, stuff->property, return RRConfigureOutputProperty (output, stuff->property,
stuff->pending, stuff->range, stuff->pending, stuff->range,
FALSE, num_valid, FALSE, num_valid,
(INT32 *) (stuff + 1)); (INT32 *) (stuff + 1));
} }
...@@ -520,7 +520,7 @@ ProcRRChangeOutputProperty (ClientPtr client) ...@@ -520,7 +520,7 @@ ProcRRChangeOutputProperty (ClientPtr client)
output = LookupOutput (client, stuff->output, DixWriteAccess); output = LookupOutput (client, stuff->output, DixWriteAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
...@@ -546,13 +546,13 @@ ProcRRDeleteOutputProperty (ClientPtr client) ...@@ -546,13 +546,13 @@ ProcRRDeleteOutputProperty (ClientPtr client)
{ {
REQUEST(xRRDeleteOutputPropertyReq); REQUEST(xRRDeleteOutputPropertyReq);
RROutputPtr output; RROutputPtr output;
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
UpdateCurrentTime(); UpdateCurrentTime();
output = LookupOutput (client, stuff->output, DixWriteAccess); output = LookupOutput (client, stuff->output, DixWriteAccess);
if (!output) if (!output)
return RRErrorBase + BadRROutput; return RRErrorBase + BadRROutput;
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
...@@ -578,7 +578,7 @@ ProcRRGetOutputProperty (ClientPtr client) ...@@ -578,7 +578,7 @@ ProcRRGetOutputProperty (ClientPtr client)
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
if (stuff->delete) if (stuff->delete)
UpdateCurrentTime(); UpdateCurrentTime();
output = LookupOutput (client, stuff->output, output = LookupOutput (client, stuff->output,
stuff->delete ? DixWriteAccess : stuff->delete ? DixWriteAccess :
DixReadAccess); DixReadAccess);
if (!output) if (!output)
...@@ -601,12 +601,12 @@ ProcRRGetOutputProperty (ClientPtr client) ...@@ -601,12 +601,12 @@ ProcRRGetOutputProperty (ClientPtr client)
} }
for (prev = &output->properties; (prop = *prev); prev = &prop->next) for (prev = &output->properties; (prop = *prev); prev = &prop->next)
if (prop->propertyName == stuff->property) if (prop->propertyName == stuff->property)
break; break;
reply.type = X_Reply; reply.type = X_Reply;
reply.sequenceNumber = client->sequence; reply.sequenceNumber = client->sequence;
if (!prop) if (!prop)
{ {
reply.nItems = 0; reply.nItems = 0;
reply.length = 0; reply.length = 0;
...@@ -633,7 +633,7 @@ ProcRRGetOutputProperty (ClientPtr client) ...@@ -633,7 +633,7 @@ ProcRRGetOutputProperty (ClientPtr client)
prop_value = &prop->pending; prop_value = &prop->pending;
else else
prop_value = &prop->current; prop_value = &prop->current;
/* If the request type and actual type don't match. Return the /* If the request type and actual type don't match. Return the
property information, but not the data. */ property information, but not the data. */
...@@ -663,7 +663,7 @@ ProcRRGetOutputProperty (ClientPtr client) ...@@ -663,7 +663,7 @@ ProcRRGetOutputProperty (ClientPtr client)
* Return type, format, value to client * Return type, format, value to client
*/ */
n = (prop_value->format/8) * prop_value->size; /* size (bytes) of prop */ n = (prop_value->format/8) * prop_value->size; /* size (bytes) of prop */
ind = stuff->longOffset << 2; ind = stuff->longOffset << 2;
/* If longOffset is invalid such that it causes "len" to /* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */ be negative, it's a value error. */
......
...@@ -71,7 +71,7 @@ RREditConnectionInfo (ScreenPtr pScreen) ...@@ -71,7 +71,7 @@ RREditConnectionInfo (ScreenPtr pScreen)
sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); sizeof (xPixmapFormat) * screenInfo.numPixmapFormats);
while (screen != pScreen->myNum) while (screen != pScreen->myNum)
{ {
depth = (xDepth *) ((char *) root + depth = (xDepth *) ((char *) root +
sizeof (xWindowRoot)); sizeof (xWindowRoot));
for (d = 0; d < root->nDepths; d++) for (d = 0; d < root->nDepths; d++)
{ {
...@@ -102,7 +102,7 @@ RRSendConfigNotify (ScreenPtr pScreen) ...@@ -102,7 +102,7 @@ RRSendConfigNotify (ScreenPtr pScreen)
event.u.configureNotify.y = 0; event.u.configureNotify.y = 0;
/* XXX xinerama stuff ? */ /* XXX xinerama stuff ? */
event.u.configureNotify.width = pWin->drawable.width; event.u.configureNotify.width = pWin->drawable.width;
event.u.configureNotify.height = pWin->drawable.height; event.u.configureNotify.height = pWin->drawable.height;
event.u.configureNotify.borderWidth = wBorderWidth (pWin); event.u.configureNotify.borderWidth = wBorderWidth (pWin);
...@@ -117,7 +117,7 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) ...@@ -117,7 +117,7 @@ RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen)
xRRScreenChangeNotifyEvent se; xRRScreenChangeNotifyEvent se;
RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL;
WindowPtr pRoot = WindowTable[pScreen->myNum]; WindowPtr pRoot = WindowTable[pScreen->myNum];
se.type = RRScreenChangeNotify + RREventBase; se.type = RRScreenChangeNotify + RREventBase;
se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0);
se.timestamp = pScrPriv->lastSetTime.milliseconds; se.timestamp = pScrPriv->lastSetTime.milliseconds;
...@@ -167,7 +167,7 @@ RRScreenSizeNotify (ScreenPtr pScreen) ...@@ -167,7 +167,7 @@ RRScreenSizeNotify (ScreenPtr pScreen)
pScrPriv->mmWidth == pScreen->mmWidth && pScrPriv->mmWidth == pScreen->mmWidth &&
pScrPriv->mmHeight == pScreen->mmHeight) pScrPriv->mmHeight == pScreen->mmHeight)
return; return;
pScrPriv->width = pScreen->width; pScrPriv->width = pScreen->width;
pScrPriv->height = pScreen->height; pScrPriv->height = pScreen->height;
pScrPriv->mmWidth = pScreen->mmWidth; pScrPriv->mmWidth = pScreen->mmWidth;
...@@ -178,7 +178,7 @@ RRScreenSizeNotify (ScreenPtr pScreen) ...@@ -178,7 +178,7 @@ RRScreenSizeNotify (ScreenPtr pScreen)
RRTellChanged (pScreen); RRTellChanged (pScreen);
RRSendConfigNotify (pScreen); RRSendConfigNotify (pScreen);
RREditConnectionInfo (pScreen); RREditConnectionInfo (pScreen);
RRPointerScreenConfigured (pScreen); RRPointerScreenConfigured (pScreen);
/* /*
* Fix pointer bounds and location * Fix pointer bounds and location
...@@ -218,7 +218,7 @@ RRScreenSizeSet (ScreenPtr pScreen, ...@@ -218,7 +218,7 @@ RRScreenSizeSet (ScreenPtr pScreen,
/* /*
* Retrieve valid screen size range * Retrieve valid screen size range
*/ */
int int
ProcRRGetScreenSizeRange (ClientPtr client) ProcRRGetScreenSizeRange (ClientPtr client)
{ {
REQUEST(xRRGetScreenSizeRangeReq); REQUEST(xRRGetScreenSizeRangeReq);
...@@ -227,7 +227,7 @@ ProcRRGetScreenSizeRange (ClientPtr client) ...@@ -227,7 +227,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int rc; int rc;
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
...@@ -240,13 +240,13 @@ ProcRRGetScreenSizeRange (ClientPtr client) ...@@ -240,13 +240,13 @@ ProcRRGetScreenSizeRange (ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.type = X_Reply; rep.type = X_Reply;
rep.pad = 0; rep.pad = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.length = 0; rep.length = 0;
if (pScrPriv) if (pScrPriv)
{ {
if (!RRGetInfo (pScreen)) if (!RRGetInfo (pScreen))
return BadAlloc; return BadAlloc;
...@@ -260,7 +260,7 @@ ProcRRGetScreenSizeRange (ClientPtr client) ...@@ -260,7 +260,7 @@ ProcRRGetScreenSizeRange (ClientPtr client)
rep.maxWidth = rep.minWidth = pScreen->width; rep.maxWidth = rep.minWidth = pScreen->width;
rep.maxHeight = rep.minHeight = pScreen->height; rep.maxHeight = rep.minHeight = pScreen->height;
} }
if (client->swapped) if (client->swapped)
{ {
int n; int n;
...@@ -283,7 +283,7 @@ ProcRRSetScreenSize (ClientPtr client) ...@@ -283,7 +283,7 @@ ProcRRSetScreenSize (ClientPtr client)
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int i, rc; int i, rc;
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
...@@ -301,13 +301,13 @@ ProcRRSetScreenSize (ClientPtr client) ...@@ -301,13 +301,13 @@ ProcRRSetScreenSize (ClientPtr client)
client->errorValue = stuff->width; client->errorValue = stuff->width;
return BadValue; return BadValue;
} }
if (stuff->height < pScrPriv->minHeight || if (stuff->height < pScrPriv->minHeight ||
pScrPriv->maxHeight < stuff->height) pScrPriv->maxHeight < stuff->height)
{ {
client->errorValue = stuff->height; client->errorValue = stuff->height;
return BadValue; return BadValue;
} }
for (i = 0; i < pScrPriv->numCrtcs; i++) for (i = 0; i < pScrPriv->numCrtcs; i++)
{ {
RRCrtcPtr crtc = pScrPriv->crtcs[i]; RRCrtcPtr crtc = pScrPriv->crtcs[i];
RRModePtr mode = crtc->mode; RRModePtr mode = crtc->mode;
...@@ -322,7 +322,7 @@ ProcRRSetScreenSize (ClientPtr client) ...@@ -322,7 +322,7 @@ ProcRRSetScreenSize (ClientPtr client)
source_width = mode->mode.height; source_width = mode->mode.height;
source_height = mode->mode.width; source_height = mode->mode.width;
} }
if (crtc->x + source_width > stuff->width || if (crtc->x + source_width > stuff->width ||
crtc->y + source_height > stuff->height) crtc->y + source_height > stuff->height)
return BadMatch; return BadMatch;
...@@ -333,7 +333,7 @@ ProcRRSetScreenSize (ClientPtr client) ...@@ -333,7 +333,7 @@ ProcRRSetScreenSize (ClientPtr client)
client->errorValue = 0; client->errorValue = 0;
return BadValue; return BadValue;
} }
if (!RRScreenSizeSet (pScreen, if (!RRScreenSizeSet (pScreen,
stuff->width, stuff->height, stuff->width, stuff->height,
stuff->widthInMillimeters, stuff->widthInMillimeters,
stuff->heightInMillimeters)) stuff->heightInMillimeters))
...@@ -358,7 +358,7 @@ ProcRRGetScreenResources (ClientPtr client) ...@@ -358,7 +358,7 @@ ProcRRGetScreenResources (ClientPtr client)
RROutput *outputs; RROutput *outputs;
xRRModeInfo *modeinfos; xRRModeInfo *modeinfos;
CARD8 *names; CARD8 *names;
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
...@@ -368,11 +368,11 @@ ProcRRGetScreenResources (ClientPtr client) ...@@ -368,11 +368,11 @@ ProcRRGetScreenResources (ClientPtr client)
#endif #endif
if (rc != Success) if (rc != Success)
return rc; return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.pad = 0; rep.pad = 0;
if (pScrPriv) if (pScrPriv)
if (!RRGetInfo (pScreen)) if (!RRGetInfo (pScreen))
return BadAlloc; return BadAlloc;
...@@ -413,8 +413,8 @@ ProcRRGetScreenResources (ClientPtr client) ...@@ -413,8 +413,8 @@ ProcRRGetScreenResources (ClientPtr client)
for (i = 0; i < num_modes; i++) for (i = 0; i < num_modes; i++)
rep.nbytesNames += modes[i]->mode.nameLength; rep.nbytesNames += modes[i]->mode.nameLength;
rep.length = (pScrPriv->numCrtcs + rep.length = (pScrPriv->numCrtcs +
pScrPriv->numOutputs + pScrPriv->numOutputs +
num_modes * (SIZEOF(xRRModeInfo) >> 2) + num_modes * (SIZEOF(xRRModeInfo) >> 2) +
((rep.nbytesNames + 3) >> 2)); ((rep.nbytesNames + 3) >> 2));
...@@ -470,14 +470,14 @@ ProcRRGetScreenResources (ClientPtr client) ...@@ -470,14 +470,14 @@ ProcRRGetScreenResources (ClientPtr client)
swaps (&modeinfos[i].nameLength, n); swaps (&modeinfos[i].nameLength, n);
swapl (&modeinfos[i].modeFlags, n); swapl (&modeinfos[i].modeFlags, n);
} }
memcpy (names, mode->name, memcpy (names, mode->name,
mode->mode.nameLength); mode->mode.nameLength);
names += mode->mode.nameLength; names += mode->mode.nameLength;
} }
xfree (modes); xfree (modes);
assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length); assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length);
} }
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n); swapl(&rep.length, n);
...@@ -521,8 +521,8 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output) ...@@ -521,8 +521,8 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output)
Bool *used; Bool *used;
/* Make sure there is plenty of space for any combination */ /* Make sure there is plenty of space for any combination */
data = malloc (sizeof (RR10DataRec) + data = malloc (sizeof (RR10DataRec) +
sizeof (RRScreenSize) * nmode + sizeof (RRScreenSize) * nmode +
sizeof (RRScreenRate) * nmode + sizeof (RRScreenRate) * nmode +
sizeof (Bool) * nmode); sizeof (Bool) * nmode);
if (!data) if (!data)
...@@ -536,7 +536,7 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output) ...@@ -536,7 +536,7 @@ RR10GetData (ScreenPtr pScreen, RROutputPtr output)
data->nrefresh = 0; data->nrefresh = 0;
data->size = 0; data->size = 0;
data->refresh = 0; data->refresh = 0;
/* /*
* find modes not yet listed * find modes not yet listed
*/ */
...@@ -626,13 +626,13 @@ ProcRRGetScreenInfo (ClientPtr client) ...@@ -626,13 +626,13 @@ ProcRRGetScreenInfo (ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.pad = 0; rep.pad = 0;
if (pScrPriv) if (pScrPriv)
if (!RRGetInfo (pScreen)) if (!RRGetInfo (pScreen))
return BadAlloc; return BadAlloc;
output = RRFirstOutput (pScreen); output = RRFirstOutput (pScreen);
if (!pScrPriv || !output) if (!pScrPriv || !output)
{ {
rep.type = X_Reply; rep.type = X_Reply;
...@@ -659,7 +659,7 @@ ProcRRGetScreenInfo (ClientPtr client) ...@@ -659,7 +659,7 @@ ProcRRGetScreenInfo (ClientPtr client)
Bool has_rate = RRClientKnowsRates (client); Bool has_rate = RRClientKnowsRates (client);
RR10DataPtr pData; RR10DataPtr pData;
RRScreenSizePtr pSize; RRScreenSizePtr pSize;
pData = RR10GetData (pScreen, output); pData = RR10GetData (pScreen, output);
if (!pData) if (!pData)
return BadAlloc; return BadAlloc;
...@@ -781,7 +781,7 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -781,7 +781,7 @@ ProcRRSetScreenConfig (ClientPtr client)
RR10DataPtr pData = NULL; RR10DataPtr pData = NULL;
RRScreenSizePtr pSize; RRScreenSizePtr pSize;
int width, height; int width, height;
UpdateCurrentTime (); UpdateCurrentTime ();
if (RRClientKnowsRates (client)) if (RRClientKnowsRates (client))
...@@ -794,7 +794,7 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -794,7 +794,7 @@ ProcRRSetScreenConfig (ClientPtr client)
REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
has_rate = FALSE; has_rate = FALSE;
} }
#ifndef NXAGENT_SERVER #ifndef NXAGENT_SERVER
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
#else #else
...@@ -807,9 +807,9 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -807,9 +807,9 @@ ProcRRSetScreenConfig (ClientPtr client)
pScreen = pDraw->pScreen; pScreen = pDraw->pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
time = ClientTimeToServerTime(stuff->timestamp); time = ClientTimeToServerTime(stuff->timestamp);
if (!pScrPriv) if (!pScrPriv)
{ {
time = currentTime; time = currentTime;
...@@ -818,7 +818,7 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -818,7 +818,7 @@ ProcRRSetScreenConfig (ClientPtr client)
} }
if (!RRGetInfo (pScreen)) if (!RRGetInfo (pScreen))
return BadAlloc; return BadAlloc;
output = RRFirstOutput (pScreen); output = RRFirstOutput (pScreen);
if (!output) if (!output)
{ {
...@@ -843,11 +843,11 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -843,11 +843,11 @@ ProcRRSetScreenConfig (ClientPtr client)
rep.status = RRSetConfigInvalidConfigTime; rep.status = RRSetConfigInvalidConfigTime;
goto sendReply; goto sendReply;
} }
pData = RR10GetData (pScreen, output); pData = RR10GetData (pScreen, output);
if (!pData) if (!pData)
return BadAlloc; return BadAlloc;
if (stuff->sizeID >= pData->nsize) if (stuff->sizeID >= pData->nsize)
{ {
/* /*
...@@ -858,7 +858,7 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -858,7 +858,7 @@ ProcRRSetScreenConfig (ClientPtr client)
return BadValue; return BadValue;
} }
pSize = &pData->sizes[stuff->sizeID]; pSize = &pData->sizes[stuff->sizeID];
/* /*
* Validate requested rotation * Validate requested rotation
*/ */
...@@ -918,7 +918,7 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -918,7 +918,7 @@ ProcRRSetScreenConfig (ClientPtr client)
} }
else else
mode = pSize->pRates[0].mode; mode = pSize->pRates[0].mode;
/* /*
* Make sure the requested set-time is not older than * Make sure the requested set-time is not older than
* the last set-time * the last set-time
...@@ -985,9 +985,9 @@ ProcRRSetScreenConfig (ClientPtr client) ...@@ -985,9 +985,9 @@ ProcRRSetScreenConfig (ClientPtr client)
/* /*
* XXX Configure other crtcs to mirror as much as possible * XXX Configure other crtcs to mirror as much as possible
*/ */
sendReply: sendReply:
if (pData) if (pData)
xfree (pData); xfree (pData);
...@@ -1000,7 +1000,7 @@ sendReply: ...@@ -1000,7 +1000,7 @@ sendReply:
rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds;
rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id;
if (client->swapped) if (client->swapped)
{ {
swaps(&rep.sequenceNumber, n); swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n); swapl(&rep.length, n);
...@@ -1018,7 +1018,7 @@ RR10CurrentSizeID (ScreenPtr pScreen) ...@@ -1018,7 +1018,7 @@ RR10CurrentSizeID (ScreenPtr pScreen)
{ {
CARD16 sizeID = 0xffff; CARD16 sizeID = 0xffff;
RROutputPtr output = RRFirstOutput (pScreen); RROutputPtr output = RRFirstOutput (pScreen);
if (output) if (output)
{ {
RR10DataPtr data = RR10GetData (pScreen, output); RR10DataPtr data = RR10GetData (pScreen, output);
......
...@@ -62,7 +62,7 @@ SProcRRSetScreenConfig (ClientPtr client) ...@@ -62,7 +62,7 @@ SProcRRSetScreenConfig (ClientPtr client)
{ {
REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
} }
swaps(&stuff->length, n); swaps(&stuff->length, n);
swapl(&stuff->drawable, n); swapl(&stuff->drawable, n);
swapl(&stuff->timestamp, n); swapl(&stuff->timestamp, n);
...@@ -208,7 +208,7 @@ SProcRRDeleteOutputProperty (ClientPtr client) ...@@ -208,7 +208,7 @@ SProcRRDeleteOutputProperty (ClientPtr client)
{ {
int n; int n;
REQUEST(xRRDeleteOutputPropertyReq); REQUEST(xRRDeleteOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
swaps(&stuff->length, n); swaps(&stuff->length, n);
swapl(&stuff->output, n); swapl(&stuff->output, n);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* This Xinerama implementation comes from the SiS driver which has * This Xinerama implementation comes from the SiS driver which has
* the following notice: * the following notice:
*/ */
/* /*
* SiS driver main code * SiS driver main code
* *
* Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
...@@ -186,7 +186,7 @@ static int ...@@ -186,7 +186,7 @@ static int
RRXineramaScreenCount (ScreenPtr pScreen) RRXineramaScreenCount (ScreenPtr pScreen)
{ {
int i, n; int i, n;
n = 0; n = 0;
if (rrGetScrPriv (pScreen)) if (rrGetScrPriv (pScreen))
{ {
...@@ -221,7 +221,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) ...@@ -221,7 +221,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
#endif #endif
if (rc != Success) if (rc != Success)
return rc; return rc;
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
...@@ -257,7 +257,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) ...@@ -257,7 +257,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pRoot = WindowTable[pScreen->myNum]; pRoot = WindowTable[pScreen->myNum];
rep.type = X_Reply; rep.type = X_Reply;
rep.length = 0; rep.length = 0;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
...@@ -313,7 +313,7 @@ ProcRRXineramaQueryScreens(ClientPtr client) ...@@ -313,7 +313,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0) if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0)
RRGetInfo (pScreen); RRGetInfo (pScreen);
} }
rep.type = X_Reply; rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.number = RRXineramaScreenCount (pScreen); rep.number = RRXineramaScreenCount (pScreen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment