diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-04 16:37:55 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-04 16:37:55 +0200 |
commit | 27b0b5723ccbcc92bbcc80dff8fb698b69e74944 (patch) | |
tree | 3b27e6dd17a7d4d00266819545ae97defa11cf81 /nx-X11/programs/Xserver/randr/rrxinerama.c | |
parent | d1d859dfdec4b4665e06401383ab71926e4e731c (diff) | |
parent | 286d83260216e8e53db701eed5c785aae1c716bf (diff) | |
download | nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.tar.gz nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.tar.bz2 nx-libs-27b0b5723ccbcc92bbcc80dff8fb698b69e74944.zip |
Merge branch 'sunweaver-pr/type-safe-swapping' into 3.6.x
Attributes GH PR #167: https://github.com/ArcticaProject/nx-libs/pull/167
Reviewed by: Vadim Troshchinskiy <vadim@qindel.com> -- Mon, 04 Jul 2016 07:31:50 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/randr/rrxinerama.c')
-rw-r--r-- | nx-X11/programs/Xserver/randr/rrxinerama.c | 83 |
1 files changed, 32 insertions, 51 deletions
diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index 5332ac01b..bd6340296 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -108,8 +108,6 @@ extern Bool noRRXineramaExtension; int ProcRRXineramaQueryVersion(ClientPtr client) { - int n; - xPanoramiXQueryVersionReply rep = { .type = X_Reply, .sequenceNumber = client->sequence, @@ -120,10 +118,10 @@ ProcRRXineramaQueryVersion(ClientPtr client) REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep); return Success; @@ -139,7 +137,6 @@ ProcRRXineramaGetState(ClientPtr client) ScreenPtr pScreen; rrScrPrivPtr pScrPriv; Bool active = FALSE; - int n; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); #ifndef NXAGENT_SERVER @@ -167,9 +164,9 @@ ProcRRXineramaGetState(ClientPtr client) .window = stuff->window }; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.window, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); return Success; @@ -194,7 +191,6 @@ ProcRRXineramaGetScreenCount(ClientPtr client) WindowPtr pWin; xPanoramiXGetScreenCountReply rep; register int rc; - int n; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); @@ -215,9 +211,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client) .window = stuff->window }; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.window, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.window); } WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); return Success; @@ -231,7 +227,6 @@ ProcRRXineramaGetScreenSize(ClientPtr client) ScreenPtr pScreen; xPanoramiXGetScreenSizeReply rep; register int rc; - int n; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); #ifndef NXAGENT_SERVER @@ -257,12 +252,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client) .screen = stuff->screen }; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.width, n); - swapl(&rep.height, n); - swapl(&rep.window, n); - swapl(&rep.screen, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.width); + swapl(&rep.height); + swapl(&rep.window); + swapl(&rep.screen); } WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); return Success; @@ -272,7 +267,6 @@ int ProcRRXineramaIsActive(ClientPtr client) { xXineramaIsActiveReply rep; - int n; REQUEST_SIZE_MATCH(xXineramaIsActiveReq); @@ -283,9 +277,9 @@ ProcRRXineramaIsActive(ClientPtr client) .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]) }; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.state, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.state); } WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); return Success; @@ -312,7 +306,6 @@ ProcRRXineramaQueryScreens(ClientPtr client) int m; RRMonitorPtr monitors = NULL; int nmonitors = 0; - int n; REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); @@ -329,9 +322,9 @@ ProcRRXineramaQueryScreens(ClientPtr client) .number = nmonitors }; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.number, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.number); } WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); @@ -370,10 +363,8 @@ ProcRRXineramaDispatch(ClientPtr client) static int SProcRRXineramaQueryVersion(ClientPtr client) { - int n; - REQUEST(xPanoramiXQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); return ProcRRXineramaQueryVersion(client); } @@ -381,47 +372,39 @@ SProcRRXineramaQueryVersion(ClientPtr client) static int SProcRRXineramaGetState(ClientPtr client) { - int n; - REQUEST(xPanoramiXGetStateReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return ProcRRXineramaGetState(client); } static int SProcRRXineramaGetScreenCount(ClientPtr client) { - int n; - REQUEST(xPanoramiXGetScreenCountReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return ProcRRXineramaGetScreenCount(client); } static int SProcRRXineramaGetScreenSize(ClientPtr client) { - int n; - REQUEST(xPanoramiXGetScreenSizeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); - swapl(&stuff->window, n); - swapl(&stuff->screen, n); + swapl(&stuff->window); + swapl(&stuff->screen); return ProcRRXineramaGetScreenSize(client); } static int SProcRRXineramaIsActive(ClientPtr client) { - int n; - REQUEST(xXineramaIsActiveReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcRRXineramaIsActive(client); } @@ -429,10 +412,8 @@ SProcRRXineramaIsActive(ClientPtr client) static int SProcRRXineramaQueryScreens(ClientPtr client) { - int n; - REQUEST(xXineramaQueryScreensReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcRRXineramaQueryScreens(client); } |