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