From 40a47bd628f525d2d8bd3ca76554089a6e9d2a1d Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 27 Apr 2011 14:19:41 -0400 Subject: [PATCH 01/12] Remove unnecessary #undefs of [f]abs and old comments Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Reviewed-by: Daniel Stone Signed-off-by: Matt Turner --- glx/glxserver.h | 6 ------ hw/dmx/glxProxy/glxserver.h | 6 ------ 2 files changed, 12 deletions(-) diff --git a/glx/glxserver.h b/glx/glxserver.h index 891315b74..6bcf7d3a7 100644 --- a/glx/glxserver.h +++ b/glx/glxserver.h @@ -46,12 +46,6 @@ #include #include -/* -** The X header misc.h defines these math functions. -*/ -#undef abs -#undef fabs - #define GL_GLEXT_PROTOTYPES /* we want prototypes */ #include #include diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index cd833f853..03e95b865 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -42,12 +42,6 @@ #include -/* -** The X header misc.h defines these math functions. -*/ -#undef abs -#undef fabs - #define GL_GLEXT_PROTOTYPES /* we want prototypes */ #include #include From 9eab5b3443a1926a29385948acc6c5e0843465ea Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 27 Apr 2011 18:25:27 -0400 Subject: [PATCH 02/12] Replace Fabs() macro with fabs() function gcc generates better code with fabs() anyway. Reviewed-by: Jeremy Huddleston Tested-by: Jeremy Huddleston Reviewed-by: Daniel Stone Signed-off-by: Matt Turner --- include/misc.h | 3 --- mi/miarc.c | 2 +- mi/mifpoly.h | 6 +++--- mi/miwideline.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/misc.h b/include/misc.h index bdcc8cc1e..48492573e 100644 --- a/include/misc.h +++ b/include/misc.h @@ -139,9 +139,6 @@ typedef struct _xReq *xReqPtr; * it in case we haven't done that yet. */ #include -#ifndef Fabs -#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */ -#endif #define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0)) /* this assumes b > 0 */ #define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b) diff --git a/mi/miarc.c b/mi/miarc.c index 881e0db03..cd870fa39 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1487,7 +1487,7 @@ miDatan2 (double dy, double dx) if (dy > 0) return 90.0; return -90.0; - } else if (Fabs (dy) == Fabs (dx)) { + } else if (fabs (dy) == fabs (dx)) { if (dy > 0) { if (dx > 0) return 45.0; diff --git a/mi/mifpoly.h b/mi/mifpoly.h index ffd19a341..cc779c946 100644 --- a/mi/mifpoly.h +++ b/mi/mifpoly.h @@ -51,12 +51,12 @@ SOFTWARE. #include #define EPSILON 0.000001 -#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON) -#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON) +#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON) +#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON) #define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \ (b) - (a) <= 0.5) #define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5))) -#define ISZERO(x) (Fabs((x)) <= EPSILON) +#define ISZERO(x) (fabs((x)) <= EPSILON) #define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y)) #define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y)) #define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y)) diff --git a/mi/miwideline.c b/mi/miwideline.c index bc5ee74c2..057339dbe 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -322,7 +322,7 @@ miPolyBuildEdge ( { double realk, kerror; realk = x0 * dy - y0 * dx; - kerror = Fabs (realk - k); + kerror = fabs (realk - k); if (kerror > .1) printf ("realk: %g k: %g\n", realk, k); } From c10bad3d3e8ff1b90014770fd470f9c67263e46f Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 27 Apr 2011 19:29:06 -0400 Subject: [PATCH 03/12] Silence printf format warnings in helper_exec.c Reviewed-by: Jeremy Huddleston Reviewed-by: Daniel Stone Signed-off-by: Matt Turner --- hw/xfree86/int10/helper_exec.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index ec8420040..8cca28a1e 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -162,9 +162,9 @@ void dump_code(xf86Int10InfoPtr pInt) { int i; - unsigned long lina = SEG_ADR((CARD32), X86_CS, IP); + CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina); + xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina); for (i=0; i<0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); xf86ErrorFVerb(3, "\n"); @@ -220,7 +220,7 @@ port_rep_inb(xf86Int10InfoPtr pInt, register int inc = d_f ? -1 : 1; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_insb(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { MEM_WB(pInt, dst, x_inb(port)); @@ -236,7 +236,7 @@ port_rep_inw(xf86Int10InfoPtr pInt, register int inc = d_f ? -2 : 2; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_insw(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { MEM_WW(pInt, dst, x_inw(port)); @@ -252,7 +252,7 @@ port_rep_inl(xf86Int10InfoPtr pInt, register int inc = d_f ? -4 : 4; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_insl(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { MEM_WL(pInt, dst, x_inl(port)); @@ -268,7 +268,7 @@ port_rep_outb(xf86Int10InfoPtr pInt, register int inc = d_f ? -1 : 1; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_outb(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { x_outb(port, MEM_RB(pInt, dst)); @@ -284,7 +284,7 @@ port_rep_outw(xf86Int10InfoPtr pInt, register int inc = d_f ? -2 : 2; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_outw(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { x_outw(port, MEM_RW(pInt, dst)); @@ -300,7 +300,7 @@ port_rep_outl(xf86Int10InfoPtr pInt, register int inc = d_f ? -4 : 4; CARD32 dst = base; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" rep_outl(%#x) %ld bytes at %8.8lx %s\n", + ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n", port, count, base, d_f ? "up" : "down"); while (count--) { x_outl(port, MEM_RL(pInt, dst)); @@ -410,7 +410,7 @@ x_inl(CARD16 port) if (!pciCfg1in(port, &val)) { val = inl(Int10Current->ioBase + port); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" inl(%#x) = %8.8lx\n", port, val); + ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val); } return val; } @@ -420,7 +420,7 @@ x_outl(CARD16 port, CARD32 val) { if (!pciCfg1out(port, val)) { if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" outl(%#x, %8.8lx)\n", port, val); + ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val); outl(Int10Current->ioBase + port, val); } } @@ -506,7 +506,7 @@ pciCfg1in(CARD16 addr, CARD32 *val) pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr), (uint32_t *)val, PCI_OFFSET(PciCfg1Addr)); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val); + ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", PciCfg1Addr, *val); return 1; } return 0; @@ -521,7 +521,7 @@ pciCfg1out(CARD16 addr, CARD32 val) } if (addr == 0xCFC) { if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outl(%#lx, %8.8lx)\n", PciCfg1Addr, val); + ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", PciCfg1Addr, val); pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr)); return 1; @@ -545,7 +545,7 @@ pciCfg1inw(CARD16 addr, CARD16 *val) pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inw(%#lx) = %4.4x\n", PciCfg1Addr + offset, *val); + ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", PciCfg1Addr + offset, *val); return 1; } return 0; @@ -566,7 +566,7 @@ pciCfg1outw(CARD16 addr, CARD16 val) const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outw(%#lx, %4.4x)\n", PciCfg1Addr + offset, val); + ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", PciCfg1Addr + offset, val); pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; @@ -590,7 +590,7 @@ pciCfg1inb(CARD16 addr, CARD8 *val) pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_inb(%#lx) = %2.2x\n", PciCfg1Addr + offset, *val); + ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", PciCfg1Addr + offset, *val); return 1; } return 0; @@ -611,7 +611,7 @@ pciCfg1outb(CARD16 addr, CARD8 val) const unsigned offset = addr - 0xCFC; if (PRINT_PORT && DEBUG_IO_TRACE()) - ErrorF(" cfg_outb(%#lx, %2.2x)\n", PciCfg1Addr + offset, val); + ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", PciCfg1Addr + offset, val); pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr), val, PCI_OFFSET(PciCfg1Addr) + offset); return 1; From 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 4 Aug 2011 15:35:41 -0400 Subject: [PATCH 04/12] Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- Xext/bigreq.c | 7 +- Xext/dpms.c | 60 +- Xext/geext.c | 16 +- Xext/panoramiX.c | 62 +- Xext/panoramiXSwap.c | 26 +- Xext/saver.c | 69 +-- Xext/security.c | 37 +- Xext/shape.c | 110 ++-- Xext/shm.c | 108 ++-- Xext/sync.c | 186 +++--- Xext/xcmisc.c | 36 +- Xext/xf86bigfont.c | 62 +- Xext/xres.c | 60 +- Xext/xselinux_ext.c | 64 +-- Xext/xtest.c | 30 +- Xext/xvdisp.c | 407 ++++++------- Xi/allowev.c | 6 +- Xi/chgdctl.c | 15 +- Xi/chgfctl.c | 52 +- Xi/chgkbd.c | 4 +- Xi/chgkmap.c | 3 +- Xi/chgprop.c | 8 +- Xi/chgptr.c | 4 +- Xi/closedev.c | 4 +- Xi/devbell.c | 4 +- Xi/extinit.c | 238 ++++---- Xi/getbmap.c | 10 +- Xi/getdctl.c | 35 +- Xi/getfctl.c | 64 +-- Xi/getfocus.c | 14 +- Xi/getkmap.c | 10 +- Xi/getmmap.c | 10 +- Xi/getprop.c | 14 +- Xi/getselev.c | 16 +- Xi/getvers.c | 16 +- Xi/grabdev.c | 16 +- Xi/grabdevb.c | 10 +- Xi/grabdevk.c | 10 +- Xi/gtmotion.c | 20 +- Xi/listdev.c | 28 +- Xi/opendev.c | 10 +- Xi/queryst.c | 13 +- Xi/selectev.c | 8 +- Xi/sendexev.c | 7 +- Xi/setbmap.c | 10 +- Xi/setdval.c | 10 +- Xi/setfocus.c | 8 +- Xi/setmmap.c | 10 +- Xi/setmode.c | 10 +- Xi/ungrdev.c | 6 +- Xi/ungrdevb.c | 8 +- Xi/ungrdevk.c | 8 +- Xi/xiallowev.c | 8 +- Xi/xichangecursor.c | 10 +- Xi/xichangehierarchy.c | 11 +- Xi/xigetclientpointer.c | 12 +- Xi/xigrabdev.c | 28 +- Xi/xipassivegrab.c | 47 +- Xi/xiproperty.c | 102 ++-- Xi/xiquerydevice.c | 66 +-- Xi/xiquerypointer.c | 28 +- Xi/xiqueryversion.c | 17 +- Xi/xiselectev.c | 30 +- Xi/xisetclientpointer.c | 8 +- Xi/xisetdevfocus.c | 23 +- Xi/xiwarppointer.c | 22 +- composite/compext.c | 74 +-- damageext/damageext.c | 44 +- dbe/dbe.c | 63 +- dix/dispatch.c | 2 +- dix/swaprep.c | 401 ++++++------- dix/swapreq.c | 728 +++++++++++------------- hw/dmx/dmx.c | 241 ++++---- hw/kdrive/ephyr/ephyrdriext.c | 24 +- hw/kdrive/ephyr/ephyrhostproxy.c | 2 +- hw/vfb/InitOutput.c | 3 +- hw/xfree86/dixmods/extmod/xf86vmode.c | 444 +++++++-------- hw/xfree86/dri/xf86dri.c | 24 +- hw/xfree86/dri2/dri2ext.c | 16 +- hw/xquartz/applewm.c | 8 +- hw/xquartz/pseudoramiX.c | 65 +-- hw/xquartz/xpr/appledri.c | 8 +- hw/xwin/winwindowswm.c | 6 +- include/misc.h | 14 +- os/connection.c | 6 +- os/io.c | 6 +- randr/rrcrtc.c | 100 ++-- randr/rrdispatch.c | 9 +- randr/rrmode.c | 7 +- randr/rroutput.c | 33 +- randr/rrproperty.c | 48 +- randr/rrscreen.c | 106 ++-- randr/rrsdispatch.c | 262 ++++----- randr/rrxinerama.c | 88 ++- record/record.c | 98 ++-- render/render.c | 442 +++++++------- test/xi2/protocol-eventconvert.c | 110 ++-- test/xi2/protocol-xigetclientpointer.c | 12 +- test/xi2/protocol-xigetselectedevents.c | 17 +- test/xi2/protocol-xipassivegrabdevice.c | 29 +- test/xi2/protocol-xiquerydevice.c | 49 +- test/xi2/protocol-xiquerypointer.c | 24 +- test/xi2/protocol-xiqueryversion.c | 16 +- test/xi2/protocol-xiselectevents.c | 11 +- test/xi2/protocol-xisetclientpointer.c | 7 +- test/xi2/protocol-xiwarppointer.c | 19 +- xfixes/cursor.c | 122 ++-- xfixes/region.c | 156 +++-- xfixes/saveset.c | 5 +- xfixes/select.c | 9 +- xfixes/xfixes.c | 16 +- xkb/ddxList.c | 5 +- xkb/xkb.c | 411 ++++++------- xkb/xkbEvents.c | 105 ++-- xkb/xkbSwap.c | 338 +++++------ 115 files changed, 3164 insertions(+), 4140 deletions(-) diff --git a/Xext/bigreq.c b/Xext/bigreq.c index a540bcbcb..a939e1699 100644 --- a/Xext/bigreq.c +++ b/Xext/bigreq.c @@ -47,10 +47,9 @@ ProcBigReqDispatch (ClientPtr client) { REQUEST(xBigReqEnableReq); xBigReqEnableReply rep; - int n; if (client->swapped) { - swaps(&stuff->length, n); + swaps(&stuff->length); } if (stuff->brReqType != X_BigReqEnable) return BadRequest; @@ -62,8 +61,8 @@ ProcBigReqDispatch (ClientPtr client) rep.sequenceNumber = client->sequence; rep.max_request_size = maxBigRequestSize; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.max_request_size, n); + swaps(&rep.sequenceNumber); + swapl(&rep.max_request_size); } WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep); return Success; diff --git a/Xext/dpms.c b/Xext/dpms.c index 33a6e267c..0c8f18f47 100644 --- a/Xext/dpms.c +++ b/Xext/dpms.c @@ -46,7 +46,6 @@ ProcDPMSGetVersion(ClientPtr client) { /* REQUEST(xDPMSGetVersionReq); */ xDPMSGetVersionReply rep; - int n; REQUEST_SIZE_MATCH(xDPMSGetVersionReq); @@ -56,9 +55,9 @@ ProcDPMSGetVersion(ClientPtr client) rep.majorVersion = DPMSMajorVersion; rep.minorVersion = DPMSMinorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep); return Success; @@ -69,7 +68,6 @@ ProcDPMSCapable(ClientPtr client) { /* REQUEST(xDPMSCapableReq); */ xDPMSCapableReply rep; - int n; REQUEST_SIZE_MATCH(xDPMSCapableReq); @@ -79,7 +77,7 @@ ProcDPMSCapable(ClientPtr client) rep.capable = DPMSCapableFlag; if (client->swapped) { - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep); return Success; @@ -90,7 +88,6 @@ ProcDPMSGetTimeouts(ClientPtr client) { /* REQUEST(xDPMSGetTimeoutsReq); */ xDPMSGetTimeoutsReply rep; - int n; REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); @@ -102,10 +99,10 @@ ProcDPMSGetTimeouts(ClientPtr client) rep.off = DPMSOffTime / MILLI_PER_SECOND; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.standby, n); - swaps(&rep.suspend, n); - swaps(&rep.off, n); + swaps(&rep.sequenceNumber); + swaps(&rep.standby); + swaps(&rep.suspend); + swaps(&rep.off); } WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep); return Success; @@ -195,7 +192,6 @@ ProcDPMSInfo(ClientPtr client) { /* REQUEST(xDPMSInfoReq); */ xDPMSInfoReply rep; - int n; REQUEST_SIZE_MATCH(xDPMSInfoReq); @@ -206,8 +202,8 @@ ProcDPMSInfo(ClientPtr client) rep.state = DPMSEnabled; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.power_level, n); + swaps(&rep.sequenceNumber); + swaps(&rep.power_level); } WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep); return Success; @@ -244,13 +240,12 @@ ProcDPMSDispatch (ClientPtr client) static int SProcDPMSGetVersion(ClientPtr client) { - int n; REQUEST(xDPMSGetVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSGetVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion, n); + swaps(&stuff->majorVersion); + swaps(&stuff->minorVersion); return ProcDPMSGetVersion(client); } @@ -258,9 +253,8 @@ static int SProcDPMSCapable(ClientPtr client) { REQUEST(xDPMSCapableReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSCapableReq); return ProcDPMSCapable(client); @@ -270,9 +264,8 @@ static int SProcDPMSGetTimeouts(ClientPtr client) { REQUEST(xDPMSGetTimeoutsReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); return ProcDPMSGetTimeouts(client); @@ -282,14 +275,13 @@ static int SProcDPMSSetTimeouts(ClientPtr client) { REQUEST(xDPMSSetTimeoutsReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq); - swaps(&stuff->standby, n); - swaps(&stuff->suspend, n); - swaps(&stuff->off, n); + swaps(&stuff->standby); + swaps(&stuff->suspend); + swaps(&stuff->off); return ProcDPMSSetTimeouts(client); } @@ -297,9 +289,8 @@ static int SProcDPMSEnable(ClientPtr client) { REQUEST(xDPMSEnableReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSEnableReq); return ProcDPMSEnable(client); @@ -309,9 +300,8 @@ static int SProcDPMSDisable(ClientPtr client) { REQUEST(xDPMSDisableReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSDisableReq); return ProcDPMSDisable(client); @@ -321,12 +311,11 @@ static int SProcDPMSForceLevel(ClientPtr client) { REQUEST(xDPMSForceLevelReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSForceLevelReq); - swaps(&stuff->level, n); + swaps(&stuff->level); return ProcDPMSForceLevel(client); } @@ -335,9 +324,8 @@ static int SProcDPMSInfo(ClientPtr client) { REQUEST(xDPMSInfoReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDPMSInfoReq); return ProcDPMSInfo(client); diff --git a/Xext/geext.c b/Xext/geext.c index 18f8ffeac..a8718ccbd 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -58,7 +58,6 @@ static void SGEGenericEvent(xEvent* from, xEvent* to); static int ProcGEQueryVersion(ClientPtr client) { - int n; GEClientInfoPtr pGEClient = GEGetClient(client); xGEQueryVersionReply rep; REQUEST(xGEQueryVersionReq); @@ -80,10 +79,10 @@ ProcGEQueryVersion(ClientPtr client) 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(xGEQueryVersionReply), (char*)&rep); @@ -101,13 +100,12 @@ int (*ProcGEVector[GENumberRequests])(ClientPtr) = { static int SProcGEQueryVersion(ClientPtr client) { - int n; REQUEST(xGEQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGEQueryVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion, n); + swaps(&stuff->majorVersion); + swaps(&stuff->minorVersion); return(*ProcGEVector[stuff->ReqType])(client); } diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 00afe94f1..3401db9dc 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -909,7 +909,6 @@ ProcPanoramiXQueryVersion (ClientPtr client) { /* REQUEST(xPanoramiXQueryVersionReq); */ xPanoramiXQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); rep.type = X_Reply; @@ -918,10 +917,10 @@ ProcPanoramiXQueryVersion (ClientPtr client) rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION; rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION; 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; @@ -933,7 +932,7 @@ ProcPanoramiXGetState(ClientPtr client) REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; - int n, rc; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -946,9 +945,9 @@ ProcPanoramiXGetState(ClientPtr client) rep.state = !noPanoramiXExtension; rep.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; @@ -961,7 +960,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client) REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; - int n, rc; + int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -974,9 +973,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client) rep.ScreenCount = PanoramiXNumScreens; rep.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; @@ -988,7 +987,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client) REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; - int n, rc; + int rc; if (stuff->screen >= PanoramiXNumScreens) return BadMatch; @@ -1007,12 +1006,12 @@ ProcPanoramiXGetScreenSize(ClientPtr client) rep.window = stuff->window; rep.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; @@ -1040,10 +1039,9 @@ ProcXineramaIsActive(ClientPtr client) rep.state = !noPanoramiXExtension; #endif if (client->swapped) { - int n; - 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; @@ -1063,10 +1061,9 @@ ProcXineramaQueryScreens(ClientPtr client) rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { - int n; - 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); @@ -1081,11 +1078,10 @@ ProcXineramaQueryScreens(ClientPtr client) scratch.height = screenInfo.screens[i]->height; if(client->swapped) { - int n; - swaps (&scratch.x_org, n); - swaps (&scratch.y_org, n); - swaps (&scratch.width, n); - swaps (&scratch.height, n); + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); } WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); } diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c index e1720c9ab..79277021a 100644 --- a/Xext/panoramiXSwap.c +++ b/Xext/panoramiXSwap.c @@ -51,9 +51,8 @@ static int SProcPanoramiXQueryVersion (ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); - int n; - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return ProcPanoramiXQueryVersion(client); } @@ -62,11 +61,10 @@ static int SProcPanoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); - int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcPanoramiXGetState(client); } @@ -74,11 +72,10 @@ static int SProcPanoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); - int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcPanoramiXGetScreenCount(client); } @@ -86,12 +83,11 @@ static int SProcPanoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); - int n; - 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 ProcPanoramiXGetScreenSize(client); } @@ -100,9 +96,8 @@ static int SProcXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); - int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcXineramaIsActive(client); } @@ -112,9 +107,8 @@ static int SProcXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); - int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcXineramaQueryScreens(client); } diff --git a/Xext/saver.c b/Xext/saver.c index 18886038a..9e91b717b 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -669,8 +669,6 @@ static int ProcScreenSaverQueryVersion (ClientPtr client) { xScreenSaverQueryVersionReply rep; - int n; - REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq); rep.type = X_Reply; rep.length = 0; @@ -678,8 +676,8 @@ ProcScreenSaverQueryVersion (ClientPtr client) rep.majorVersion = SERVER_SAVER_MAJOR_VERSION; rep.minorVersion = SERVER_SAVER_MINOR_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep); return Success; @@ -690,7 +688,7 @@ ProcScreenSaverQueryInfo (ClientPtr client) { REQUEST(xScreenSaverQueryInfoReq); xScreenSaverQueryInfoReply rep; - int n, rc; + int rc; ScreenSaverStuffPtr pSaver; DrawablePtr pDraw; CARD32 lastInput; @@ -750,12 +748,12 @@ ProcScreenSaverQueryInfo (ClientPtr client) rep.kind = ScreenSaverInternal; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.window, n); - swapl (&rep.tilOrSince, n); - swapl (&rep.idle, n); - swapl (&rep.eventMask, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.window); + swapl(&rep.tilOrSince); + swapl(&rep.idle); + swapl(&rep.eventMask); } WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep); return Success; @@ -1384,9 +1382,7 @@ static int SProcScreenSaverQueryVersion (ClientPtr client) { REQUEST(xScreenSaverQueryVersionReq); - int n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq); return ProcScreenSaverQueryVersion (client); } @@ -1395,11 +1391,9 @@ static int SProcScreenSaverQueryInfo (ClientPtr client) { REQUEST(xScreenSaverQueryInfoReq); - int n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq); - swapl (&stuff->drawable, n); + swapl(&stuff->drawable); return ProcScreenSaverQueryInfo (client); } @@ -1407,12 +1401,10 @@ static int SProcScreenSaverSelectInput (ClientPtr client) { REQUEST(xScreenSaverSelectInputReq); - int n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq); - swapl (&stuff->drawable, n); - swapl (&stuff->eventMask, n); + swapl(&stuff->drawable); + swapl(&stuff->eventMask); return ProcScreenSaverSelectInput (client); } @@ -1420,18 +1412,16 @@ static int SProcScreenSaverSetAttributes (ClientPtr client) { REQUEST(xScreenSaverSetAttributesReq); - int n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq); - swapl (&stuff->drawable, n); - swaps (&stuff->x, n); - swaps (&stuff->y, n); - swaps (&stuff->width, n); - swaps (&stuff->height, n); - swaps (&stuff->borderWidth, n); - swapl (&stuff->visualID, n); - swapl (&stuff->mask, n); + swapl(&stuff->drawable); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swaps(&stuff->borderWidth); + swapl(&stuff->visualID); + swapl(&stuff->mask); SwapRestL(stuff); return ProcScreenSaverSetAttributes (client); } @@ -1440,23 +1430,20 @@ static int SProcScreenSaverUnsetAttributes (ClientPtr client) { REQUEST(xScreenSaverUnsetAttributesReq); - int n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq); - swapl (&stuff->drawable, n); + swapl(&stuff->drawable); return ProcScreenSaverUnsetAttributes (client); } static int SProcScreenSaverSuspend (ClientPtr client) { - int n; REQUEST(xScreenSaverSuspendReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); - swapl(&stuff->suspend, n); + swapl(&stuff->suspend); return ProcScreenSaverSuspend (client); } diff --git a/Xext/security.c b/Xext/security.c index 8673880d1..08d8158e3 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -368,10 +368,9 @@ ProcSecurityQueryVersion( rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; if(client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); } (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), (char *)&rep); @@ -580,11 +579,10 @@ ProcSecurityGenerateAuthorization( if (client->swapped) { - char n; - swapl(&rep.length, n); - swaps(&rep.sequenceNumber, n); - swapl(&rep.authId, n); - swaps(&rep.dataLength, n); + swapl(&rep.length); + swaps(&rep.sequenceNumber); + swapl(&rep.authId); + swaps(&rep.dataLength); } WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), @@ -652,12 +650,11 @@ SProcSecurityQueryVersion( ClientPtr client) { REQUEST(xSecurityQueryVersionReq); - char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion,n); + swaps(&stuff->majorVersion); + swaps(&stuff->minorVersion); return ProcSecurityQueryVersion(client); } /* SProcSecurityQueryVersion */ @@ -667,16 +664,15 @@ SProcSecurityGenerateAuthorization( ClientPtr client) { REQUEST(xSecurityGenerateAuthorizationReq); - char n; CARD32 *values; unsigned long nvalues; int values_offset; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq); - swaps(&stuff->nbytesAuthProto, n); - swaps(&stuff->nbytesAuthData, n); - swapl(&stuff->valueMask, n); + swaps(&stuff->nbytesAuthProto); + swaps(&stuff->nbytesAuthData); + swapl(&stuff->valueMask); values_offset = bytes_to_int32(stuff->nbytesAuthProto) + bytes_to_int32(stuff->nbytesAuthData); if (values_offset > @@ -694,11 +690,10 @@ SProcSecurityRevokeAuthorization( ClientPtr client) { REQUEST(xSecurityRevokeAuthorizationReq); - char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); - swapl(&stuff->authId, n); + swapl(&stuff->authId); return ProcSecurityRevokeAuthorization(client); } /* SProcSecurityRevokeAuthorization */ diff --git a/Xext/shape.c b/Xext/shape.c index 115fc07ed..cb2a0e0f6 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -214,8 +214,6 @@ static int ProcShapeQueryVersion (ClientPtr client) { xShapeQueryVersionReply rep; - int n; - REQUEST_SIZE_MATCH (xShapeQueryVersionReq); memset(&rep, 0, sizeof(xShapeQueryVersionReply)); rep.type = X_Reply; @@ -224,10 +222,10 @@ ProcShapeQueryVersion (ClientPtr client) rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION; rep.minorVersion = SERVER_SHAPE_MINOR_VERSION; 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 (xShapeQueryVersionReply), (char *)&rep); return Success; @@ -637,7 +635,7 @@ ProcShapeQueryExtents (ClientPtr client) WindowPtr pWin; xShapeQueryExtentsReply rep; BoxRec extents, *pExtents; - int n, rc; + int rc; RegionPtr region; REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); @@ -679,16 +677,16 @@ ProcShapeQueryExtents (ClientPtr client) rep.widthClipShape = extents.x2 - extents.x1; rep.heightClipShape = extents.y2 - extents.y1; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.xBoundingShape, n); - swaps(&rep.yBoundingShape, n); - swaps(&rep.widthBoundingShape, n); - swaps(&rep.heightBoundingShape, n); - swaps(&rep.xClipShape, n); - swaps(&rep.yClipShape, n); - swaps(&rep.widthClipShape, n); - swaps(&rep.heightClipShape, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.xBoundingShape); + swaps(&rep.yBoundingShape); + swaps(&rep.widthBoundingShape); + swaps(&rep.heightBoundingShape); + swaps(&rep.xClipShape); + swaps(&rep.yClipShape); + swaps(&rep.widthClipShape); + swaps(&rep.heightClipShape); } WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep); return Success; @@ -915,8 +913,6 @@ ProcShapeInputSelected (ClientPtr client) ShapeEventPtr pShapeEvent, *pHead; int enabled, rc; xShapeInputSelectedReply rep; - int n; - REQUEST_SIZE_MATCH (xShapeInputSelectedReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -942,8 +938,8 @@ ProcShapeInputSelected (ClientPtr client) rep.sequenceNumber = client->sequence; rep.enabled = enabled; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep); return Success; @@ -958,8 +954,6 @@ ProcShapeGetRectangles (ClientPtr client) xRectangle *rects; int nrects, i, rc; RegionPtr region; - int n; - REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -1023,9 +1017,9 @@ ProcShapeGetRectangles (ClientPtr client) rep.ordering = YXBanded; rep.nrects = nrects; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.nrects, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.nrects); SwapShorts ((short *)rects, (unsigned long)nrects * 4); } WriteToClient (client, sizeof (rep), (char *) &rep); @@ -1100,24 +1094,22 @@ SShapeNotifyEvent(xShapeNotifyEvent *from, xShapeNotifyEvent *to) static int SProcShapeQueryVersion (ClientPtr client) { - int n; REQUEST (xShapeQueryVersionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); return ProcShapeQueryVersion (client); } static int SProcShapeRectangles (ClientPtr client) { - char n; REQUEST (xShapeRectanglesReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); SwapRestS(stuff); return ProcShapeRectangles (client); } @@ -1125,80 +1117,74 @@ SProcShapeRectangles (ClientPtr client) static int SProcShapeMask (ClientPtr client) { - char n; REQUEST (xShapeMaskReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeMaskReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); - swapl (&stuff->src, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); + swapl(&stuff->src); return ProcShapeMask (client); } static int SProcShapeCombine (ClientPtr client) { - char n; REQUEST (xShapeCombineReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeCombineReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); - swapl (&stuff->src, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); + swapl(&stuff->src); return ProcShapeCombine (client); } static int SProcShapeOffset (ClientPtr client) { - char n; REQUEST (xShapeOffsetReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeOffsetReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); return ProcShapeOffset (client); } static int SProcShapeQueryExtents (ClientPtr client) { - char n; REQUEST (xShapeQueryExtentsReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeQueryExtentsReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcShapeQueryExtents (client); } static int SProcShapeSelectInput (ClientPtr client) { - char n; REQUEST (xShapeSelectInputReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeSelectInputReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcShapeSelectInput (client); } static int SProcShapeInputSelected (ClientPtr client) { - int n; REQUEST (xShapeInputSelectedReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xShapeInputSelectedReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcShapeInputSelected (client); } @@ -1206,11 +1192,9 @@ static int SProcShapeGetRectangles (ClientPtr client) { REQUEST(xShapeGetRectanglesReq); - char n; - - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShapeGetRectanglesReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcShapeGetRectangles (client); } diff --git a/Xext/shm.c b/Xext/shm.c index b08af821b..73cf5d862 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -289,7 +289,6 @@ static int ProcShmQueryVersion(ClientPtr client) { xShmQueryVersionReply rep; - int n; REQUEST_SIZE_MATCH(xShmQueryVersionReq); memset(&rep, 0, sizeof(xShmQueryVersionReply)); @@ -303,12 +302,12 @@ ProcShmQueryVersion(ClientPtr client) rep.uid = geteuid(); rep.gid = getegid(); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swaps(&rep.uid, n); - swaps(&rep.gid, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); + swaps(&rep.uid); + swaps(&rep.gid); } WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep); return Success; @@ -633,7 +632,7 @@ ProcShmGetImage(ClientPtr client) Mask plane = 0; xShmGetImageReply xgi; ShmDescPtr shmdesc; - int n, rc; + int rc; REQUEST(xShmGetImageReq); @@ -727,10 +726,10 @@ ProcShmGetImage(ClientPtr client) } if (client->swapped) { - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); + swaps(&xgi.sequenceNumber); + swapl(&xgi.length); + swapl(&xgi.visual); + swapl(&xgi.size); } WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); @@ -897,11 +896,10 @@ ProcPanoramiXShmGetImage(ClientPtr client) free(drawables); if (client->swapped) { - int n; - swaps(&xgi.sequenceNumber, n); - swapl(&xgi.length, n); - swapl(&xgi.visual, n); - swapl(&xgi.size, n); + swaps(&xgi.sequenceNumber); + swapl(&xgi.length); + swapl(&xgi.visual); + swapl(&xgi.size); } WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi); @@ -1165,89 +1163,83 @@ SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to) static int SProcShmQueryVersion(ClientPtr client) { - int n; REQUEST(xShmQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcShmQueryVersion(client); } static int SProcShmAttach(ClientPtr client) { - int n; REQUEST(xShmAttachReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmAttachReq); - swapl(&stuff->shmseg, n); - swapl(&stuff->shmid, n); + swapl(&stuff->shmseg); + swapl(&stuff->shmid); return ProcShmAttach(client); } static int SProcShmDetach(ClientPtr client) { - int n; REQUEST(xShmDetachReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmDetachReq); - swapl(&stuff->shmseg, n); + swapl(&stuff->shmseg); return ProcShmDetach(client); } static int SProcShmPutImage(ClientPtr client) { - int n; REQUEST(xShmPutImageReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->totalWidth, n); - swaps(&stuff->totalHeight, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->totalWidth); + swaps(&stuff->totalHeight); + swaps(&stuff->srcX); + swaps(&stuff->srcY); + swaps(&stuff->srcWidth); + swaps(&stuff->srcHeight); + swaps(&stuff->dstX); + swaps(&stuff->dstY); + swapl(&stuff->shmseg); + swapl(&stuff->offset); return ProcShmPutImage(client); } static int SProcShmGetImage(ClientPtr client) { - int n; REQUEST(xShmGetImageReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); + swapl(&stuff->drawable); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->planeMask); + swapl(&stuff->shmseg); + swapl(&stuff->offset); return ProcShmGetImage(client); } static int SProcShmCreatePixmap(ClientPtr client) { - int n; REQUEST(xShmCreatePixmapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xShmCreatePixmapReq); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->offset, n); + swapl(&stuff->pid); + swapl(&stuff->drawable); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->shmseg); + swapl(&stuff->offset); return ProcShmCreatePixmap(client); } diff --git a/Xext/sync.c b/Xext/sync.c index 36dd27888..3b257f73b 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -1273,8 +1273,6 @@ static int ProcSyncInitialize(ClientPtr client) { xSyncInitializeReply rep; - int n; - REQUEST_SIZE_MATCH(xSyncInitializeReq); memset(&rep, 0, sizeof(xSyncInitializeReply)); @@ -1286,7 +1284,7 @@ ProcSyncInitialize(ClientPtr client) if (client->swapped) { - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(rep), (char *) &rep); return Success; @@ -1326,10 +1324,9 @@ ProcSyncListSystemCounters(ClientPtr client) if (client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.nCounters, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.nCounters); } for (i = 0; i < SyncNumSystemCounters; i++) @@ -1346,11 +1343,10 @@ ProcSyncListSystemCounters(ClientPtr client) if (client->swapped) { - char n; - swapl(&walklist->counter, n); - swapl(&walklist->resolution_hi, n); - swapl(&walklist->resolution_lo, n); - swaps(&walklist->name_length, n); + swapl(&walklist->counter); + swapl(&walklist->resolution_hi); + swapl(&walklist->resolution_lo); + swaps(&walklist->name_length); } pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter; @@ -1433,9 +1429,8 @@ ProcSyncGetPriority(ClientPtr client) if (client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.priority, n); + swaps(&rep.sequenceNumber); + swapl(&rep.priority); } WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); @@ -1732,11 +1727,10 @@ ProcSyncQueryCounter(ClientPtr client) rep.value_lo = XSyncValueLow32(pCounter->value); if (client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.value_hi, n); - swapl(&rep.value_lo, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.value_hi); + swapl(&rep.value_lo); } WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); return Success; @@ -1921,15 +1915,14 @@ ProcSyncQueryAlarm(ClientPtr client) if (client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.counter, n); - swapl(&rep.wait_value_hi, n); - swapl(&rep.wait_value_lo, n); - swapl(&rep.test_type, n); - swapl(&rep.delta_hi, n); - swapl(&rep.delta_lo, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.counter); + swapl(&rep.wait_value_hi); + swapl(&rep.wait_value_lo); + swapl(&rep.test_type); + swapl(&rep.delta_hi); + swapl(&rep.delta_lo); } WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); @@ -2087,9 +2080,8 @@ ProcSyncQueryFence(ClientPtr client) if (client->swapped) { - char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep); @@ -2242,9 +2234,7 @@ static int SProcSyncInitialize(ClientPtr client) { REQUEST(xSyncInitializeReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncInitializeReq); return ProcSyncInitialize(client); @@ -2254,9 +2244,7 @@ static int SProcSyncListSystemCounters(ClientPtr client) { REQUEST(xSyncListSystemCountersReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncListSystemCountersReq); return ProcSyncListSystemCounters(client); @@ -2266,13 +2254,11 @@ static int SProcSyncCreateCounter(ClientPtr client) { REQUEST(xSyncCreateCounterReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncCreateCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->initial_value_lo, n); - swapl(&stuff->initial_value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->initial_value_lo); + swapl(&stuff->initial_value_hi); return ProcSyncCreateCounter(client); } @@ -2281,13 +2267,11 @@ static int SProcSyncSetCounter(ClientPtr client) { REQUEST(xSyncSetCounterReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncSetCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->value_lo, n); - swapl(&stuff->value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->value_lo); + swapl(&stuff->value_hi); return ProcSyncSetCounter(client); } @@ -2296,13 +2280,11 @@ static int SProcSyncChangeCounter(ClientPtr client) { REQUEST(xSyncChangeCounterReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncChangeCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->value_lo, n); - swapl(&stuff->value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->value_lo); + swapl(&stuff->value_hi); return ProcSyncChangeCounter(client); } @@ -2311,11 +2293,9 @@ static int SProcSyncQueryCounter(ClientPtr client) { REQUEST(xSyncQueryCounterReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncQueryCounterReq); - swapl(&stuff->counter, n); + swapl(&stuff->counter); return ProcSyncQueryCounter(client); } @@ -2324,11 +2304,9 @@ static int SProcSyncDestroyCounter(ClientPtr client) { REQUEST(xSyncDestroyCounterReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncDestroyCounterReq); - swapl(&stuff->counter, n); + swapl(&stuff->counter); return ProcSyncDestroyCounter(client); } @@ -2337,9 +2315,7 @@ static int SProcSyncAwait(ClientPtr client) { REQUEST(xSyncAwaitReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); SwapRestL(stuff); @@ -2350,12 +2326,10 @@ static int SProcSyncCreateAlarm(ClientPtr client) { REQUEST(xSyncCreateAlarmReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); - swapl(&stuff->id, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->id); + swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncCreateAlarm(client); @@ -2365,12 +2339,10 @@ static int SProcSyncChangeAlarm(ClientPtr client) { REQUEST(xSyncChangeAlarmReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); - swapl(&stuff->alarm, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->alarm); + swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncChangeAlarm(client); } @@ -2379,11 +2351,9 @@ static int SProcSyncQueryAlarm(ClientPtr client) { REQUEST(xSyncQueryAlarmReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncQueryAlarmReq); - swapl(&stuff->alarm, n); + swapl(&stuff->alarm); return ProcSyncQueryAlarm(client); } @@ -2392,11 +2362,9 @@ static int SProcSyncDestroyAlarm(ClientPtr client) { REQUEST(xSyncDestroyAlarmReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq); - swapl(&stuff->alarm, n); + swapl(&stuff->alarm); return ProcSyncDestroyAlarm(client); } @@ -2405,12 +2373,10 @@ static int SProcSyncSetPriority(ClientPtr client) { REQUEST(xSyncSetPriorityReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncSetPriorityReq); - swapl(&stuff->id, n); - swapl(&stuff->priority, n); + swapl(&stuff->id); + swapl(&stuff->priority); return ProcSyncSetPriority(client); } @@ -2419,11 +2385,9 @@ static int SProcSyncGetPriority(ClientPtr client) { REQUEST(xSyncGetPriorityReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncGetPriorityReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSyncGetPriority(client); } @@ -2432,11 +2396,9 @@ static int SProcSyncCreateFence(ClientPtr client) { REQUEST(xSyncCreateFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncCreateFenceReq); - swapl(&stuff->fid, n); + swapl(&stuff->fid); return ProcSyncCreateFence(client); } @@ -2445,11 +2407,9 @@ static int SProcSyncTriggerFence(ClientPtr client) { REQUEST(xSyncTriggerFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncTriggerFenceReq); - swapl(&stuff->fid, n); + swapl(&stuff->fid); return ProcSyncTriggerFence(client); } @@ -2458,11 +2418,9 @@ static int SProcSyncResetFence(ClientPtr client) { REQUEST(xSyncResetFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncResetFenceReq); - swapl(&stuff->fid, n); + swapl(&stuff->fid); return ProcSyncResetFence(client); } @@ -2471,11 +2429,9 @@ static int SProcSyncDestroyFence(ClientPtr client) { REQUEST(xSyncDestroyFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncDestroyFenceReq); - swapl(&stuff->fid, n); + swapl(&stuff->fid); return ProcSyncDestroyFence(client); } @@ -2484,11 +2440,9 @@ static int SProcSyncQueryFence(ClientPtr client) { REQUEST(xSyncQueryFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncQueryFenceReq); - swapl(&stuff->fid, n); + swapl(&stuff->fid); return ProcSyncQueryFence(client); } @@ -2497,9 +2451,7 @@ static int SProcSyncAwaitFence(ClientPtr client) { REQUEST(xSyncAwaitFenceReq); - char n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq); SwapRestL(stuff); diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c index 378afccca..8e3c9cd80 100644 --- a/Xext/xcmisc.c +++ b/Xext/xcmisc.c @@ -51,7 +51,6 @@ static int ProcXCMiscGetVersion(ClientPtr client) { xXCMiscGetVersionReply rep; - int n; REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); rep.type = X_Reply; @@ -60,9 +59,9 @@ ProcXCMiscGetVersion(ClientPtr client) rep.majorVersion = XCMiscMajorVersion; rep.minorVersion = XCMiscMinorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep); return Success; @@ -72,7 +71,6 @@ static int ProcXCMiscGetXIDRange(ClientPtr client) { xXCMiscGetXIDRangeReply rep; - int n; XID min_id, max_id; REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq); @@ -83,9 +81,9 @@ ProcXCMiscGetXIDRange(ClientPtr client) rep.start_id = min_id; rep.count = max_id - min_id + 1; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.start_id, n); - swapl(&rep.count, n); + swaps(&rep.sequenceNumber); + swapl(&rep.start_id); + swapl(&rep.count); } WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep); return Success; @@ -96,7 +94,6 @@ ProcXCMiscGetXIDList(ClientPtr client) { REQUEST(xXCMiscGetXIDListReq); xXCMiscGetXIDListReply rep; - int n; XID *pids; unsigned int count; @@ -116,9 +113,9 @@ ProcXCMiscGetXIDList(ClientPtr client) rep.length = count; rep.count = count; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.count, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.count); } WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep); if (count) @@ -150,34 +147,31 @@ ProcXCMiscDispatch (ClientPtr client) static int SProcXCMiscGetVersion(ClientPtr client) { - int n; REQUEST(xXCMiscGetVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion, n); + swaps(&stuff->majorVersion); + swaps(&stuff->minorVersion); return ProcXCMiscGetVersion(client); } static int SProcXCMiscGetXIDRange(ClientPtr client) { - int n; REQUEST(xReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcXCMiscGetXIDRange(client); } static int SProcXCMiscGetXIDList(ClientPtr client) { - int n; REQUEST(xXCMiscGetXIDListReq); - swaps(&stuff->length, n); - swapl(&stuff->count, n); + swaps(&stuff->length); + swapl(&stuff->count); return ProcXCMiscGetXIDList(client); } diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index de8274469..4b63a13a1 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -307,13 +307,13 @@ ProcXF86BigfontQueryVersion( ; /* may add more bits here in future versions */ if (client->swapped) { char tmp; - swaps(&reply.sequenceNumber, tmp); - swapl(&reply.length, tmp); - swaps(&reply.majorVersion, tmp); - swaps(&reply.minorVersion, tmp); - swapl(&reply.uid, tmp); - swapl(&reply.gid, tmp); - swapl(&reply.signature, tmp); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swaps(&reply.majorVersion); + swaps(&reply.minorVersion); + swapl(&reply.uid); + swapl(&reply.gid); + swapl(&reply.signature); } WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), (char *)&reply); @@ -326,12 +326,12 @@ swapCharInfo( { char tmp; - swaps(&pCI->leftSideBearing, tmp); - swaps(&pCI->rightSideBearing, tmp); - swaps(&pCI->characterWidth, tmp); - swaps(&pCI->ascent, tmp); - swaps(&pCI->descent, tmp); - swaps(&pCI->attributes, tmp); + swaps(&pCI->leftSideBearing); + swaps(&pCI->rightSideBearing); + swaps(&pCI->characterWidth); + swaps(&pCI->ascent); + swaps(&pCI->descent); + swaps(&pCI->attributes); } /* static CARD32 hashCI (xCharInfo *p); */ @@ -587,20 +587,20 @@ ProcXF86BigfontQueryFont( reply->shmsegoffset = 0; if (client->swapped) { char tmp; - swaps(&reply->sequenceNumber, tmp); - swapl(&reply->length, tmp); + swaps(&reply->sequenceNumber); + swapl(&reply->length); swapCharInfo(&reply->minBounds); swapCharInfo(&reply->maxBounds); - swaps(&reply->minCharOrByte2, tmp); - swaps(&reply->maxCharOrByte2, tmp); - swaps(&reply->defaultChar, tmp); - swaps(&reply->nFontProps, tmp); - swaps(&reply->fontAscent, tmp); - swaps(&reply->fontDescent, tmp); - swapl(&reply->nCharInfos, tmp); - swapl(&reply->nUniqCharInfos, tmp); - swapl(&reply->shmid, tmp); - swapl(&reply->shmsegoffset, tmp); + swaps(&reply->minCharOrByte2); + swaps(&reply->maxCharOrByte2); + swaps(&reply->defaultChar); + swaps(&reply->nFontProps); + swaps(&reply->fontAscent); + swaps(&reply->fontDescent); + swapl(&reply->nCharInfos); + swapl(&reply->nUniqCharInfos); + swapl(&reply->shmid); + swapl(&reply->shmsegoffset); } p = (char*) &reply[1]; { @@ -614,8 +614,8 @@ ProcXF86BigfontQueryFont( prFP->value = pFP->value; if (client->swapped) { char tmp; - swapl(&prFP->name, tmp); - swapl(&prFP->value, tmp); + swapl(&prFP->name); + swapl(&prFP->value); } } p = (char*) prFP; @@ -635,7 +635,7 @@ ProcXF86BigfontQueryFont( *ps = pIndex2UniqIndex[j]; if (client->swapped) { char tmp; - swaps(ps, tmp); + swaps(ps); } } } @@ -672,7 +672,7 @@ SProcXF86BigfontQueryVersion( REQUEST(xXF86BigfontQueryVersionReq); char tmp; - swaps(&stuff->length, tmp); + swaps(&stuff->length); return ProcXF86BigfontQueryVersion(client); } @@ -683,9 +683,9 @@ SProcXF86BigfontQueryFont( REQUEST(xXF86BigfontQueryFontReq); char tmp; - swaps(&stuff->length, tmp); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq); - swapl(&stuff->id, tmp); + swapl(&stuff->id); return ProcXF86BigfontQueryFont(client); } diff --git a/Xext/xres.c b/Xext/xres.c index 06639a2cf..9df12ae81 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -43,11 +43,10 @@ ProcXResQueryVersion (ClientPtr client) rep.server_major = SERVER_XRES_MAJOR_VERSION; rep.server_minor = SERVER_XRES_MINOR_VERSION; if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.server_major, n); - swaps(&rep.server_minor, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.server_major); + swaps(&rep.server_minor); } WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep); return Success; @@ -78,10 +77,9 @@ ProcXResQueryClients (ClientPtr client) rep.num_clients = num_clients; rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient); if (client->swapped) { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.num_clients, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.num_clients); } WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep); @@ -93,9 +91,8 @@ ProcXResQueryClients (ClientPtr client) scratch.resource_mask = RESOURCE_ID_MASK; if(client->swapped) { - int n; - swapl (&scratch.resource_base, n); - swapl (&scratch.resource_mask, n); + swapl(&scratch.resource_base); + swapl(&scratch.resource_mask); } WriteToClient (client, sz_xXResClient, (char *) &scratch); } @@ -147,10 +144,9 @@ ProcXResQueryClientResources (ClientPtr client) rep.num_types = num_types; rep.length = bytes_to_int32(rep.num_types * sz_xXResType); if (client->swapped) { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.num_types, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.num_types); } WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep); @@ -174,9 +170,8 @@ ProcXResQueryClientResources (ClientPtr client) scratch.count = counts[i]; if(client->swapped) { - int n; - swapl (&scratch.resource_type, n); - swapl (&scratch.count, n); + swapl(&scratch.resource_type); + swapl(&scratch.count); } WriteToClient (client, sz_xXResType, (char *) &scratch); } @@ -287,11 +282,10 @@ ProcXResQueryClientPixmapBytes (ClientPtr client) rep.bytes_overflow = 0; #endif if (client->swapped) { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swapl (&rep.bytes, n); - swapl (&rep.bytes_overflow, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.bytes); + swapl(&rep.bytes_overflow); } WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep); @@ -321,11 +315,9 @@ static int SProcXResQueryVersion (ClientPtr client) { REQUEST(xXResQueryVersionReq); - int n; - REQUEST_SIZE_MATCH (xXResQueryVersionReq); - swaps(&stuff->client_major,n); - swaps(&stuff->client_minor,n); + swaps(&stuff->client_major); + swaps(&stuff->client_minor); return ProcXResQueryVersion(client); } @@ -333,10 +325,8 @@ static int SProcXResQueryClientResources (ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); - int n; - REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq); - swaps(&stuff->xid,n); + swaps(&stuff->xid); return ProcXResQueryClientResources(client); } @@ -344,10 +334,8 @@ static int SProcXResQueryClientPixmapBytes (ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); - int n; - REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq); - swaps(&stuff->xid,n); + swaps(&stuff->xid); return ProcXResQueryClientPixmapBytes(client); } @@ -355,9 +343,7 @@ static int SProcResDispatch (ClientPtr client) { REQUEST(xReq); - int n; - - swaps(&stuff->length,n); + swaps(&stuff->length); switch (stuff->data) { case X_XResQueryVersion: diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c index 374571c4b..56f2d1ff2 100644 --- a/Xext/xselinux_ext.c +++ b/Xext/xselinux_ext.c @@ -71,11 +71,10 @@ ProcSELinuxQueryVersion(ClientPtr client) rep.server_major = SELINUX_MAJOR_VERSION; rep.server_minor = SELINUX_MINOR_VERSION; if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.server_major, n); - swaps(&rep.server_minor, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.server_major); + swaps(&rep.server_minor); } WriteToClient(client, sizeof(rep), (char *)&rep); return Success; @@ -100,10 +99,9 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid) rep.context_len = len; if (client->swapped) { - int n; - swapl(&rep.length, n); - swaps(&rep.sequenceNumber, n); - swapl(&rep.context_len, n); + swapl(&rep.length); + swaps(&rep.sequenceNumber); + swapl(&rep.context_len); } WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep); @@ -353,17 +351,17 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items, for (k = 0; k < count; k++) { buf[pos] = items[k].id; if (client->swapped) - swapl(buf + pos, n); + swapl(buf + pos); pos++; buf[pos] = items[k].octx_len * 4; if (client->swapped) - swapl(buf + pos, n); + swapl(buf + pos); pos++; buf[pos] = items[k].dctx_len * 4; if (client->swapped) - swapl(buf + pos, n); + swapl(buf + pos); pos++; memcpy((char *)(buf + pos), items[k].octx, strlen(items[k].octx) + 1); @@ -379,9 +377,9 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items, rep.count = count; if (client->swapped) { - swapl(&rep.length, n); - swaps(&rep.sequenceNumber, n); - swapl(&rep.count, n); + swapl(&rep.length); + swaps(&rep.sequenceNumber); + swapl(&rep.count); } WriteToClient(client, sizeof(SELinuxListItemsReply), (char *)&rep); @@ -529,11 +527,10 @@ static int SProcSELinuxQueryVersion(ClientPtr client) { REQUEST(SELinuxQueryVersionReq); - int n; REQUEST_SIZE_MATCH(SELinuxQueryVersionReq); - swaps(&stuff->client_major, n); - swaps(&stuff->client_minor, n); + swaps(&stuff->client_major); + swaps(&stuff->client_minor); return ProcSELinuxQueryVersion(client); } @@ -541,10 +538,9 @@ static int SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) { REQUEST(SELinuxSetCreateContextReq); - int n; REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq); - swapl(&stuff->context_len, n); + swapl(&stuff->context_len); return ProcSELinuxSetCreateContext(client, offset); } @@ -552,11 +548,10 @@ static int SProcSELinuxSetDeviceContext(ClientPtr client) { REQUEST(SELinuxSetContextReq); - int n; REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq); - swapl(&stuff->id, n); - swapl(&stuff->context_len, n); + swapl(&stuff->id); + swapl(&stuff->context_len); return ProcSELinuxSetDeviceContext(client); } @@ -564,10 +559,9 @@ static int SProcSELinuxGetDeviceContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetContextReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSELinuxGetDeviceContext(client); } @@ -575,10 +569,9 @@ static int SProcSELinuxGetDrawableContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetContextReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSELinuxGetDrawableContext(client); } @@ -586,11 +579,10 @@ static int SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey) { REQUEST(SELinuxGetPropertyContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq); - swapl(&stuff->window, n); - swapl(&stuff->property, n); + swapl(&stuff->window); + swapl(&stuff->property); return ProcSELinuxGetPropertyContext(client, privKey); } @@ -598,10 +590,9 @@ static int SProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey) { REQUEST(SELinuxGetContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetContextReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSELinuxGetSelectionContext(client, privKey); } @@ -609,10 +600,9 @@ static int SProcSELinuxListProperties(ClientPtr client) { REQUEST(SELinuxGetContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetContextReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSELinuxListProperties(client); } @@ -620,10 +610,9 @@ static int SProcSELinuxGetClientContext(ClientPtr client) { REQUEST(SELinuxGetContextReq); - int n; REQUEST_SIZE_MATCH(SELinuxGetContextReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSELinuxGetClientContext(client); } @@ -631,9 +620,8 @@ static int SProcSELinuxDispatch(ClientPtr client) { REQUEST(xReq); - int n; - swaps(&stuff->length, n); + swaps(&stuff->length); switch (stuff->data) { case X_SELinuxQueryVersion: diff --git a/Xext/xtest.c b/Xext/xtest.c index cc675c116..945e202d6 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -91,7 +91,6 @@ static int ProcXTestGetVersion(ClientPtr client) { xXTestGetVersionReply rep; - int n; REQUEST_SIZE_MATCH(xXTestGetVersionReq); rep.type = X_Reply; @@ -100,8 +99,8 @@ ProcXTestGetVersion(ClientPtr client) rep.majorVersion = XTestMajorVersion; rep.minorVersion = XTestMinorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swaps(&rep.minorVersion); } WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep); return Success; @@ -114,7 +113,7 @@ ProcXTestCompareCursor(ClientPtr client) xXTestCompareCursorReply rep; WindowPtr pWin; CursorPtr pCursor; - int n, rc; + int rc; DeviceIntPtr ptr = PickPointer(client); REQUEST_SIZE_MATCH(xXTestCompareCursorReq); @@ -139,7 +138,7 @@ ProcXTestCompareCursor(ClientPtr client) rep.sequenceNumber = client->sequence; rep.same = (wCursor(pWin) == pCursor); if (client->swapped) { - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep); return Success; @@ -348,7 +347,7 @@ ProcXTestFakeInput(ClientPtr client) if (client->swapped) { (void) XTestSwapFakeInput(client, (xReq *)stuff); - swaps(&stuff->length, n); + swaps(&stuff->length); } ResetCurrentRequest (client); client->sequence--; @@ -476,25 +475,23 @@ ProcXTestDispatch (ClientPtr client) static int SProcXTestGetVersion(ClientPtr client) { - int n; REQUEST(xXTestGetVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestGetVersionReq); - swaps(&stuff->minorVersion, n); + swaps(&stuff->minorVersion); return ProcXTestGetVersion(client); } static int SProcXTestCompareCursor(ClientPtr client) { - int n; REQUEST(xXTestCompareCursorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestCompareCursorReq); - swapl(&stuff->window, n); - swapl(&stuff->cursor, n); + swapl(&stuff->window); + swapl(&stuff->cursor); return ProcXTestCompareCursor(client); } @@ -525,10 +522,10 @@ XTestSwapFakeInput(ClientPtr client, xReq *req) static int SProcXTestFakeInput(ClientPtr client) { - int n; + int n; REQUEST(xReq); - swaps(&stuff->length, n); + swaps(&stuff->length); n = XTestSwapFakeInput(client, stuff); if (n != Success) return n; @@ -538,10 +535,9 @@ SProcXTestFakeInput(ClientPtr client) static int SProcXTestGrabControl(ClientPtr client) { - int n; REQUEST(xXTestGrabControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXTestGrabControlReq); return ProcXTestGrabControl(client); } diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index b96843159..364a90cf2 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -59,12 +59,10 @@ SWriteQueryExtensionReply( ClientPtr client, xvQueryExtensionReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->version, n); - swaps(&rep->revision, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->version); + swaps(&rep->revision); (void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep); @@ -76,11 +74,9 @@ SWriteQueryAdaptorsReply( ClientPtr client, xvQueryAdaptorsReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_adaptors, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_adaptors); (void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep); @@ -92,11 +88,9 @@ SWriteQueryEncodingsReply( ClientPtr client, xvQueryEncodingsReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_encodings, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_encodings); (void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep); @@ -108,12 +102,10 @@ SWriteAdaptorInfo( ClientPtr client, xvAdaptorInfo *pAdaptor ){ - char n; - - swapl(&pAdaptor->base_id, n); - swaps(&pAdaptor->name_size, n); - swaps(&pAdaptor->num_ports, n); - swaps(&pAdaptor->num_formats, n); + swapl(&pAdaptor->base_id); + swaps(&pAdaptor->name_size); + swaps(&pAdaptor->num_ports); + swaps(&pAdaptor->num_formats); (void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor); @@ -125,14 +117,13 @@ SWriteEncodingInfo( ClientPtr client, xvEncodingInfo *pEncoding ){ - char n; - swapl(&pEncoding->encoding, n); - swaps(&pEncoding->name_size, n); - swaps(&pEncoding->width, n); - swaps(&pEncoding->height, n); - swapl(&pEncoding->rate.numerator, n); - swapl(&pEncoding->rate.denominator, n); + swapl(&pEncoding->encoding); + swaps(&pEncoding->name_size); + swaps(&pEncoding->width); + swaps(&pEncoding->height); + swapl(&pEncoding->rate.numerator); + swapl(&pEncoding->rate.denominator); (void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding); return Success; @@ -143,9 +134,7 @@ SWriteFormat( ClientPtr client, xvFormat *pFormat ){ - char n; - - swapl(&pFormat->visual, n); + swapl(&pFormat->visual); (void)WriteToClient(client, sz_xvFormat, (char *)pFormat); return Success; @@ -156,12 +145,10 @@ SWriteAttributeInfo( ClientPtr client, xvAttributeInfo *pAtt ){ - char n; - - swapl(&pAtt->flags, n); - swapl(&pAtt->size, n); - swapl(&pAtt->min, n); - swapl(&pAtt->max, n); + swapl(&pAtt->flags); + swapl(&pAtt->size); + swapl(&pAtt->min); + swapl(&pAtt->max); (void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt); return Success; @@ -172,21 +159,19 @@ SWriteImageFormatInfo( ClientPtr client, xvImageFormatInfo *pImage ){ - char n; - - swapl(&pImage->id, n); - swapl(&pImage->red_mask, n); - swapl(&pImage->green_mask, n); - swapl(&pImage->blue_mask, n); - swapl(&pImage->y_sample_bits, n); - swapl(&pImage->u_sample_bits, n); - swapl(&pImage->v_sample_bits, n); - swapl(&pImage->horz_y_period, n); - swapl(&pImage->horz_u_period, n); - swapl(&pImage->horz_v_period, n); - swapl(&pImage->vert_y_period, n); - swapl(&pImage->vert_u_period, n); - swapl(&pImage->vert_v_period, n); + swapl(&pImage->id); + swapl(&pImage->red_mask); + swapl(&pImage->green_mask); + swapl(&pImage->blue_mask); + swapl(&pImage->y_sample_bits); + swapl(&pImage->u_sample_bits); + swapl(&pImage->v_sample_bits); + swapl(&pImage->horz_y_period); + swapl(&pImage->horz_u_period); + swapl(&pImage->horz_v_period); + swapl(&pImage->vert_y_period); + swapl(&pImage->vert_u_period); + swapl(&pImage->vert_v_period); (void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage); @@ -198,10 +183,8 @@ SWriteGrabPortReply( ClientPtr client, xvGrabPortReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); (void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep); @@ -213,11 +196,9 @@ SWriteGetPortAttributeReply( ClientPtr client, xvGetPortAttributeReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->value, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->value); (void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep); @@ -229,12 +210,10 @@ SWriteQueryBestSizeReply( ClientPtr client, xvQueryBestSizeReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->actual_width, n); - swaps(&rep->actual_height, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->actual_width); + swaps(&rep->actual_height); (void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep); @@ -246,12 +225,10 @@ SWriteQueryPortAttributesReply( ClientPtr client, xvQueryPortAttributesReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_attributes, n); - swapl(&rep->text_size, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->num_attributes); + swapl(&rep->text_size); (void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep); @@ -263,14 +240,12 @@ SWriteQueryImageAttributesReply( ClientPtr client, xvQueryImageAttributesReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_planes, n); - swapl(&rep->data_size, n); - swaps(&rep->width, n); - swaps(&rep->height, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->num_planes); + swapl(&rep->data_size); + swaps(&rep->width); + swaps(&rep->height); (void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep); @@ -282,11 +257,9 @@ SWriteListImageFormatsReply( ClientPtr client, xvListImageFormatsReply *rep ){ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->num_formats, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->num_formats); (void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep); @@ -1278,154 +1251,144 @@ ProcXvDispatch(ClientPtr client) static int SProcXvQueryExtension(ClientPtr client) { - char n; REQUEST(xvQueryExtensionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return XvProcVector[xv_QueryExtension](client); } static int SProcXvQueryAdaptors(ClientPtr client) { - char n; REQUEST(xvQueryAdaptorsReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return XvProcVector[xv_QueryAdaptors](client); } static int SProcXvQueryEncodings(ClientPtr client) { - char n; REQUEST(xvQueryEncodingsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); + swaps(&stuff->length); + swapl(&stuff->port); return XvProcVector[xv_QueryEncodings](client); } static int SProcXvGrabPort(ClientPtr client) { - char n; REQUEST(xvGrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->time); return XvProcVector[xv_GrabPort](client); } static int SProcXvUngrabPort(ClientPtr client) { - char n; REQUEST(xvUngrabPortReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->time, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->time); return XvProcVector[xv_UngrabPort](client); } static int SProcXvPutVideo(ClientPtr client) { - char n; REQUEST(xvPutVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->vid_x); + swaps(&stuff->vid_y); + swaps(&stuff->vid_w); + swaps(&stuff->vid_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); return XvProcVector[xv_PutVideo](client); } static int SProcXvPutStill(ClientPtr client) { - char n; REQUEST(xvPutStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->vid_x); + swaps(&stuff->vid_y); + swaps(&stuff->vid_w); + swaps(&stuff->vid_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); return XvProcVector[xv_PutStill](client); } static int SProcXvGetVideo(ClientPtr client) { - char n; REQUEST(xvGetVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->vid_x); + swaps(&stuff->vid_y); + swaps(&stuff->vid_w); + swaps(&stuff->vid_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); return XvProcVector[xv_GetVideo](client); } static int SProcXvGetStill(ClientPtr client) { - char n; REQUEST(xvGetStillReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->vid_x, n); - swaps(&stuff->vid_y, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->vid_x); + swaps(&stuff->vid_y); + swaps(&stuff->vid_w); + swaps(&stuff->vid_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); return XvProcVector[xv_GetStill](client); } static int SProcXvPutImage(ClientPtr client) { - char n; REQUEST(xvPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->id, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swapl(&stuff->id); + swaps(&stuff->src_x); + swaps(&stuff->src_y); + swaps(&stuff->src_w); + swaps(&stuff->src_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); + swaps(&stuff->width); + swaps(&stuff->height); return XvProcVector[xv_PutImage](client); } @@ -1433,25 +1396,24 @@ SProcXvPutImage(ClientPtr client) static int SProcXvShmPutImage(ClientPtr client) { - char n; REQUEST(xvShmPutImageReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swapl(&stuff->shmseg, n); - swapl(&stuff->id, n); - swapl(&stuff->offset, n); - swaps(&stuff->src_x, n); - swaps(&stuff->src_y, n); - swaps(&stuff->src_w, n); - swaps(&stuff->src_h, n); - swaps(&stuff->drw_x, n); - swaps(&stuff->drw_y, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swapl(&stuff->shmseg); + swapl(&stuff->id); + swapl(&stuff->offset); + swaps(&stuff->src_x); + swaps(&stuff->src_y); + swaps(&stuff->src_w); + swaps(&stuff->src_h); + swaps(&stuff->drw_x); + swaps(&stuff->drw_y); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); + swaps(&stuff->width); + swaps(&stuff->height); return XvProcVector[xv_ShmPutImage](client); } #else /* MITSHM */ @@ -1461,101 +1423,92 @@ SProcXvShmPutImage(ClientPtr client) static int SProcXvSelectVideoNotify(ClientPtr client) { - char n; REQUEST(xvSelectVideoNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); + swaps(&stuff->length); + swapl(&stuff->drawable); return XvProcVector[xv_SelectVideoNotify](client); } static int SProcXvSelectPortNotify(ClientPtr client) { - char n; REQUEST(xvSelectPortNotifyReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); + swaps(&stuff->length); + swapl(&stuff->port); return XvProcVector[xv_SelectPortNotify](client); } static int SProcXvStopVideo(ClientPtr client) { - char n; REQUEST(xvStopVideoReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->drawable, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->drawable); return XvProcVector[xv_StopVideo](client); } static int SProcXvSetPortAttribute(ClientPtr client) { - char n; REQUEST(xvSetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); - swapl(&stuff->value, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->attribute); + swapl(&stuff->value); return XvProcVector[xv_SetPortAttribute](client); } static int SProcXvGetPortAttribute(ClientPtr client) { - char n; REQUEST(xvGetPortAttributeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->attribute, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->attribute); return XvProcVector[xv_GetPortAttribute](client); } static int SProcXvQueryBestSize(ClientPtr client) { - char n; REQUEST(xvQueryBestSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swaps(&stuff->vid_w, n); - swaps(&stuff->vid_h, n); - swaps(&stuff->drw_w, n); - swaps(&stuff->drw_h, n); + swaps(&stuff->length); + swapl(&stuff->port); + swaps(&stuff->vid_w); + swaps(&stuff->vid_h); + swaps(&stuff->drw_w); + swaps(&stuff->drw_h); return XvProcVector[xv_QueryBestSize](client); } static int SProcXvQueryPortAttributes(ClientPtr client) { - char n; REQUEST(xvQueryPortAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); + swaps(&stuff->length); + swapl(&stuff->port); return XvProcVector[xv_QueryPortAttributes](client); } static int SProcXvQueryImageAttributes(ClientPtr client) { - char n; REQUEST(xvQueryImageAttributesReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); - swapl(&stuff->id, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->port); + swapl(&stuff->id); + swaps(&stuff->width); + swaps(&stuff->height); return XvProcVector[xv_QueryImageAttributes](client); } static int SProcXvListImageFormats(ClientPtr client) { - char n; REQUEST(xvListImageFormatsReq); - swaps(&stuff->length, n); - swapl(&stuff->port, n); + swaps(&stuff->length); + swapl(&stuff->port); return XvProcVector[xv_ListImageFormats](client); } diff --git a/Xi/allowev.c b/Xi/allowev.c index 96f3b543c..ff9e667b0 100644 --- a/Xi/allowev.c +++ b/Xi/allowev.c @@ -72,12 +72,10 @@ SOFTWARE. int SProcXAllowDeviceEvents(ClientPtr client) { - char n; - REQUEST(xAllowDeviceEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllowDeviceEventsReq); - swapl(&stuff->time, n); + swapl(&stuff->time); return (ProcXAllowDeviceEvents(client)); } diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c index 4c4aebac6..ca697d9d8 100644 --- a/Xi/chgdctl.c +++ b/Xi/chgdctl.c @@ -74,16 +74,15 @@ SOFTWARE. int SProcXChangeDeviceControl(ClientPtr client) { - char n; xDeviceCtl *ctl; REQUEST(xChangeDeviceControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); - swaps(&stuff->control, n); + swaps(&stuff->control); ctl = (xDeviceCtl*)&stuff[1]; - swaps(&ctl->control, n); - swaps(&ctl->length, n); + swaps(&ctl->control); + swaps(&ctl->length); switch(stuff->control) { case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: @@ -230,9 +229,7 @@ void SRepXChangeDeviceControl(ClientPtr client, int size, xChangeDeviceControlReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/chgfctl.c b/Xi/chgfctl.c index 9189702c1..f818cd0ce 100644 --- a/Xi/chgfctl.c +++ b/Xi/chgfctl.c @@ -74,12 +74,10 @@ SOFTWARE. int SProcXChangeFeedbackControl(ClientPtr client) { - char n; - REQUEST(xChangeFeedbackControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq); - swapl(&stuff->mask, n); + swapl(&stuff->mask); return (ProcXChangeFeedbackControl(client)); } @@ -93,17 +91,16 @@ static int ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, KbdFeedbackPtr k, xKbdFeedbackCtl * f) { - char n; KeybdCtrl kctrl; int t; int key = DO_ALL; if (client->swapped) { - swaps(&f->length, n); - swaps(&f->pitch, n); - swaps(&f->duration, n); - swapl(&f->led_mask, n); - swapl(&f->led_values, n); + swaps(&f->length); + swaps(&f->pitch); + swaps(&f->duration); + swapl(&f->led_mask); + swapl(&f->led_values); } kctrl = k->ctrl; @@ -210,14 +207,13 @@ static int ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, PtrFeedbackPtr p, xPtrFeedbackCtl * f) { - char n; PtrCtrl pctrl; /* might get BadValue part way through */ if (client->swapped) { - swaps(&f->length, n); - swaps(&f->num, n); - swaps(&f->denom, n); - swaps(&f->thresh, n); + swaps(&f->length); + swaps(&f->num); + swaps(&f->denom); + swaps(&f->thresh); } pctrl = p->ctrl; @@ -276,11 +272,9 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, IntegerFeedbackPtr i, xIntegerFeedbackCtl * f) { - char n; - if (client->swapped) { - swaps(&f->length, n); - swapl(&f->int_to_display, n); + swaps(&f->length); + swapl(&f->int_to_display); } i->ctrl.integer_displayed = f->int_to_display; @@ -299,13 +293,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, StringFeedbackPtr s, xStringFeedbackCtl * f) { - char n; int i, j; KeySym *syms, *sup_syms; syms = (KeySym *) (f + 1); if (client->swapped) { - swaps(&f->length, n); /* swapped num_keysyms in calling proc */ + swaps(&f->length); /* swapped num_keysyms in calling proc */ SwapLongs((CARD32 *) syms, f->num_keysyms); } @@ -339,14 +332,13 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, BellFeedbackPtr b, xBellFeedbackCtl * f) { - char n; int t; BellCtrl bctrl; /* might get BadValue part way through */ if (client->swapped) { - swaps(&f->length, n); - swaps(&f->pitch, n); - swaps(&f->duration, n); + swaps(&f->length); + swaps(&f->pitch); + swaps(&f->duration); } bctrl = b->ctrl; @@ -397,13 +389,12 @@ static int ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask, LedFeedbackPtr l, xLedFeedbackCtl * f) { - char n; LedCtrl lctrl; /* might get BadValue part way through */ if (client->swapped) { - swaps(&f->length, n); - swapl(&f->led_values, n); - swapl(&f->led_mask, n); + swaps(&f->length); + swapl(&f->led_values); + swapl(&f->led_mask); } f->led_mask &= l->ctrl.led_mask; /* set only supported leds */ @@ -467,11 +458,10 @@ ProcXChangeFeedbackControl(ClientPtr client) break; case StringFeedbackClass: { - char n; xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]); if (client->swapped) { - swaps(&f->num_keysyms, n); + swaps(&f->num_keysyms); } if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms)) return BadLength; diff --git a/Xi/chgkbd.c b/Xi/chgkbd.c index f9fd09902..d8139193f 100644 --- a/Xi/chgkbd.c +++ b/Xi/chgkbd.c @@ -75,10 +75,8 @@ SOFTWARE. int SProcXChangeKeyboardDevice(ClientPtr client) { - char n; - REQUEST(xChangeKeyboardDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq); return (ProcXChangeKeyboardDevice(client)); } diff --git a/Xi/chgkmap.c b/Xi/chgkmap.c index e4b9e154c..32caa2d02 100644 --- a/Xi/chgkmap.c +++ b/Xi/chgkmap.c @@ -72,11 +72,10 @@ SOFTWARE. int SProcXChangeDeviceKeyMapping(ClientPtr client) { - char n; unsigned int count; REQUEST(xChangeDeviceKeyMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq); count = stuff->keyCodes * stuff->keySymsPerKeyCode; REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32)); diff --git a/Xi/chgprop.c b/Xi/chgprop.c index d24a24638..a9f833c25 100644 --- a/Xi/chgprop.c +++ b/Xi/chgprop.c @@ -74,13 +74,11 @@ SOFTWARE. int SProcXChangeDeviceDontPropagateList(ClientPtr client) { - char n; - REQUEST(xChangeDeviceDontPropagateListReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq); - swapl(&stuff->window, n); - swaps(&stuff->count, n); + swapl(&stuff->window); + swaps(&stuff->count); REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq, stuff->count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->count); diff --git a/Xi/chgptr.c b/Xi/chgptr.c index 6a4fbc342..ee04ab662 100644 --- a/Xi/chgptr.c +++ b/Xi/chgptr.c @@ -77,10 +77,8 @@ SOFTWARE. int SProcXChangePointerDevice(ClientPtr client) { - char n; - REQUEST(xChangePointerDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangePointerDeviceReq); return (ProcXChangePointerDevice(client)); } diff --git a/Xi/closedev.c b/Xi/closedev.c index 1064be67b..54ada55f5 100644 --- a/Xi/closedev.c +++ b/Xi/closedev.c @@ -73,10 +73,8 @@ SOFTWARE. int SProcXCloseDevice(ClientPtr client) { - char n; - REQUEST(xCloseDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCloseDeviceReq); return (ProcXCloseDevice(client)); } diff --git a/Xi/devbell.c b/Xi/devbell.c index 539da1814..881524260 100644 --- a/Xi/devbell.c +++ b/Xi/devbell.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXDeviceBell(ClientPtr client) { - char n; - REQUEST(xDeviceBellReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXDeviceBell(client)); } diff --git a/Xi/extinit.c b/Xi/extinit.c index 0905e1877..7724f5f5a 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -533,43 +533,39 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) static void SEventDeviceValuator(deviceValuator * from, deviceValuator * to) { - char n; int i; INT32 *ip B32; *to = *from; - swaps(&to->sequenceNumber, n); - swaps(&to->device_state, n); + swaps(&to->sequenceNumber); + swaps(&to->device_state); ip = &to->valuator0; for (i = 0; i < 6; i++) { - swapl((ip + i), n); /* macro - braces are required */ + swapl(ip + i); } } static void SEventFocus(deviceFocus * from, deviceFocus * to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); - swapl(&to->time, n); - swapl(&to->window, n); + swaps(&to->sequenceNumber); + swapl(&to->time); + swapl(&to->window); } static void SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to) { int i; - char n; INT32 *ip B32; *to = *from; - swaps(&to->sequenceNumber, n); - swapl(&to->time, n); + swaps(&to->sequenceNumber); + swapl(&to->time); ip = &to->valuator0; for (i = 0; i < 3; i++) { - swapl((ip + i), n); /* macro - braces are required */ + swapl(ip + i); } } @@ -577,93 +573,78 @@ static void SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from, deviceKeyStateNotify * to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); + swaps(&to->sequenceNumber); } static void SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from, deviceButtonStateNotify * to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); + swaps(&to->sequenceNumber); } static void SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); - swapl(&to->time, n); + swaps(&to->sequenceNumber); + swapl(&to->time); } static void SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); - swapl(&to->time, n); + swaps(&to->sequenceNumber); + swapl(&to->time); } static void SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to) { - char n; - *to = *from; - swaps(&to->sequenceNumber,n); - swapl(&to->time, n); - swaps(&to->control, n); + swaps(&to->sequenceNumber); + swapl(&to->time); + swaps(&to->control); } static void SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to) { - char n; - *to = *from; - swaps(&to->sequenceNumber,n); - swapl(&to->time, n); - swapl(&to->atom, n); + swaps(&to->sequenceNumber); + swapl(&to->time); + swapl(&to->atom); } static void SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to) { - char n; - *to = *from; - swaps(&to->sequenceNumber,n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->time, n); - swapl(&to->root, n); - swapl(&to->event, n); - swapl(&to->child, n); - swapl(&to->root_x, n); - swapl(&to->root_y, n); - swapl(&to->event_x, n); - swapl(&to->event_y, n); - swaps(&to->sourceid, n); - swaps(&to->buttons_len, n); - swapl(&to->mods.base_mods, n); - swapl(&to->mods.latched_mods, n); - swapl(&to->mods.locked_mods, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->root); + swapl(&to->event); + swapl(&to->child); + swapl(&to->root_x); + swapl(&to->root_y); + swapl(&to->event_x); + swapl(&to->event_y); + swaps(&to->sourceid); + swaps(&to->buttons_len); + swapl(&to->mods.base_mods); + swapl(&to->mods.latched_mods); + swapl(&to->mods.locked_mods); } static void SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to) { - char n; int i, j; xXIAnyInfo *any; @@ -682,8 +663,8 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to) xXIKeyInfo *ki = (xXIKeyInfo*)any; uint32_t *key = (uint32_t*)&ki[1]; for (j = 0; j < ki->num_keycodes; j++, key++) - swapl(key, n); - swaps(&ki->num_keycodes, n); + swapl(key); + swaps(&ki->num_keycodes); } break; case ButtonClass: @@ -692,71 +673,70 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to) Atom *labels = (Atom*)((char*)bi + sizeof(xXIButtonInfo) + pad_to_int32(bits_to_bytes(bi->num_buttons))); for (j = 0; j < bi->num_buttons; j++) - swapl(&labels[j], n); - swaps(&bi->num_buttons, n); + swapl(&labels[j]); + swaps(&bi->num_buttons); } break; case ValuatorClass: { xXIValuatorInfo* ai = (xXIValuatorInfo*)any; - swapl(&ai->label, n); - swapl(&ai->min.integral, n); - swapl(&ai->min.frac, n); - swapl(&ai->max.integral, n); - swapl(&ai->max.frac, n); - swapl(&ai->resolution, n); - swaps(&ai->number, n); + swapl(&ai->label); + swapl(&ai->min.integral); + swapl(&ai->min.frac); + swapl(&ai->max.integral); + swapl(&ai->max.frac); + swapl(&ai->resolution); + swaps(&ai->number); } break; } - swaps(&any->type, n); - swaps(&any->length, n); - swaps(&any->sourceid, n); + swaps(&any->type); + swaps(&any->length); + swaps(&any->sourceid); any = (xXIAnyInfo*)((char*)any + length * 4); } - swaps(&to->sequenceNumber, n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->time, n); - swaps(&to->num_classes, n); - swaps(&to->sourceid, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swaps(&to->num_classes); + swaps(&to->sourceid); } static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to) { int i; - char n; char *ptr; char *vmask; memcpy(to, from, sizeof(xEvent) + from->length * 4); - swaps(&to->sequenceNumber, n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->time, n); - swapl(&to->detail, n); - swapl(&to->root, n); - swapl(&to->event, n); - swapl(&to->child, n); - swapl(&to->root_x, n); - swapl(&to->root_y, n); - swapl(&to->event_x, n); - swapl(&to->event_y, n); - swaps(&to->buttons_len, n); - swaps(&to->valuators_len, n); - swaps(&to->sourceid, n); - swapl(&to->mods.base_mods, n); - swapl(&to->mods.latched_mods, n); - swapl(&to->mods.locked_mods, n); - swapl(&to->mods.effective_mods, n); - swapl(&to->flags, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->detail); + swapl(&to->root); + swapl(&to->event); + swapl(&to->child); + swapl(&to->root_x); + swapl(&to->root_y); + swapl(&to->event_x); + swapl(&to->event_y); + swaps(&to->buttons_len); + swaps(&to->valuators_len); + swaps(&to->sourceid); + swapl(&to->mods.base_mods); + swapl(&to->mods.latched_mods); + swapl(&to->mods.locked_mods); + swapl(&to->mods.effective_mods); + swapl(&to->flags); ptr = (char*)(&to[1]); ptr += from->buttons_len * 4; @@ -766,9 +746,9 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to) { if (BitIsOn(vmask, i)) { - swapl(((uint32_t*)ptr), n); + swapl(((uint32_t *)ptr)); ptr += 4; - swapl(((uint32_t*)ptr), n); + swapl(((uint32_t *)ptr)); ptr += 4; } } @@ -778,55 +758,51 @@ static void SDeviceHierarchyEvent(xXIHierarchyEvent *from, xXIHierarchyEvent *to) { int i; - char n; xXIHierarchyInfo *info; *to = *from; memcpy(&to[1], &from[1], from->length * 4); - swaps(&to->sequenceNumber, n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->time, n); - swapl(&to->flags, n); - swaps(&to->num_info, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->flags); + swaps(&to->num_info); info = (xXIHierarchyInfo*)&to[1]; for (i = 0; i< from->num_info; i++) { - swaps(&info->deviceid, n); - swaps(&info->attachment, n); + swaps(&info->deviceid); + swaps(&info->attachment); info++; } } static void SXIPropertyEvent(xXIPropertyEvent *from, xXIPropertyEvent *to) { - char n; - *to = *from; - swaps(&to->sequenceNumber, n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->property, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->property); } static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to) { - char n; int i; FP3232 *values; unsigned char *mask; memcpy(to, from, sizeof(xEvent) + from->length * 4); - swaps(&to->sequenceNumber, n); - swapl(&to->length, n); - swaps(&to->evtype, n); - swaps(&to->deviceid, n); - swapl(&to->time, n); - swapl(&to->detail, n); + swaps(&to->sequenceNumber); + swapl(&to->length); + swaps(&to->evtype); + swaps(&to->deviceid); + swapl(&to->time); + swapl(&to->detail); mask = (unsigned char*)&to[1]; @@ -841,16 +817,16 @@ static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to) * they were in aAbBcC order because it's easier and really * doesn't matter. */ - swapl(&values->integral, n); - swapl(&values->frac, n); + swapl(&values->integral); + swapl(&values->frac); values++; - swapl(&values->integral, n); - swapl(&values->frac, n); + swapl(&values->integral); + swapl(&values->frac); values++; } } - swaps(&to->valuators_len, n); + swaps(&to->valuators_len); } diff --git a/Xi/getbmap.c b/Xi/getbmap.c index e2d58972a..b7054f7d2 100644 --- a/Xi/getbmap.c +++ b/Xi/getbmap.c @@ -70,10 +70,8 @@ SOFTWARE. int SProcXGetDeviceButtonMapping(ClientPtr client) { - char n; - REQUEST(xGetDeviceButtonMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXGetDeviceButtonMapping(client)); } @@ -126,9 +124,7 @@ void SRepXGetDeviceButtonMapping(ClientPtr client, int size, xGetDeviceButtonMappingReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 4e04b8b06..4287028db 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -71,12 +71,10 @@ SOFTWARE. int SProcXGetDeviceControl(ClientPtr client) { - char n; - REQUEST(xGetDeviceControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceControlReq); - swaps(&stuff->control, n); + swaps(&stuff->control); return (ProcXGetDeviceControl(client)); } @@ -90,7 +88,6 @@ static void CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, int length) { - char n; AxisInfoPtr a; xDeviceResolutionState *r; int i, *iptr; @@ -108,19 +105,18 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf, for (i = 0, a = v->axes; i < v->numAxes; i++, a++) *iptr++ = a->max_resolution; if (client->swapped) { - swaps(&r->control, n); - swaps(&r->length, n); - swapl(&r->num_valuators, n); + swaps(&r->control); + swaps(&r->length); + swapl(&r->num_valuators); iptr = (int *)buf; for (i = 0; i < (3 * v->numAxes); i++, iptr++) { - swapl(iptr, n); + swapl(iptr); } } } static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) { - char n; xDeviceCoreState *c = (xDeviceCoreState *) buf; c->control = DEVICE_CORE; @@ -129,15 +125,14 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer); if (client->swapped) { - swaps(&c->control, n); - swaps(&c->length, n); - swaps(&c->status, n); + swaps(&c->control); + swaps(&c->length); + swaps(&c->status); } } static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) { - char n; xDeviceEnableState *e = (xDeviceEnableState *) buf; e->control = DEVICE_ENABLE; @@ -145,9 +140,9 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) e->enable = dev->enabled; if (client->swapped) { - swaps(&e->control, n); - swaps(&e->length, n); - swaps(&e->enable, n); + swaps(&e->control); + swaps(&e->length); + swaps(&e->enable); } } @@ -161,10 +156,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) void SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getfctl.c b/Xi/getfctl.c index 9563d63d6..ea80a879d 100644 --- a/Xi/getfctl.c +++ b/Xi/getfctl.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXGetFeedbackControl(ClientPtr client) { - char n; - REQUEST(xGetFeedbackControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXGetFeedbackControl(client)); } @@ -88,7 +86,6 @@ static void CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf) { int i; - char n; xKbdFeedbackState *k2; k2 = (xKbdFeedbackState *) * buf; @@ -104,11 +101,11 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf) for (i = 0; i < 32; i++) k2->auto_repeats[i] = k->ctrl.autoRepeats[i]; if (client->swapped) { - swaps(&k2->length, n); - swaps(&k2->pitch, n); - swaps(&k2->duration, n); - swapl(&k2->led_mask, n); - swapl(&k2->led_values, n); + swaps(&k2->length); + swaps(&k2->pitch); + swaps(&k2->duration); + swapl(&k2->led_mask); + swapl(&k2->led_values); } *buf += sizeof(xKbdFeedbackState); } @@ -122,7 +119,6 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf) static void CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf) { - char n; xPtrFeedbackState *p2; p2 = (xPtrFeedbackState *) * buf; @@ -133,10 +129,10 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf) p2->accelDenom = p->ctrl.den; p2->threshold = p->ctrl.threshold; if (client->swapped) { - swaps(&p2->length, n); - swaps(&p2->accelNum, n); - swaps(&p2->accelDenom, n); - swaps(&p2->threshold, n); + swaps(&p2->length); + swaps(&p2->accelNum); + swaps(&p2->accelDenom); + swaps(&p2->threshold); } *buf += sizeof(xPtrFeedbackState); } @@ -150,7 +146,6 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf) static void CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf) { - char n; xIntegerFeedbackState *i2; i2 = (xIntegerFeedbackState *) * buf; @@ -161,10 +156,10 @@ CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf) i2->min_value = i->ctrl.min_value; i2->max_value = i->ctrl.max_value; if (client->swapped) { - swaps(&i2->length, n); - swapl(&i2->resolution, n); - swapl(&i2->min_value, n); - swapl(&i2->max_value, n); + swaps(&i2->length); + swapl(&i2->resolution); + swapl(&i2->min_value); + swapl(&i2->max_value); } *buf += sizeof(xIntegerFeedbackState); } @@ -179,7 +174,6 @@ static void CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf) { int i; - char n; xStringFeedbackState *s2; KeySym *kptr; @@ -195,12 +189,12 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf) for (i = 0; i < s->ctrl.num_symbols_supported; i++) *kptr++ = *(s->ctrl.symbols_supported + i); if (client->swapped) { - swaps(&s2->length, n); - swaps(&s2->max_symbols, n); - swaps(&s2->num_syms_supported, n); + swaps(&s2->length); + swaps(&s2->max_symbols); + swaps(&s2->num_syms_supported); kptr = (KeySym *) (*buf); for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) { - swapl(kptr, n); + swapl(kptr); } } *buf += (s->ctrl.num_symbols_supported * sizeof(KeySym)); @@ -215,7 +209,6 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf) static void CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf) { - char n; xLedFeedbackState *l2; l2 = (xLedFeedbackState *) * buf; @@ -225,9 +218,9 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf) l2->led_values = l->ctrl.led_values; l2->led_mask = l->ctrl.led_mask; if (client->swapped) { - swaps(&l2->length, n); - swapl(&l2->led_values, n); - swapl(&l2->led_mask, n); + swaps(&l2->length); + swapl(&l2->led_values); + swapl(&l2->led_mask); } *buf += sizeof(xLedFeedbackState); } @@ -241,7 +234,6 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf) static void CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf) { - char n; xBellFeedbackState *b2; b2 = (xBellFeedbackState *) * buf; @@ -252,9 +244,9 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf) b2->pitch = b->ctrl.pitch; b2->duration = b->ctrl.duration; if (client->swapped) { - swaps(&b2->length, n); - swaps(&b2->pitch, n); - swaps(&b2->duration, n); + swaps(&b2->length); + swaps(&b2->pitch); + swaps(&b2->duration); } *buf += sizeof(xBellFeedbackState); } @@ -270,11 +262,9 @@ void SRepXGetFeedbackControl(ClientPtr client, int size, xGetFeedbackControlReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_feedbacks, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_feedbacks); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getfocus.c b/Xi/getfocus.c index 69eadde87..676850df1 100644 --- a/Xi/getfocus.c +++ b/Xi/getfocus.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXGetDeviceFocus(ClientPtr client) { - char n; - REQUEST(xGetDeviceFocusReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXGetDeviceFocus(client)); } @@ -133,11 +131,9 @@ ProcXGetDeviceFocus(ClientPtr client) void SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->focus, n); - swapl(&rep->time, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->focus); + swapl(&rep->time); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getkmap.c b/Xi/getkmap.c index c38467b96..2501ec05a 100644 --- a/Xi/getkmap.c +++ b/Xi/getkmap.c @@ -74,10 +74,8 @@ SOFTWARE. int SProcXGetDeviceKeyMapping(ClientPtr client) { - char n; - REQUEST(xGetDeviceKeyMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXGetDeviceKeyMapping(client)); } @@ -150,9 +148,7 @@ void SRepXGetDeviceKeyMapping(ClientPtr client, int size, xGetDeviceKeyMappingReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getmmap.c b/Xi/getmmap.c index bd652e9d4..4eee00679 100644 --- a/Xi/getmmap.c +++ b/Xi/getmmap.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXGetDeviceModifierMapping(ClientPtr client) { - char n; - REQUEST(xGetDeviceModifierMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXGetDeviceModifierMapping(client)); } @@ -129,9 +127,7 @@ void SRepXGetDeviceModifierMapping(ClientPtr client, int size, xGetDeviceModifierMappingReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getprop.c b/Xi/getprop.c index 5e102627d..11afd3784 100644 --- a/Xi/getprop.c +++ b/Xi/getprop.c @@ -75,12 +75,10 @@ extern int ExtEventIndex; int SProcXGetDeviceDontPropagateList(ClientPtr client) { - char n; - REQUEST(xGetDeviceDontPropagateListReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return (ProcXGetDeviceDontPropagateList(client)); } @@ -178,10 +176,8 @@ void SRepXGetDeviceDontPropagateList(ClientPtr client, int size, xGetDeviceDontPropagateListReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->count, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->count); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getselev.c b/Xi/getselev.c index 7304738b3..b316e2364 100644 --- a/Xi/getselev.c +++ b/Xi/getselev.c @@ -73,12 +73,10 @@ SOFTWARE. int SProcXGetSelectedExtensionEvents(ClientPtr client) { - char n; - REQUEST(xGetSelectedExtensionEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return (ProcXGetSelectedExtensionEvents(client)); } @@ -168,11 +166,9 @@ void SRepXGetSelectedExtensionEvents(ClientPtr client, int size, xGetSelectedExtensionEventsReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->this_client_count, n); - swaps(&rep->all_clients_count, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->this_client_count); + swaps(&rep->all_clients_count); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/getvers.c b/Xi/getvers.c index c8e9ebca6..8bea1c4b9 100644 --- a/Xi/getvers.c +++ b/Xi/getvers.c @@ -73,12 +73,10 @@ XExtensionVersion XIVersion; int SProcXGetExtensionVersion(ClientPtr client) { - char n; - REQUEST(xGetExtensionVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq); - swaps(&stuff->nbytes, n); + swaps(&stuff->nbytes); return (ProcXGetExtensionVersion(client)); } @@ -125,11 +123,9 @@ void SRepXGetExtensionVersion(ClientPtr client, int size, xGetExtensionVersionReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->major_version, n); - swaps(&rep->minor_version, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->major_version); + swaps(&rep->minor_version); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/grabdev.c b/Xi/grabdev.c index 925c9a6d2..4572c33fc 100644 --- a/Xi/grabdev.c +++ b/Xi/grabdev.c @@ -75,14 +75,12 @@ extern int ExtEventIndex; int SProcXGrabDevice(ClientPtr client) { - char n; - REQUEST(xGrabDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceReq); - swapl(&stuff->grabWindow, n); - swapl(&stuff->time, n); - swaps(&stuff->event_count, n); + swapl(&stuff->grabWindow); + swapl(&stuff->time); + swaps(&stuff->event_count); if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; @@ -210,9 +208,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count, void SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/grabdevb.c b/Xi/grabdevb.c index e235f5313..2897d410b 100644 --- a/Xi/grabdevb.c +++ b/Xi/grabdevb.c @@ -74,14 +74,12 @@ SOFTWARE. int SProcXGrabDeviceButton(ClientPtr client) { - char n; - REQUEST(xGrabDeviceButtonReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); - swaps(&stuff->event_count, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); + swaps(&stuff->event_count); REQUEST_FIXED_SIZE(xGrabDeviceButtonReq, stuff->event_count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); diff --git a/Xi/grabdevk.c b/Xi/grabdevk.c index b34867b5f..cedd90d9c 100644 --- a/Xi/grabdevk.c +++ b/Xi/grabdevk.c @@ -74,14 +74,12 @@ SOFTWARE. int SProcXGrabDeviceKey(ClientPtr client) { - char n; - REQUEST(xGrabDeviceKeyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); - swaps(&stuff->event_count, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); + swaps(&stuff->event_count); REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); return (ProcXGrabDeviceKey(client)); diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 9132f4f47..34f167b40 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -71,13 +71,11 @@ SOFTWARE. int SProcXGetDeviceMotionEvents(ClientPtr client) { - char n; - REQUEST(xGetDeviceMotionEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq); - swapl(&stuff->start, n); - swapl(&stuff->stop, n); + swapl(&stuff->start); + swapl(&stuff->stop); return (ProcXGetDeviceMotionEvents(client)); } @@ -143,11 +141,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client) WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep); if (nEvents) { if (client->swapped) { - char n; - bufptr = coords; for (i = 0; i < nEvents * (axes + 1); i++) { - swapl(bufptr, n); + swapl(bufptr); bufptr++; } } @@ -168,10 +164,8 @@ void SRepXGetDeviceMotionEvents(ClientPtr client, int size, xGetDeviceMotionEventsReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->nEvents, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->nEvents); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/listdev.c b/Xi/listdev.c index 29f0d96e3..1b3081d96 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -78,10 +78,8 @@ SOFTWARE. int SProcXListInputDevices(ClientPtr client) { - char n; - REQUEST(xListInputDevicesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXListInputDevices(client)); } @@ -145,7 +143,6 @@ CopyDeviceName(char **namebuf, char *name) static void CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf) { - char n; xButtonInfoPtr b2; b2 = (xButtonInfoPtr) * buf; @@ -153,7 +150,7 @@ CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf) b2->length = sizeof(xButtonInfo); b2->num_buttons = b->numButtons; if (client && client->swapped) { - swaps(&b2->num_buttons, n); /* macro - braces are required */ + swaps(&b2->num_buttons); } *buf += sizeof(xButtonInfo); } @@ -168,7 +165,6 @@ static void CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, char **buf) { - char n; xDeviceInfoPtr dev; dev = (xDeviceInfoPtr) * buf; @@ -188,7 +184,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, dev->use = IsXExtensionDevice; if (client->swapped) { - swapl(&dev->type, n); /* macro - braces are required */ + swapl(&dev->type); } *buf += sizeof(xDeviceInfo); } @@ -202,7 +198,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, static void CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) { - char n; xKeyInfoPtr k2; k2 = (xKeyInfoPtr) * buf; @@ -212,7 +207,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) k2->max_keycode = k->xkbInfo->desc->max_key_code; k2->num_keys = k2->max_keycode - k2->min_keycode + 1; if (client && client->swapped) { - swaps(&k2->num_keys, n); + swaps(&k2->num_keys); } *buf += sizeof(xKeyInfo); } @@ -233,7 +228,6 @@ static int CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) { int i, j, axes, t_axes; - char n; ValuatorClassPtr v = dev->valuator; xValuatorInfoPtr v2; AxisInfo *a; @@ -251,7 +245,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) v2->mode = valuator_get_mode(dev, 0); v2->motion_buffer_size = v->numMotionEvents; if (client && client->swapped) { - swapl(&v2->motion_buffer_size, n); + swapl(&v2->motion_buffer_size); } *buf += sizeof(xValuatorInfo); a = v->axes + (VPC * i); @@ -261,9 +255,9 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) a2->max_value = a->max_value; a2->resolution = a->resolution; if (client && client->swapped) { - swapl(&a2->min_value, n); - swapl(&a2->max_value, n); - swapl(&a2->resolution, n); + swapl(&a2->min_value); + swapl(&a2->max_value); + swapl(&a2->resolution); } a2++; a++; @@ -424,9 +418,7 @@ ProcXListInputDevices(ClientPtr client) void SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/opendev.c b/Xi/opendev.c index 13841dc4f..ba0d30436 100644 --- a/Xi/opendev.c +++ b/Xi/opendev.c @@ -76,10 +76,8 @@ extern CARD8 event_base[]; int SProcXOpenDevice(ClientPtr client) { - char n; - REQUEST(xOpenDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXOpenDevice(client)); } @@ -166,9 +164,7 @@ ProcXOpenDevice(ClientPtr client) void SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/queryst.c b/Xi/queryst.c index 73af76d22..8c3bdcf97 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -56,10 +56,8 @@ from The Open Group. int SProcXQueryDeviceState(ClientPtr client) { - char n; - REQUEST(xQueryDeviceStateReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXQueryDeviceState(client)); } @@ -72,7 +70,6 @@ SProcXQueryDeviceState(ClientPtr client) int ProcXQueryDeviceState(ClientPtr client) { - char n; int rc, i; int num_classes = 0; int total_length = 0; @@ -159,7 +156,7 @@ ProcXQueryDeviceState(ClientPtr client) *((int *)buf) = *values; values++; if (client->swapped) { - swapl((int *)buf, n); /* macro - braces needed */ + swapl((int *)buf); } buf += sizeof(int); } @@ -184,9 +181,7 @@ ProcXQueryDeviceState(ClientPtr client) void SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/selectev.c b/Xi/selectev.c index 031e602ad..4c2c2fe05 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.c @@ -123,13 +123,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win, int SProcXSelectExtensionEvent(ClientPtr client) { - char n; - REQUEST(xSelectExtensionEventReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); - swapl(&stuff->window, n); - swaps(&stuff->count, n); + swapl(&stuff->window); + swaps(&stuff->count); REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->count); diff --git a/Xi/sendexev.c b/Xi/sendexev.c index 16cbd6f77..4770c28d1 100644 --- a/Xi/sendexev.c +++ b/Xi/sendexev.c @@ -76,7 +76,6 @@ extern int lastEvent; /* Defined in extension.c */ int SProcXSendExtensionEvent(ClientPtr client) { - char n; CARD32 *p; int i; xEvent eventT; @@ -84,10 +83,10 @@ SProcXSendExtensionEvent(ClientPtr client) EventSwapPtr proc; REQUEST(xSendExtensionEventReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); - swapl(&stuff->destination, n); - swaps(&stuff->count, n); + swapl(&stuff->destination); + swaps(&stuff->count); if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count + bytes_to_int32(stuff->num_events * sizeof(xEvent))) diff --git a/Xi/setbmap.c b/Xi/setbmap.c index 37c40e408..2a8f5d3b7 100644 --- a/Xi/setbmap.c +++ b/Xi/setbmap.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXSetDeviceButtonMapping(ClientPtr client) { - char n; - REQUEST(xSetDeviceButtonMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXSetDeviceButtonMapping(client)); } @@ -132,9 +130,7 @@ void SRepXSetDeviceButtonMapping(ClientPtr client, int size, xSetDeviceButtonMappingReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/setdval.c b/Xi/setdval.c index b384f0d3c..ea17852f7 100644 --- a/Xi/setdval.c +++ b/Xi/setdval.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXSetDeviceValuators(ClientPtr client) { - char n; - REQUEST(xSetDeviceValuatorsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXSetDeviceValuators(client)); } @@ -138,9 +136,7 @@ void SRepXSetDeviceValuators(ClientPtr client, int size, xSetDeviceValuatorsReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/setfocus.c b/Xi/setfocus.c index 03bc37acb..feec3fc35 100644 --- a/Xi/setfocus.c +++ b/Xi/setfocus.c @@ -74,13 +74,11 @@ SOFTWARE. int SProcXSetDeviceFocus(ClientPtr client) { - char n; - REQUEST(xSetDeviceFocusReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetDeviceFocusReq); - swapl(&stuff->focus, n); - swapl(&stuff->time, n); + swapl(&stuff->focus); + swapl(&stuff->time); return (ProcXSetDeviceFocus(client)); } diff --git a/Xi/setmmap.c b/Xi/setmmap.c index cbe5dc8c5..dc6d828a1 100644 --- a/Xi/setmmap.c +++ b/Xi/setmmap.c @@ -73,10 +73,8 @@ SOFTWARE. int SProcXSetDeviceModifierMapping(ClientPtr client) { - char n; - REQUEST(xSetDeviceModifierMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXSetDeviceModifierMapping(client)); } @@ -140,9 +138,7 @@ void SRepXSetDeviceModifierMapping(ClientPtr client, int size, xSetDeviceModifierMappingReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/setmode.c b/Xi/setmode.c index 42e90f75d..80ee764b0 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -71,10 +71,8 @@ SOFTWARE. int SProcXSetDeviceMode(ClientPtr client) { - char n; - REQUEST(xSetDeviceModeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXSetDeviceMode(client)); } @@ -138,9 +136,7 @@ ProcXSetDeviceMode(ClientPtr client) void SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/ungrdev.c b/Xi/ungrdev.c index a09c3d024..bc66cfc4b 100644 --- a/Xi/ungrdev.c +++ b/Xi/ungrdev.c @@ -70,12 +70,10 @@ SOFTWARE. int SProcXUngrabDevice(ClientPtr client) { - char n; - REQUEST(xUngrabDeviceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceReq); - swapl(&stuff->time, n); + swapl(&stuff->time); return (ProcXUngrabDevice(client)); } diff --git a/Xi/ungrdevb.c b/Xi/ungrdevb.c index 4e93f1ae3..9e9ece47a 100644 --- a/Xi/ungrdevb.c +++ b/Xi/ungrdevb.c @@ -76,13 +76,11 @@ SOFTWARE. int SProcXUngrabDeviceButton(ClientPtr client) { - char n; - REQUEST(xUngrabDeviceButtonReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); return (ProcXUngrabDeviceButton(client)); } diff --git a/Xi/ungrdevk.c b/Xi/ungrdevk.c index 3b4d6260e..526347db4 100644 --- a/Xi/ungrdevk.c +++ b/Xi/ungrdevk.c @@ -78,13 +78,11 @@ SOFTWARE. int SProcXUngrabDeviceKey(ClientPtr client) { - char n; - REQUEST(xUngrabDeviceKeyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); return (ProcXUngrabDeviceKey(client)); } diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index 3077e1a44..0d45b3654 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -44,13 +44,11 @@ int SProcXIAllowEvents(ClientPtr client) { - char n; - REQUEST(xXIAllowEventsReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->time, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->time); return ProcXIAllowEvents(client); } diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index 215339331..48f51f3b5 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -56,13 +56,11 @@ int SProcXIChangeCursor(ClientPtr client) { - char n; - REQUEST(xXIChangeCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->win, n); - swapl(&stuff->cursor, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swapl(&stuff->win); + swapl(&stuff->cursor); + swaps(&stuff->deviceid); REQUEST_SIZE_MATCH(xXIChangeCursorReq); return (ProcXIChangeCursor(client)); } diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 96ead6fcd..f2bd8bb05 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -133,10 +133,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) int SProcXIChangeHierarchy(ClientPtr client) { - char n; - REQUEST(xXIChangeHierarchyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (ProcXIChangeHierarchy(client)); } @@ -424,7 +422,6 @@ ProcXIChangeHierarchy(ClientPtr client) { xXIAnyHierarchyChangeInfo *any; int required_len = sizeof(xXIChangeHierarchyReq); - char n; int rc = Success; int flags[MAXDEVICES] = {0}; @@ -437,8 +434,8 @@ ProcXIChangeHierarchy(ClientPtr client) any = (xXIAnyHierarchyChangeInfo*)&stuff[1]; while(stuff->num_changes--) { - SWAPIF(swapl(&any->type, n)); - SWAPIF(swaps(&any->length, n)); + SWAPIF(swapl(&any->type)); + SWAPIF(swaps(&any->length)); required_len += any->length; if ((stuff->length * 4) < required_len) @@ -449,7 +446,7 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster: { xXIAddMasterInfo* c = (xXIAddMasterInfo*)any; - SWAPIF(swaps(&c->name_len, n)); + SWAPIF(swaps(&c->name_len)); rc = add_master(client, c, flags); if (rc != Success) diff --git a/Xi/xigetclientpointer.c b/Xi/xigetclientpointer.c index 401e89fb4..1124ae08c 100644 --- a/Xi/xigetclientpointer.c +++ b/Xi/xigetclientpointer.c @@ -49,11 +49,10 @@ int SProcXIGetClientPointer(ClientPtr client) { - char n; REQUEST(xXIGetClientPointerReq); - swaps(&stuff->length, n); - swapl(&stuff->win, n); + swaps(&stuff->length); + swapl(&stuff->win); return ProcXIGetClientPointer(client); } @@ -97,10 +96,9 @@ void SRepXIGetClientPointer(ClientPtr client, int size, xXIGetClientPointerReply* rep) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->deviceid, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->deviceid); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/xigrabdev.c b/Xi/xigrabdev.c index 0adc8787d..a9b655c0e 100644 --- a/Xi/xigrabdev.c +++ b/Xi/xigrabdev.c @@ -45,16 +45,14 @@ int SProcXIGrabDevice(ClientPtr client) { - char n; - REQUEST(xXIGrabDeviceReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->grab_window, n); - swapl(&stuff->cursor, n); - swapl(&stuff->time, n); - swaps(&stuff->mask_len, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->grab_window); + swapl(&stuff->cursor); + swapl(&stuff->time); + swaps(&stuff->mask_len); return ProcXIGrabDevice(client); } @@ -115,13 +113,11 @@ ProcXIGrabDevice(ClientPtr client) int SProcXIUngrabDevice(ClientPtr client) { - char n; - REQUEST(xXIUngrabDeviceReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->time, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->time); return ProcXIUngrabDevice(client); } @@ -153,9 +149,7 @@ ProcXIUngrabDevice(ClientPtr client) void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index ae4343344..6b4574854 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -49,27 +49,26 @@ int SProcXIPassiveGrabDevice(ClientPtr client) { int i; - char n; xXIModifierInfo *mods; REQUEST(xXIPassiveGrabDeviceReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->grab_window, n); - swapl(&stuff->cursor, n); - swapl(&stuff->time, n); - swapl(&stuff->detail, n); - swaps(&stuff->mask_len, n); - swaps(&stuff->num_modifiers, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->grab_window); + swapl(&stuff->cursor); + swapl(&stuff->time); + swapl(&stuff->detail); + swaps(&stuff->mask_len); + swaps(&stuff->num_modifiers); mods = (xXIModifierInfo*)&stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, mods++) { - swapl(&mods->base_mods, n); - swapl(&mods->latched_mods, n); - swapl(&mods->locked_mods, n); + swapl(&mods->base_mods); + swapl(&mods->latched_mods); + swapl(&mods->locked_mods); } return ProcXIPassiveGrabDevice(client); @@ -88,7 +87,6 @@ ProcXIPassiveGrabDevice(ClientPtr client) GrabParameters param; void *tmp; int mask_len; - int n; REQUEST(xXIPassiveGrabDeviceReq); REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq); @@ -198,7 +196,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) info->status = status; info->modifiers = *modifiers; if (client->swapped) - swapl(&info->modifiers, n); + swapl(&info->modifiers); rep.num_modifiers++; rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo)); @@ -217,11 +215,9 @@ void SRepXIPassiveGrabDevice(ClientPtr client, int size, xXIPassiveGrabDeviceReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_modifiers, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_modifiers); WriteToClient(client, size, (char *)rep); } @@ -229,22 +225,21 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size, int SProcXIPassiveUngrabDevice(ClientPtr client) { - char n; int i; uint32_t *modifiers; REQUEST(xXIPassiveUngrabDeviceReq); - swaps(&stuff->length, n); - swapl(&stuff->grab_window, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->detail, n); - swaps(&stuff->num_modifiers, n); + swaps(&stuff->length); + swapl(&stuff->grab_window); + swaps(&stuff->deviceid); + swapl(&stuff->detail); + swaps(&stuff->num_modifiers); modifiers = (uint32_t*)&stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, modifiers++) - swapl(modifiers, n); + swapl(modifiers); return ProcXIPassiveUngrabDevice(client); } diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 83ce93014..fa0d81188 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -1036,10 +1036,9 @@ ProcXGetDeviceProperty (ClientPtr client) int SProcXListDeviceProperties (ClientPtr client) { - char n; REQUEST(xListDevicePropertiesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xListDevicePropertiesReq); return (ProcXListDeviceProperties(client)); @@ -1048,25 +1047,23 @@ SProcXListDeviceProperties (ClientPtr client) int SProcXChangeDeviceProperty (ClientPtr client) { - char n; REQUEST(xChangeDevicePropertyReq); REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->nUnits, n); + swaps(&stuff->length); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->nUnits); return (ProcXChangeDeviceProperty(client)); } int SProcXDeleteDeviceProperty (ClientPtr client) { - char n; REQUEST(xDeleteDevicePropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->property, n); + swaps(&stuff->length); + swapl(&stuff->property); REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq); return (ProcXDeleteDeviceProperty(client)); } @@ -1074,14 +1071,13 @@ SProcXDeleteDeviceProperty (ClientPtr client) int SProcXGetDeviceProperty (ClientPtr client) { - char n; REQUEST(xGetDevicePropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->longOffset, n); - swapl(&stuff->longLength, n); + swaps(&stuff->length); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->longOffset); + swapl(&stuff->longLength); REQUEST_SIZE_MATCH(xGetDevicePropertyReq); return (ProcXGetDeviceProperty(client)); } @@ -1093,10 +1089,9 @@ void SRepXListDeviceProperties(ClientPtr client, int size, xListDevicePropertiesReply *rep) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->nAtoms, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->nAtoms); /* properties will be swapped later, see ProcXListDeviceProperties */ WriteToClient(client, size, (char*)rep); } @@ -1105,13 +1100,11 @@ void SRepXGetDeviceProperty(ClientPtr client, int size, xGetDevicePropertyReply *rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->propertyType, n); - swapl(&rep->bytesAfter, n); - swapl(&rep->nItems, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->propertyType); + swapl(&rep->bytesAfter); + swapl(&rep->nItems); /* data will be swapped, see ProcXGetDeviceProperty */ WriteToClient(client, size, (char*)rep); } @@ -1279,11 +1272,10 @@ ProcXIGetProperty(ClientPtr client) int SProcXIListProperties(ClientPtr client) { - char n; REQUEST(xXIListPropertiesReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); REQUEST_SIZE_MATCH(xXIListPropertiesReq); return (ProcXIListProperties(client)); @@ -1292,27 +1284,25 @@ SProcXIListProperties(ClientPtr client) int SProcXIChangeProperty(ClientPtr client) { - char n; REQUEST(xXIChangePropertyReq); REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->num_items, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->num_items); return (ProcXIChangeProperty(client)); } int SProcXIDeleteProperty(ClientPtr client) { - char n; REQUEST(xXIDeletePropertyReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->property, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->property); REQUEST_SIZE_MATCH(xXIDeletePropertyReq); return (ProcXIDeleteProperty(client)); } @@ -1320,15 +1310,14 @@ SProcXIDeleteProperty(ClientPtr client) int SProcXIGetProperty(ClientPtr client) { - char n; REQUEST(xXIGetPropertyReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->offset, n); - swapl(&stuff->len, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->offset); + swapl(&stuff->len); REQUEST_SIZE_MATCH(xXIGetPropertyReq); return (ProcXIGetProperty(client)); } @@ -1338,10 +1327,9 @@ void SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply *rep) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_properties, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_properties); /* properties will be swapped later, see ProcXIListProperties */ WriteToClient(client, size, (char*)rep); } @@ -1350,13 +1338,11 @@ void SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply *rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->type, n); - swapl(&rep->bytes_after, n); - swapl(&rep->num_items, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->type); + swapl(&rep->bytes_after); + swapl(&rep->num_items); /* data will be swapped, see ProcXIGetProperty */ WriteToClient(client, size, (char*)rep); } diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index a768d499c..f5fca0d69 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -52,12 +52,10 @@ static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info); int SProcXIQueryDevice(ClientPtr client) { - char n; - REQUEST(xXIQueryDeviceReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); return ProcXIQueryDevice(client); } @@ -166,11 +164,9 @@ ProcXIQueryDevice(ClientPtr client) void SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_devices, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_devices); /* Device info is already swapped, see ProcXIQueryDevice */ @@ -278,17 +274,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState) static void SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info) { - char n; Atom *btn; int i; - swaps(&info->type, n); - swaps(&info->length, n); - swaps(&info->sourceid, n); + swaps(&info->type); + swaps(&info->length); + swaps(&info->sourceid); for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++) - swaps(btn, n); + swaps(btn); - swaps(&info->num_buttons, n); + swaps(&info->num_buttons); } /** @@ -317,17 +312,16 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info) static void SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info) { - char n; uint32_t *key; int i; - swaps(&info->type, n); - swaps(&info->length, n); - swaps(&info->sourceid, n); + swaps(&info->type); + swaps(&info->length); + swaps(&info->sourceid); for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++) - swapl(key, n); + swapl(key); - swaps(&info->num_keycodes, n); + swaps(&info->num_keycodes); } /** @@ -364,16 +358,15 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber, static void SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info) { - char n; - swaps(&info->type, n); - swaps(&info->length, n); - swapl(&info->label, n); - swapl(&info->min.integral, n); - swapl(&info->min.frac, n); - swapl(&info->max.integral, n); - swapl(&info->max.frac, n); - swaps(&info->number, n); - swaps(&info->sourceid, n); + swaps(&info->type); + swaps(&info->length); + swapl(&info->label); + swapl(&info->min.integral); + swapl(&info->min.frac); + swapl(&info->max.integral); + swapl(&info->max.frac); + swaps(&info->number); + swaps(&info->sourceid); } int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment) @@ -471,7 +464,6 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev, static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info) { - char n; char *any = (char*)&info[1]; int i; @@ -497,10 +489,10 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info) any += len * 4; } - swaps(&info->deviceid, n); - swaps(&info->use, n); - swaps(&info->attachment, n); - swaps(&info->num_classes, n); - swaps(&info->name_len, n); + swaps(&info->deviceid); + swaps(&info->use); + swaps(&info->attachment); + swaps(&info->num_classes); + swaps(&info->name_len); } diff --git a/Xi/xiquerypointer.c b/Xi/xiquerypointer.c index 51317994b..9e05eff30 100644 --- a/Xi/xiquerypointer.c +++ b/Xi/xiquerypointer.c @@ -61,12 +61,10 @@ int SProcXIQueryPointer(ClientPtr client) { - char n; - REQUEST(xXIQueryPointerReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->win, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->win); return (ProcXIQueryPointer(client)); } @@ -212,17 +210,15 @@ void SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->root, n); - swapl(&rep->child, n); - swapl(&rep->root_x, n); - swapl(&rep->root_y, n); - swapl(&rep->win_x, n); - swapl(&rep->win_y, n); - swaps(&rep->buttons_len, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->root); + swapl(&rep->child); + swapl(&rep->root_x); + swapl(&rep->root_y); + swapl(&rep->win_x); + swapl(&rep->win_y); + swaps(&rep->buttons_len); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c index f647f9872..a94061432 100644 --- a/Xi/xiqueryversion.c +++ b/Xi/xiqueryversion.c @@ -103,23 +103,20 @@ ProcXIQueryVersion(ClientPtr client) int SProcXIQueryVersion(ClientPtr client) { - char n; - REQUEST(xXIQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq); - swaps(&stuff->major_version, n); - swaps(&stuff->minor_version, n); + swaps(&stuff->major_version); + swaps(&stuff->minor_version); return (ProcXIQueryVersion(client)); } void SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->major_version, n); - swaps(&rep->minor_version, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->major_version); + swaps(&rep->minor_version); WriteToClient(client, size, (char *)rep); } diff --git a/Xi/xiselectev.c b/Xi/xiselectev.c index 22fbaf5e7..3af4f1fb9 100644 --- a/Xi/xiselectev.c +++ b/Xi/xiselectev.c @@ -63,21 +63,20 @@ int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len) int SProcXISelectEvents(ClientPtr client) { - char n; int i; xXIEventMask* evmask; REQUEST(xXISelectEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXISelectEventsReq); - swapl(&stuff->win, n); - swaps(&stuff->num_masks, n); + swapl(&stuff->win); + swaps(&stuff->num_masks); evmask = (xXIEventMask*)&stuff[1]; for (i = 0; i < stuff->num_masks; i++) { - swaps(&evmask->deviceid, n); - swaps(&evmask->mask_len, n); + swaps(&evmask->deviceid); + swaps(&evmask->mask_len); evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4); } @@ -192,12 +191,10 @@ ProcXISelectEvents(ClientPtr client) int SProcXIGetSelectedEvents(ClientPtr client) { - char n; - REQUEST(xXIGetSelectedEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq); - swapl(&stuff->win, n); + swapl(&stuff->win); return (ProcXIGetSelectedEvents(client)); } @@ -207,7 +204,6 @@ ProcXIGetSelectedEvents(ClientPtr client) { int rc, i; WindowPtr win; - char n; char *buffer = NULL; xXIGetSelectedEventsReply reply; OtherInputMasks *masks; @@ -275,8 +271,8 @@ ProcXIGetSelectedEvents(ClientPtr client) if (client->swapped) { - swaps(&evmask->deviceid, n); - swaps(&evmask->mask_len, n); + swaps(&evmask->deviceid); + swaps(&evmask->mask_len); } memcpy(&evmask[1], devmask, j + 1); @@ -299,11 +295,9 @@ ProcXIGetSelectedEvents(ClientPtr client) void SRepXIGetSelectedEvents(ClientPtr client, int len, xXIGetSelectedEventsReply *rep) { - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_masks, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_masks); WriteToClient(client, len, (char *)rep); } diff --git a/Xi/xisetclientpointer.c b/Xi/xisetclientpointer.c index 09db8ff75..934747d30 100644 --- a/Xi/xisetclientpointer.c +++ b/Xi/xisetclientpointer.c @@ -51,12 +51,10 @@ int SProcXISetClientPointer(ClientPtr client) { - char n; - REQUEST(xXISetClientPointerReq); - swaps(&stuff->length, n); - swapl(&stuff->win, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swapl(&stuff->win); + swaps(&stuff->deviceid); REQUEST_SIZE_MATCH(xXISetClientPointerReq); return (ProcXISetClientPointer(client)); } diff --git a/Xi/xisetdevfocus.c b/Xi/xisetdevfocus.c index 059424e41..294df7c32 100644 --- a/Xi/xisetdevfocus.c +++ b/Xi/xisetdevfocus.c @@ -43,13 +43,11 @@ int SProcXISetFocus(ClientPtr client) { - char n; - REQUEST(xXISetFocusReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); - swapl(&stuff->focus, n); - swapl(&stuff->time, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); + swapl(&stuff->focus); + swapl(&stuff->time); return ProcXISetFocus(client); } @@ -57,11 +55,9 @@ SProcXISetFocus(ClientPtr client) int SProcXIGetFocus(ClientPtr client) { - char n; - REQUEST(xXIGetFocusReq); - swaps(&stuff->length, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swaps(&stuff->deviceid); return ProcXIGetFocus(client); } @@ -122,9 +118,8 @@ ProcXIGetFocus(ClientPtr client) void SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swapl(&rep->focus, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->focus); WriteToClient(client, len, (char *)rep); } diff --git a/Xi/xiwarppointer.c b/Xi/xiwarppointer.c index a463ab94d..8fcb4d16b 100644 --- a/Xi/xiwarppointer.c +++ b/Xi/xiwarppointer.c @@ -56,19 +56,17 @@ int SProcXIWarpPointer(ClientPtr client) { - char n; - REQUEST(xXIWarpPointerReq); - swaps(&stuff->length, n); - swapl(&stuff->src_win, n); - swapl(&stuff->dst_win, n); - swapl(&stuff->src_x, n); - swapl(&stuff->src_y, n); - swaps(&stuff->src_width, n); - swaps(&stuff->src_height, n); - swapl(&stuff->dst_x, n); - swapl(&stuff->dst_y, n); - swaps(&stuff->deviceid, n); + swaps(&stuff->length); + swapl(&stuff->src_win); + swapl(&stuff->dst_win); + swapl(&stuff->src_x); + swapl(&stuff->src_y); + swaps(&stuff->src_width); + swaps(&stuff->src_height); + swapl(&stuff->dst_x); + swapl(&stuff->dst_y); + swaps(&stuff->deviceid); return (ProcXIWarpPointer(client)); } diff --git a/composite/compext.c b/composite/compext.c index e0d8e75e4..722587a43 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -109,7 +109,6 @@ ProcCompositeQueryVersion (ClientPtr client) { CompositeClientPtr pCompositeClient = GetCompositeClient (client); xCompositeQueryVersionReply rep; - register int n; REQUEST(xCompositeQueryVersionReq); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); @@ -126,10 +125,10 @@ ProcCompositeQueryVersion (ClientPtr client) pCompositeClient->major_version = rep.majorVersion; pCompositeClient->minor_version = rep.minorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); return Success; @@ -315,10 +314,9 @@ ProcCompositeGetOverlayWindow (ClientPtr client) if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.overlayWin, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.overlayWin); } (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); @@ -377,111 +375,102 @@ ProcCompositeDispatch (ClientPtr client) static int SProcCompositeQueryVersion (ClientPtr client) { - int n; REQUEST(xCompositeQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeRedirectWindow (ClientPtr client) { - int n; REQUEST(xCompositeRedirectWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeRedirectSubwindows (ClientPtr client) { - int n; REQUEST(xCompositeRedirectSubwindowsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeUnredirectWindow (ClientPtr client) { - int n; REQUEST(xCompositeUnredirectWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeUnredirectSubwindows (ClientPtr client) { - int n; REQUEST(xCompositeUnredirectSubwindowsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeCreateRegionFromBorderClip (ClientPtr client) { - int n; REQUEST(xCompositeCreateRegionFromBorderClipReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq); - swapl (&stuff->region, n); - swapl (&stuff->window, n); + swapl(&stuff->region); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeNameWindowPixmap (ClientPtr client) { - int n; REQUEST(xCompositeNameWindowPixmapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); - swapl (&stuff->window, n); - swapl (&stuff->pixmap, n); + swapl(&stuff->window); + swapl(&stuff->pixmap); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeGetOverlayWindow (ClientPtr client) { - int n; REQUEST(xCompositeGetOverlayWindowReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } static int SProcCompositeReleaseOverlayWindow (ClientPtr client) { - int n; REQUEST(xCompositeReleaseOverlayWindowReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return (*ProcCompositeVector[stuff->compositeReqType]) (client); } @@ -839,10 +828,9 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client) if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.overlayWin, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.overlayWin); } (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); diff --git a/damageext/damageext.c b/damageext/damageext.c index 02db88a8e..86f880c1e 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -129,7 +129,6 @@ ProcDamageQueryVersion(ClientPtr client) { DamageClientPtr pDamageClient = GetDamageClient (client); xDamageQueryVersionReply rep; - register int n; REQUEST(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq); @@ -150,10 +149,10 @@ ProcDamageQueryVersion(ClientPtr client) pDamageClient->major_version = rep.majorVersion; pDamageClient->minor_version = rep.minorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep); return Success; @@ -334,65 +333,60 @@ ProcDamageDispatch (ClientPtr client) static int SProcDamageQueryVersion(ClientPtr client) { - register int n; REQUEST(xDamageQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDamageQueryVersionReq); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcDamageVector[stuff->damageReqType]) (client); } static int SProcDamageCreate (ClientPtr client) { - register int n; REQUEST(xDamageCreateReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDamageCreateReq); - swapl (&stuff->damage, n); - swapl (&stuff->drawable, n); + swapl(&stuff->damage); + swapl(&stuff->drawable); return (*ProcDamageVector[stuff->damageReqType]) (client); } static int SProcDamageDestroy (ClientPtr client) { - register int n; REQUEST(xDamageDestroyReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDamageDestroyReq); - swapl (&stuff->damage, n); + swapl(&stuff->damage); return (*ProcDamageVector[stuff->damageReqType]) (client); } static int SProcDamageSubtract (ClientPtr client) { - register int n; REQUEST(xDamageSubtractReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDamageSubtractReq); - swapl (&stuff->damage, n); - swapl (&stuff->repair, n); - swapl (&stuff->parts, n); + swapl(&stuff->damage); + swapl(&stuff->repair); + swapl(&stuff->parts); return (*ProcDamageVector[stuff->damageReqType]) (client); } static int SProcDamageAdd (ClientPtr client) { - register int n; REQUEST(xDamageAddReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDamageSubtractReq); - swapl (&stuff->drawable, n); - swapl (&stuff->region, n); + swapl(&stuff->drawable); + swapl(&stuff->region); return (*ProcDamageVector[stuff->damageReqType]) (client); } diff --git a/dbe/dbe.c b/dbe/dbe.c index 51bbdc6c9..86d8220b8 100644 --- a/dbe/dbe.c +++ b/dbe/dbe.c @@ -127,8 +127,6 @@ ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ xDbeGetVersionReply rep; - register int n; - REQUEST_SIZE_MATCH(xDbeGetVersionReq); @@ -140,7 +138,7 @@ ProcDbeGetVersion(ClientPtr client) if (client->swapped) { - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); } WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep); @@ -656,7 +654,7 @@ ProcDbeGetVisualInfo(ClientPtr client) xDbeGetVisualInfoReply rep; Drawable *drawables; DrawablePtr *pDrawables = NULL; - register int i, j, n, rc; + register int i, j, rc; register int count; /* number of visual infos in reply */ register int length; /* length of reply */ ScreenPtr pScreen; @@ -732,9 +730,9 @@ ProcDbeGetVisualInfo(ClientPtr client) if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.m, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.m); } /* Send off reply. */ @@ -751,7 +749,7 @@ ProcDbeGetVisualInfo(ClientPtr client) if (client->swapped) { - swapl(&data32, n); + swapl(&data32); } WriteToClient(client, sizeof(CARD32), (char *)&data32); @@ -772,7 +770,7 @@ ProcDbeGetVisualInfo(ClientPtr client) if (client->swapped) { - swapl(&visInfo.visualID, n); + swapl(&visInfo.visualID); /* We do not need to swap depth and perfLevel since they are * already 1 byte quantities. @@ -822,7 +820,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) REQUEST(xDbeGetBackBufferAttributesReq); xDbeGetBackBufferAttributesReply rep; DbeWindowPrivPtr pDbeWindowPriv; - int rc, n; + int rc; REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); @@ -845,9 +843,9 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.attributes, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.attributes); } WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), @@ -926,10 +924,8 @@ static int SProcDbeGetVersion(ClientPtr client) { REQUEST(xDbeGetVersionReq); - register int n; - - swaps(&stuff->length, n); + swaps(&stuff->length); return(ProcDbeGetVersion(client)); } /* SProcDbeGetVersion() */ @@ -962,13 +958,12 @@ static int SProcDbeAllocateBackBufferName(ClientPtr client) { REQUEST(xDbeAllocateBackBufferNameReq); - register int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq); - swapl(&stuff->window, n); - swapl(&stuff->buffer, n); + swapl(&stuff->window); + swapl(&stuff->buffer); /* stuff->swapAction is a byte. We do not need to swap this field. */ return(ProcDbeAllocateBackBufferName(client)); @@ -997,13 +992,11 @@ static int SProcDbeDeallocateBackBufferName(ClientPtr client) { REQUEST (xDbeDeallocateBackBufferNameReq); - register int n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq); - swapl(&stuff->buffer, n); + swapl(&stuff->buffer); return(ProcDbeDeallocateBackBufferName(client)); @@ -1035,14 +1028,14 @@ static int SProcDbeSwapBuffers(ClientPtr client) { REQUEST(xDbeSwapBuffersReq); - register int i, n; + register int i; xDbeSwapInfo *pSwapInfo; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq); - swapl(&stuff->n, n); + swapl(&stuff->n); if (stuff->n != 0) { @@ -1054,7 +1047,7 @@ SProcDbeSwapBuffers(ClientPtr client) */ for (i = 0; i < stuff->n; i++) { - swapl(&pSwapInfo->window, n); + swapl(&pSwapInfo->window); } } @@ -1083,9 +1076,8 @@ static int SProcDbeBeginIdiom(ClientPtr client) { REQUEST(xDbeBeginIdiomReq); - register int n; - swaps(&stuff->length, n); + swaps(&stuff->length); return(ProcDbeBeginIdiom(client)); } /* SProcDbeBeginIdiom() */ @@ -1112,13 +1104,11 @@ static int SProcDbeGetVisualInfo(ClientPtr client) { REQUEST(xDbeGetVisualInfoReq); - register int n; - - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq); - swapl(&stuff->n, n); + swapl(&stuff->n); SwapRestL(stuff); return(ProcDbeGetVisualInfo(client)); @@ -1146,12 +1136,11 @@ static int SProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST (xDbeGetBackBufferAttributesReq); - register int n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); - swapl(&stuff->buffer, n); + swapl(&stuff->buffer); return(ProcDbeGetBackBufferAttributes(client)); diff --git a/dix/dispatch.c b/dix/dispatch.c index 192c8c34e..78e252e82 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3584,7 +3584,7 @@ ProcInitialConnection(ClientPtr client) bytes_to_int32(prefix->nbytesAuthString); if (client->swapped) { - swaps(&stuff->length, whichbyte); + swaps(&stuff->length); } ResetCurrentRequest(client); return Success; diff --git a/dix/swaprep.c b/dix/swaprep.c index c173411ab..a02333d10 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -74,14 +74,13 @@ void Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int i; - char n; size >>= 2; for(i = 0; i < size; i++) /* brackets are mandatory here, because "swapl" macro expands to several statements */ { - swapl(&pbuf[i], n); + swapl(&pbuf[i]); } (void)WriteToClient(pClient, size << 2, (char *) pbuf); } @@ -187,9 +186,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) void SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); + swaps(&pRep->sequenceNumber); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -198,67 +195,57 @@ void SGetWindowAttributesReply(ClientPtr pClient, int size, xGetWindowAttributesReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->visualID, n); - swaps(&pRep->class, n); - swapl(&pRep->backingBitPlanes, n); - swapl(&pRep->backingPixel, n); - swapl(&pRep->colormap, n); - swapl(&pRep->allEventMasks, n); - swapl(&pRep->yourEventMask, n); - swaps(&pRep->doNotPropagateMask, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->visualID); + swaps(&pRep->class); + swapl(&pRep->backingBitPlanes); + swapl(&pRep->backingPixel); + swapl(&pRep->colormap); + swapl(&pRep->allEventMasks); + swapl(&pRep->yourEventMask); + swaps(&pRep->doNotPropagateMask); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->root, n); - swaps(&pRep->x, n); - swaps(&pRep->y, n); - swaps(&pRep->width, n); - swaps(&pRep->height, n); - swaps(&pRep->borderWidth, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->root); + swaps(&pRep->x); + swaps(&pRep->y); + swaps(&pRep->width); + swaps(&pRep->height); + swaps(&pRep->borderWidth); (void)WriteToClient(pClient, size, (char *) pRep); } void SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->root, n); - swapl(&pRep->parent, n); - swaps(&pRep->nChildren, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->root); + swapl(&pRep->parent); + swaps(&pRep->nChildren); (void)WriteToClient(pClient, size, (char *) pRep); } void SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->atom, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->atom); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nameLength, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nameLength); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -266,24 +253,20 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) void SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->propertyType, n); - swapl(&pRep->bytesAfter, n); - swapl(&pRep->nItems, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->propertyType); + swapl(&pRep->bytesAfter); + swapl(&pRep->nItems); (void)WriteToClient(pClient, size, (char *) pRep); } void SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nProperties, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nProperties); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -291,10 +274,8 @@ void SGetSelectionOwnerReply(ClientPtr pClient, int size, xGetSelectionOwnerReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->owner, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->owner); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -302,27 +283,23 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, void SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->root, n); - swapl(&pRep->child, n); - swaps(&pRep->rootX, n); - swaps(&pRep->rootY, n); - swaps(&pRep->winX, n); - swaps(&pRep->winY, n); - swaps(&pRep->mask, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->root); + swapl(&pRep->child); + swaps(&pRep->rootX); + swaps(&pRep->rootY); + swaps(&pRep->winX); + swaps(&pRep->winY); + swaps(&pRep->mask); (void)WriteToClient(pClient, size, (char *) pRep); } static void SwapTimecoord(xTimecoord* pCoord) { - char n; - - swapl(&pCoord->time, n); - swaps(&pCoord->x, n); - swaps(&pCoord->y, n); + swapl(&pCoord->time); + swaps(&pCoord->x); + swaps(&pCoord->y); } void @@ -344,33 +321,27 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep) void SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->nEvents, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->nEvents); (void)WriteToClient(pClient, size, (char *) pRep); } void STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->child, n); - swaps(&pRep->dstX, n); - swaps(&pRep->dstY, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->child); + swaps(&pRep->dstX); + swaps(&pRep->dstY); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->focus, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->focus); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -378,40 +349,34 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) void SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); (void)WriteToClient(pClient, size, (char *) pRep); } static void SwapCharInfo(xCharInfo *pInfo) { - char n; - - swaps(&pInfo->leftSideBearing, n); - swaps(&pInfo->rightSideBearing, n); - swaps(&pInfo->characterWidth, n); - swaps(&pInfo->ascent, n); - swaps(&pInfo->descent, n); - swaps(&pInfo->attributes, n); + swaps(&pInfo->leftSideBearing); + swaps(&pInfo->rightSideBearing); + swaps(&pInfo->characterWidth); + swaps(&pInfo->ascent); + swaps(&pInfo->descent); + swaps(&pInfo->attributes); } static void SwapFontInfo(xQueryFontReply *pr) { - char n; - - swaps(&pr->minCharOrByte2, n); - swaps(&pr->maxCharOrByte2, n); - swaps(&pr->defaultChar, n); - swaps(&pr->nFontProps, n); - swaps(&pr->fontAscent, n); - swaps(&pr->fontDescent, n); + swaps(&pr->minCharOrByte2); + swaps(&pr->maxCharOrByte2); + swaps(&pr->defaultChar); + swaps(&pr->nFontProps); + swaps(&pr->fontAscent); + swaps(&pr->fontDescent); SwapCharInfo( &pr->minBounds); SwapCharInfo( &pr->maxBounds); - swapl(&pr->nCharInfos, n); + swapl(&pr->nCharInfos); } static void @@ -421,10 +386,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) xCharInfo * pxci; unsigned nchars, nprops; char *pby; - char n; - swaps(&pr->sequenceNumber, n); - swapl(&pr->length, n); + swaps(&pr->sequenceNumber); + swapl(&pr->length); nchars = pr->nCharInfos; nprops = pr->nFontProps; SwapFontInfo(pr); @@ -433,9 +397,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) * they are always 2 4 byte values */ for(i = 0; i < nprops; i++) { - swapl(pby, n); + swapl(pby); pby += 4; - swapl(pby, n); + swapl(pby); pby += 4; } if (hasGlyphs) @@ -456,27 +420,23 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep) void SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->fontAscent, n); - swaps(&pRep->fontDescent, n); - swaps(&pRep->overallAscent, n); - swaps(&pRep->overallDescent, n); - swapl(&pRep->overallWidth, n); - swapl(&pRep->overallLeft, n); - swapl(&pRep->overallRight, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->fontAscent); + swaps(&pRep->fontDescent); + swaps(&pRep->overallAscent); + swaps(&pRep->overallDescent); + swapl(&pRep->overallWidth); + swapl(&pRep->overallLeft); + swapl(&pRep->overallRight); (void)WriteToClient(pClient, size, (char *) pRep); } void SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nFonts, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nFonts); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -491,22 +451,18 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, void SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nPaths, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nPaths); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->visual, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->visual); (void)WriteToClient(pClient, size, (char *) pRep); /* Fortunately, image doesn't need swapping */ } @@ -515,52 +471,44 @@ void SListInstalledColormapsReply(ClientPtr pClient, int size, xListInstalledColormapsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nColormaps, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nColormaps); (void)WriteToClient(pClient, size, (char *) pRep); } void SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->red, n); - swaps(&pRep->green, n); - swaps(&pRep->blue, n); - swapl(&pRep->pixel, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->red); + swaps(&pRep->green); + swaps(&pRep->blue); + swapl(&pRep->pixel); (void)WriteToClient(pClient, size, (char *) pRep); } void SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->pixel, n); - swaps(&pRep->exactRed, n); - swaps(&pRep->exactGreen, n); - swaps(&pRep->exactBlue, n); - swaps(&pRep->screenRed, n); - swaps(&pRep->screenGreen, n); - swaps(&pRep->screenBlue, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->pixel); + swaps(&pRep->exactRed); + swaps(&pRep->exactGreen); + swaps(&pRep->exactBlue); + swaps(&pRep->screenRed); + swaps(&pRep->screenGreen); + swaps(&pRep->screenBlue); (void)WriteToClient(pClient, size, (char *) pRep); } void SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nPixels, n); - swaps(&pRep->nMasks, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nPixels); + swaps(&pRep->nMasks); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -568,25 +516,21 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) void SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nPixels, n); - swapl(&pRep->redMask, n); - swapl(&pRep->greenMask, n); - swapl(&pRep->blueMask, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nPixels); + swapl(&pRep->redMask); + swapl(&pRep->greenMask); + swapl(&pRep->blueMask); (void)WriteToClient(pClient, size, (char *) pRep); } static void SwapRGB(xrgb *prgb) { - char n; - - swaps(&prgb->red, n); - swaps(&prgb->green, n); - swaps(&prgb->blue, n); + swaps(&prgb->red); + swaps(&prgb->green); + swaps(&prgb->blue); } void @@ -608,47 +552,39 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb) void SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nColors, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nColors); (void)WriteToClient(pClient, size, (char *) pRep); } void SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->exactRed, n); - swaps(&pRep->exactGreen, n); - swaps(&pRep->exactBlue, n); - swaps(&pRep->screenRed, n); - swaps(&pRep->screenGreen, n); - swaps(&pRep->screenBlue, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->exactRed); + swaps(&pRep->exactGreen); + swaps(&pRep->exactBlue); + swaps(&pRep->screenRed); + swaps(&pRep->screenGreen); + swaps(&pRep->screenBlue); (void)WriteToClient(pClient, size, (char *) pRep); } void SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->width, n); - swaps(&pRep->height, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->width); + swaps(&pRep->height); (void)WriteToClient(pClient, size, (char *) pRep); } void SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -656,10 +592,8 @@ void SGetKeyboardMappingReply(ClientPtr pClient, int size, xGetKeyboardMappingReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -667,10 +601,8 @@ void SGetPointerMappingReply(ClientPtr pClient, int size, xGetPointerMappingReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -678,46 +610,38 @@ void SGetModifierMappingReply(ClientPtr pClient, int size, xGetModifierMappingReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->ledMask, n); - swaps(&pRep->bellPitch, n); - swaps(&pRep->bellDuration, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->ledMask); + swaps(&pRep->bellPitch); + swaps(&pRep->bellDuration); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->accelNumerator, n); - swaps(&pRep->accelDenominator, n); - swaps(&pRep->threshold, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->accelNumerator); + swaps(&pRep->accelDenominator); + swaps(&pRep->threshold); (void)WriteToClient(pClient, size, (char *) pRep); } void SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swaps(&pRep->timeout, n); - swaps(&pRep->interval, n); + swaps(&pRep->sequenceNumber); + swaps(&pRep->timeout); + swaps(&pRep->interval); (void)WriteToClient(pClient, size, (char *) pRep); } @@ -729,8 +653,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) while (bufT < endbuf) { xHostEntry *host = (xHostEntry *) bufT; int len = host->length; - char n; - swaps (&host->length, n); + swaps(&host->length); bufT += sizeof (xHostEntry) + pad_to_int32(len); } (void)WriteToClient (pClient, size, buf); @@ -739,11 +662,9 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) void SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep) { - char n; - - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swaps(&pRep->nHosts, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swaps(&pRep->nHosts); (void)WriteToClient(pClient, size, (char *) pRep); } diff --git a/dix/swapreq.c b/dix/swapreq.c index 2e34711c0..d07cd10d3 100644 --- a/dix/swapreq.c +++ b/dix/swapreq.c @@ -64,23 +64,21 @@ SOFTWARE. void SwapLongs (CARD32 *list, unsigned long count) { - char n; - while (count >= 8) { - swapl(list+0, n); - swapl(list+1, n); - swapl(list+2, n); - swapl(list+3, n); - swapl(list+4, n); - swapl(list+5, n); - swapl(list+6, n); - swapl(list+7, n); + swapl(list + 0); + swapl(list + 1); + swapl(list + 2); + swapl(list + 3); + swapl(list + 4); + swapl(list + 5); + swapl(list + 6); + swapl(list + 7); list += 8; count -= 8; } if (count != 0) { do { - swapl(list, n); + swapl(list); list++; } while (--count != 0); } @@ -90,31 +88,29 @@ SwapLongs (CARD32 *list, unsigned long count) void SwapShorts (short *list, unsigned long count) { - char n; - while (count >= 16) { - swaps(list+0, n); - swaps(list+1, n); - swaps(list+2, n); - swaps(list+3, n); - swaps(list+4, n); - swaps(list+5, n); - swaps(list+6, n); - swaps(list+7, n); - swaps(list+8, n); - swaps(list+9, n); - swaps(list+10, n); - swaps(list+11, n); - swaps(list+12, n); - swaps(list+13, n); - swaps(list+14, n); - swaps(list+15, n); + swaps(list + 0); + swaps(list + 1); + swaps(list + 2); + swaps(list + 3); + swaps(list + 4); + swaps(list + 5); + swaps(list + 6); + swaps(list + 7); + swaps(list + 8); + swaps(list + 9); + swaps(list + 10); + swaps(list + 11); + swaps(list + 12); + swaps(list + 13); + swaps(list + 14); + swaps(list + 15); list += 16; count -= 16; } if (count != 0) { do { - swaps(list, n); + swaps(list); list++; } while (--count != 0); } @@ -125,10 +121,8 @@ SwapShorts (short *list, unsigned long count) int SProcSimpleReq(ClientPtr client) { - char n; - REQUEST(xReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return(*ProcVector[stuff->reqType])(client); } @@ -138,33 +132,29 @@ SProcSimpleReq(ClientPtr client) int SProcResourceReq(ClientPtr client) { - char n; - REQUEST(xResourceReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */ - swapl(&stuff->id, n); + swapl(&stuff->id); return(*ProcVector[stuff->reqType])(client); } int SProcCreateWindow(ClientPtr client) { - char n; - REQUEST(xCreateWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xCreateWindowReq); - swapl(&stuff->wid, n); - swapl(&stuff->parent, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swaps(&stuff->borderWidth, n); - swaps(&stuff->class, n); - swapl(&stuff->visual, n); - swapl(&stuff->mask, n); + swapl(&stuff->wid); + swapl(&stuff->parent); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swaps(&stuff->borderWidth); + swaps(&stuff->class); + swapl(&stuff->visual); + swapl(&stuff->mask); SwapRestL(stuff); return((* ProcVector[X_CreateWindow])(client)); } @@ -172,13 +162,11 @@ SProcCreateWindow(ClientPtr client) int SProcChangeWindowAttributes(ClientPtr client) { - char n; - REQUEST(xChangeWindowAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - swapl(&stuff->window, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->window); + swapl(&stuff->valueMask); SwapRestL(stuff); return((* ProcVector[X_ChangeWindowAttributes])(client)); } @@ -186,26 +174,24 @@ SProcChangeWindowAttributes(ClientPtr client) int SProcReparentWindow(ClientPtr client) { - char n; REQUEST(xReparentWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xReparentWindowReq); - swapl(&stuff->window, n); - swapl(&stuff->parent, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swapl(&stuff->window); + swapl(&stuff->parent); + swaps(&stuff->x); + swaps(&stuff->y); return((* ProcVector[X_ReparentWindow])(client)); } int SProcConfigureWindow(ClientPtr client) { - char n; REQUEST(xConfigureWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); - swapl(&stuff->window, n); - swaps(&stuff->mask, n); + swapl(&stuff->window); + swaps(&stuff->mask); SwapRestL(stuff); return((* ProcVector[X_ConfigureWindow])(client)); @@ -215,25 +201,23 @@ SProcConfigureWindow(ClientPtr client) int SProcInternAtom(ClientPtr client) { - char n; REQUEST(xInternAtomReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xInternAtomReq); - swaps(&stuff->nbytes, n); + swaps(&stuff->nbytes); return((* ProcVector[X_InternAtom])(client)); } int SProcChangeProperty(ClientPtr client) { - char n; REQUEST(xChangePropertyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangePropertyReq); - swapl(&stuff->window, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->nUnits, n); + swapl(&stuff->window); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->nUnits); switch ( stuff->format ) { case 8 : break; @@ -250,12 +234,11 @@ SProcChangeProperty(ClientPtr client) int SProcDeleteProperty(ClientPtr client) { - char n; REQUEST(xDeletePropertyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDeletePropertyReq); - swapl(&stuff->window, n); - swapl(&stuff->property, n); + swapl(&stuff->window); + swapl(&stuff->property); return((* ProcVector[X_DeleteProperty])(client)); } @@ -263,57 +246,53 @@ SProcDeleteProperty(ClientPtr client) int SProcGetProperty(ClientPtr client) { - char n; REQUEST(xGetPropertyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetPropertyReq); - swapl(&stuff->window, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->longOffset, n); - swapl(&stuff->longLength, n); + swapl(&stuff->window); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->longOffset); + swapl(&stuff->longLength); return((* ProcVector[X_GetProperty])(client)); } int SProcSetSelectionOwner(ClientPtr client) { - char n; REQUEST(xSetSelectionOwnerReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); - swapl(&stuff->window, n); - swapl(&stuff->selection, n); - swapl(&stuff->time, n); + swapl(&stuff->window); + swapl(&stuff->selection); + swapl(&stuff->time); return((* ProcVector[X_SetSelectionOwner])(client)); } int SProcConvertSelection(ClientPtr client) { - char n; REQUEST(xConvertSelectionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xConvertSelectionReq); - swapl(&stuff->requestor, n); - swapl(&stuff->selection, n); - swapl(&stuff->target, n); - swapl(&stuff->property, n); - swapl(&stuff->time, n); + swapl(&stuff->requestor); + swapl(&stuff->selection); + swapl(&stuff->target); + swapl(&stuff->property); + swapl(&stuff->time); return((* ProcVector[X_ConvertSelection])(client)); } int SProcSendEvent(ClientPtr client) { - char n; xEvent eventT; EventSwapPtr proc; REQUEST(xSendEventReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSendEventReq); - swapl(&stuff->destination, n); - swapl(&stuff->eventMask, n); + swapl(&stuff->destination); + swapl(&stuff->eventMask); /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; @@ -328,223 +307,206 @@ SProcSendEvent(ClientPtr client) int SProcGrabPointer(ClientPtr client) { - char n; REQUEST(xGrabPointerReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabPointerReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->eventMask, n); - swapl(&stuff->confineTo, n); - swapl(&stuff->cursor, n); - swapl(&stuff->time, n); + swapl(&stuff->grabWindow); + swaps(&stuff->eventMask); + swapl(&stuff->confineTo); + swapl(&stuff->cursor); + swapl(&stuff->time); return((* ProcVector[X_GrabPointer])(client)); } int SProcGrabButton(ClientPtr client) { - char n; REQUEST(xGrabButtonReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabButtonReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->eventMask, n); - swapl(&stuff->confineTo, n); - swapl(&stuff->cursor, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->eventMask); + swapl(&stuff->confineTo); + swapl(&stuff->cursor); + swaps(&stuff->modifiers); return((* ProcVector[X_GrabButton])(client)); } int SProcUngrabButton(ClientPtr client) { - char n; REQUEST(xUngrabButtonReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabButtonReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); return((* ProcVector[X_UngrabButton])(client)); } int SProcChangeActivePointerGrab(ClientPtr client) { - char n; REQUEST(xChangeActivePointerGrabReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); - swapl(&stuff->cursor, n); - swapl(&stuff->time, n); - swaps(&stuff->eventMask, n); + swapl(&stuff->cursor); + swapl(&stuff->time); + swaps(&stuff->eventMask); return((* ProcVector[X_ChangeActivePointerGrab])(client)); } int SProcGrabKeyboard(ClientPtr client) { - char n; REQUEST(xGrabKeyboardReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabKeyboardReq); - swapl(&stuff->grabWindow, n); - swapl(&stuff->time, n); + swapl(&stuff->grabWindow); + swapl(&stuff->time); return((* ProcVector[X_GrabKeyboard])(client)); } int SProcGrabKey(ClientPtr client) { - char n; REQUEST(xGrabKeyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGrabKeyReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); return((* ProcVector[X_GrabKey])(client)); } int SProcUngrabKey(ClientPtr client) { - char n; REQUEST(xUngrabKeyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xUngrabKeyReq); - swapl(&stuff->grabWindow, n); - swaps(&stuff->modifiers, n); + swapl(&stuff->grabWindow); + swaps(&stuff->modifiers); return((* ProcVector[X_UngrabKey])(client)); } int SProcGetMotionEvents(ClientPtr client) { - char n; REQUEST(xGetMotionEventsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetMotionEventsReq); - swapl(&stuff->window, n); - swapl(&stuff->start, n); - swapl(&stuff->stop, n); + swapl(&stuff->window); + swapl(&stuff->start); + swapl(&stuff->stop); return((* ProcVector[X_GetMotionEvents])(client)); } int SProcTranslateCoords(ClientPtr client) { - char n; REQUEST(xTranslateCoordsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xTranslateCoordsReq); - swapl(&stuff->srcWid, n); - swapl(&stuff->dstWid, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); + swapl(&stuff->srcWid); + swapl(&stuff->dstWid); + swaps(&stuff->srcX); + swaps(&stuff->srcY); return((* ProcVector[X_TranslateCoords])(client)); } int SProcWarpPointer(ClientPtr client) { - char n; REQUEST(xWarpPointerReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xWarpPointerReq); - swapl(&stuff->srcWid, n); - swapl(&stuff->dstWid, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->srcWidth, n); - swaps(&stuff->srcHeight, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); + swapl(&stuff->srcWid); + swapl(&stuff->dstWid); + swaps(&stuff->srcX); + swaps(&stuff->srcY); + swaps(&stuff->srcWidth); + swaps(&stuff->srcHeight); + swaps(&stuff->dstX); + swaps(&stuff->dstY); return((* ProcVector[X_WarpPointer])(client)); } int SProcSetInputFocus(ClientPtr client) { - char n; REQUEST(xSetInputFocusReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetInputFocusReq); - swapl(&stuff->focus, n); - swapl(&stuff->time, n); + swapl(&stuff->focus); + swapl(&stuff->time); return((* ProcVector[X_SetInputFocus])(client)); } int SProcOpenFont(ClientPtr client) { - char n; REQUEST(xOpenFontReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xOpenFontReq); - swapl(&stuff->fid, n); - swaps(&stuff->nbytes, n); + swapl(&stuff->fid); + swaps(&stuff->nbytes); return((* ProcVector[X_OpenFont])(client)); } int SProcListFonts(ClientPtr client) { - char n; REQUEST(xListFontsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xListFontsReq); - swaps(&stuff->maxNames, n); - swaps(&stuff->nbytes, n); + swaps(&stuff->maxNames); + swaps(&stuff->nbytes); return((* ProcVector[X_ListFonts])(client)); } int SProcListFontsWithInfo(ClientPtr client) { - char n; REQUEST(xListFontsWithInfoReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); - swaps(&stuff->maxNames, n); - swaps(&stuff->nbytes, n); + swaps(&stuff->maxNames); + swaps(&stuff->nbytes); return((* ProcVector[X_ListFontsWithInfo])(client)); } int SProcSetFontPath(ClientPtr client) { - char n; REQUEST(xSetFontPathReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); - swaps(&stuff->nFonts, n); + swaps(&stuff->nFonts); return((* ProcVector[X_SetFontPath])(client)); } int SProcCreatePixmap(ClientPtr client) { - char n; REQUEST(xCreatePixmapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreatePixmapReq); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swapl(&stuff->pid); + swapl(&stuff->drawable); + swaps(&stuff->width); + swaps(&stuff->height); return((* ProcVector[X_CreatePixmap])(client)); } int SProcCreateGC(ClientPtr client) { - char n; REQUEST(xCreateGCReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xCreateGCReq); - swapl(&stuff->gc, n); - swapl(&stuff->drawable, n); - swapl(&stuff->mask, n); + swapl(&stuff->gc); + swapl(&stuff->drawable); + swapl(&stuff->mask); SwapRestL(stuff); return((* ProcVector[X_CreateGC])(client)); } @@ -552,12 +514,11 @@ SProcCreateGC(ClientPtr client) int SProcChangeGC(ClientPtr client) { - char n; REQUEST(xChangeGCReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeGCReq); - swapl(&stuff->gc, n); - swapl(&stuff->mask, n); + swapl(&stuff->gc); + swapl(&stuff->mask); SwapRestL(stuff); return((* ProcVector[X_ChangeGC])(client)); } @@ -565,26 +526,24 @@ SProcChangeGC(ClientPtr client) int SProcCopyGC(ClientPtr client) { - char n; REQUEST(xCopyGCReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyGCReq); - swapl(&stuff->srcGC, n); - swapl(&stuff->dstGC, n); - swapl(&stuff->mask, n); + swapl(&stuff->srcGC); + swapl(&stuff->dstGC); + swapl(&stuff->mask); return((* ProcVector[X_CopyGC])(client)); } int SProcSetDashes(ClientPtr client) { - char n; REQUEST(xSetDashesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetDashesReq); - swapl(&stuff->gc, n); - swaps(&stuff->dashOffset, n); - swaps(&stuff->nDashes, n); + swapl(&stuff->gc); + swaps(&stuff->dashOffset); + swaps(&stuff->nDashes); return((* ProcVector[X_SetDashes])(client)); } @@ -592,13 +551,12 @@ SProcSetDashes(ClientPtr client) int SProcSetClipRectangles(ClientPtr client) { - char n; REQUEST(xSetClipRectanglesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); - swapl(&stuff->gc, n); - swaps(&stuff->xOrigin, n); - swaps(&stuff->yOrigin, n); + swapl(&stuff->gc); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); SwapRestS(stuff); return((* ProcVector[X_SetClipRectangles])(client)); } @@ -606,54 +564,51 @@ SProcSetClipRectangles(ClientPtr client) int SProcClearToBackground(ClientPtr client) { - char n; REQUEST(xClearAreaReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xClearAreaReq); - swapl(&stuff->window, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swapl(&stuff->window); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); return((* ProcVector[X_ClearArea])(client)); } int SProcCopyArea(ClientPtr client) { - char n; REQUEST(xCopyAreaReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyAreaReq); - swapl(&stuff->srcDrawable, n); - swapl(&stuff->dstDrawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swapl(&stuff->srcDrawable); + swapl(&stuff->dstDrawable); + swapl(&stuff->gc); + swaps(&stuff->srcX); + swaps(&stuff->srcY); + swaps(&stuff->dstX); + swaps(&stuff->dstY); + swaps(&stuff->width); + swaps(&stuff->height); return((* ProcVector[X_CopyArea])(client)); } int SProcCopyPlane(ClientPtr client) { - char n; REQUEST(xCopyPlaneReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyPlaneReq); - swapl(&stuff->srcDrawable, n); - swapl(&stuff->dstDrawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->srcX, n); - swaps(&stuff->srcY, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->bitPlane, n); + swapl(&stuff->srcDrawable); + swapl(&stuff->dstDrawable); + swapl(&stuff->gc); + swaps(&stuff->srcX); + swaps(&stuff->srcY); + swaps(&stuff->dstX); + swaps(&stuff->dstY); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->bitPlane); return((* ProcVector[X_CopyPlane])(client)); } @@ -662,13 +617,11 @@ SProcCopyPlane(ClientPtr client) int SProcPoly(ClientPtr client) { - char n; - REQUEST(xPolyPointReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPolyPointReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); SwapRestS(stuff); return((* ProcVector[stuff->reqType])(client)); } @@ -679,13 +632,11 @@ SProcPoly(ClientPtr client) int SProcFillPoly(ClientPtr client) { - char n; - REQUEST(xFillPolyReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xFillPolyReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); SwapRestS(stuff); return((* ProcVector[X_FillPoly])(client)); } @@ -693,16 +644,15 @@ SProcFillPoly(ClientPtr client) int SProcPutImage(ClientPtr client) { - char n; REQUEST(xPutImageReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPutImageReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swaps(&stuff->dstX, n); - swaps(&stuff->dstY, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->width); + swaps(&stuff->height); + swaps(&stuff->dstX); + swaps(&stuff->dstY); /* Image should already be swapped */ return((* ProcVector[X_PutImage])(client)); @@ -711,16 +661,15 @@ SProcPutImage(ClientPtr client) int SProcGetImage(ClientPtr client) { - char n; REQUEST(xGetImageReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetImageReq); - swapl(&stuff->drawable, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->planeMask, n); + swapl(&stuff->drawable); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->planeMask); return((* ProcVector[X_GetImage])(client)); } @@ -729,14 +678,13 @@ SProcGetImage(ClientPtr client) int SProcPolyText(ClientPtr client) { - char n; REQUEST(xPolyTextReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xPolyTextReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->x); + swaps(&stuff->y); return((* ProcVector[stuff->reqType])(client)); } @@ -745,27 +693,25 @@ SProcPolyText(ClientPtr client) int SProcImageText(ClientPtr client) { - char n; REQUEST(xImageTextReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xImageTextReq); - swapl(&stuff->drawable, n); - swapl(&stuff->gc, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swapl(&stuff->drawable); + swapl(&stuff->gc); + swaps(&stuff->x); + swaps(&stuff->y); return((* ProcVector[stuff->reqType])(client)); } int SProcCreateColormap(ClientPtr client) { - char n; REQUEST(xCreateColormapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateColormapReq); - swapl(&stuff->mid, n); - swapl(&stuff->window, n); - swapl(&stuff->visual, n); + swapl(&stuff->mid); + swapl(&stuff->window); + swapl(&stuff->visual); return((* ProcVector[X_CreateColormap])(client)); } @@ -773,12 +719,11 @@ SProcCreateColormap(ClientPtr client) int SProcCopyColormapAndFree(ClientPtr client) { - char n; REQUEST(xCopyColormapAndFreeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); - swapl(&stuff->mid, n); - swapl(&stuff->srcCmap, n); + swapl(&stuff->mid); + swapl(&stuff->srcCmap); return((* ProcVector[X_CopyColormapAndFree])(client)); } @@ -786,67 +731,61 @@ SProcCopyColormapAndFree(ClientPtr client) int SProcAllocColor(ClientPtr client) { - char n; REQUEST(xAllocColorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorReq); - swapl(&stuff->cmap, n); - swaps(&stuff->red, n); - swaps(&stuff->green, n); - swaps(&stuff->blue, n); + swapl(&stuff->cmap); + swaps(&stuff->red); + swaps(&stuff->green); + swaps(&stuff->blue); return((* ProcVector[X_AllocColor])(client)); } int SProcAllocNamedColor(ClientPtr client) { - char n; - REQUEST(xAllocNamedColorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq); - swapl(&stuff->cmap, n); - swaps(&stuff->nbytes, n); + swapl(&stuff->cmap); + swaps(&stuff->nbytes); return((* ProcVector[X_AllocNamedColor])(client)); } int SProcAllocColorCells(ClientPtr client) { - char n; REQUEST(xAllocColorCellsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorCellsReq); - swapl(&stuff->cmap, n); - swaps(&stuff->colors, n); - swaps(&stuff->planes, n); + swapl(&stuff->cmap); + swaps(&stuff->colors); + swaps(&stuff->planes); return((* ProcVector[X_AllocColorCells])(client)); } int SProcAllocColorPlanes(ClientPtr client) { - char n; REQUEST(xAllocColorPlanesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); - swapl(&stuff->cmap, n); - swaps(&stuff->colors, n); - swaps(&stuff->red, n); - swaps(&stuff->green, n); - swaps(&stuff->blue, n); + swapl(&stuff->cmap); + swaps(&stuff->colors); + swaps(&stuff->red); + swaps(&stuff->green); + swaps(&stuff->blue); return((* ProcVector[X_AllocColorPlanes])(client)); } int SProcFreeColors(ClientPtr client) { - char n; REQUEST(xFreeColorsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); - swapl(&stuff->cmap, n); - swapl(&stuff->planeMask, n); + swapl(&stuff->cmap); + swapl(&stuff->planeMask); SwapRestL(stuff); return((* ProcVector[X_FreeColors])(client)); @@ -855,25 +794,22 @@ SProcFreeColors(ClientPtr client) void SwapColorItem(xColorItem *pItem) { - char n; - - swapl(&pItem->pixel, n); - swaps(&pItem->red, n); - swaps(&pItem->green, n); - swaps(&pItem->blue, n); + swapl(&pItem->pixel); + swaps(&pItem->red); + swaps(&pItem->green); + swaps(&pItem->blue); } int SProcStoreColors(ClientPtr client) { - char n; long count; xColorItem *pItem; REQUEST(xStoreColorsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xStoreColorsReq); - swapl(&stuff->cmap, n); + swapl(&stuff->cmap); pItem = (xColorItem *) &stuff[1]; for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; ) SwapColorItem(pItem++); @@ -883,24 +819,22 @@ SProcStoreColors(ClientPtr client) int SProcStoreNamedColor (ClientPtr client) { - char n; REQUEST(xStoreNamedColorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); - swapl(&stuff->cmap, n); - swapl(&stuff->pixel, n); - swaps(&stuff->nbytes, n); + swapl(&stuff->cmap); + swapl(&stuff->pixel); + swaps(&stuff->nbytes); return((* ProcVector[X_StoreNamedColor])(client)); } int SProcQueryColors (ClientPtr client) { - char n; REQUEST(xQueryColorsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); - swapl(&stuff->cmap, n); + swapl(&stuff->cmap); SwapRestL(stuff); return((* ProcVector[X_QueryColors])(client)); } @@ -908,54 +842,51 @@ SProcQueryColors (ClientPtr client) int SProcLookupColor (ClientPtr client) { - char n; REQUEST(xLookupColorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xLookupColorReq); - swapl(&stuff->cmap, n); - swaps(&stuff->nbytes, n); + swapl(&stuff->cmap); + swaps(&stuff->nbytes); return((* ProcVector[X_LookupColor])(client)); } int SProcCreateCursor (ClientPtr client) { - char n; REQUEST(xCreateCursorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateCursorReq); - swapl(&stuff->cid, n); - swapl(&stuff->source, n); - swapl(&stuff->mask, n); - swaps(&stuff->foreRed, n); - swaps(&stuff->foreGreen, n); - swaps(&stuff->foreBlue, n); - swaps(&stuff->backRed, n); - swaps(&stuff->backGreen, n); - swaps(&stuff->backBlue, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swapl(&stuff->cid); + swapl(&stuff->source); + swapl(&stuff->mask); + swaps(&stuff->foreRed); + swaps(&stuff->foreGreen); + swaps(&stuff->foreBlue); + swaps(&stuff->backRed); + swaps(&stuff->backGreen); + swaps(&stuff->backBlue); + swaps(&stuff->x); + swaps(&stuff->y); return((* ProcVector[X_CreateCursor])(client)); } int SProcCreateGlyphCursor (ClientPtr client) { - char n; REQUEST(xCreateGlyphCursorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); - swapl(&stuff->cid, n); - swapl(&stuff->source, n); - swapl(&stuff->mask, n); - swaps(&stuff->sourceChar, n); - swaps(&stuff->maskChar, n); - swaps(&stuff->foreRed, n); - swaps(&stuff->foreGreen, n); - swaps(&stuff->foreBlue, n); - swaps(&stuff->backRed, n); - swaps(&stuff->backGreen, n); - swaps(&stuff->backBlue, n); + swapl(&stuff->cid); + swapl(&stuff->source); + swapl(&stuff->mask); + swaps(&stuff->sourceChar); + swaps(&stuff->maskChar); + swaps(&stuff->foreRed); + swaps(&stuff->foreGreen); + swaps(&stuff->foreBlue); + swaps(&stuff->backRed); + swaps(&stuff->backGreen); + swaps(&stuff->backBlue); return((* ProcVector[X_CreateGlyphCursor])(client)); } @@ -963,30 +894,28 @@ SProcCreateGlyphCursor (ClientPtr client) int SProcRecolorCursor (ClientPtr client) { - char n; REQUEST(xRecolorCursorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecolorCursorReq); - swapl(&stuff->cursor, n); - swaps(&stuff->foreRed, n); - swaps(&stuff->foreGreen, n); - swaps(&stuff->foreBlue, n); - swaps(&stuff->backRed, n); - swaps(&stuff->backGreen, n); - swaps(&stuff->backBlue, n); + swapl(&stuff->cursor); + swaps(&stuff->foreRed); + swaps(&stuff->foreGreen); + swaps(&stuff->foreBlue); + swaps(&stuff->backRed); + swaps(&stuff->backGreen); + swaps(&stuff->backBlue); return((* ProcVector[X_RecolorCursor])(client)); } int SProcQueryBestSize (ClientPtr client) { - char n; REQUEST(xQueryBestSizeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xQueryBestSizeReq); - swapl(&stuff->drawable, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swapl(&stuff->drawable); + swaps(&stuff->width); + swaps(&stuff->height); return((* ProcVector[X_QueryBestSize])(client)); } @@ -994,20 +923,18 @@ SProcQueryBestSize (ClientPtr client) int SProcQueryExtension (ClientPtr client) { - char n; REQUEST(xQueryExtensionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); - swaps(&stuff->nbytes, n); + swaps(&stuff->nbytes); return((* ProcVector[X_QueryExtension])(client)); } int SProcChangeKeyboardMapping (ClientPtr client) { - char n; REQUEST(xChangeKeyboardMappingReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); SwapRestL(stuff); return((* ProcVector[X_ChangeKeyboardMapping])(client)); @@ -1017,11 +944,10 @@ SProcChangeKeyboardMapping (ClientPtr client) int SProcChangeKeyboardControl (ClientPtr client) { - char n; REQUEST(xChangeKeyboardControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); - swapl(&stuff->mask, n); + swapl(&stuff->mask); SwapRestL(stuff); return((* ProcVector[X_ChangeKeyboardControl])(client)); } @@ -1029,13 +955,12 @@ SProcChangeKeyboardControl (ClientPtr client) int SProcChangePointerControl (ClientPtr client) { - char n; REQUEST(xChangePointerControlReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xChangePointerControlReq); - swaps(&stuff->accelNum, n); - swaps(&stuff->accelDenum, n); - swaps(&stuff->threshold, n); + swaps(&stuff->accelNum); + swaps(&stuff->accelDenum); + swaps(&stuff->threshold); return((* ProcVector[X_ChangePointerControl])(client)); } @@ -1043,37 +968,33 @@ SProcChangePointerControl (ClientPtr client) int SProcSetScreenSaver (ClientPtr client) { - char n; REQUEST(xSetScreenSaverReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xSetScreenSaverReq); - swaps(&stuff->timeout, n); - swaps(&stuff->interval, n); + swaps(&stuff->timeout); + swaps(&stuff->interval); return((* ProcVector[X_SetScreenSaver])(client)); } int SProcChangeHosts (ClientPtr client) { - char n; - REQUEST(xChangeHostsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xChangeHostsReq); - swaps(&stuff->hostLength, n); + swaps(&stuff->hostLength); return((* ProcVector[X_ChangeHosts])(client)); } int SProcRotateProperties (ClientPtr client) { - char n; REQUEST(xRotatePropertiesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); - swapl(&stuff->window, n); - swaps(&stuff->nAtoms, n); - swaps(&stuff->nPositions, n); + swapl(&stuff->window); + swaps(&stuff->nAtoms); + swaps(&stuff->nPositions); SwapRestL(stuff); return ((* ProcVector[X_RotateProperties])(client)); } @@ -1081,19 +1002,16 @@ int SProcRotateProperties (ClientPtr client) int SProcNoOperation(ClientPtr client) { - char n; REQUEST(xReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ((* ProcVector[X_NoOperation])(client)); } void SwapConnClientPrefix(xConnClientPrefix *pCCP) { - char n; - - swaps(&pCCP->majorVersion, n); - swaps(&pCCP->minorVersion, n); - swaps(&pCCP->nbytesAuthProto, n); - swaps(&pCCP->nbytesAuthString, n); + swaps(&pCCP->majorVersion); + swaps(&pCCP->minorVersion); + swaps(&pCCP->nbytesAuthProto); + swaps(&pCCP->nbytesAuthString); } diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index f3e41ac17..c05bd523a 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -174,7 +174,6 @@ static int dmxFetchInputAttributes(unsigned int mask, static int ProcDMXQueryVersion(ClientPtr client) { xDMXQueryVersionReply rep; - int n; REQUEST_SIZE_MATCH(xDMXQueryVersionReq); @@ -185,11 +184,11 @@ static int ProcDMXQueryVersion(ClientPtr client) rep.minorVersion = SERVER_DMX_MINOR_VERSION; rep.patchVersion = SERVER_DMX_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - swapl(&rep.patchVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); + swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep); return Success; @@ -198,7 +197,6 @@ static int ProcDMXQueryVersion(ClientPtr client) static int ProcDMXSync(ClientPtr client) { xDMXSyncReply rep; - int n; REQUEST_SIZE_MATCH(xDMXSyncReq); @@ -209,9 +207,9 @@ static int ProcDMXSync(ClientPtr client) rep.length = 0; rep.status = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep); return Success; @@ -222,7 +220,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client) xDMXForceWindowCreationReply rep; REQUEST(xDMXForceWindowCreationReq); WindowPtr pWin; - int n; REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq); @@ -259,9 +256,9 @@ static int ProcDMXForceWindowCreation(ClientPtr client) rep.length = 0; rep.status = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep); return Success; @@ -270,7 +267,6 @@ static int ProcDMXForceWindowCreation(ClientPtr client) static int ProcDMXGetScreenCount(ClientPtr client) { xDMXGetScreenCountReply rep; - int n; REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); @@ -279,9 +275,9 @@ static int ProcDMXGetScreenCount(ClientPtr client) rep.length = 0; rep.screenCount = dmxGetNumScreens(); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.screenCount, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.screenCount); } WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep); return Success; @@ -291,7 +287,6 @@ static int ProcDMXGetScreenAttributes(ClientPtr client) { REQUEST(xDMXGetScreenAttributesReq); xDMXGetScreenAttributesReply rep; - int n; int length; int paddedLength; DMXScreenAttributesRec attr; @@ -325,20 +320,20 @@ static int ProcDMXGetScreenAttributes(ClientPtr client) rep.displayNameLength = length; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.displayNameLength, n); - swapl(&rep.logicalScreen, n); - swaps(&rep.screenWindowWidth, n); - swaps(&rep.screenWindowHeight, n); - swaps(&rep.screenWindowXoffset, n); - swaps(&rep.screenWindowYoffset, n); - swaps(&rep.rootWindowWidth, n); - swaps(&rep.rootWindowHeight, n); - swaps(&rep.rootWindowXoffset, n); - swaps(&rep.rootWindowYoffset, n); - swaps(&rep.rootWindowXorigin, n); - swaps(&rep.rootWindowYorigin, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.displayNameLength); + swapl(&rep.logicalScreen); + swaps(&rep.screenWindowWidth); + swaps(&rep.screenWindowHeight); + swaps(&rep.screenWindowXoffset); + swaps(&rep.screenWindowYoffset); + swaps(&rep.rootWindowWidth); + swaps(&rep.rootWindowHeight); + swaps(&rep.rootWindowXoffset); + swaps(&rep.rootWindowYoffset); + swaps(&rep.rootWindowXorigin); + swaps(&rep.rootWindowYorigin); } WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep); if (length) WriteToClient(client, length, (char *)attr.displayName); @@ -349,7 +344,6 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) { REQUEST(xDMXChangeScreensAttributesReq); xDMXChangeScreensAttributesReply rep; - int n; int status = DMX_BAD_XINERAMA; unsigned int mask = 0; unsigned int i; @@ -407,10 +401,10 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client) rep.status = status; rep.errorScreen = errorScreen; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); - swapl(&rep.errorScreen, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); + swapl(&rep.errorScreen); } WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), @@ -422,7 +416,6 @@ static int ProcDMXAddScreen(ClientPtr client) { REQUEST(xDMXAddScreenReq); xDMXAddScreenReply rep; - int n; int status = 0; CARD32 *value_list; DMXScreenAttributesRec attr; @@ -458,10 +451,10 @@ static int ProcDMXAddScreen(ClientPtr client) rep.status = status; rep.physicalScreen = stuff->physicalScreen; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); - swapl(&rep.physicalScreen, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); + swapl(&rep.physicalScreen); } WriteToClient(client, sizeof(xDMXAddScreenReply), @@ -473,7 +466,6 @@ static int ProcDMXRemoveScreen(ClientPtr client) { REQUEST(xDMXRemoveScreenReq); xDMXRemoveScreenReply rep; - int n; int status = 0; REQUEST_SIZE_MATCH(xDMXRemoveScreenReq); @@ -485,9 +477,9 @@ static int ProcDMXRemoveScreen(ClientPtr client) rep.length = 0; rep.status = status; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xDMXRemoveScreenReply), @@ -563,7 +555,7 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) { REQUEST(xDMXGetWindowAttributesReq); xDMXGetWindowAttributesReply rep; - int i, n; + int i; CARD32 *screens; CARD32 *windows; xRectangle *pos, *vis; @@ -603,22 +595,22 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) rep.length = count * 6; rep.screenCount = count; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.screenCount, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.screenCount); for (i = 0; i < count; i++) { - swapl(&screens[i], n); - swapl(&windows[i], n); + swapl(&screens[i]); + swapl(&windows[i]); - swaps(&pos[i].x, n); - swaps(&pos[i].y, n); - swaps(&pos[i].width, n); - swaps(&pos[i].height, n); + swaps(&pos[i].x); + swaps(&pos[i].y); + swaps(&pos[i].width); + swaps(&pos[i].height); - swaps(&vis[i].x, n); - swaps(&vis[i].y, n); - swaps(&vis[i].width, n); - swaps(&vis[i].height, n); + swaps(&vis[i].x); + swaps(&vis[i].y); + swaps(&vis[i].width); + swaps(&vis[i].height); } } @@ -643,7 +635,6 @@ static int ProcDMXGetWindowAttributes(ClientPtr client) static int ProcDMXGetDesktopAttributes(ClientPtr client) { xDMXGetDesktopAttributesReply rep; - int n; DMXDesktopAttributesRec attr; REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq); @@ -660,12 +651,12 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client) rep.length = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.width, n); - swapl(&rep.height, n); - swapl(&rep.shiftX, n); - swapl(&rep.shiftY, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.width); + swapl(&rep.height); + swapl(&rep.shiftX); + swapl(&rep.shiftY); } WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep); return Success; @@ -675,7 +666,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client) { REQUEST(xDMXChangeDesktopAttributesReq); xDMXChangeDesktopAttributesReply rep; - int n; int status = DMX_BAD_XINERAMA; CARD32 *value_list; DMXDesktopAttributesRec attr; @@ -704,9 +694,9 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client) rep.length = 0; rep.status = status; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), @@ -717,7 +707,6 @@ static int ProcDMXChangeDesktopAttributes(ClientPtr client) static int ProcDMXGetInputCount(ClientPtr client) { xDMXGetInputCountReply rep; - int n; REQUEST_SIZE_MATCH(xDMXGetInputCountReq); @@ -726,9 +715,9 @@ static int ProcDMXGetInputCount(ClientPtr client) rep.length = 0; rep.inputCount = dmxGetInputCount(); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.inputCount, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.inputCount); } WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep); return Success; @@ -738,7 +727,6 @@ static int ProcDMXGetInputAttributes(ClientPtr client) { REQUEST(xDMXGetInputAttributesReq); xDMXGetInputAttributesReply rep; - int n; int length; int paddedLength; DMXInputAttributesRec attr; @@ -760,12 +748,12 @@ static int ProcDMXGetInputAttributes(ClientPtr client) rep.length = bytes_to_int32(paddedLength); rep.nameLength = length; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.inputType, n); - swapl(&rep.physicalScreen, n); - swapl(&rep.physicalId, n); - swapl(&rep.nameLength, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.inputType); + swapl(&rep.physicalScreen); + swapl(&rep.physicalId); + swapl(&rep.nameLength); } WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep); if (length) WriteToClient(client, length, (char *)attr.name); @@ -776,7 +764,6 @@ static int ProcDMXAddInput(ClientPtr client) { REQUEST(xDMXAddInputReq); xDMXAddInputReply rep; - int n; int status = 0; CARD32 *value_list; DMXInputAttributesRec attr; @@ -814,10 +801,10 @@ static int ProcDMXAddInput(ClientPtr client) rep.status = status; rep.physicalId = id; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); - swapl(&rep.physicalId, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); + swapl(&rep.physicalId); } WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep); return Success; @@ -827,7 +814,6 @@ static int ProcDMXRemoveInput(ClientPtr client) { REQUEST(xDMXRemoveInputReq); xDMXRemoveInputReply rep; - int n; int status = 0; REQUEST_SIZE_MATCH(xDMXRemoveInputReq); @@ -841,9 +827,9 @@ static int ProcDMXRemoveInput(ClientPtr client) rep.length = 0; rep.status = status; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep); return Success; @@ -883,79 +869,72 @@ static int ProcDMXDispatch(ClientPtr client) static int SProcDMXQueryVersion(ClientPtr client) { - int n; REQUEST(xDMXQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXQueryVersionReq); return ProcDMXQueryVersion(client); } static int SProcDMXSync(ClientPtr client) { - int n; REQUEST(xDMXSyncReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXSyncReq); return ProcDMXSync(client); } static int SProcDMXForceWindowCreation(ClientPtr client) { - int n; REQUEST(xDMXForceWindowCreationReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq); - swaps(&stuff->window, n); + swaps(&stuff->window); return ProcDMXForceWindowCreation(client); } static int SProcDMXGetScreenCount(ClientPtr client) { - int n; REQUEST(xDMXGetScreenCountReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); return ProcDMXGetScreenCount(client); } static int SProcDMXGetScreenAttributes(ClientPtr client) { - int n; REQUEST(xDMXGetScreenAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq); - swapl(&stuff->physicalScreen, n); + swapl(&stuff->physicalScreen); return ProcDMXGetScreenAttributes(client); } static int SProcDMXChangeScreensAttributes(ClientPtr client) { - int n; REQUEST(xDMXChangeScreensAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq); - swapl(&stuff->screenCount, n); - swapl(&stuff->maskCount, n); + swapl(&stuff->screenCount); + swapl(&stuff->maskCount); SwapRestL(stuff); return ProcDMXGetScreenAttributes(client); } static int SProcDMXAddScreen(ClientPtr client) { - int n; int paddedLength; REQUEST(xDMXAddScreenReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq); - swapl(&stuff->displayNameLength, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->displayNameLength); + swapl(&stuff->valueMask); paddedLength = pad_to_int32(stuff->displayNameLength); SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4); return ProcDMXAddScreen(client); @@ -963,79 +942,72 @@ static int SProcDMXAddScreen(ClientPtr client) static int SProcDMXRemoveScreen(ClientPtr client) { - int n; REQUEST(xDMXRemoveScreenReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXRemoveScreenReq); - swapl(&stuff->physicalScreen, n); + swapl(&stuff->physicalScreen); return ProcDMXRemoveScreen(client); } static int SProcDMXGetWindowAttributes(ClientPtr client) { - int n; REQUEST(xDMXGetWindowAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq); - swapl(&stuff->window, n); + swapl(&stuff->window); return ProcDMXGetWindowAttributes(client); } static int SProcDMXGetDesktopAttributes(ClientPtr client) { - int n; REQUEST(xDMXGetDesktopAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq); return ProcDMXGetDesktopAttributes(client); } static int SProcDMXChangeDesktopAttributes(ClientPtr client) { - int n; REQUEST(xDMXChangeDesktopAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq); - swapl(&stuff->valueMask, n); + swapl(&stuff->valueMask); SwapRestL(stuff); return ProcDMXChangeDesktopAttributes(client); } static int SProcDMXGetInputCount(ClientPtr client) { - int n; REQUEST(xDMXGetInputCountReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetInputCountReq); return ProcDMXGetInputCount(client); } static int SProcDMXGetInputAttributes(ClientPtr client) { - int n; REQUEST(xDMXGetInputAttributesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq); - swapl(&stuff->deviceId, n); + swapl(&stuff->deviceId); return ProcDMXGetInputAttributes(client); } static int SProcDMXAddInput(ClientPtr client) { - int n; int paddedLength; REQUEST(xDMXAddInputReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xDMXAddInputReq); - swapl(&stuff->displayNameLength, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->displayNameLength); + swapl(&stuff->valueMask); paddedLength = pad_to_int32(stuff->displayNameLength); SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4); return ProcDMXAddInput(client); @@ -1043,12 +1015,11 @@ static int SProcDMXAddInput(ClientPtr client) static int SProcDMXRemoveInput(ClientPtr client) { - int n; REQUEST(xDMXRemoveInputReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXRemoveInputReq); - swapl(&stuff->physicalId, n); + swapl(&stuff->physicalId); return ProcDMXRemoveInput(client); } diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 0bd51b2c7..0741a7294 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -541,7 +541,6 @@ static int ProcXF86DRIQueryVersion (register ClientPtr client) { xXF86DRIQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); EPHYR_LOG ("enter\n") ; @@ -553,11 +552,11 @@ ProcXF86DRIQueryVersion (register ClientPtr client) rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION; rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swapl(&rep.patchVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); + swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); EPHYR_LOG ("leave\n") ; @@ -569,7 +568,6 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) { xXF86DRIQueryDirectRenderingCapableReply rep; Bool isCapable; - register int n; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); @@ -592,8 +590,8 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) rep.isCapable = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep); @@ -1311,19 +1309,17 @@ ProcXF86DRIDispatch (register ClientPtr client) static int SProcXF86DRIQueryVersion (register ClientPtr client) { - register int n; REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcXF86DRIQueryVersion(client); } static int SProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) { - register int n; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - swaps(&stuff->length, n); - swapl(&stuff->screen, n); + swaps(&stuff->length); + swapl(&stuff->screen); return ProcXF86DRIQueryDirectRenderingCapable(client); } diff --git a/hw/kdrive/ephyr/ephyrhostproxy.c b/hw/kdrive/ephyr/ephyrhostproxy.c index ce3f01852..3137055ca 100644 --- a/hw/kdrive/ephyr/ephyrhostproxy.c +++ b/hw/kdrive/ephyr/ephyrhostproxy.c @@ -68,7 +68,7 @@ ephyrHostProxyDoForward (pointer a_request_buffer, EPHYR_LOG ("enter\n") ; if (a_do_swap) { - swaps (&in_req->length, n) ; + swaps(&in_req->length) ; } EPHYR_LOG ("Req {type:%d, data:%d, length:%d}\n", in_req->reqType, in_req->data, in_req->length) ; diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 31ed50533..0e701e518 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -760,8 +760,7 @@ vfbWriteXWDFileHeader(ScreenPtr pScreen) SwapLongs((CARD32 *)pXWDHeader, SIZEOF(XWDheader)/4); for (i = 0; i < pvfb->ncolors; i++) { - register char n; - swapl(&pvfb->pXWDCmap[i].pixel, n); + swapl(&pvfb->pXWDCmap[i].pixel); } } } diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 4737f2d96..46ff3bf63 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -282,7 +282,6 @@ static int ProcXF86VidModeQueryVersion(ClientPtr client) { xXF86VidModeQueryVersionReply rep; - register int n; DEBUG_P("XF86VidModeQueryVersion"); @@ -293,10 +292,10 @@ ProcXF86VidModeQueryVersion(ClientPtr client) rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION; rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION; 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(xXF86VidModeQueryVersionReply), (char *)&rep); return Success; @@ -309,7 +308,6 @@ ProcXF86VidModeGetModeLine(ClientPtr client) xXF86VidModeGetModeLineReply rep; xXF86OldVidModeGetModeLineReply oldrep; pointer mode; - register int n; int dotClock; int ver; @@ -364,20 +362,20 @@ ProcXF86VidModeGetModeLine(ClientPtr client) rep.privsize = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.dotclock, n); - swaps(&rep.hdisplay, n); - swaps(&rep.hsyncstart, n); - swaps(&rep.hsyncend, n); - swaps(&rep.htotal, n); - swaps(&rep.hskew, n); - swaps(&rep.vdisplay, n); - swaps(&rep.vsyncstart, n); - swaps(&rep.vsyncend, n); - swaps(&rep.vtotal, n); - swapl(&rep.flags, n); - swapl(&rep.privsize, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.dotclock); + swaps(&rep.hdisplay); + swaps(&rep.hsyncstart); + swaps(&rep.hsyncend); + swaps(&rep.htotal); + swaps(&rep.hskew); + swaps(&rep.vdisplay); + swaps(&rep.vsyncstart); + swaps(&rep.vsyncend); + swaps(&rep.vtotal); + swapl(&rep.flags); + swapl(&rep.privsize); } if (ver < 2) { oldrep.type = rep.type; @@ -412,7 +410,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) xXF86OldVidModeModeInfo oldmdinf; pointer mode; int modecount, dotClock; - register int n; int ver; DEBUG_P("XF86VidModeGetAllModelines"); @@ -442,9 +439,9 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) rep.sequenceNumber = client->sequence; rep.modecount = modecount; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.modecount, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.modecount); } WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep); @@ -462,18 +459,18 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); mdinf.privsize = 0; if (client->swapped) { - swapl(&mdinf.dotclock, n); - swaps(&mdinf.hdisplay, n); - swaps(&mdinf.hsyncstart, n); - swaps(&mdinf.hsyncend, n); - swaps(&mdinf.htotal, n); - swaps(&mdinf.hskew, n); - swaps(&mdinf.vdisplay, n); - swaps(&mdinf.vsyncstart, n); - swaps(&mdinf.vsyncend, n); - swaps(&mdinf.vtotal, n); - swapl(&mdinf.flags, n); - swapl(&mdinf.privsize, n); + swapl(&mdinf.dotclock); + swaps(&mdinf.hdisplay); + swaps(&mdinf.hsyncstart); + swaps(&mdinf.hsyncend); + swaps(&mdinf.htotal); + swaps(&mdinf.hskew); + swaps(&mdinf.vdisplay); + swaps(&mdinf.vsyncstart); + swaps(&mdinf.vsyncend); + swaps(&mdinf.vtotal); + swapl(&mdinf.flags); + swapl(&mdinf.privsize); } if (ver < 2) { oldmdinf.dotclock = mdinf.dotclock; @@ -1016,10 +1013,9 @@ status_reply: rep.sequenceNumber = client->sequence; rep.status = status; if (client->swapped) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.status, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.status); } WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) @@ -1164,7 +1160,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client) { REQUEST(xXF86VidModeGetMonitorReq); xXF86VidModeGetMonitorReply rep; - register int n; CARD32 *hsyncdata, *vsyncdata; int i, nHsync, nVrefresh; pointer monitor; @@ -1226,8 +1221,8 @@ ProcXF86VidModeGetMonitor(ClientPtr client) if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; @@ -1251,7 +1246,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client) { REQUEST(xXF86VidModeGetViewPortReq); xXF86VidModeGetViewPortReply rep; - int x, y, n; + int x, y; DEBUG_P("XF86VidModeGetViewPort"); @@ -1269,10 +1264,10 @@ ProcXF86VidModeGetViewPort(ClientPtr client) rep.y = y; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.x, n); - swapl(&rep.y, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.x); + swapl(&rep.y); } WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep); return Success; @@ -1301,7 +1296,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) { REQUEST(xXF86VidModeGetDotClocksReq); xXF86VidModeGetDotClocksReply rep; - register int n; + int n; int numClocks; CARD32 dotclock; int *Clocks = NULL; @@ -1338,11 +1333,11 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) rep.flags |= CLKFLAG_PROGRAMABLE; } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.clocks, n); - swapl(&rep.maxclocks, n); - swapl(&rep.flags, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.clocks); + swapl(&rep.maxclocks); + swapl(&rep.flags); } WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep); if (!ClockProg) { @@ -1384,7 +1379,6 @@ ProcXF86VidModeGetGamma(ClientPtr client) { REQUEST(xXF86VidModeGetGammaReq); xXF86VidModeGetGammaReply rep; - register int n; float red, green, blue; DEBUG_P("XF86VidModeGetGamma"); @@ -1403,11 +1397,11 @@ ProcXF86VidModeGetGamma(ClientPtr client) rep.green = (CARD32)(green * 10000.); rep.blue = (CARD32)(blue * 10000.); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.red, n); - swapl(&rep.green, n); - swapl(&rep.blue, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.red); + swapl(&rep.green); + swapl(&rep.blue); } WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep); return Success; @@ -1444,7 +1438,7 @@ static int ProcXF86VidModeGetGammaRamp(ClientPtr client) { CARD16 *ramp = NULL; - int n, length; + int length; size_t ramplen = 0; xXF86VidModeGetGammaRampReply rep; REQUEST(xXF86VidModeGetGammaRampReq); @@ -1476,9 +1470,9 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) rep.sequenceNumber = client->sequence; rep.size = stuff->size; if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.size, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.size); SwapShorts((short*)ramp, length * 3); } WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep); @@ -1496,7 +1490,6 @@ static int ProcXF86VidModeGetGammaRampSize(ClientPtr client) { xXF86VidModeGetGammaRampSizeReply rep; - int n; REQUEST(xXF86VidModeGetGammaRampSizeReq); if(stuff->screen >= screenInfo.numScreens) @@ -1509,9 +1502,9 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client) rep.sequenceNumber = client->sequence; rep.size = VidModeGetGammaRampSize(stuff->screen); if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.size, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.size); } WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep); @@ -1522,7 +1515,6 @@ static int ProcXF86VidModeGetPermissions(ClientPtr client) { xXF86VidModeGetPermissionsReply rep; - int n; REQUEST(xXF86VidModeGetPermissionsReq); if(stuff->screen >= screenInfo.numScreens) @@ -1539,9 +1531,9 @@ ProcXF86VidModeGetPermissions(ClientPtr client) rep.permissions |= XF86VM_WRITE_PERMISSION; } if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.permissions, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.permissions); } WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep); @@ -1636,31 +1628,28 @@ ProcXF86VidModeDispatch(ClientPtr client) static int SProcXF86VidModeQueryVersion(ClientPtr client) { - register int n; REQUEST(xXF86VidModeQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcXF86VidModeQueryVersion(client); } static int SProcXF86VidModeGetModeLine(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetModeLineReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetModeLine(client); } static int SProcXF86VidModeGetAllModeLines(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetAllModeLinesReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetAllModeLines(client); } @@ -1670,40 +1659,39 @@ SProcXF86VidModeAddModeLine(ClientPtr client) xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *)client->requestBuffer; int ver; - register int n; REQUEST(xXF86VidModeAddModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { - swaps(&oldstuff->length, n); + swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq); - swapl(&oldstuff->screen, n); - swaps(&oldstuff->hdisplay, n); - swaps(&oldstuff->hsyncstart, n); - swaps(&oldstuff->hsyncend, n); - swaps(&oldstuff->htotal, n); - swaps(&oldstuff->vdisplay, n); - swaps(&oldstuff->vsyncstart, n); - swaps(&oldstuff->vsyncend, n); - swaps(&oldstuff->vtotal, n); - swapl(&oldstuff->flags, n); - swapl(&oldstuff->privsize, n); + swapl(&oldstuff->screen); + swaps(&oldstuff->hdisplay); + swaps(&oldstuff->hsyncstart); + swaps(&oldstuff->hsyncend); + swaps(&oldstuff->htotal); + swaps(&oldstuff->vdisplay); + swaps(&oldstuff->vsyncstart); + swaps(&oldstuff->vsyncend); + swaps(&oldstuff->vtotal); + swapl(&oldstuff->flags); + swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq); - swapl(&stuff->screen, n); - swaps(&stuff->hdisplay, n); - swaps(&stuff->hsyncstart, n); - swaps(&stuff->hsyncend, n); - swaps(&stuff->htotal, n); - swaps(&stuff->hskew, n); - swaps(&stuff->vdisplay, n); - swaps(&stuff->vsyncstart, n); - swaps(&stuff->vsyncend, n); - swaps(&stuff->vtotal, n); - swapl(&stuff->flags, n); - swapl(&stuff->privsize, n); + swapl(&stuff->screen); + swaps(&stuff->hdisplay); + swaps(&stuff->hsyncstart); + swaps(&stuff->hsyncend); + swaps(&stuff->htotal); + swaps(&stuff->hskew); + swaps(&stuff->vdisplay); + swaps(&stuff->vsyncstart); + swaps(&stuff->vsyncend); + swaps(&stuff->vtotal); + swapl(&stuff->flags); + swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeAddModeLine(client); @@ -1715,40 +1703,39 @@ SProcXF86VidModeDeleteModeLine(ClientPtr client) xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer; int ver; - register int n; REQUEST(xXF86VidModeDeleteModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { - swaps(&oldstuff->length, n); + swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq); - swapl(&oldstuff->screen, n); - swaps(&oldstuff->hdisplay, n); - swaps(&oldstuff->hsyncstart, n); - swaps(&oldstuff->hsyncend, n); - swaps(&oldstuff->htotal, n); - swaps(&oldstuff->vdisplay, n); - swaps(&oldstuff->vsyncstart, n); - swaps(&oldstuff->vsyncend, n); - swaps(&oldstuff->vtotal, n); - swapl(&oldstuff->flags, n); - swapl(&oldstuff->privsize, n); + swapl(&oldstuff->screen); + swaps(&oldstuff->hdisplay); + swaps(&oldstuff->hsyncstart); + swaps(&oldstuff->hsyncend); + swaps(&oldstuff->htotal); + swaps(&oldstuff->vdisplay); + swaps(&oldstuff->vsyncstart); + swaps(&oldstuff->vsyncend); + swaps(&oldstuff->vtotal); + swapl(&oldstuff->flags); + swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq); - swapl(&stuff->screen, n); - swaps(&stuff->hdisplay, n); - swaps(&stuff->hsyncstart, n); - swaps(&stuff->hsyncend, n); - swaps(&stuff->htotal, n); - swaps(&stuff->hskew, n); - swaps(&stuff->vdisplay, n); - swaps(&stuff->vsyncstart, n); - swaps(&stuff->vsyncend, n); - swaps(&stuff->vtotal, n); - swapl(&stuff->flags, n); - swapl(&stuff->privsize, n); + swapl(&stuff->screen); + swaps(&stuff->hdisplay); + swaps(&stuff->hsyncstart); + swaps(&stuff->hsyncend); + swaps(&stuff->htotal); + swaps(&stuff->hskew); + swaps(&stuff->vdisplay); + swaps(&stuff->vsyncstart); + swaps(&stuff->vsyncend); + swaps(&stuff->vtotal); + swapl(&stuff->flags); + swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeDeleteModeLine(client); @@ -1760,40 +1747,39 @@ SProcXF86VidModeModModeLine(ClientPtr client) xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *)client->requestBuffer; int ver; - register int n; REQUEST(xXF86VidModeModModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { - swaps(&oldstuff->length, n); + swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq); - swapl(&oldstuff->screen, n); - swaps(&oldstuff->hdisplay, n); - swaps(&oldstuff->hsyncstart, n); - swaps(&oldstuff->hsyncend, n); - swaps(&oldstuff->htotal, n); - swaps(&oldstuff->vdisplay, n); - swaps(&oldstuff->vsyncstart, n); - swaps(&oldstuff->vsyncend, n); - swaps(&oldstuff->vtotal, n); - swapl(&oldstuff->flags, n); - swapl(&oldstuff->privsize, n); + swapl(&oldstuff->screen); + swaps(&oldstuff->hdisplay); + swaps(&oldstuff->hsyncstart); + swaps(&oldstuff->hsyncend); + swaps(&oldstuff->htotal); + swaps(&oldstuff->vdisplay); + swaps(&oldstuff->vsyncstart); + swaps(&oldstuff->vsyncend); + swaps(&oldstuff->vtotal); + swapl(&oldstuff->flags); + swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq); - swapl(&stuff->screen, n); - swaps(&stuff->hdisplay, n); - swaps(&stuff->hsyncstart, n); - swaps(&stuff->hsyncend, n); - swaps(&stuff->htotal, n); - swaps(&stuff->hskew, n); - swaps(&stuff->vdisplay, n); - swaps(&stuff->vsyncstart, n); - swaps(&stuff->vsyncend, n); - swaps(&stuff->vtotal, n); - swapl(&stuff->flags, n); - swapl(&stuff->privsize, n); + swapl(&stuff->screen); + swaps(&stuff->hdisplay); + swaps(&stuff->hsyncstart); + swaps(&stuff->hsyncend); + swaps(&stuff->htotal); + swaps(&stuff->hskew); + swaps(&stuff->vdisplay); + swaps(&stuff->vsyncstart); + swaps(&stuff->vsyncend); + swaps(&stuff->vtotal); + swapl(&stuff->flags); + swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeModModeLine(client); @@ -1805,40 +1791,39 @@ SProcXF86VidModeValidateModeLine(ClientPtr client) xXF86OldVidModeValidateModeLineReq *oldstuff = (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer; int ver; - register int n; REQUEST(xXF86VidModeValidateModeLineReq); ver = ClientMajorVersion(client); if (ver < 2) { - swaps(&oldstuff->length, n); + swaps(&oldstuff->length); REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq); - swapl(&oldstuff->screen, n); - swaps(&oldstuff->hdisplay, n); - swaps(&oldstuff->hsyncstart, n); - swaps(&oldstuff->hsyncend, n); - swaps(&oldstuff->htotal, n); - swaps(&oldstuff->vdisplay, n); - swaps(&oldstuff->vsyncstart, n); - swaps(&oldstuff->vsyncend, n); - swaps(&oldstuff->vtotal, n); - swapl(&oldstuff->flags, n); - swapl(&oldstuff->privsize, n); + swapl(&oldstuff->screen); + swaps(&oldstuff->hdisplay); + swaps(&oldstuff->hsyncstart); + swaps(&oldstuff->hsyncend); + swaps(&oldstuff->htotal); + swaps(&oldstuff->vdisplay); + swaps(&oldstuff->vsyncstart); + swaps(&oldstuff->vsyncend); + swaps(&oldstuff->vtotal); + swapl(&oldstuff->flags); + swapl(&oldstuff->privsize); SwapRestL(oldstuff); } else { - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq); - swapl(&stuff->screen, n); - swaps(&stuff->hdisplay, n); - swaps(&stuff->hsyncstart, n); - swaps(&stuff->hsyncend, n); - swaps(&stuff->htotal, n); - swaps(&stuff->hskew, n); - swaps(&stuff->vdisplay, n); - swaps(&stuff->vsyncstart, n); - swaps(&stuff->vsyncend, n); - swaps(&stuff->vtotal, n); - swapl(&stuff->flags, n); - swapl(&stuff->privsize, n); + swapl(&stuff->screen); + swaps(&stuff->hdisplay); + swaps(&stuff->hsyncstart); + swaps(&stuff->hsyncend); + swaps(&stuff->htotal); + swaps(&stuff->hskew); + swaps(&stuff->vdisplay); + swaps(&stuff->vsyncstart); + swaps(&stuff->vsyncend); + swaps(&stuff->vtotal); + swapl(&stuff->flags); + swapl(&stuff->privsize); SwapRestL(stuff); } return ProcXF86VidModeValidateModeLine(client); @@ -1847,130 +1832,120 @@ SProcXF86VidModeValidateModeLine(ClientPtr client) static int SProcXF86VidModeSwitchMode(ClientPtr client) { - register int n; REQUEST(xXF86VidModeSwitchModeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq); - swaps(&stuff->screen, n); - swaps(&stuff->zoom, n); + swaps(&stuff->screen); + swaps(&stuff->zoom); return ProcXF86VidModeSwitchMode(client); } static int SProcXF86VidModeSwitchToMode(ClientPtr client) { - register int n; REQUEST(xXF86VidModeSwitchToModeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeSwitchToMode(client); } static int SProcXF86VidModeLockModeSwitch(ClientPtr client) { - register int n; REQUEST(xXF86VidModeLockModeSwitchReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq); - swaps(&stuff->screen, n); - swaps(&stuff->lock, n); + swaps(&stuff->screen); + swaps(&stuff->lock); return ProcXF86VidModeLockModeSwitch(client); } static int SProcXF86VidModeGetMonitor(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetMonitorReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetMonitor(client); } static int SProcXF86VidModeGetViewPort(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetViewPortReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetViewPort(client); } static int SProcXF86VidModeSetViewPort(ClientPtr client) { - register int n; REQUEST(xXF86VidModeSetViewPortReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq); - swaps(&stuff->screen, n); - swapl(&stuff->x, n); - swapl(&stuff->y, n); + swaps(&stuff->screen); + swapl(&stuff->x); + swapl(&stuff->y); return ProcXF86VidModeSetViewPort(client); } static int SProcXF86VidModeGetDotClocks(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetDotClocksReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetDotClocks(client); } static int SProcXF86VidModeSetClientVersion(ClientPtr client) { - register int n; REQUEST(xXF86VidModeSetClientVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq); - swaps(&stuff->major, n); - swaps(&stuff->minor, n); + swaps(&stuff->major); + swaps(&stuff->minor); return ProcXF86VidModeSetClientVersion(client); } static int SProcXF86VidModeSetGamma(ClientPtr client) { - register int n; REQUEST(xXF86VidModeSetGammaReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq); - swaps(&stuff->screen, n); - swapl(&stuff->red, n); - swapl(&stuff->green, n); - swapl(&stuff->blue, n); + swaps(&stuff->screen); + swapl(&stuff->red); + swapl(&stuff->green); + swapl(&stuff->blue); return ProcXF86VidModeSetGamma(client); } static int SProcXF86VidModeGetGamma(ClientPtr client) { - register int n; REQUEST(xXF86VidModeGetGammaReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetGamma(client); } static int SProcXF86VidModeSetGammaRamp(ClientPtr client) { - int length, n; + int length; REQUEST(xXF86VidModeSetGammaRampReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq); - swaps(&stuff->size, n); - swaps(&stuff->screen, n); + swaps(&stuff->size); + swaps(&stuff->screen); length = ((stuff->size + 1) & ~1) * 6; REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); SwapRestS(stuff); @@ -1980,34 +1955,31 @@ SProcXF86VidModeSetGammaRamp(ClientPtr client) static int SProcXF86VidModeGetGammaRamp(ClientPtr client) { - int n; REQUEST(xXF86VidModeGetGammaRampReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); - swaps(&stuff->size, n); - swaps(&stuff->screen, n); + swaps(&stuff->size); + swaps(&stuff->screen); return ProcXF86VidModeGetGammaRamp(client); } static int SProcXF86VidModeGetGammaRampSize(ClientPtr client) { - int n; REQUEST(xXF86VidModeGetGammaRampSizeReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetGammaRampSize(client); } static int SProcXF86VidModeGetPermissions(ClientPtr client) { - int n; REQUEST(xXF86VidModeGetPermissionsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); - swaps(&stuff->screen, n); + swaps(&stuff->screen); return ProcXF86VidModeGetPermissions(client); } diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index e02644a30..c35ba2f94 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -86,7 +86,6 @@ ProcXF86DRIQueryVersion( ) { xXF86DRIQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); rep.type = X_Reply; @@ -96,11 +95,11 @@ ProcXF86DRIQueryVersion( rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION; rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); - swapl(&rep.patchVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); + swapl(&rep.patchVersion); } WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep); return Success; @@ -113,7 +112,6 @@ ProcXF86DRIQueryDirectRenderingCapable( { xXF86DRIQueryDirectRenderingCapableReply rep; Bool isCapable; - register int n; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq); @@ -136,8 +134,8 @@ ProcXF86DRIQueryDirectRenderingCapable( rep.isCapable = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, @@ -595,9 +593,8 @@ SProcXF86DRIQueryVersion( register ClientPtr client ) { - register int n; REQUEST(xXF86DRIQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcXF86DRIQueryVersion(client); } @@ -606,10 +603,9 @@ SProcXF86DRIQueryDirectRenderingCapable( register ClientPtr client ) { - register int n; REQUEST(xXF86DRIQueryDirectRenderingCapableReq); - swaps(&stuff->length, n); - swapl(&stuff->screen, n); + swaps(&stuff->length); + swapl(&stuff->screen); return ProcXF86DRIQueryDirectRenderingCapable(client); } diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 552b26b7c..934abf6de 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -71,10 +71,9 @@ ProcDRI2QueryVersion(ClientPtr client) { REQUEST(xDRI2QueryVersionReq); xDRI2QueryVersionReply rep; - int n; if (client->swapped) - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xDRI2QueryVersionReq); rep.type = X_Reply; @@ -84,10 +83,10 @@ ProcDRI2QueryVersion(ClientPtr client) rep.minorVersion = dri2_minor; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep); @@ -585,16 +584,15 @@ SProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); xDRI2ConnectReply rep; - int n; /* If the client is swapped, it's not local. Talk to the hand. */ - swaps(&stuff->length, n); + swaps(&stuff->length); if (sizeof(*stuff) / 4 != client->req_len) return BadLength; rep.sequenceNumber = client->sequence; - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); rep.length = 0; rep.driverNameLength = 0; rep.deviceNameLength = 0; diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 2f26e61d9..27fb125d3 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -147,7 +147,6 @@ ProcAppleWMQueryVersion( ) { xAppleWMQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq); rep.type = X_Reply; @@ -157,8 +156,8 @@ ProcAppleWMQueryVersion( rep.minorVersion = SERVER_APPLEWM_MINOR_VERSION; rep.patchVersion = SERVER_APPLEWM_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); return Success; @@ -681,9 +680,8 @@ SProcAppleWMQueryVersion( register ClientPtr client ) { - register int n; REQUEST(xAppleWMQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcAppleWMQueryVersion(client); } diff --git a/hw/xquartz/pseudoramiX.c b/hw/xquartz/pseudoramiX.c index 298ec2be9..5a5b9c2e7 100644 --- a/hw/xquartz/pseudoramiX.c +++ b/hw/xquartz/pseudoramiX.c @@ -183,7 +183,7 @@ static int ProcPseudoramiXGetState(ClientPtr client) REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; - register int n, rc; + register int rc; TRACE(); @@ -197,9 +197,9 @@ static int ProcPseudoramiXGetState(ClientPtr client) rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.state, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.state); } WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep); return Success; @@ -212,7 +212,7 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; - register int n, rc; + register int rc; TRACE(); @@ -226,9 +226,9 @@ static int ProcPseudoramiXGetScreenCount(ClientPtr client) rep.sequenceNumber = client->sequence; rep.ScreenCount = pseudoramiXNumScreens; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.ScreenCount, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.ScreenCount); } WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); return Success; @@ -259,10 +259,10 @@ static int ProcPseudoramiXGetScreenSize(ClientPtr client) rep.height = pseudoramiXScreens[stuff->screen].h; // was screenInfo.screens[stuff->screen]->height; if (client->swapped) { - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.width, n); - swaps (&rep.height, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.width); + swaps(&rep.height); } WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); return Success; @@ -284,10 +284,9 @@ static int ProcPseudoramiXIsActive(ClientPtr client) rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; if (client->swapped) { - register int n; - 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; @@ -309,10 +308,9 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens; rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { - register int n; - 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); @@ -327,11 +325,10 @@ static int ProcPseudoramiXQueryScreens(ClientPtr client) scratch.height = pseudoramiXScreens[i].h; if(client->swapped) { - register int n; - swaps (&scratch.x_org, n); - swaps (&scratch.y_org, n); - swaps (&scratch.width, n); - swaps (&scratch.height, n); + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); } WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch); } @@ -369,11 +366,10 @@ static int SProcPseudoramiXQueryVersion (ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); - register int n; TRACE(); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return ProcPseudoramiXQueryVersion(client); } @@ -382,11 +378,10 @@ static int SProcPseudoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); - register int n; TRACE(); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); return ProcPseudoramiXGetState(client); } @@ -395,11 +390,10 @@ static int SProcPseudoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); - register int n; TRACE(); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); return ProcPseudoramiXGetScreenCount(client); } @@ -408,11 +402,10 @@ static int SProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); - register int n; TRACE(); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); return ProcPseudoramiXGetScreenSize(client); } @@ -422,11 +415,10 @@ static int SProcPseudoramiXIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); - register int n; TRACE(); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcPseudoramiXIsActive(client); } @@ -436,11 +428,10 @@ static int SProcPseudoramiXQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); - register int n; TRACE(); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcPseudoramiXQueryScreens(client); } diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index ff70a381a..1304d5a43 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -91,7 +91,6 @@ ProcAppleDRIQueryVersion( ) { xAppleDRIQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq); rep.type = X_Reply; @@ -101,8 +100,8 @@ ProcAppleDRIQueryVersion( rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION; rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); return Success; @@ -372,9 +371,8 @@ SProcAppleDRIQueryVersion( register ClientPtr client ) { - register int n; REQUEST(xAppleDRIQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcAppleDRIQueryVersion(client); } diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 71384097f..403c859e7 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -91,8 +91,8 @@ ProcWindowsWMQueryVersion(ClientPtr client) rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep); return Success; @@ -588,7 +588,7 @@ SProcWindowsWMQueryVersion (ClientPtr client) { int n; REQUEST(xWindowsWMQueryVersionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return ProcWindowsWMQueryVersion(client); } diff --git a/include/misc.h b/include/misc.h index 48492573e..cca30d2d0 100644 --- a/include/misc.h +++ b/include/misc.h @@ -256,19 +256,21 @@ version_compare(uint16_t a_major, uint16_t a_minor, SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) /* byte swap a 32-bit value */ -#define swapl(x, n) { \ - n = ((char *) (x))[0];\ +#define swapl(x) do { \ + char n = ((char *) (x))[0];\ ((char *) (x))[0] = ((char *) (x))[3];\ ((char *) (x))[3] = n;\ n = ((char *) (x))[1];\ ((char *) (x))[1] = ((char *) (x))[2];\ - ((char *) (x))[2] = n; } + ((char *) (x))[2] = n;\ + } while (0) /* byte swap a short */ -#define swaps(x, n) { \ - n = ((char *) (x))[0];\ +#define swaps(x) do { \ + char n = ((char *) (x))[0];\ ((char *) (x))[0] = ((char *) (x))[1];\ - ((char *) (x))[1] = n; } + ((char *) (x))[1] = n;\ + } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ #define cpswapl(src, dst) { \ diff --git a/os/connection.c b/os/connection.c index 0c580ab5e..b339f4e96 100644 --- a/os/connection.c +++ b/os/connection.c @@ -905,9 +905,9 @@ ErrorConnMax(XtransConnInfo trans_conn) if (((*(char *) &whichbyte) && (byteOrder == 'B')) || (!(*(char *) &whichbyte) && (byteOrder == 'l'))) { - swaps(&csp.majorVersion, whichbyte); - swaps(&csp.minorVersion, whichbyte); - swaps(&csp.length, whichbyte); + swaps(&csp.majorVersion); + swaps(&csp.minorVersion); + swaps(&csp.length); } iov[0].iov_len = sz_xConnSetupPrefix; iov[0].iov_base = (char *) &csp; diff --git a/os/io.c b/os/io.c index 421023807..068f5f028 100644 --- a/os/io.c +++ b/os/io.c @@ -598,8 +598,7 @@ ResetCurrentRequest(ClientPtr client) ((xBigReq *)oci->bufptr)->length = client->req_len; if (client->swapped) { - char n; - swapl(&((xBigReq *)oci->bufptr)->length, n); + swapl(&((xBigReq *)oci->bufptr)->length); } } if (gotnow >= (needed << 2)) @@ -822,11 +821,10 @@ WriteToClient (ClientPtr who, int count, const void *__buf) { /* start of new reply */ CARD32 replylen; unsigned long bytesleft; - char n; replylen = ((xGenericReply *)buf)->length; if (who->swapped) - swapl(&replylen, n); + swapl(&replylen); bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes; replyinfo.startOfReply = TRUE; replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft; diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 0437795c4..a8b73d9b7 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -751,7 +751,7 @@ ProcRRGetCrtcInfo (ClientPtr client) RRModePtr mode; RROutput *outputs; RROutput *possible; - int i, j, k, n; + int i, j, k; int width, height; BoxRec panned_area; @@ -818,7 +818,7 @@ ProcRRGetCrtcInfo (ClientPtr client) { outputs[i] = crtc->outputs[i]->id; if (client->swapped) - swapl (&outputs[i], n); + swapl(&outputs[i]); } k = 0; for (i = 0; i < pScrPriv->numOutputs; i++) @@ -827,23 +827,23 @@ ProcRRGetCrtcInfo (ClientPtr client) { possible[k] = pScrPriv->outputs[i]->id; if (client->swapped) - swapl (&possible[k], n); + swapl(&possible[k]); k++; } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.x, n); - swaps(&rep.y, n); - swaps(&rep.width, n); - swaps(&rep.height, n); - swapl(&rep.mode, n); - swaps(&rep.rotation, n); - swaps(&rep.rotations, n); - swaps(&rep.nOutput, n); - swaps(&rep.nPossibleOutput, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swaps(&rep.x); + swaps(&rep.y); + swaps(&rep.width); + swaps(&rep.height); + swapl(&rep.mode); + swaps(&rep.rotation); + swaps(&rep.rotations); + swaps(&rep.nOutput); + swaps(&rep.nPossibleOutput); } WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep); if (extraLen) @@ -1058,10 +1058,9 @@ sendReply: if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.newTimestamp); } WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); @@ -1079,7 +1078,6 @@ ProcRRGetPanning (ClientPtr client) BoxRec total; BoxRec tracking; INT16 border[4]; - int n; REQUEST_SIZE_MATCH(xRRGetPanningReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); @@ -1117,21 +1115,21 @@ ProcRRGetPanning (ClientPtr client) } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.timestamp, n); - swaps(&rep.left, n); - swaps(&rep.top, n); - swaps(&rep.width, n); - swaps(&rep.height, n); - swaps(&rep.track_left, n); - swaps(&rep.track_top, n); - swaps(&rep.track_width, n); - swaps(&rep.track_height, n); - swaps(&rep.border_left, n); - swaps(&rep.border_top, n); - swaps(&rep.border_right, n); - swaps(&rep.border_bottom, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.timestamp); + swaps(&rep.left); + swaps(&rep.top); + swaps(&rep.width); + swaps(&rep.height); + swaps(&rep.track_left); + swaps(&rep.track_top); + swaps(&rep.track_width); + swaps(&rep.track_height); + swaps(&rep.border_left); + swaps(&rep.border_top); + swaps(&rep.border_right); + swaps(&rep.border_bottom); } WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep); return Success; @@ -1149,7 +1147,6 @@ ProcRRSetPanning (ClientPtr client) BoxRec total; BoxRec tracking; INT16 border[4]; - int n; REQUEST_SIZE_MATCH(xRRSetPanningReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); @@ -1198,9 +1195,9 @@ sendReply: rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.newTimestamp, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.newTimestamp); } WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep); return Success; @@ -1212,7 +1209,6 @@ ProcRRGetCrtcGammaSize (ClientPtr client) REQUEST(xRRGetCrtcGammaSizeReq); xRRGetCrtcGammaSizeReply reply; RRCrtcPtr crtc; - int n; REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); @@ -1226,9 +1222,9 @@ ProcRRGetCrtcGammaSize (ClientPtr client) reply.length = 0; reply.size = crtc->gammaSize; if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swaps(&reply.size); } WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); return Success; @@ -1240,7 +1236,6 @@ ProcRRGetCrtcGamma (ClientPtr client) REQUEST(xRRGetCrtcGammaReq); xRRGetCrtcGammaReply reply; RRCrtcPtr crtc; - int n; unsigned long len; char *extra = NULL; @@ -1264,9 +1259,9 @@ ProcRRGetCrtcGamma (ClientPtr client) reply.length = bytes_to_int32(len); reply.size = crtc->gammaSize; if (client->swapped) { - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swaps (&reply.size, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swaps(&reply.size); } WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply); if (crtc->gammaSize) @@ -1361,7 +1356,6 @@ transform_filter_encode (ClientPtr client, char *output, RRTransformPtr transform) { int nbytes, nparams; - int n; if (transform->filter == NULL) { *nbytesFilter = 0; @@ -1377,8 +1371,8 @@ transform_filter_encode (ClientPtr client, char *output, output[nbytes++] = 0; memcpy (output + nbytes, transform->params, nparams * sizeof (xFixed)); if (client->swapped) { - swaps (nbytesFilter, n); - swaps (nparamsFilter, n); + swaps(nbytesFilter); + swaps(nparamsFilter); SwapLongs ((CARD32 *) (output + nbytes), nparams); } nbytes += nparams * sizeof (xFixed); @@ -1399,7 +1393,7 @@ ProcRRGetCrtcTransform (ClientPtr client) REQUEST(xRRGetCrtcTransformReq); xRRGetCrtcTransformReply *reply; RRCrtcPtr crtc; - int n, nextra; + int nextra; RRTransformPtr current, pending; char *extra; @@ -1436,8 +1430,8 @@ ProcRRGetCrtcTransform (ClientPtr client) current); if (client->swapped) { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); } WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply); free(reply); diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index d1c99c288..5a6a85287 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -36,7 +36,6 @@ static int ProcRRQueryVersion (ClientPtr client) { xRRQueryVersionReply rep = {0}; - register int n; REQUEST(xRRQueryVersionReq); rrClientPriv(client); @@ -59,10 +58,10 @@ ProcRRQueryVersion (ClientPtr client) } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); return Success; diff --git a/randr/rrmode.c b/randr/rrmode.c index d7560dcb2..63a2d2a74 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -325,10 +325,9 @@ ProcRRCreateMode (ClientPtr client) rep.mode = mode->mode.id; if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.mode, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.mode); } WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep); /* Drop out reference to this mode */ diff --git a/randr/rroutput.c b/randr/rroutput.c index 5edeb7dd2..b57be198f 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -447,7 +447,7 @@ ProcRRGetOutputInfo (ClientPtr client) RRMode *modes; RROutput *clones; char *name; - int i, n; + int i; REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); @@ -494,7 +494,7 @@ ProcRRGetOutputInfo (ClientPtr client) { crtcs[i] = output->crtcs[i]->id; if (client->swapped) - swapl (&crtcs[i], n); + swapl(&crtcs[i]); } for (i = 0; i < output->numModes + output->numUserModes; i++) { @@ -503,26 +503,26 @@ ProcRRGetOutputInfo (ClientPtr client) else modes[i] = output->userModes[i - output->numModes]->mode.id; if (client->swapped) - swapl (&modes[i], n); + swapl(&modes[i]); } for (i = 0; i < output->numClones; i++) { clones[i] = output->clones[i]->id; if (client->swapped) - swapl (&clones[i], n); + swapl(&clones[i]); } memcpy (name, output->name, output->nameLength); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swapl(&rep.crtc, n); - swapl(&rep.mmWidth, n); - swapl(&rep.mmHeight, n); - swaps(&rep.nCrtcs, n); - swaps(&rep.nModes, n); - swaps(&rep.nClones, n); - swaps(&rep.nameLength, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swapl(&rep.crtc); + swapl(&rep.mmWidth); + swapl(&rep.mmHeight); + swaps(&rep.nCrtcs); + swaps(&rep.nModes); + swaps(&rep.nClones); + swaps(&rep.nameLength); } WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep); if (extraLen) @@ -614,9 +614,8 @@ ProcRRGetOutputPrimary(ClientPtr client) rep.output = primary ? primary->id : None; if (client->swapped) { - int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.output, n); + swaps(&rep.sequenceNumber); + swapl(&rep.output); } WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep); diff --git a/randr/rrproperty.c b/randr/rrproperty.c index 61e7bb45a..6ed24d3aa 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -409,10 +409,9 @@ ProcRRListOutputProperties (ClientPtr client) rep.nAtoms = numProps; if (client->swapped) { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); - swaps (&rep.nAtoms, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.nAtoms); } temppAtoms = pAtoms; for (prop = output->properties; prop; prop = prop->next) @@ -458,9 +457,8 @@ ProcRRQueryOutputProperty (ClientPtr client) rep.immutable = prop->immutable; if (client->swapped) { - int n; - swaps (&rep.sequenceNumber, n); - swapl (&rep.length, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); } WriteToClient (client, sizeof (xRRQueryOutputPropertyReply), (char*)&rep); if (prop->num_valid) @@ -615,13 +613,11 @@ ProcRRGetOutputProperty (ClientPtr client) reply.propertyType = None; reply.format = 0; if (client->swapped) { - int n; - - swaps(&reply.sequenceNumber, n); - swapl(&reply.length, n); - swapl(&reply.propertyType, n); - swapl(&reply.bytesAfter, n); - swapl(&reply.nItems, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); return Success; @@ -647,13 +643,11 @@ ProcRRGetOutputProperty (ClientPtr client) reply.nItems = 0; reply.propertyType = prop_value->type; if (client->swapped) { - int n; - - swaps(&reply.sequenceNumber, n); - swapl(&reply.length, n); - swapl(&reply.propertyType, n); - swapl(&reply.bytesAfter, n); - swapl(&reply.nItems, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); } WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); return Success; @@ -704,13 +698,11 @@ ProcRRGetOutputProperty (ClientPtr client) } if (client->swapped) { - int n; - - swaps(&reply.sequenceNumber, n); - swapl(&reply.length, n); - swapl(&reply.propertyType, n); - swapl(&reply.bytesAfter, n); - swapl(&reply.nItems, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); } WriteToClient(client, sizeof(xGenericReply), &reply); if (len) diff --git a/randr/rrscreen.c b/randr/rrscreen.c index da6d48d6e..ab4675734 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -232,14 +232,12 @@ ProcRRGetScreenSizeRange (ClientPtr client) } if (client->swapped) { - int n; - - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swaps(&rep.minWidth, n); - swaps(&rep.minHeight, n); - swaps(&rep.maxWidth, n); - swaps(&rep.maxHeight, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.minWidth); + swaps(&rep.minHeight); + swaps(&rep.maxWidth); + swaps(&rep.maxHeight); } WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); return Success; @@ -318,7 +316,7 @@ rrGetScreenResources(ClientPtr client, Bool query) rrScrPrivPtr pScrPriv; CARD8 *extra; unsigned long extraLen; - int i, n, rc, has_primary = 0; + int i, rc, has_primary = 0; RRCrtc *crtcs; RROutput *outputs; xRRModeInfo *modeinfos; @@ -401,7 +399,7 @@ rrGetScreenResources(ClientPtr client, Bool query) has_primary = 1; crtcs[0] = pScrPriv->primaryOutput->crtc->id; if (client->swapped) - swapl (&crtcs[0], n); + swapl(&crtcs[0]); } for (i = 0; i < pScrPriv->numCrtcs; i++) @@ -414,14 +412,14 @@ rrGetScreenResources(ClientPtr client, Bool query) } crtcs[i + has_primary] = pScrPriv->crtcs[i]->id; if (client->swapped) - swapl (&crtcs[i + has_primary], n); + swapl(&crtcs[i + has_primary]); } for (i = 0; i < pScrPriv->numOutputs; i++) { outputs[i] = pScrPriv->outputs[i]->id; if (client->swapped) - swapl (&outputs[i], n); + swapl(&outputs[i]); } for (i = 0; i < num_modes; i++) @@ -430,19 +428,19 @@ rrGetScreenResources(ClientPtr client, Bool query) modeinfos[i] = mode->mode; if (client->swapped) { - swapl (&modeinfos[i].id, n); - swaps (&modeinfos[i].width, n); - swaps (&modeinfos[i].height, n); - swapl (&modeinfos[i].dotClock, n); - swaps (&modeinfos[i].hSyncStart, n); - swaps (&modeinfos[i].hSyncEnd, n); - swaps (&modeinfos[i].hTotal, n); - swaps (&modeinfos[i].hSkew, n); - swaps (&modeinfos[i].vSyncStart, n); - swaps (&modeinfos[i].vSyncEnd, n); - swaps (&modeinfos[i].vTotal, n); - swaps (&modeinfos[i].nameLength, n); - swapl (&modeinfos[i].modeFlags, n); + swapl(&modeinfos[i].id); + swaps(&modeinfos[i].width); + swaps(&modeinfos[i].height); + swapl(&modeinfos[i].dotClock); + swaps(&modeinfos[i].hSyncStart); + swaps(&modeinfos[i].hSyncEnd); + swaps(&modeinfos[i].hTotal); + swaps(&modeinfos[i].hSkew); + swaps(&modeinfos[i].vSyncStart); + swaps(&modeinfos[i].vSyncEnd); + swaps(&modeinfos[i].vTotal); + swaps(&modeinfos[i].nameLength); + swapl(&modeinfos[i].modeFlags); } memcpy (names, mode->name, mode->mode.nameLength); @@ -453,14 +451,14 @@ rrGetScreenResources(ClientPtr client, Bool query) } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swapl(&rep.configTimestamp, n); - swaps(&rep.nCrtcs, n); - swaps(&rep.nOutputs, n); - swaps(&rep.nModes, n); - swaps(&rep.nbytesNames, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swapl(&rep.configTimestamp); + swaps(&rep.nCrtcs); + swaps(&rep.nOutputs); + swaps(&rep.nModes); + swaps(&rep.nbytesNames); } WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep); if (extraLen) @@ -592,7 +590,7 @@ ProcRRGetScreenInfo (ClientPtr client) REQUEST(xRRGetScreenInfoReq); xRRGetScreenInfoReply rep; WindowPtr pWin; - int n, rc; + int rc; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; CARD8 *extra; @@ -688,10 +686,10 @@ ProcRRGetScreenInfo (ClientPtr client) size->heightInMillimeters = pSize->mmHeight; if (client->swapped) { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); + swaps(&size->widthInPixels); + swaps(&size->heightInPixels); + swaps(&size->widthInMillimeters); + swaps(&size->heightInMillimeters); } size++; if (has_rate) @@ -699,7 +697,7 @@ ProcRRGetScreenInfo (ClientPtr client) *rates = pSize->nRates; if (client->swapped) { - swaps (rates, n); + swaps(rates); } rates++; for (j = 0; j < pSize->nRates; j++) @@ -707,7 +705,7 @@ ProcRRGetScreenInfo (ClientPtr client) *rates = pSize->pRates[j].rate; if (client->swapped) { - swaps (rates, n); + swaps(rates); } rates++; } @@ -723,14 +721,14 @@ ProcRRGetScreenInfo (ClientPtr client) rep.length = bytes_to_int32(extraLen); } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swaps(&rep.rotation); + swaps(&rep.nSizes); + swaps(&rep.sizeID); + swaps(&rep.rate); + swaps(&rep.nrateEnts); } WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); if (extraLen) @@ -747,7 +745,7 @@ ProcRRSetScreenConfig (ClientPtr client) REQUEST(xRRSetScreenConfigReq); xRRSetScreenConfigReply rep; DrawablePtr pDraw; - int n, rc; + int rc; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; TimeStamp time; @@ -976,11 +974,11 @@ sendReply: if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.newTimestamp); + swapl(&rep.newConfigTimestamp); + swapl(&rep.root); } WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c index e16090a41..543fc9022 100644 --- a/randr/rrsdispatch.c +++ b/randr/rrsdispatch.c @@ -25,149 +25,138 @@ static int SProcRRQueryVersion (ClientPtr client) { - register int n; REQUEST(xRRQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetScreenInfo (ClientPtr client) { - register int n; REQUEST(xRRGetScreenInfoReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetScreenConfig (ClientPtr client) { - register int n; REQUEST(xRRSetScreenConfigReq); if (RRClientKnowsRates (client)) { REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); + swaps(&stuff->rate); } else { REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); } - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); + swaps(&stuff->length); + swapl(&stuff->drawable); + swapl(&stuff->timestamp); + swaps(&stuff->sizeID); + swaps(&stuff->rotation); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSelectInput (ClientPtr client) { - register int n; REQUEST(xRRSelectInputReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swaps(&stuff->enable, n); + swaps(&stuff->length); + swapl(&stuff->window); + swaps(&stuff->enable); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetScreenSizeRange (ClientPtr client) { - int n; REQUEST(xRRGetScreenSizeRangeReq); REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetScreenSize (ClientPtr client) { - int n; REQUEST(xRRSetScreenSizeReq); REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swapl(&stuff->widthInMillimeters, n); - swapl(&stuff->heightInMillimeters, n); + swaps(&stuff->length); + swapl(&stuff->window); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->widthInMillimeters); + swapl(&stuff->heightInMillimeters); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetScreenResources (ClientPtr client) { - int n; REQUEST(xRRGetScreenResourcesReq); REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetOutputInfo (ClientPtr client) { - int n; REQUEST(xRRGetOutputInfoReq); REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->configTimestamp, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->configTimestamp); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRListOutputProperties (ClientPtr client) { - int n; REQUEST(xRRListOutputPropertiesReq); REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); + swaps(&stuff->length); + swapl(&stuff->output); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRQueryOutputProperty (ClientPtr client) { - int n; REQUEST(xRRQueryOutputPropertyReq); REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->property, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->property); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRConfigureOutputProperty (ClientPtr client) { - int n; REQUEST(xRRConfigureOutputPropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->property, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->property); SwapRestL(stuff); return (*ProcRandrVector[stuff->randrReqType]) (client); } @@ -175,15 +164,14 @@ SProcRRConfigureOutputProperty (ClientPtr client) static int SProcRRChangeOutputProperty (ClientPtr client) { - int n; REQUEST(xRRChangeOutputPropertyReq); REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->nUnits, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->nUnits); switch(stuff->format) { case 8: break; @@ -203,125 +191,117 @@ SProcRRChangeOutputProperty (ClientPtr client) static int SProcRRDeleteOutputProperty (ClientPtr client) { - int n; REQUEST(xRRDeleteOutputPropertyReq); REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->property, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->property); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetOutputProperty (ClientPtr client) { - int n; REQUEST(xRRGetOutputPropertyReq); REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->property, n); - swapl(&stuff->type, n); - swapl(&stuff->longOffset, n); - swapl(&stuff->longLength, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->property); + swapl(&stuff->type); + swapl(&stuff->longOffset); + swapl(&stuff->longLength); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRCreateMode (ClientPtr client) { - int n; xRRModeInfo *modeinfo; REQUEST(xRRCreateModeReq); REQUEST_AT_LEAST_SIZE(xRRCreateModeReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); modeinfo = &stuff->modeInfo; - swapl(&modeinfo->id, n); - swaps(&modeinfo->width, n); - swaps(&modeinfo->height, n); - swapl(&modeinfo->dotClock, n); - swaps(&modeinfo->hSyncStart, n); - swaps(&modeinfo->hSyncEnd, n); - swaps(&modeinfo->hTotal, n); - swaps(&modeinfo->vSyncStart, n); - swaps(&modeinfo->vSyncEnd, n); - swaps(&modeinfo->vTotal, n); - swaps(&modeinfo->nameLength, n); - swapl(&modeinfo->modeFlags, n); + swapl(&modeinfo->id); + swaps(&modeinfo->width); + swaps(&modeinfo->height); + swapl(&modeinfo->dotClock); + swaps(&modeinfo->hSyncStart); + swaps(&modeinfo->hSyncEnd); + swaps(&modeinfo->hTotal); + swaps(&modeinfo->vSyncStart); + swaps(&modeinfo->vSyncEnd); + swaps(&modeinfo->vTotal); + swaps(&modeinfo->nameLength); + swapl(&modeinfo->modeFlags); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRDestroyMode (ClientPtr client) { - int n; REQUEST(xRRDestroyModeReq); REQUEST_SIZE_MATCH(xRRDestroyModeReq); - swaps(&stuff->length, n); - swapl(&stuff->mode, n); + swaps(&stuff->length); + swapl(&stuff->mode); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRAddOutputMode (ClientPtr client) { - int n; REQUEST(xRRAddOutputModeReq); REQUEST_SIZE_MATCH(xRRAddOutputModeReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->mode, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->mode); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRDeleteOutputMode (ClientPtr client) { - int n; REQUEST(xRRDeleteOutputModeReq); REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); - swaps(&stuff->length, n); - swapl(&stuff->output, n); - swapl(&stuff->mode, n); + swaps(&stuff->length); + swapl(&stuff->output); + swapl(&stuff->mode); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetCrtcInfo (ClientPtr client) { - int n; REQUEST(xRRGetCrtcInfoReq); REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); - swapl(&stuff->configTimestamp, n); + swaps(&stuff->length); + swapl(&stuff->crtc); + swapl(&stuff->configTimestamp); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetCrtcConfig (ClientPtr client) { - int n; REQUEST(xRRSetCrtcConfigReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); - swapl(&stuff->timestamp, n); - swapl(&stuff->configTimestamp, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); - swapl(&stuff->mode, n); - swaps(&stuff->rotation, n); + swaps(&stuff->length); + swapl(&stuff->crtc); + swapl(&stuff->timestamp); + swapl(&stuff->configTimestamp); + swaps(&stuff->x); + swaps(&stuff->y); + swapl(&stuff->mode); + swaps(&stuff->rotation); SwapRestL(stuff); return (*ProcRandrVector[stuff->randrReqType]) (client); } @@ -329,37 +309,34 @@ SProcRRSetCrtcConfig (ClientPtr client) static int SProcRRGetCrtcGammaSize (ClientPtr client) { - int n; REQUEST(xRRGetCrtcGammaSizeReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); + swaps(&stuff->length); + swapl(&stuff->crtc); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetCrtcGamma (ClientPtr client) { - int n; REQUEST(xRRGetCrtcGammaReq); REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); + swaps(&stuff->length); + swapl(&stuff->crtc); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetCrtcGamma (ClientPtr client) { - int n; REQUEST(xRRSetCrtcGammaReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); - swaps(&stuff->size, n); + swaps(&stuff->length); + swapl(&stuff->crtc); + swaps(&stuff->size); SwapRestS(stuff); return (*ProcRandrVector[stuff->randrReqType]) (client); } @@ -367,16 +344,16 @@ SProcRRSetCrtcGamma (ClientPtr client) static int SProcRRSetCrtcTransform (ClientPtr client) { - int n, nparams; + int nparams; char *filter; CARD32 *params; REQUEST(xRRSetCrtcTransformReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); + swaps(&stuff->length); + swapl(&stuff->crtc); SwapLongs((CARD32 *)&stuff->transform, bytes_to_int32(sizeof(xRenderTransform))); - swaps(&stuff->nbytesFilter, n); + swaps(&stuff->nbytesFilter); filter = (char *)(stuff + 1); params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter)); nparams = ((CARD32 *) stuff + client->req_len) - params; @@ -390,74 +367,69 @@ SProcRRSetCrtcTransform (ClientPtr client) static int SProcRRGetCrtcTransform (ClientPtr client) { - int n; REQUEST(xRRGetCrtcTransformReq); REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); + swaps(&stuff->length); + swapl(&stuff->crtc); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRGetPanning (ClientPtr client) { - int n; REQUEST(xRRGetPanningReq); REQUEST_SIZE_MATCH(xRRGetPanningReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); + swaps(&stuff->length); + swapl(&stuff->crtc); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetPanning (ClientPtr client) { - int n; REQUEST(xRRSetPanningReq); REQUEST_SIZE_MATCH(xRRSetPanningReq); - swaps(&stuff->length, n); - swapl(&stuff->crtc, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->left, n); - swaps(&stuff->top, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); - swaps(&stuff->track_left, n); - swaps(&stuff->track_top, n); - swaps(&stuff->track_width, n); - swaps(&stuff->track_height, n); - swaps(&stuff->border_left, n); - swaps(&stuff->border_top, n); - swaps(&stuff->border_right, n); - swaps(&stuff->border_bottom, n); + swaps(&stuff->length); + swapl(&stuff->crtc); + swapl(&stuff->timestamp); + swaps(&stuff->left); + swaps(&stuff->top); + swaps(&stuff->width); + swaps(&stuff->height); + swaps(&stuff->track_left); + swaps(&stuff->track_top); + swaps(&stuff->track_width); + swaps(&stuff->track_height); + swaps(&stuff->border_left); + swaps(&stuff->border_top); + swaps(&stuff->border_right); + swaps(&stuff->border_bottom); return (*ProcRandrVector[stuff->randrReqType]) (client); } static int SProcRRSetOutputPrimary (ClientPtr client) { - int n; REQUEST(xRRSetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->output, n); + swaps(&stuff->length); + swapl(&stuff->window); + swapl(&stuff->output); return ProcRandrVector[stuff->randrReqType](client); } static int SProcRRGetOutputPrimary (ClientPtr client) { - int n; REQUEST(xRRGetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return ProcRandrVector[stuff->randrReqType](client); } diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index c1bd5bb33..6d4519043 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -90,7 +90,6 @@ int ProcRRXineramaQueryVersion(ClientPtr client) { xPanoramiXQueryVersionReply rep; - register int n; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); rep.type = X_Reply; @@ -99,10 +98,10 @@ ProcRRXineramaQueryVersion(ClientPtr client) rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION; rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION; 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; @@ -114,7 +113,7 @@ ProcRRXineramaGetState(ClientPtr client) REQUEST(xPanoramiXGetStateReq); WindowPtr pWin; xPanoramiXGetStateReply rep; - register int n, rc; + register int rc; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; Bool active = FALSE; @@ -138,9 +137,9 @@ ProcRRXineramaGetState(ClientPtr client) rep.state = active; rep.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; @@ -180,7 +179,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) REQUEST(xPanoramiXGetScreenCountReq); WindowPtr pWin; xPanoramiXGetScreenCountReply rep; - register int n, rc; + register int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -193,9 +192,9 @@ ProcRRXineramaGetScreenCount(ClientPtr client) rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen); rep.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; @@ -208,7 +207,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) WindowPtr pWin, pRoot; ScreenPtr pScreen; xPanoramiXGetScreenSizeReply rep; - register int n, rc; + register int rc; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -226,12 +225,12 @@ ProcRRXineramaGetScreenSize(ClientPtr client) rep.window = stuff->window; rep.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; @@ -250,10 +249,9 @@ ProcRRXineramaIsActive(ClientPtr client) rep.sequenceNumber = client->sequence; rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]); if(client->swapped) { - register int n; - 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; @@ -287,11 +285,10 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc) scratch.height = height; } if(client->swapped) { - register int n; - swaps(&scratch.x_org, n); - swaps(&scratch.y_org, n); - swaps(&scratch.width, n); - swaps(&scratch.height, n); + swaps(&scratch.x_org); + swaps(&scratch.y_org); + swaps(&scratch.width); + swaps(&scratch.height); } WriteToClient(client, sz_XineramaScreenInfo, &scratch); } @@ -313,10 +310,9 @@ ProcRRXineramaQueryScreens(ClientPtr client) rep.number = RRXineramaScreenCount (pScreen); rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if(client->swapped) { - register int n; - 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); @@ -371,8 +367,7 @@ static int SProcRRXineramaQueryVersion (ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); - register int n; - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); return ProcRRXineramaQueryVersion(client); } @@ -381,10 +376,9 @@ static int SProcRRXineramaGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); - register int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcRRXineramaGetState(client); } @@ -392,10 +386,9 @@ static int SProcRRXineramaGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); - register int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return ProcRRXineramaGetScreenCount(client); } @@ -403,11 +396,10 @@ static int SProcRRXineramaGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); - register int n; - 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); } @@ -415,8 +407,7 @@ static int SProcRRXineramaIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); - register int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); return ProcRRXineramaIsActive(client); } @@ -425,8 +416,7 @@ static int SProcRRXineramaQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); - register int n; - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); return ProcRRXineramaQueryScreens(client); } diff --git a/record/record.c b/record/record.c index 69fca727e..68311ac8f 100644 --- a/record/record.c +++ b/record/record.c @@ -295,7 +295,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, CARD32 elemHeaderData[2]; int numElemHeaders = 0; Bool recordingClientSwapped = pContext->pRecordingClient->swapped; - int n; CARD32 serverTime = 0; Bool gotServerTime = FALSE; int replylen; @@ -339,11 +338,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, if (recordingClientSwapped) { - swaps(&pRep->sequenceNumber, n); - swapl(&pRep->length, n); - swapl(&pRep->idBase, n); - swapl(&pRep->serverTime, n); - swapl(&pRep->recordedSequenceNumber, n); + swaps(&pRep->sequenceNumber); + swapl(&pRep->length); + swapl(&pRep->idBase); + swapl(&pRep->serverTime); + swapl(&pRep->recordedSequenceNumber); } pContext->numBufBytes = SIZEOF(xRecordEnableContextReply); } @@ -361,7 +360,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, else elemHeaderData[numElemHeaders] = GetTimeInMillis(); if (recordingClientSwapped) - swapl(&elemHeaderData[numElemHeaders], n); + swapl(&elemHeaderData[numElemHeaders]); numElemHeaders++; } @@ -371,17 +370,17 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, { elemHeaderData[numElemHeaders] = pClient->sequence; if (recordingClientSwapped) - swapl(&elemHeaderData[numElemHeaders], n); + swapl(&elemHeaderData[numElemHeaders]); numElemHeaders++; } /* adjust reply length */ replylen = pRep->length; - if (recordingClientSwapped) swapl(&replylen, n); + if (recordingClientSwapped) swapl(&replylen); replylen += numElemHeaders + bytes_to_int32(datalen) + bytes_to_int32(futurelen); - if (recordingClientSwapped) swapl(&replylen, n); + if (recordingClientSwapped) swapl(&replylen); pRep->length = replylen; } /* end if not continued reply */ @@ -473,7 +472,6 @@ static void RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff) { CARD32 bigLength; - char n; int bytesLeft; /* note: client->req_len has been frobbed by ReadRequestFromClient @@ -490,7 +488,7 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff) /* reinsert the extended length field that was squished out */ bigLength = client->req_len + bytes_to_int32(sizeof(bigLength)); if (client->swapped) - swapl(&bigLength, n); + swapl(&bigLength); RecordAProtocolElement(pContext, client, XRecordFromClient, (pointer)&bigLength, sizeof(bigLength), /* continuation */ -1); bytesLeft -= sizeof(bigLength); @@ -1892,7 +1890,6 @@ ProcRecordQueryVersion(ClientPtr client) { /* REQUEST(xRecordQueryVersionReq); */ xRecordQueryVersionReply rep; - int n; REQUEST_SIZE_MATCH(xRecordQueryVersionReq); rep.type = X_Reply; @@ -1902,9 +1899,9 @@ ProcRecordQueryVersion(ClientPtr client) rep.minorVersion = SERVER_RECORD_MINOR_VERSION; if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.majorVersion, n); - swaps(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swaps(&rep.majorVersion); + swaps(&rep.minorVersion); } (void)WriteToClient(client, sizeof(xRecordQueryVersionReply), (char *)&rep); @@ -2207,13 +2204,12 @@ static void RecordSwapRanges(xRecordRange *pRanges, int nRanges) { int i; - register char n; for (i = 0; i < nRanges; i++, pRanges++) { - swaps(&pRanges->extRequestsMinorFirst, n); - swaps(&pRanges->extRequestsMinorLast, n); - swaps(&pRanges->extRepliesMinorFirst, n); - swaps(&pRanges->extRepliesMinorLast, n); + swaps(&pRanges->extRequestsMinorFirst); + swaps(&pRanges->extRequestsMinorLast); + swaps(&pRanges->extRepliesMinorFirst); + swaps(&pRanges->extRepliesMinorLast); } } /* RecordSwapRanges */ @@ -2224,7 +2220,6 @@ ProcRecordGetContext(ClientPtr client) RecordContextPtr pContext; REQUEST(xRecordGetContextReq); xRecordGetContextReply rep; - int n; RecordClientsAndProtocolPtr pRCAP; int nRCAPs = 0; GetContextRangeInfoPtr pRangeInfo; @@ -2323,9 +2318,9 @@ ProcRecordGetContext(ClientPtr client) rep.elementHeader = pContext->elemHeaders; if(client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.nClients, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.nClients); } (void)WriteToClient(client, sizeof(xRecordGetContextReply), (char *)&rep); @@ -2340,13 +2335,13 @@ ProcRecordGetContext(ClientPtr client) rci.nRanges = pri->nRanges; if (client->swapped) { - swapl(&rci.nRanges, n); + swapl(&rci.nRanges); RecordSwapRanges(pri->pRanges, pri->nRanges); } for (i = 0; i < pRCAP->numClients; i++) { rci.clientResource = pRCAP->pClientIDs[i]; - if (client->swapped) swapl(&rci.clientResource, n); + if (client->swapped) swapl(&rci.clientResource); WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci); WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, (char *)pri->pRanges); @@ -2590,12 +2585,11 @@ static int SProcRecordQueryVersion(ClientPtr client) { REQUEST(xRecordQueryVersionReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordQueryVersionReq); - swaps(&stuff->majorVersion, n); - swaps(&stuff->minorVersion,n); + swaps(&stuff->majorVersion); + swaps(&stuff->minorVersion); return ProcRecordQueryVersion(client); } /* SProcRecordQueryVersion */ @@ -2603,19 +2597,18 @@ SProcRecordQueryVersion(ClientPtr client) static int SwapCreateRegister(xRecordRegisterClientsReq *stuff) { - register char n; int i; XID *pClientID; - swapl(&stuff->context, n); - swapl(&stuff->nClients, n); - swapl(&stuff->nRanges, n); + swapl(&stuff->context); + swapl(&stuff->nClients); + swapl(&stuff->nRanges); pClientID = (XID *)&stuff[1]; if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)) return BadLength; for (i = 0; i < stuff->nClients; i++, pClientID++) { - swapl(pClientID, n); + swapl(pClientID); } if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq) - stuff->nClients) @@ -2630,9 +2623,8 @@ SProcRecordCreateContext(ClientPtr client) { REQUEST(xRecordCreateContextReq); int status; - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq); if ((status = SwapCreateRegister((pointer)stuff)) != Success) return status; @@ -2645,9 +2637,8 @@ SProcRecordRegisterClients(ClientPtr client) { REQUEST(xRecordRegisterClientsReq); int status; - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq); if ((status = SwapCreateRegister((pointer)stuff)) != Success) return status; @@ -2659,12 +2650,11 @@ static int SProcRecordUnregisterClients(ClientPtr client) { REQUEST(xRecordUnregisterClientsReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq); - swapl(&stuff->context, n); - swapl(&stuff->nClients, n); + swapl(&stuff->context); + swapl(&stuff->nClients); SwapRestL(stuff); return ProcRecordUnregisterClients(client); } /* SProcRecordUnregisterClients */ @@ -2674,11 +2664,10 @@ static int SProcRecordGetContext(ClientPtr client) { REQUEST(xRecordGetContextReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordGetContextReq); - swapl(&stuff->context, n); + swapl(&stuff->context); return ProcRecordGetContext(client); } /* SProcRecordGetContext */ @@ -2686,11 +2675,10 @@ static int SProcRecordEnableContext(ClientPtr client) { REQUEST(xRecordEnableContextReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordEnableContextReq); - swapl(&stuff->context, n); + swapl(&stuff->context); return ProcRecordEnableContext(client); } /* SProcRecordEnableContext */ @@ -2699,11 +2687,10 @@ static int SProcRecordDisableContext(ClientPtr client) { REQUEST(xRecordDisableContextReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordDisableContextReq); - swapl(&stuff->context, n); + swapl(&stuff->context); return ProcRecordDisableContext(client); } /* SProcRecordDisableContext */ @@ -2712,11 +2699,10 @@ static int SProcRecordFreeContext(ClientPtr client) { REQUEST(xRecordFreeContextReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xRecordFreeContextReq); - swapl(&stuff->context, n); + swapl(&stuff->context); return ProcRecordFreeContext(client); } /* SProcRecordFreeContext */ diff --git a/render/render.c b/render/render.c index ebb1d630a..facc32a29 100644 --- a/render/render.c +++ b/render/render.c @@ -276,7 +276,6 @@ ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); xRenderQueryVersionReply rep; - register int n; REQUEST(xRenderQueryVersionReq); pRenderClient->major_version = stuff->majorVersion; @@ -300,10 +299,10 @@ ProcRenderQueryVersion (ClientPtr client) } if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep); return Success; @@ -345,7 +344,6 @@ ProcRenderQueryPictFormats (ClientPtr client) int nvisual; int rlength; int s; - int n; int numScreens; int numSubpixel; /* REQUEST(xRenderQueryPictFormatsReq); */ @@ -432,16 +430,16 @@ ProcRenderQueryPictFormats (ClientPtr client) pictForm->colormap = None; if (client->swapped) { - swapl (&pictForm->id, n); - swaps (&pictForm->direct.red, n); - swaps (&pictForm->direct.redMask, n); - swaps (&pictForm->direct.green, n); - swaps (&pictForm->direct.greenMask, n); - swaps (&pictForm->direct.blue, n); - swaps (&pictForm->direct.blueMask, n); - swaps (&pictForm->direct.alpha, n); - swaps (&pictForm->direct.alphaMask, n); - swapl (&pictForm->colormap, n); + swapl(&pictForm->id); + swaps(&pictForm->direct.red); + swaps(&pictForm->direct.redMask); + swaps(&pictForm->direct.green); + swaps(&pictForm->direct.greenMask); + swaps(&pictForm->direct.blue); + swaps(&pictForm->direct.blueMask); + swaps(&pictForm->direct.alpha); + swaps(&pictForm->direct.alphaMask); + swapl(&pictForm->colormap); } pictForm++; } @@ -471,8 +469,8 @@ ProcRenderQueryPictFormats (ClientPtr client) pictVisual->format = pFormat->id; if (client->swapped) { - swapl (&pictVisual->visual, n); - swapl (&pictVisual->format, n); + swapl(&pictVisual->visual); + swapl(&pictVisual->format); } pictVisual++; nvisual++; @@ -482,7 +480,7 @@ ProcRenderQueryPictFormats (ClientPtr client) pictDepth->nPictVisuals = nvisual; if (client->swapped) { - swaps (&pictDepth->nPictVisuals, n); + swaps(&pictDepth->nPictVisuals); } ndepth++; pictDepth = (xPictDepth *) pictVisual; @@ -495,8 +493,8 @@ ProcRenderQueryPictFormats (ClientPtr client) pictScreen->fallback = 0; if (client->swapped) { - swapl (&pictScreen->nDepth, n); - swapl (&pictScreen->fallback, n); + swapl(&pictScreen->nDepth); + swapl(&pictScreen->fallback); } pictScreen = (xPictScreen *) pictDepth; } @@ -512,20 +510,20 @@ ProcRenderQueryPictFormats (ClientPtr client) *pictSubpixel = SubPixelUnknown; if (client->swapped) { - swapl (pictSubpixel, n); + swapl(pictSubpixel); } ++pictSubpixel; } if (client->swapped) { - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numFormats, n); - swapl (&reply->numScreens, n); - swapl (&reply->numDepths, n); - swapl (&reply->numVisuals, n); - swapl (&reply->numSubpixel, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swapl(&reply->numFormats); + swapl(&reply->numScreens); + swapl(&reply->numDepths); + swapl(&reply->numVisuals); + swapl(&reply->numSubpixel); } WriteToClient(client, rlength, (char *) reply); free(reply); @@ -538,7 +536,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) PictFormatPtr pFormat; int rc, num; int rlength; - int i, n; + int i; REQUEST(xRenderQueryPictIndexValuesReq); xRenderQueryPictIndexValuesReply *reply; xIndexValue *values; @@ -575,15 +573,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client) { for (i = 0; i < num; i++) { - swapl (&values[i].pixel, n); - swaps (&values[i].red, n); - swaps (&values[i].green, n); - swaps (&values[i].blue, n); - swaps (&values[i].alpha, n); + swapl(&values[i].pixel); + swaps(&values[i].red); + swaps(&values[i].green); + swaps(&values[i].blue); + swaps(&values[i].alpha); } - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swapl (&reply->numIndexValues, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swapl(&reply->numIndexValues); } WriteToClient(client, rlength, (char *) reply); @@ -1822,16 +1820,14 @@ ProcRenderQueryFilters (ClientPtr client) if (client->swapped) { - register int n; - for (i = 0; i < reply->numAliases; i++) { - swaps (&aliases[i], n); + swaps(&aliases[i]); } - swaps(&reply->sequenceNumber, n); - swapl(&reply->length, n); - swapl(&reply->numAliases, n); - swapl(&reply->numFilters, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swapl(&reply->numAliases); + swapl(&reply->numFilters); } WriteToClient(client, total_bytes, (char *) reply); free(reply); @@ -2068,31 +2064,28 @@ ProcRenderDispatch (ClientPtr client) static int SProcRenderQueryVersion (ClientPtr client) { - register int n; REQUEST(xRenderQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcRenderVector[stuff->renderReqType])(client); } static int SProcRenderQueryPictFormats (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictFormatsReq); - swaps(&stuff->length, n); + swaps(&stuff->length); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryPictIndexValues (ClientPtr client) { - register int n; REQUEST(xRenderQueryPictIndexValuesReq); - swaps(&stuff->length, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2105,13 +2098,12 @@ SProcRenderQueryDithers (ClientPtr client) static int SProcRenderCreatePicture (ClientPtr client) { - register int n; REQUEST(xRenderCreatePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->drawable, n); - swapl(&stuff->format, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->drawable); + swapl(&stuff->format); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2119,11 +2111,10 @@ SProcRenderCreatePicture (ClientPtr client) static int SProcRenderChangePicture (ClientPtr client) { - register int n; REQUEST(xRenderChangePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->mask, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->mask); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2131,12 +2122,11 @@ SProcRenderChangePicture (ClientPtr client) static int SProcRenderSetPictureClipRectangles (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureClipRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOrigin, n); - swaps(&stuff->yOrigin, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2144,65 +2134,61 @@ SProcRenderSetPictureClipRectangles (ClientPtr client) static int SProcRenderFreePicture (ClientPtr client) { - register int n; REQUEST(xRenderFreePictureReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + swapl(&stuff->picture); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderComposite (ClientPtr client) { - register int n; REQUEST(xRenderCompositeReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->mask, n); - swapl(&stuff->dst, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xMask, n); - swaps(&stuff->yMask, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->mask); + swapl(&stuff->dst); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xMask); + swaps(&stuff->yMask); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderScale (ClientPtr client) { - register int n; REQUEST(xRenderScaleReq); - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->colorScale, n); - swapl(&stuff->alphaScale, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); - swaps(&stuff->xDst, n); - swaps(&stuff->yDst, n); - swaps(&stuff->width, n); - swaps(&stuff->height, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->colorScale); + swapl(&stuff->alphaScale); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); + swaps(&stuff->xDst); + swaps(&stuff->yDst); + swaps(&stuff->width); + swaps(&stuff->height); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderTrapezoids (ClientPtr client) { - register int n; REQUEST(xRenderTrapezoidsReq); REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2210,16 +2196,15 @@ SProcRenderTrapezoids (ClientPtr client) static int SProcRenderTriangles (ClientPtr client) { - register int n; REQUEST(xRenderTrianglesReq); REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2227,16 +2212,15 @@ SProcRenderTriangles (ClientPtr client) static int SProcRenderTriStrip (ClientPtr client) { - register int n; REQUEST(xRenderTriStripReq); REQUEST_AT_LEAST_SIZE(xRenderTriStripReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2244,16 +2228,15 @@ SProcRenderTriStrip (ClientPtr client) static int SProcRenderTriFan (ClientPtr client) { - register int n; REQUEST(xRenderTriFanReq); REQUEST_AT_LEAST_SIZE(xRenderTriFanReq); - swaps (&stuff->length, n); - swapl (&stuff->src, n); - swapl (&stuff->dst, n); - swapl (&stuff->maskFormat, n); - swaps (&stuff->xSrc, n); - swaps (&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2279,47 +2262,43 @@ SProcRenderTransform (ClientPtr client) static int SProcRenderCreateGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderCreateGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->format, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->format); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderReferenceGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderReferenceGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->gsid, n); - swapl(&stuff->existing, n); + swaps(&stuff->length); + swapl(&stuff->gsid); + swapl(&stuff->existing); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderFreeGlyphSet (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphSetReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderAddGlyphs (ClientPtr client) { - register int n; register int i; CARD32 *gids; void *end; xGlyphInfo *gi; REQUEST(xRenderAddGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); - swapl(&stuff->nglyphs, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); + swapl(&stuff->nglyphs); if (stuff->nglyphs & 0xe0000000) return BadLength; end = (CARD8 *) stuff + (client->req_len << 2); @@ -2331,13 +2310,13 @@ SProcRenderAddGlyphs (ClientPtr client) return BadLength; for (i = 0; i < stuff->nglyphs; i++) { - swapl (&gids[i], n); - swaps (&gi[i].width, n); - swaps (&gi[i].height, n); - swaps (&gi[i].x, n); - swaps (&gi[i].y, n); - swaps (&gi[i].xOff, n); - swaps (&gi[i].yOff, n); + swapl(&gids[i]); + swaps(&gi[i].width); + swaps(&gi[i].height); + swaps(&gi[i].x); + swaps(&gi[i].y); + swaps(&gi[i].xOff); + swaps(&gi[i].yOff); } return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2351,10 +2330,9 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client) static int SProcRenderFreeGlyphs (ClientPtr client) { - register int n; REQUEST(xRenderFreeGlyphsReq); - swaps(&stuff->length, n); - swapl(&stuff->glyphset, n); + swaps(&stuff->length); + swapl(&stuff->glyphset); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2362,7 +2340,6 @@ SProcRenderFreeGlyphs (ClientPtr client) static int SProcRenderCompositeGlyphs (ClientPtr client) { - register int n; xGlyphElt *elt; CARD8 *buffer; CARD8 *end; @@ -2378,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) case X_RenderCompositeGlyphs32: size = 4; break; } - swaps(&stuff->length, n); - swapl(&stuff->src, n); - swapl(&stuff->dst, n); - swapl(&stuff->maskFormat, n); - swapl(&stuff->glyphset, n); - swaps(&stuff->xSrc, n); - swaps(&stuff->ySrc, n); + swaps(&stuff->length); + swapl(&stuff->src); + swapl(&stuff->dst); + swapl(&stuff->maskFormat); + swapl(&stuff->glyphset); + swaps(&stuff->xSrc); + swaps(&stuff->ySrc); buffer = (CARD8 *) (stuff + 1); end = (CARD8 *) stuff + (client->req_len << 2); while (buffer + sizeof (xGlyphElt) < end) @@ -2392,13 +2369,13 @@ SProcRenderCompositeGlyphs (ClientPtr client) elt = (xGlyphElt *) buffer; buffer += sizeof (xGlyphElt); - swaps (&elt->deltax, n); - swaps (&elt->deltay, n); + swaps(&elt->deltax); + swaps(&elt->deltay); i = elt->len; if (i == 0xff) { - swapl (buffer, n); + swapl(buffer); buffer += 4; } else @@ -2411,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client) case 2: while (i--) { - swaps (buffer, n); + swaps(buffer); buffer += 2; } break; case 4: while (i--) { - swapl (buffer, n); + swapl(buffer); buffer += 4; } break; @@ -2433,16 +2410,15 @@ SProcRenderCompositeGlyphs (ClientPtr client) static int SProcRenderFillRectangles (ClientPtr client) { - register int n; REQUEST(xRenderFillRectanglesReq); REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - swaps(&stuff->length, n); - swapl(&stuff->dst, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); - swaps(&stuff->color.alpha, n); + swaps(&stuff->length); + swapl(&stuff->dst); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); + swaps(&stuff->color.alpha); SwapRestS(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2450,73 +2426,68 @@ SProcRenderFillRectangles (ClientPtr client) static int SProcRenderCreateCursor (ClientPtr client) { - register int n; REQUEST(xRenderCreateCursorReq); REQUEST_SIZE_MATCH (xRenderCreateCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); - swapl(&stuff->src, n); - swaps(&stuff->x, n); - swaps(&stuff->y, n); + swaps(&stuff->length); + swapl(&stuff->cid); + swapl(&stuff->src); + swaps(&stuff->x); + swaps(&stuff->y); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureTransform (ClientPtr client) { - register int n; REQUEST(xRenderSetPictureTransformReq); REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swapl(&stuff->transform.matrix11, n); - swapl(&stuff->transform.matrix12, n); - swapl(&stuff->transform.matrix13, n); - swapl(&stuff->transform.matrix21, n); - swapl(&stuff->transform.matrix22, n); - swapl(&stuff->transform.matrix23, n); - swapl(&stuff->transform.matrix31, n); - swapl(&stuff->transform.matrix32, n); - swapl(&stuff->transform.matrix33, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swapl(&stuff->transform.matrix11); + swapl(&stuff->transform.matrix12); + swapl(&stuff->transform.matrix13); + swapl(&stuff->transform.matrix21); + swapl(&stuff->transform.matrix22); + swapl(&stuff->transform.matrix23); + swapl(&stuff->transform.matrix31); + swapl(&stuff->transform.matrix32); + swapl(&stuff->transform.matrix33); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderQueryFilters (ClientPtr client) { - register int n; REQUEST (xRenderQueryFiltersReq); REQUEST_SIZE_MATCH (xRenderQueryFiltersReq); - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); + swaps(&stuff->length); + swapl(&stuff->drawable); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderSetPictureFilter (ClientPtr client) { - register int n; REQUEST (xRenderSetPictureFilterReq); REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->nbytes, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->nbytes); return (*ProcRenderVector[stuff->renderReqType]) (client); } static int SProcRenderCreateAnimCursor (ClientPtr client) { - register int n; REQUEST (xRenderCreateAnimCursorReq); REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq); - swaps(&stuff->length, n); - swapl(&stuff->cid, n); + swaps(&stuff->length); + swapl(&stuff->cid); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2524,14 +2495,13 @@ SProcRenderCreateAnimCursor (ClientPtr client) static int SProcRenderAddTraps (ClientPtr client) { - register int n; REQUEST (xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - swaps(&stuff->length, n); - swapl(&stuff->picture, n); - swaps(&stuff->xOff, n); - swaps(&stuff->yOff, n); + swaps(&stuff->length); + swapl(&stuff->picture); + swaps(&stuff->xOff); + swaps(&stuff->yOff); SwapRestL(stuff); return (*ProcRenderVector[stuff->renderReqType]) (client); } @@ -2539,32 +2509,31 @@ SProcRenderAddTraps (ClientPtr client) static int SProcRenderCreateSolidFill(ClientPtr client) { - register int n; REQUEST (xRenderCreateSolidFillReq); REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swaps(&stuff->color.alpha, n); - swaps(&stuff->color.red, n); - swaps(&stuff->color.green, n); - swaps(&stuff->color.blue, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swaps(&stuff->color.alpha); + swaps(&stuff->color.red); + swaps(&stuff->color.green); + swaps(&stuff->color.blue); return (*ProcRenderVector[stuff->renderReqType]) (client); } static void swapStops(void *stuff, int num) { - int i, n; + int i; CARD32 *stops; CARD16 *colors; stops = (CARD32 *)(stuff); for (i = 0; i < num; ++i) { - swapl(stops, n); + swapl(stops); ++stops; } colors = (CARD16 *)(stops); for (i = 0; i < 4*num; ++i) { - swaps(colors, n); + swaps(colors); ++colors; } } @@ -2572,18 +2541,17 @@ static void swapStops(void *stuff, int num) static int SProcRenderCreateLinearGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateLinearGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->p1.x, n); - swapl(&stuff->p1.y, n); - swapl(&stuff->p2.x, n); - swapl(&stuff->p2.y, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->p1.x); + swapl(&stuff->p1.y); + swapl(&stuff->p2.x); + swapl(&stuff->p2.y); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2599,20 +2567,19 @@ SProcRenderCreateLinearGradient (ClientPtr client) static int SProcRenderCreateRadialGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateRadialGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->inner.x, n); - swapl(&stuff->inner.y, n); - swapl(&stuff->outer.x, n); - swapl(&stuff->outer.y, n); - swapl(&stuff->inner_radius, n); - swapl(&stuff->outer_radius, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->inner.x); + swapl(&stuff->inner.y); + swapl(&stuff->outer.x); + swapl(&stuff->outer.y); + swapl(&stuff->inner_radius); + swapl(&stuff->outer_radius); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) @@ -2628,17 +2595,16 @@ SProcRenderCreateRadialGradient (ClientPtr client) static int SProcRenderCreateConicalGradient (ClientPtr client) { - register int n; int len; REQUEST (xRenderCreateConicalGradientReq); REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq); - swaps(&stuff->length, n); - swapl(&stuff->pid, n); - swapl(&stuff->center.x, n); - swapl(&stuff->center.y, n); - swapl(&stuff->angle, n); - swapl(&stuff->nStops, n); + swaps(&stuff->length); + swapl(&stuff->pid); + swapl(&stuff->center.x); + swapl(&stuff->center.y); + swapl(&stuff->angle); + swapl(&stuff->nStops); len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq); if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor))) diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c index 6e61d74b4..6ec94be6c 100644 --- a/test/xi2/protocol-eventconvert.c +++ b/test/xi2/protocol-eventconvert.c @@ -44,15 +44,13 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, if (swap) { - char n; - - swaps(&out->sequenceNumber, n); - swapl(&out->length, n); - swaps(&out->evtype, n); - swaps(&out->deviceid, n); - swapl(&out->time, n); - swapl(&out->detail, n); - swaps(&out->valuators_len, n); + swaps(&out->sequenceNumber); + swapl(&out->length); + swaps(&out->evtype); + swaps(&out->deviceid); + swapl(&out->time); + swapl(&out->detail); + swaps(&out->valuators_len); } @@ -101,9 +99,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, vo.frac = value->frac; if (swap) { - char n; - swapl(&vo.integral, n); - swapl(&vo.frac, n); + swapl(&vo.integral); + swapl(&vo.frac); } assert(vi.integral == vo.integral); @@ -118,9 +115,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out, vo.frac = raw_value->frac; if (swap) { - char n; - swapl(&vo.integral, n); - swapl(&vo.frac, n); + swapl(&vo.integral); + swapl(&vo.frac); } assert(vi.integral == vo.integral); @@ -276,29 +272,27 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, FP3232 *values; if (swap) { - char n; - - swaps(&out->sequenceNumber, n); - swapl(&out->length, n); - swaps(&out->evtype, n); - swaps(&out->deviceid, n); - swaps(&out->sourceid, n); - swapl(&out->time, n); - swapl(&out->detail, n); - swapl(&out->root, n); - swapl(&out->event, n); - swapl(&out->child, n); - swapl(&out->root_x, n); - swapl(&out->root_y, n); - swapl(&out->event_x, n); - swapl(&out->event_y, n); - swaps(&out->buttons_len, n); - swaps(&out->valuators_len, n); - swapl(&out->mods.base_mods, n); - swapl(&out->mods.latched_mods, n); - swapl(&out->mods.locked_mods, n); - swapl(&out->mods.effective_mods, n); - swapl(&out->flags, n); + swaps(&out->sequenceNumber); + swapl(&out->length); + swaps(&out->evtype); + swaps(&out->deviceid); + swaps(&out->sourceid); + swapl(&out->time); + swapl(&out->detail); + swapl(&out->root); + swapl(&out->event); + swapl(&out->child); + swapl(&out->root_x); + swapl(&out->root_y); + swapl(&out->event_x); + swapl(&out->event_y); + swaps(&out->buttons_len); + swaps(&out->valuators_len); + swapl(&out->mods.base_mods); + swapl(&out->mods.latched_mods); + swapl(&out->mods.locked_mods); + swapl(&out->mods.effective_mods); + swapl(&out->flags); } assert(out->extension == 0); /* IReqCode defaults to 0 */ @@ -388,9 +382,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out, if (swap) { - char n; - swapl(&vo.integral, n); - swapl(&vo.frac, n); + swapl(&vo.integral); + swapl(&vo.frac); } @@ -647,15 +640,13 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, if (swap) { - char n; - - swaps(&out->sequenceNumber, n); - swapl(&out->length, n); - swaps(&out->evtype, n); - swaps(&out->deviceid, n); - swaps(&out->sourceid, n); - swapl(&out->time, n); - swaps(&out->num_classes, n); + swaps(&out->sequenceNumber); + swapl(&out->length); + swaps(&out->evtype); + swaps(&out->deviceid); + swaps(&out->sourceid); + swapl(&out->time); + swaps(&out->num_classes); } assert(out->type == GenericEvent); @@ -672,10 +663,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, if (swap) { - char n; - swaps(&any->length, n); - swaps(&any->type, n); - swaps(&any->sourceid, n); + swaps(&any->length); + swaps(&any->type); + swaps(&any->sourceid); } switch(any->type) @@ -687,8 +677,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, if (swap) { - char n; - swaps(&b->num_buttons, n); + swaps(&b->num_buttons); } assert(b->length == @@ -703,8 +692,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, { if (swap) { - char n; - swapl(&names[j], n); + swapl(&names[j]); } assert(names[j] == in->buttons.names[j]); } @@ -717,8 +705,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, if (swap) { - char n; - swaps(&k->num_keycodes, n); + swaps(&k->num_keycodes); } assert(k->length == @@ -732,8 +719,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, { if (swap) { - char n; - swapl(&kc[j], n); + swapl(&kc[j]); } assert(kc[j] >= in->keys.min_keycode); assert(kc[j] <= in->keys.max_keycode); diff --git a/test/xi2/protocol-xigetclientpointer.c b/test/xi2/protocol-xigetclientpointer.c index 5e45e7b32..aec58908d 100644 --- a/test/xi2/protocol-xigetclientpointer.c +++ b/test/xi2/protocol-xigetclientpointer.c @@ -70,10 +70,9 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void if (client->swapped) { - char n; - swapl(&rep->length, n); - swaps(&rep->sequenceNumber, n); - swaps(&rep->deviceid, n); + swapl(&rep->length); + swaps(&rep->sequenceNumber); + swaps(&rep->deviceid); } reply_check_defaults(rep, len, XIGetClientPointer); @@ -85,7 +84,6 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error) { - char n; int rc; test_data.win = req->win; @@ -97,8 +95,8 @@ static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* assert(client_request.errorValue == req->win); client_request.swapped = TRUE; - swapl(&req->win, n); - swaps(&req->length, n); + swapl(&req->win); + swaps(&req->length); rc = SProcXIGetClientPointer(&client_request); assert(rc == error); diff --git a/test/xi2/protocol-xigetselectedevents.c b/test/xi2/protocol-xigetselectedevents.c index 55de77356..a78fb2655 100644 --- a/test/xi2/protocol-xigetselectedevents.c +++ b/test/xi2/protocol-xigetselectedevents.c @@ -91,10 +91,9 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, voi if (client->swapped) { - char n; - swapl(&rep->length, n); - swaps(&rep->sequenceNumber, n); - swaps(&rep->num_masks, n); + swapl(&rep->length); + swaps(&rep->sequenceNumber); + swaps(&rep->num_masks); } reply_check_defaults(rep, len, XIGetSelectedEvents); @@ -115,9 +114,8 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data { if (client->swapped) { - char n; - swaps(&mask->deviceid, n); - swaps(&mask->mask_len, n); + swaps(&mask->deviceid); + swaps(&mask->mask_len); } assert(mask->deviceid < 6); @@ -136,7 +134,6 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error) { - char n; int rc; ClientRec client; client = init_client(req->length, req); @@ -148,8 +145,8 @@ static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error) reply_handler = reply_XIGetSelectedEvents; client.swapped = TRUE; - swapl(&req->win, n); - swaps(&req->length, n); + swapl(&req->win); + swaps(&req->length); rc = SProcXIGetSelectedEvents(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xipassivegrabdevice.c b/test/xi2/protocol-xipassivegrabdevice.c index a61c1549c..1ffcdee97 100644 --- a/test/xi2/protocol-xipassivegrabdevice.c +++ b/test/xi2/protocol-xipassivegrabdevice.c @@ -85,10 +85,9 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi if (client->swapped) { - char n; - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - swaps(&rep->num_modifiers, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->num_modifiers); testdata.num_modifiers = rep->num_modifiers; } @@ -104,14 +103,13 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata) { int i; - int n; xXIGrabModifierInfo *mods = (xXIGrabModifierInfo*)data; for (i = 0; i < testdata.num_modifiers; i++, mods++) { if (client->swapped) - swapl(&mods->modifiers, n); + swapl(&mods->modifiers); /* 1 - 7 is the range we use for the global modifiers array * above */ @@ -128,7 +126,6 @@ static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq* req, int error, int errval) { - char n; int rc; int modifiers; @@ -139,20 +136,20 @@ static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceRe assert(client_request.errorValue == errval); client_request.swapped = TRUE; - swaps(&req->length, n); - swapl(&req->time, n); - swapl(&req->grab_window, n); - swapl(&req->cursor, n); - swapl(&req->detail, n); - swaps(&req->deviceid, n); + swaps(&req->length); + swapl(&req->time); + swapl(&req->grab_window); + swapl(&req->cursor); + swapl(&req->detail); + swaps(&req->deviceid); modifiers = req->num_modifiers; - swaps(&req->num_modifiers, n); - swaps(&req->mask_len, n); + swaps(&req->num_modifiers); + swaps(&req->mask_len); while(modifiers--) { CARD32 *mod = ((CARD32*)(req + 1)) + modifiers; - swapl(mod, n); + swapl(mod); } rc = SProcXIPassiveGrabDevice(&client_request); diff --git a/test/xi2/protocol-xiquerydevice.c b/test/xi2/protocol-xiquerydevice.c index cb1cc8130..47eb5b14c 100644 --- a/test/xi2/protocol-xiquerydevice.c +++ b/test/xi2/protocol-xiquerydevice.c @@ -64,10 +64,9 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use if (client->swapped) { - char n; - swapl(&rep->length, n); - swaps(&rep->sequenceNumber, n); - swaps(&rep->num_devices, n); + swapl(&rep->length); + swaps(&rep->sequenceNumber); + swaps(&rep->num_devices); } reply_check_defaults(rep, len, XIQueryDevice); @@ -86,7 +85,6 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use /* reply handling for the trailing bytes that constitute the device info */ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata) { - char n; int i, j; struct test_data *querydata = (struct test_data*)userdata; @@ -98,11 +96,11 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void { if (client->swapped) { - swaps(&info->deviceid, n); - swaps(&info->attachment, n); - swaps(&info->use, n); - swaps(&info->num_classes, n); - swaps(&info->name_len, n); + swaps(&info->deviceid); + swaps(&info->attachment); + swaps(&info->use); + swaps(&info->num_classes); + swaps(&info->name_len); } if (querydata->which_device > XIAllMasterDevices) @@ -152,9 +150,9 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void { if (client->swapped) { - swaps(&any->type, n); - swaps(&any->length, n); - swaps(&any->sourceid, n); + swaps(&any->type); + swaps(&any->length); + swaps(&any->sourceid); } switch(info->deviceid) @@ -168,7 +166,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void uint32_t *kc; if (client->swapped) - swaps(&ki->num_keycodes, n); + swaps(&ki->num_keycodes); assert(any->type == XIKeyClass); assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1)); @@ -178,7 +176,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void for (k = 0; k < ki->num_keycodes; k++, kc++) { if (client->swapped) - swapl(kc, n); + swapl(kc); assert(*kc >= xkb->min_key_code); assert(*kc <= xkb->max_key_code); @@ -197,7 +195,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void xXIButtonInfo *bi = (xXIButtonInfo*)any; if (client->swapped) - swaps(&bi->num_buttons, n); + swaps(&bi->num_buttons); assert(bi->num_buttons == devices.vcp->button->numButtons); @@ -209,13 +207,13 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void if (client->swapped) { - swaps(&vi->number, n); - swapl(&vi->label, n); - swapl(&vi->min.integral, n); - swapl(&vi->min.frac, n); - swapl(&vi->max.integral, n); - swapl(&vi->max.frac, n); - swapl(&vi->resolution, n); + swaps(&vi->number); + swapl(&vi->label); + swapl(&vi->min.integral); + swapl(&vi->min.frac); + swapl(&vi->max.integral); + swapl(&vi->max.frac); + swapl(&vi->resolution); } assert(vi->length == 11); @@ -244,7 +242,6 @@ static void request_XIQueryDevice(struct test_data *querydata, int deviceid, int error) { int rc; - char n; ClientRec client; xXIQueryDeviceReq request; @@ -264,8 +261,8 @@ static void request_XIQueryDevice(struct test_data *querydata, reply_handler = reply_XIQueryDevice; client.swapped = TRUE; - swaps(&request.length, n); - swaps(&request.deviceid, n); + swaps(&request.length); + swaps(&request.deviceid); rc = SProcXIQueryDevice(&client); assert(rc == error); diff --git a/test/xi2/protocol-xiquerypointer.c b/test/xi2/protocol-xiquerypointer.c index 0985ec70d..65346ab5d 100644 --- a/test/xi2/protocol-xiquerypointer.c +++ b/test/xi2/protocol-xiquerypointer.c @@ -81,16 +81,15 @@ static void reply_XIQueryPointer(ClientPtr client, int len, char *data, if (client->swapped) { - char n; - swapl(&rep->length, n); - swaps(&rep->sequenceNumber, n); - swapl(&rep->root, n); - swapl(&rep->child, n); - swapl(&rep->root_x, n); - swapl(&rep->root_y, n); - swapl(&rep->win_x, n); - swapl(&rep->win_y, n); - swaps(&rep->buttons_len, n); + swapl(&rep->length); + swaps(&rep->sequenceNumber); + swapl(&rep->root); + swapl(&rep->child); + swapl(&rep->root_x); + swapl(&rep->root_y); + swapl(&rep->win_x); + swapl(&rep->win_y); + swaps(&rep->buttons_len); } reply_check_defaults(rep, len, XIQueryPointer); @@ -132,7 +131,6 @@ static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, voi static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, int error) { - char n; int rc; rc = ProcXIQueryPointer(&client_request); @@ -142,8 +140,8 @@ static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, in assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; - swaps(&req->deviceid, n); - swaps(&req->length, n); + swaps(&req->deviceid); + swaps(&req->length); rc = SProcXIQueryPointer(&client_request); assert(rc == error); diff --git a/test/xi2/protocol-xiqueryversion.c b/test/xi2/protocol-xiqueryversion.c index 3bb356e7f..d60d16b9d 100644 --- a/test/xi2/protocol-xiqueryversion.c +++ b/test/xi2/protocol-xiqueryversion.c @@ -64,11 +64,10 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us if (client->swapped) { - char n; - swapl(&rep->length, n); - swaps(&rep->sequenceNumber, n); - swaps(&rep->major_version, n); - swaps(&rep->minor_version, n); + swapl(&rep->length); + swaps(&rep->sequenceNumber); + swaps(&rep->major_version); + swaps(&rep->minor_version); } reply_check_defaults(rep, len, XIQueryVersion); @@ -91,7 +90,6 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us */ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error) { - char n; int rc; struct test_data versions; xXIQueryVersionReq request; @@ -118,9 +116,9 @@ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int e client.swapped = TRUE; - swaps(&request.length, n); - swaps(&request.major_version, n); - swaps(&request.minor_version, n); + swaps(&request.length); + swaps(&request.major_version); + swaps(&request.minor_version); rc = SProcXIQueryVersion(&client); assert(rc == error); diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c index fa422e2cb..4eaf839fa 100644 --- a/test/xi2/protocol-xiselectevents.c +++ b/test/xi2/protocol-xiselectevents.c @@ -89,7 +89,6 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access static void request_XISelectEvent(xXISelectEventsReq *req, int error) { - char n; int i; int rc; ClientRec client; @@ -114,14 +113,14 @@ static void request_XISelectEvent(xXISelectEventsReq *req, int error) for (i = 0; i < req->num_masks; i++) { next = (xXIEventMask*)((char*)&mask[1] + mask->mask_len * 4); - swaps(&mask->deviceid, n); - swaps(&mask->mask_len, n); + swaps(&mask->deviceid); + swaps(&mask->mask_len); mask = next; } - swapl(&req->win, n); - swaps(&req->length, n); - swaps(&req->num_masks, n); + swapl(&req->win); + swaps(&req->length); + swaps(&req->num_masks); rc = SProcXISelectEvents(&client); assert(rc == error); } diff --git a/test/xi2/protocol-xisetclientpointer.c b/test/xi2/protocol-xisetclientpointer.c index c266b6560..d9620e336 100644 --- a/test/xi2/protocol-xisetclientpointer.c +++ b/test/xi2/protocol-xisetclientpointer.c @@ -66,7 +66,6 @@ int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask a static void request_XISetClientPointer(xXISetClientPointerReq* req, int error) { - char n; int rc; client_request = init_client(req->length, req); @@ -77,9 +76,9 @@ static void request_XISetClientPointer(xXISetClientPointerReq* req, int error) assert(client_request.errorValue == req->deviceid); client_request.swapped = TRUE; - swapl(&req->win, n); - swaps(&req->length, n); - swaps(&req->deviceid, n); + swapl(&req->win); + swaps(&req->length); + swaps(&req->deviceid); rc = SProcXISetClientPointer(&client_request); assert(rc == error); diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c index 0c8db453d..2b40f63f9 100644 --- a/test/xi2/protocol-xiwarppointer.c +++ b/test/xi2/protocol-xiwarppointer.c @@ -78,7 +78,6 @@ static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen, static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, int error) { - char n; int rc; rc = ProcXIWarpPointer(client); @@ -93,15 +92,15 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, client->swapped = TRUE; - swapl(&req->src_win, n); - swapl(&req->dst_win, n); - swapl(&req->src_x, n); - swapl(&req->src_y, n); - swapl(&req->dst_x, n); - swapl(&req->dst_y, n); - swaps(&req->src_width, n); - swaps(&req->src_height, n); - swaps(&req->deviceid, n); + swapl(&req->src_win); + swapl(&req->dst_win); + swapl(&req->src_x); + swapl(&req->src_y); + swapl(&req->dst_x); + swapl(&req->dst_y); + swaps(&req->src_width); + swaps(&req->src_height); + swaps(&req->deviceid); rc = SProcXIWarpPointer(client); assert(rc == error); diff --git a/xfixes/cursor.c b/xfixes/cursor.c index ecbed4016..2950e4579 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -309,12 +309,11 @@ GetBit (unsigned char *line, int x) int SProcXFixesSelectCursorInput (ClientPtr client) { - register int n; REQUEST(xXFixesSelectCursorInputReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->eventMask, n); + swaps(&stuff->length); + swapl(&stuff->window); + swapl(&stuff->eventMask); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -418,16 +417,15 @@ ProcXFixesGetCursorImage (ClientPtr client) CopyCursorToImage (pCursor, image); if (client->swapped) { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->x); + swaps(&rep->y); + swaps(&rep->width); + swaps(&rep->height); + swaps(&rep->xhot); + swaps(&rep->yhot); + swapl(&rep->cursorSerial); SwapLongs (image, npixels); } WriteToClient(client, sizeof (xXFixesGetCursorImageReply) + @@ -439,9 +437,8 @@ ProcXFixesGetCursorImage (ClientPtr client) int SProcXFixesGetCursorImage (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorImageReq); - swaps (&stuff->length, n); + swaps(&stuff->length); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -467,13 +464,12 @@ ProcXFixesSetCursorName (ClientPtr client) int SProcXFixesSetCursorName (ClientPtr client) { - int n; REQUEST(xXFixesSetCursorNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - swapl (&stuff->cursor, n); - swaps (&stuff->nbytes, n); + swapl(&stuff->cursor); + swaps(&stuff->nbytes); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -501,11 +497,10 @@ ProcXFixesGetCursorName (ClientPtr client) reply.nbytes = len; if (client->swapped) { - int n; - swaps (&reply.sequenceNumber, n); - swapl (&reply.length, n); - swapl (&reply.atom, n); - swaps (&reply.nbytes, n); + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.atom); + swaps(&reply.nbytes); } WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply); WriteToClient(client, len, str); @@ -516,12 +511,11 @@ ProcXFixesGetCursorName (ClientPtr client) int SProcXFixesGetCursorName (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - swapl (&stuff->cursor, n); + swapl(&stuff->cursor); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -576,18 +570,17 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) memcpy ((image + npixels), name, nbytes); if (client->swapped) { - int n; - swaps (&rep->sequenceNumber, n); - swapl (&rep->length, n); - swaps (&rep->x, n); - swaps (&rep->y, n); - swaps (&rep->width, n); - swaps (&rep->height, n); - swaps (&rep->xhot, n); - swaps (&rep->yhot, n); - swapl (&rep->cursorSerial, n); - swapl (&rep->cursorName, n); - swaps (&rep->nbytes, n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->x); + swaps(&rep->y); + swaps(&rep->width); + swaps(&rep->height); + swaps(&rep->xhot); + swaps(&rep->yhot); + swapl(&rep->cursorSerial); + swapl(&rep->cursorName); + swaps(&rep->nbytes); SwapLongs (image, npixels); } WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) + @@ -599,9 +592,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) int SProcXFixesGetCursorImageAndName (ClientPtr client) { - int n; REQUEST(xXFixesGetCursorImageAndNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -734,13 +726,12 @@ ProcXFixesChangeCursor (ClientPtr client) int SProcXFixesChangeCursor (ClientPtr client) { - int n; REQUEST(xXFixesChangeCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -772,13 +763,12 @@ ProcXFixesChangeCursorByName (ClientPtr client) int SProcXFixesChangeCursorByName (ClientPtr client) { - int n; REQUEST(xXFixesChangeCursorByNameReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq); - swapl (&stuff->source, n); - swaps (&stuff->nbytes, n); + swapl(&stuff->source); + swaps(&stuff->nbytes); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -933,12 +923,11 @@ ProcXFixesHideCursor (ClientPtr client) int SProcXFixesHideCursor (ClientPtr client) { - int n; REQUEST(xXFixesHideCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesHideCursorReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -984,12 +973,11 @@ ProcXFixesShowCursor (ClientPtr client) int SProcXFixesShowCursor (ClientPtr client) { - int n; REQUEST(xXFixesShowCursorReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesShowCursorReq); - swapl (&stuff->window, n); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -1350,18 +1338,17 @@ ProcXFixesCreatePointerBarrier (ClientPtr client) int SProcXFixesCreatePointerBarrier (ClientPtr client) { - int n; REQUEST(xXFixesCreatePointerBarrierReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); - swapl(&stuff->barrier, n); - swapl(&stuff->window, n); - swaps(&stuff->x1, n); - swaps(&stuff->y1, n); - swaps(&stuff->x2, n); - swaps(&stuff->y2, n); - swapl(&stuff->directions, n); + swapl(&stuff->barrier); + swapl(&stuff->window); + swaps(&stuff->x1); + swaps(&stuff->y1); + swaps(&stuff->x2); + swaps(&stuff->y2); + swapl(&stuff->directions); return ProcXFixesVector[stuff->xfixesReqType](client); } @@ -1412,12 +1399,11 @@ ProcXFixesDestroyPointerBarrier (ClientPtr client) int SProcXFixesDestroyPointerBarrier (ClientPtr client) { - int n; REQUEST(xXFixesDestroyPointerBarrierReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq); - swapl(&stuff->barrier, n); + swapl(&stuff->barrier); return ProcXFixesVector[stuff->xfixesReqType](client); } diff --git a/xfixes/region.c b/xfixes/region.c index be2d391dd..4c2263702 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -93,12 +93,11 @@ ProcXFixesCreateRegion (ClientPtr client) int SProcXFixesCreateRegion (ClientPtr client) { - register int n; REQUEST(xXFixesCreateRegionReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq); - swapl(&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -138,13 +137,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) int SProcXFixesCreateRegionFromBitmap (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromBitmapReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq); - swapl(&stuff->region, n); - swapl(&stuff->bitmap, n); + swapl(&stuff->region); + swapl(&stuff->bitmap); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -200,13 +198,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) int SProcXFixesCreateRegionFromWindow (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromWindowReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq); - swapl(&stuff->region, n); - swapl(&stuff->window, n); + swapl(&stuff->region); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -250,13 +247,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) int SProcXFixesCreateRegionFromGC (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromGCReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); - swapl(&stuff->region, n); - swapl(&stuff->gc, n); + swapl(&stuff->region); + swapl(&stuff->gc); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -297,13 +293,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) int SProcXFixesCreateRegionFromPicture (ClientPtr client) { - int n; REQUEST (xXFixesCreateRegionFromPictureReq); - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); - swapl(&stuff->region, n); - swapl(&stuff->picture, n); + swapl(&stuff->region); + swapl(&stuff->picture); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -322,12 +317,11 @@ ProcXFixesDestroyRegion (ClientPtr client) int SProcXFixesDestroyRegion (ClientPtr client) { - int n; REQUEST (xXFixesDestroyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -361,12 +355,11 @@ ProcXFixesSetRegion (ClientPtr client) int SProcXFixesSetRegion (ClientPtr client) { - int n; REQUEST (xXFixesSetRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -389,13 +382,12 @@ ProcXFixesCopyRegion (ClientPtr client) int SProcXFixesCopyRegion (ClientPtr client) { - int n; REQUEST (xXFixesCopyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -431,14 +423,13 @@ ProcXFixesCombineRegion (ClientPtr client) int SProcXFixesCombineRegion (ClientPtr client) { - int n; REQUEST (xXFixesCombineRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - swapl (&stuff->source1, n); - swapl (&stuff->source2, n); - swapl (&stuff->destination, n); + swapl(&stuff->source1); + swapl(&stuff->source2); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -475,17 +466,16 @@ ProcXFixesInvertRegion (ClientPtr client) int SProcXFixesInvertRegion (ClientPtr client) { - int n; REQUEST(xXFixesInvertRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - swapl (&stuff->source, n); - swaps (&stuff->x, n); - swaps (&stuff->y, n); - swaps (&stuff->width, n); - swaps (&stuff->height, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -505,14 +495,13 @@ ProcXFixesTranslateRegion (ClientPtr client) int SProcXFixesTranslateRegion (ClientPtr client) { - int n; REQUEST(xXFixesTranslateRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - swapl (&stuff->region, n); - swaps (&stuff->dx, n); - swaps (&stuff->dy, n); + swapl(&stuff->region); + swaps(&stuff->dx); + swaps(&stuff->dy); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -534,13 +523,12 @@ ProcXFixesRegionExtents (ClientPtr client) int SProcXFixesRegionExtents (ClientPtr client) { - int n; REQUEST(xXFixesRegionExtentsReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -584,13 +572,12 @@ ProcXFixesFetchRegion (ClientPtr client) } if (client->swapped) { - int n; - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swaps (&reply->x, n); - swaps (&reply->y, n); - swaps (&reply->width, n); - swaps (&reply->height, n); + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swaps(&reply->x); + swaps(&reply->y); + swaps(&reply->width); + swaps(&reply->height); SwapShorts ((INT16 *) pRect, nBox * 4); } (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + @@ -602,12 +589,11 @@ ProcXFixesFetchRegion (ClientPtr client) int SProcXFixesFetchRegion (ClientPtr client) { - int n; REQUEST(xXFixesFetchRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -645,15 +631,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client) int SProcXFixesSetGCClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetGCClipRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - swapl (&stuff->gc, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + swapl(&stuff->gc); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -739,15 +724,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) int SProcXFixesSetWindowShapeRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetWindowShapeRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); - swapl (&stuff->region, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -769,15 +753,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) int SProcXFixesSetPictureClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetPictureClipRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - swapl (&stuff->picture, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + swapl(&stuff->picture); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -824,17 +807,16 @@ ProcXFixesExpandRegion (ClientPtr client) int SProcXFixesExpandRegion (ClientPtr client) { - int n; REQUEST (xXFixesExpandRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); - swaps (&stuff->left, n); - swaps (&stuff->right, n); - swaps (&stuff->top, n); - swaps (&stuff->bottom, n); + swapl(&stuff->source); + swapl(&stuff->destination); + swaps(&stuff->left); + swaps(&stuff->right); + swaps(&stuff->top); + swaps(&stuff->bottom); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } diff --git a/xfixes/saveset.c b/xfixes/saveset.c index 35d8e17e0..ba959c22b 100644 --- a/xfixes/saveset.c +++ b/xfixes/saveset.c @@ -63,10 +63,9 @@ ProcXFixesChangeSaveSet(ClientPtr client) int SProcXFixesChangeSaveSet(ClientPtr client) { - register int n; REQUEST(xXFixesChangeSaveSetReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType])(client); } diff --git a/xfixes/select.c b/xfixes/select.c index baf1ef8f4..2bf13f3fd 100644 --- a/xfixes/select.c +++ b/xfixes/select.c @@ -220,13 +220,12 @@ ProcXFixesSelectSelectionInput (ClientPtr client) int SProcXFixesSelectSelectionInput (ClientPtr client) { - register int n; REQUEST(xXFixesSelectSelectionInputReq); - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swapl(&stuff->selection, n); - swapl(&stuff->eventMask, n); + swaps(&stuff->length); + swapl(&stuff->window); + swapl(&stuff->selection); + swapl(&stuff->eventMask); return (*ProcXFixesVector[stuff->xfixesReqType])(client); } diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index e0ebedd80..96d33c00b 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -61,7 +61,6 @@ ProcXFixesQueryVersion(ClientPtr client) { XFixesClientPtr pXFixesClient = GetXFixesClient (client); xXFixesQueryVersionReply rep; - register int n; REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); @@ -83,10 +82,10 @@ ProcXFixesQueryVersion(ClientPtr client) pXFixesClient->major_version = rep.majorVersion; pXFixesClient->minor_version = rep.minorVersion; if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.majorVersion); + swapl(&rep.minorVersion); } WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep); return Success; @@ -161,12 +160,11 @@ ProcXFixesDispatch (ClientPtr client) static int SProcXFixesQueryVersion(ClientPtr client) { - register int n; REQUEST(xXFixesQueryVersionReq); - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); + swaps(&stuff->length); + swapl(&stuff->majorVersion); + swapl(&stuff->minorVersion); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } diff --git a/xkb/ddxList.c b/xkb/ddxList.c index 3d301d88e..7de8efc15 100644 --- a/xkb/ddxList.c +++ b/xkb/ddxList.c @@ -107,9 +107,8 @@ char * tmp; wire16[1]= slen; memcpy(wire8,str,slen); if (client->swapped) { - register int n; - swaps(&wire16[0],n); - swaps(&wire16[1],n); + swaps(&wire16[0]); + swaps(&wire16[1]); } list->nPool+= wlen; list->nFound[what]++; diff --git a/xkb/xkb.c b/xkb/xkb.c index 9c66955f4..9ae9b9ec8 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -158,7 +158,6 @@ ProcXkbUseExtension(ClientPtr client) { REQUEST(xkbUseExtensionReq); xkbUseExtensionReply rep; - register int n; int supported; REQUEST_SIZE_MATCH(xkbUseExtensionReq); @@ -189,9 +188,9 @@ ProcXkbUseExtension(ClientPtr client) rep.serverMajor = SERVER_XKB_MAJOR_VERSION; rep.serverMinor = SERVER_XKB_MINOR_VERSION; if ( client->swapped ) { - swaps(&rep.sequenceNumber, n); - swaps(&rep.serverMajor, n); - swaps(&rep.serverMinor, n); + swaps(&rep.sequenceNumber); + swaps(&rep.serverMajor); + swaps(&rep.serverMinor); } WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); return Success; @@ -574,9 +573,8 @@ ProcXkbGetState(ClientPtr client) rep.compatState = xkb->compat_state; rep.ptrBtnState = xkb->ptr_buttons; if (client->swapped) { - register int n; - swaps(&rep.sequenceNumber,n); - swaps(&rep.ptrBtnState,n); + swaps(&rep.sequenceNumber); + swaps(&rep.ptrBtnState); } WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); return Success; @@ -658,7 +656,6 @@ ProcXkbGetControls(ClientPtr client) xkbGetControlsReply rep; XkbControlsPtr xkb; DeviceIntPtr dev; - register int n; REQUEST(xkbGetControlsReq); REQUEST_SIZE_MATCH(xkbGetControlsReq); @@ -701,26 +698,26 @@ ProcXkbGetControls(ClientPtr client) rep.axOptions = xkb->ax_options; memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize); if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length,n); - swaps(&rep.internalVMods, n); - swaps(&rep.ignoreLockVMods, n); - swapl(&rep.enabledCtrls, n); - swaps(&rep.repeatDelay, n); - swaps(&rep.repeatInterval, n); - swaps(&rep.slowKeysDelay, n); - swaps(&rep.debounceDelay, n); - swaps(&rep.mkDelay, n); - swaps(&rep.mkInterval, n); - swaps(&rep.mkTimeToMax, n); - swaps(&rep.mkMaxSpeed, n); - swaps(&rep.mkCurve, n); - swaps(&rep.axTimeout, n); - swapl(&rep.axtCtrlsMask, n); - swapl(&rep.axtCtrlsValues, n); - swaps(&rep.axtOptsMask, n); - swaps(&rep.axtOptsValues, n); - swaps(&rep.axOptions, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.internalVMods); + swaps(&rep.ignoreLockVMods); + swapl(&rep.enabledCtrls); + swaps(&rep.repeatDelay); + swaps(&rep.repeatInterval); + swaps(&rep.slowKeysDelay); + swaps(&rep.debounceDelay); + swaps(&rep.mkDelay); + swaps(&rep.mkInterval); + swaps(&rep.mkTimeToMax); + swaps(&rep.mkMaxSpeed); + swaps(&rep.mkCurve); + swaps(&rep.axTimeout); + swapl(&rep.axtCtrlsMask); + swapl(&rep.axtCtrlsValues); + swaps(&rep.axtOptsMask); + swaps(&rep.axtOptsValues); + swaps(&rep.axOptions); } WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); return Success; @@ -999,8 +996,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, wire->nMapEntries = type->map_count; wire->preserve = (type->preserve!=NULL); if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); + swaps(&wire->virtualMods); } buf= (char *)&wire[1]; @@ -1016,8 +1012,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, wire->realMods= entry->mods.real_mods; wire->virtualMods= entry->mods.vmods; if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); + swaps(&wire->virtualMods); } } buf= (char *)wire; @@ -1031,8 +1026,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb, pwire->realMods= preserve->real_mods; pwire->virtualMods= preserve->vmods; if (client->swapped) { - register int n; - swaps(&pwire->virtualMods,n); + swaps(&pwire->virtualMods); } } buf= (char *)pwire; @@ -1112,10 +1106,10 @@ register unsigned i; pSym = &xkb->map->syms[symMap->offset]; memcpy((char *)buf,(char *)pSym,outMap->nSyms*4); if (client->swapped) { - register int n,nSyms= outMap->nSyms; - swaps(&outMap->nSyms,n); + register int nSyms= outMap->nSyms; + swaps(&outMap->nSyms); while (nSyms-->0) { - swapl(buf,n); + swapl(buf); buf+= 4; } } @@ -1402,12 +1396,11 @@ char *desc,*start; len, (unsigned long)(desc-start)); } if (client->swapped) { - register int n; - swaps(&rep->sequenceNumber,n); - swapl(&rep->length,n); - swaps(&rep->present,n); - swaps(&rep->totalSyms,n); - swaps(&rep->totalActs,n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->present); + swaps(&rep->totalSyms); + swaps(&rep->totalActs); } WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); WriteToClient(client, len, start); @@ -1589,8 +1582,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; for (i=0;inTypes;i++) { unsigned width; if (client->swapped) { - register int s; - swaps(&wire->virtualMods,s); + swaps(&wire->virtualMods); } n= i+req->firstType; width= wire->numLevels; @@ -1616,8 +1608,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; for (n=0;nnMapEntries;n++) { if (client->swapped) { - register int s; - swaps(&mapWire[n].virtualMods,s); + swaps(&mapWire[n].virtualMods); } if (mapWire[n].realMods&(~wire->realMods)) { *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods, @@ -1635,8 +1626,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn; } if (wire->preserve) { if (client->swapped) { - register int s; - swaps(&preWire[n].virtualMods,s); + swaps(&preWire[n].virtualMods); } if (preWire[n].realMods&(~mapWire[n].realMods)) { *nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods, @@ -1686,7 +1676,7 @@ xkbSymMapWireDesc* wire = *wireRtrn; KeySym *pSyms; register unsigned nG; if (client->swapped) { - swaps(&wire->nSyms,nG); + swaps(&wire->nSyms); } nG = XkbNumGroups(wire->groupInfo); if (nG>XkbNumKbdGroups) { @@ -2066,9 +2056,8 @@ unsigned first,last; newSyms[s]= pSyms[s]; } if (client->swapped) { - int n; for (s=0;snSyms;s++) { - swapl(&newSyms[s],n); + swapl(&newSyms[s]); } } } @@ -2654,8 +2643,7 @@ int size; wire->flags= sym->flags; memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc); if (client->swapped) { - register int n; - swapl(&wire->sym,n); + swapl(&wire->sym); } } if (rep->groups) { @@ -2666,8 +2654,7 @@ int size; grp->realMods= compat->groups[i].real_mods; grp->virtualMods= compat->groups[i].vmods; if (client->swapped) { - register int n; - swaps(&grp->virtualMods,n); + swaps(&grp->virtualMods); } grp++; } @@ -2680,12 +2667,11 @@ int size; else data= NULL; if (client->swapped) { - register int n; - swaps(&rep->sequenceNumber,n); - swapl(&rep->length,n); - swaps(&rep->firstSI,n); - swaps(&rep->nSI,n); - swaps(&rep->nTotalSI,n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swaps(&rep->firstSI); + swaps(&rep->nSI); + swaps(&rep->nTotalSI); } WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); @@ -2802,8 +2788,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, sym = &compat->sym_interpret[req->firstSI]; for (i=0;inSI;i++,wire++) { if (client->swapped) { - int n; - swapl(&wire->sym,n); + swapl(&wire->sym); } if (wire->sym == NoSymbol && wire->match == XkbSI_AnyOfOrNone && (wire->mods & 0xff) == 0xff && @@ -2841,8 +2826,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { if (req->groups & bit) { if (client->swapped) { - int n; - swaps(&wire->virtualMods,n); + swaps(&wire->virtualMods); } compat->groups[i].mask= wire->realMods; compat->groups[i].real_mods= wire->realMods; @@ -2962,7 +2946,6 @@ ProcXkbGetIndicatorState(ClientPtr client) xkbGetIndicatorStateReply rep; XkbSrvLedInfoPtr sli; DeviceIntPtr dev; - register int i; REQUEST(xkbGetIndicatorStateReq); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); @@ -2984,8 +2967,8 @@ ProcXkbGetIndicatorState(ClientPtr client) rep.state = sli->effectiveState; if (client->swapped) { - swaps(&rep.sequenceNumber,i); - swapl(&rep.state,i); + swaps(&rep.sequenceNumber); + swapl(&rep.state); } WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); return Success; @@ -3037,9 +3020,8 @@ register unsigned bit; wire->virtualMods= indicators->maps[i].mods.vmods; wire->ctrls= indicators->maps[i].ctrls; if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); - swapl(&wire->ctrls,n); + swaps(&wire->virtualMods); + swapl(&wire->ctrls); } wire++; } @@ -3055,10 +3037,10 @@ register unsigned bit; } else map = NULL; if (client->swapped) { - swaps(&rep->sequenceNumber,i); - swapl(&rep->length,i); - swapl(&rep->which,i); - swapl(&rep->realIndicators,i); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->which); + swapl(&rep->realIndicators); } WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep); if (map) { @@ -3174,9 +3156,8 @@ ProcXkbSetIndicatorMap(ClientPtr client) for (i=0,bit=1;iwhich&bit) { if (client->swapped) { - int n; - swaps(&from->virtualMods,n); - swapl(&from->ctrls,n); + swaps(&from->virtualMods); + swapl(&from->ctrls); } CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup); CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods); @@ -3277,12 +3258,11 @@ ProcXkbGetNamedIndicator(ClientPtr client) rep.supported= TRUE; } if ( client->swapped ) { - register int n; - swapl(&rep.length,n); - swaps(&rep.sequenceNumber,n); - swapl(&rep.indicator,n); - swaps(&rep.virtualMods,n); - swapl(&rep.ctrls,n); + swapl(&rep.length); + swaps(&rep.sequenceNumber); + swapl(&rep.indicator); + swaps(&rep.virtualMods); + swapl(&rep.ctrls); } WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); @@ -3529,8 +3509,7 @@ Atom *atm; if (atoms[i]!=None) { *atm= atoms[i]; if (swap) { - register int n; - swapl(atm,n); + swapl(atm); } atm++; } @@ -3649,16 +3628,15 @@ XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep) register unsigned i,length,which; char * start; char * desc; -register int n; length= rep->length*4; which= rep->which; if (client->swapped) { - swaps(&rep->sequenceNumber,n); - swapl(&rep->length,n); - swapl(&rep->which,n); - swaps(&rep->virtualMods,n); - swapl(&rep->indicators,n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->which); + swaps(&rep->virtualMods); + swapl(&rep->indicators); } start = desc = calloc(1, length); @@ -3668,21 +3646,21 @@ register int n; if (which&XkbKeycodesNameMask) { *((CARD32 *)desc)= xkb->names->keycodes; if (client->swapped) { - swapl(desc,n); + swapl(desc); } desc+= 4; } if (which&XkbGeometryNameMask) { *((CARD32 *)desc)= xkb->names->geometry; if (client->swapped) { - swapl(desc,n); + swapl(desc); } desc+= 4; } if (which&XkbSymbolsNameMask) { *((CARD32 *)desc)= xkb->names->symbols; if (client->swapped) { - swapl(desc,n); + swapl(desc); } desc+= 4; } @@ -3690,21 +3668,21 @@ register int n; register CARD32 *atm= (CARD32 *)desc; atm[0]= (CARD32)xkb->names->phys_symbols; if (client->swapped) { - swapl(&atm[0],n); + swapl(&atm[0]); } desc+= 4; } if (which&XkbTypesNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->types; if (client->swapped) { - swapl(desc,n); + swapl(desc); } desc+= 4; } if (which&XkbCompatNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->compat; if (client->swapped) { - swapl(desc,n); + swapl(desc); } desc+= 4; } @@ -3715,7 +3693,7 @@ register int n; for (i=0;imap->num_types;i++,atm++,type++) { *atm= (CARD32)type->name; if (client->swapped) { - swapl(atm,n); + swapl(atm); } } desc= (char *)atm; @@ -3736,7 +3714,7 @@ register int n; for (l=0;lnum_levels;l++,atm++) { *atm= type->level_names[l]; if (client->swapped) { - swapl(atm,n); + swapl(atm); } } desc+= type->num_levels*4; @@ -3772,7 +3750,7 @@ register int n; for (i=0;inRadioGroups;i++,atm++) { *atm= (CARD32)xkb->names->radio_groups[i]; if (client->swapped) { - swapl(atm,n); + swapl(atm); } } desc+= rep->nRadioGroups*4; @@ -3835,8 +3813,7 @@ register int i; for (i=0;iapproxNdx= XkbNoShape; shapeWire->pad= 0; if (swap) { - register int n; - swapl(&shapeWire->name,n); + swapl(&shapeWire->name); } wire= (char *)&shapeWire[1]; for (o=0,ol=shape->outlines;onum_outlines;o++,ol++) { @@ -4483,9 +4457,8 @@ xkbShapeWireDesc * shapeWire; ptWire[p].x= pt->x; ptWire[p].y= pt->y; if (swap) { - register int n; - swaps(&ptWire[p].x,n); - swaps(&ptWire[p].y,n); + swaps(&ptWire[p].x); + swaps(&ptWire[p].y); } } wire= (char *)&ptWire[ol->num_points]; @@ -4528,10 +4501,9 @@ xkbDoodadWireDesc * doodadWire; doodadWire->any.top= doodad->any.top; doodadWire->any.left= doodad->any.left; if (swap) { - register int n; - swapl(&doodadWire->any.name,n); - swaps(&doodadWire->any.top,n); - swaps(&doodadWire->any.left,n); + swapl(&doodadWire->any.name); + swaps(&doodadWire->any.top); + swaps(&doodadWire->any.left); } switch (doodad->any.type) { case XkbOutlineDoodad: @@ -4540,8 +4512,7 @@ xkbDoodadWireDesc * doodadWire; doodadWire->shape.colorNdx= doodad->shape.color_ndx; doodadWire->shape.shapeNdx= doodad->shape.shape_ndx; if (swap) { - register int n; - swaps(&doodadWire->shape.angle,n); + swaps(&doodadWire->shape.angle); } break; case XkbTextDoodad: @@ -4550,10 +4521,9 @@ xkbDoodadWireDesc * doodadWire; doodadWire->text.height= doodad->text.height; doodadWire->text.colorNdx= doodad->text.color_ndx; if (swap) { - register int n; - swaps(&doodadWire->text.angle,n); - swaps(&doodadWire->text.width,n); - swaps(&doodadWire->text.height,n); + swaps(&doodadWire->text.angle); + swaps(&doodadWire->text.width); + swaps(&doodadWire->text.height); } wire= XkbWriteCountedString(wire,doodad->text.text,swap); wire= XkbWriteCountedString(wire,doodad->text.font,swap); @@ -4593,8 +4563,7 @@ xkbOverlayWireDesc * olWire; olWire->pad1= 0; olWire->pad2= 0; if (swap) { - register int n; - swapl(&olWire->name,n); + swapl(&olWire->name); } wire= (char *)&olWire[1]; for (r=0,row=ol->rows;rnum_rows;r++,row++) { @@ -4673,13 +4642,12 @@ xkbSectionWireDesc * sectionWire; sectionWire->nOverlays= section->num_overlays; sectionWire->pad= 0; if (swap) { - register int n; - swapl(§ionWire->name,n); - swaps(§ionWire->top,n); - swaps(§ionWire->left,n); - swaps(§ionWire->width,n); - swaps(§ionWire->height,n); - swaps(§ionWire->angle,n); + swapl(§ionWire->name); + swaps(§ionWire->top); + swaps(§ionWire->left); + swaps(§ionWire->width); + swaps(§ionWire->height); + swaps(§ionWire->angle); } wire= (char *)§ionWire[1]; if (section->rows) { @@ -4694,9 +4662,8 @@ xkbSectionWireDesc * sectionWire; rowWire->vertical= row->vertical; rowWire->pad= 0; if (swap) { - register int n; - swaps(&rowWire->top,n); - swaps(&rowWire->left,n); + swaps(&rowWire->top); + swaps(&rowWire->left); } wire= (char *)&rowWire[1]; if (row->keys) { @@ -4710,8 +4677,7 @@ xkbSectionWireDesc * sectionWire; keyWire[k].shapeNdx= key->shape_ndx; keyWire[k].colorNdx= key->color_ndx; if (swap) { - register int n; - swaps(&keyWire[k].gap,n); + swaps(&keyWire[k].gap); } } wire= (char *)&keyWire[row->num_keys]; @@ -4813,18 +4779,17 @@ XkbSendGeometry( ClientPtr client, start= NULL; } if (client->swapped) { - register int n; - swaps(&rep->sequenceNumber,n); - swapl(&rep->length,n); - swapl(&rep->name,n); - swaps(&rep->widthMM,n); - swaps(&rep->heightMM,n); - swaps(&rep->nProperties,n); - swaps(&rep->nColors,n); - swaps(&rep->nShapes,n); - swaps(&rep->nSections,n); - swaps(&rep->nDoodads,n); - swaps(&rep->nKeyAliases,n); + swaps(&rep->sequenceNumber); + swapl(&rep->length); + swapl(&rep->name); + swaps(&rep->widthMM); + swaps(&rep->heightMM); + swaps(&rep->nProperties); + swaps(&rep->nColors); + swaps(&rep->nShapes); + swaps(&rep->nSections); + swaps(&rep->nDoodads); + swaps(&rep->nKeyAliases); } WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep); if (len>0) @@ -4876,8 +4841,7 @@ CARD16 len,*plen; wire= *wire_inout; plen= (CARD16 *)wire; if (swap) { - register int n; - swaps(plen,n); + swaps(plen); } len= *plen; str= malloc(len+1); @@ -4903,11 +4867,10 @@ XkbDoodadPtr doodad; dWire= (xkbDoodadWireDesc *)(*wire_inout); wire= (char *)&dWire[1]; if (client->swapped) { - register int n; - swapl(&dWire->any.name,n); - swaps(&dWire->any.top,n); - swaps(&dWire->any.left,n); - swaps(&dWire->any.angle,n); + swapl(&dWire->any.name); + swaps(&dWire->any.top); + swaps(&dWire->any.left); + swaps(&dWire->any.angle); } CHK_ATOM_ONLY(dWire->any.name); doodad= XkbAddGeomDoodad(geom,section,dWire->any.name); @@ -4941,9 +4904,8 @@ XkbDoodadPtr doodad; return BadMatch; } if (client->swapped) { - register int n; - swaps(&dWire->text.width,n); - swaps(&dWire->text.height,n); + swaps(&dWire->text.width); + swaps(&dWire->text.height); } doodad->text.width= dWire->text.width; doodad->text.height= dWire->text.height; @@ -5009,8 +4971,7 @@ xkbOverlayRowWireDesc * rWire; wire= *wire_inout; olWire= (xkbOverlayWireDesc *)wire; if (client->swapped) { - register int n; - swapl(&olWire->name,n); + swapl(&olWire->name); } CHK_ATOM_ONLY(olWire->name); ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows); @@ -5062,13 +5023,12 @@ XkbSectionPtr section; register int r; xkbRowWireDesc * rWire; if (client->swapped) { - register int n; - swapl(&sWire->name,n); - swaps(&sWire->top,n); - swaps(&sWire->left,n); - swaps(&sWire->width,n); - swaps(&sWire->height,n); - swaps(&sWire->angle,n); + swapl(&sWire->name); + swaps(&sWire->top); + swaps(&sWire->left); + swaps(&sWire->width); + swaps(&sWire->height); + swaps(&sWire->angle); } CHK_ATOM_ONLY(sWire->name); section= XkbAddGeomSection(geom,sWire->name,sWire->nRows, @@ -5087,9 +5047,8 @@ XkbSectionPtr section; XkbRowPtr row; xkbKeyWireDesc * kWire; if (client->swapped) { - register int n; - swaps(&rWire->top,n); - swaps(&rWire->left,n); + swaps(&rWire->top); + swaps(&rWire->left); } row= XkbAddGeomRow(section,rWire->nKeys); if (!row) @@ -5184,9 +5143,8 @@ char * wire; pt->x= ptWire[p].x; pt->y= ptWire[p].y; if (client->swapped) { - register int n; - swaps(&pt->x,n); - swaps(&pt->y,n); + swaps(&pt->x); + swaps(&pt->y); } } ol->num_points= olWire->nPoints; @@ -5453,12 +5411,11 @@ ProcXkbPerClientFlags(ClientPtr client) rep.autoCtrls= rep.autoCtrlValues= 0; } if ( client->swapped ) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.supported,n); - swapl(&rep.value,n); - swapl(&rep.autoCtrls,n); - swapl(&rep.autoCtrlValues,n); + swaps(&rep.sequenceNumber); + swapl(&rep.supported); + swapl(&rep.value); + swapl(&rep.autoCtrls); + swapl(&rep.autoCtrlValues); } WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); return Success; @@ -5576,16 +5533,15 @@ ProcXkbListComponents(ClientPtr client) if (list.nTotal>list.maxRtrn) rep.extra = (list.nTotal-list.maxRtrn); if (client->swapped) { - register int n; - swaps(&rep.sequenceNumber,n); - swapl(&rep.length,n); - swaps(&rep.nKeymaps,n); - swaps(&rep.nKeycodes,n); - swaps(&rep.nTypes,n); - swaps(&rep.nCompatMaps,n); - swaps(&rep.nSymbols,n); - swaps(&rep.nGeometries,n); - swaps(&rep.extra,n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.nKeymaps); + swaps(&rep.nKeycodes); + swaps(&rep.nTypes); + swaps(&rep.nCompatMaps); + swaps(&rep.nSymbols); + swaps(&rep.nGeometries); + swaps(&rep.extra); } WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep); if (list.nPool && list.pool) { @@ -5849,11 +5805,10 @@ ProcXkbGetKbdByName(ClientPtr client) reported= rep.reported; if ( client->swapped ) { - register int n; - swaps(&rep.sequenceNumber,n); - swapl(&rep.length,n); - swaps(&rep.found,n); - swaps(&rep.reported,n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.found); + swaps(&rep.reported); } WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep); if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) @@ -6038,13 +5993,12 @@ int length; wire.physIndicators= sli->physIndicators; wire.state= sli->effectiveState; if (client->swapped) { - register int n; - swaps(&wire.ledClass,n); - swaps(&wire.ledID,n); - swapl(&wire.namesPresent,n); - swapl(&wire.mapsPresent,n); - swapl(&wire.physIndicators,n); - swapl(&wire.state,n); + swaps(&wire.ledClass); + swaps(&wire.ledID); + swapl(&wire.namesPresent); + swapl(&wire.mapsPresent); + swapl(&wire.physIndicators); + swapl(&wire.state); } WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire); length+= SIZEOF(xkbDeviceLedsWireDesc); @@ -6056,8 +6010,7 @@ int length; if (sli->namesPresent&bit) { awire= (CARD32)sli->names[i]; if (client->swapped) { - register int n; - swapl(&awire,n); + swapl(&awire); } WriteToClient(client,4,(char *)&awire); length+= 4; @@ -6077,9 +6030,8 @@ int length; iwire.virtualMods= sli->maps[i].mods.vmods; iwire.ctrls= sli->maps[i].ctrls; if (client->swapped) { - register int n; - swaps(&iwire.virtualMods,n); - swapl(&iwire.ctrls,n); + swaps(&iwire.virtualMods); + swapl(&iwire.ctrls); } WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc), (char *)&iwire); @@ -6232,14 +6184,13 @@ char * str; length= rep.length*4; nDeviceLedFBs = rep.nDeviceLedFBs; if (client->swapped) { - register int n; - swaps(&rep.sequenceNumber,n); - swapl(&rep.length,n); - swaps(&rep.present,n); - swaps(&rep.supported,n); - swaps(&rep.unsupported,n); - swaps(&rep.nDeviceLedFBs,n); - swapl(&rep.type,n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.present); + swaps(&rep.supported); + swaps(&rep.unsupported); + swaps(&rep.nDeviceLedFBs); + swapl(&rep.type); } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); @@ -6286,12 +6237,11 @@ XkbSrvLedInfoPtr sli; ledWire= (xkbDeviceLedsWireDesc *)wire; for (i=0;iswapped) { - register int n; - swaps(&ledWire->ledClass,n); - swaps(&ledWire->ledID,n); - swapl(&ledWire->namesPresent,n); - swapl(&ledWire->mapsPresent,n); - swapl(&ledWire->physIndicators,n); + swaps(&ledWire->ledClass); + swaps(&ledWire->ledID); + swapl(&ledWire->namesPresent); + swapl(&ledWire->mapsPresent); + swapl(&ledWire->physIndicators); } sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID, @@ -6314,8 +6264,7 @@ XkbSrvLedInfoPtr sli; if (nNames>0) { for (n=0;nswapped) { - register int t; - swapl(atomWire,t); + swapl(atomWire); } CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue, *status_rtrn,NULL); @@ -6326,9 +6275,8 @@ XkbSrvLedInfoPtr sli; if (nMaps>0) { for (n=0;nswapped) { - register int t; - swaps(&mapWire->virtualMods,t); - swapl(&mapWire->ctrls,t); + swaps(&mapWire->virtualMods); + swapl(&mapWire->ctrls); } CHK_MASK_LEGAL3(0x21,mapWire->whichGroups, XkbIM_UseAnyGroup, @@ -6649,12 +6597,11 @@ int rc; rep.supportedFlags = ~0; rep.supportedCtrls = ~0; if ( client->swapped ) { - register int n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.currentFlags, n); - swapl(&rep.currentCtrls, n); - swapl(&rep.supportedFlags, n); - swapl(&rep.supportedCtrls, n); + swaps(&rep.sequenceNumber); + swapl(&rep.currentFlags); + swapl(&rep.currentCtrls); + swapl(&rep.supportedFlags); + swapl(&rep.supportedCtrls); } WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); return Success; diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c index dfbf7f2b3..347f0f8a4 100644 --- a/xkb/xkbEvents.c +++ b/xkb/xkbEvents.c @@ -172,10 +172,9 @@ XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN) pNKN->time = time; pNKN->changed = changed; if (clients[i]->swapped) { - int n; - swaps(&pNKN->sequenceNumber,n); - swapl(&pNKN->time,n); - swaps(&pNKN->changed,n); + swaps(&pNKN->sequenceNumber); + swapl(&pNKN->time); + swaps(&pNKN->changed); } WriteToClient(clients[i], sizeof(xEvent), pNKN); @@ -239,11 +238,10 @@ register CARD16 changed,bState; pSN->changed = changed; pSN->ptrBtnState = bState; if ( interest->client->swapped ) { - register int n; - swaps(&pSN->sequenceNumber,n); - swapl(&pSN->time,n); - swaps(&pSN->changed,n); - swaps(&pSN->ptrBtnState,n); + swaps(&pSN->sequenceNumber); + swapl(&pSN->time); + swaps(&pSN->changed); + swaps(&pSN->ptrBtnState); } WriteToClient(interest->client, sizeof(xEvent), (char *)pSN); } @@ -285,10 +283,9 @@ XkbSendMapNotify(DeviceIntPtr kbd, xkbMapNotify *pMN) pMN->changed = changed; if (clients[i]->swapped) { - int n; - swaps(&pMN->sequenceNumber, n); - swapl(&pMN->time, n); - swaps(&pMN->changed, n); + swaps(&pMN->sequenceNumber); + swapl(&pMN->time); + swaps(&pMN->changed); } WriteToClient(clients[i], sizeof(xEvent), pMN); } @@ -413,12 +410,11 @@ Time time = 0; pCN->sequenceNumber = interest->client->sequence; pCN->time = time; if ( interest->client->swapped ) { - register int n; - swaps(&pCN->sequenceNumber,n); - swapl(&pCN->changedControls,n); - swapl(&pCN->enabledControls,n); - swapl(&pCN->enabledControlChanges,n); - swapl(&pCN->time,n); + swaps(&pCN->sequenceNumber); + swapl(&pCN->changedControls); + swapl(&pCN->enabledControls); + swapl(&pCN->enabledControlChanges); + swapl(&pCN->time); } WriteToClient(interest->client, sizeof(xEvent), (char *)pCN); } @@ -462,11 +458,10 @@ CARD32 state,changed; pEv->changed = changed; pEv->state = state; if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); - swapl(&pEv->changed,n); - swapl(&pEv->state,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); + swapl(&pEv->changed); + swapl(&pEv->state); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } @@ -549,13 +544,12 @@ XID winID = 0; bn.name = name; bn.window= winID; if ( interest->client->swapped ) { - register int n; - swaps(&bn.sequenceNumber,n); - swapl(&bn.time,n); - swaps(&bn.pitch,n); - swaps(&bn.duration,n); - swapl(&bn.name,n); - swapl(&bn.window,n); + swaps(&bn.sequenceNumber); + swapl(&bn.time); + swaps(&bn.pitch); + swaps(&bn.duration); + swapl(&bn.name); + swapl(&bn.window); } WriteToClient(interest->client, sizeof(xEvent), (char *)&bn); } @@ -596,11 +590,10 @@ CARD16 sk_delay,db_delay; pEv->slowKeysDelay = sk_delay; pEv->debounceDelay = db_delay; if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); - swaps(&pEv->slowKeysDelay,n); - swaps(&pEv->debounceDelay,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); + swaps(&pEv->slowKeysDelay); + swaps(&pEv->debounceDelay); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } @@ -644,12 +637,11 @@ CARD32 changedIndicators; pEv->changedIndicators = changedIndicators; pEv->changedVirtualMods= changedVirtualMods; if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); - swaps(&pEv->changed,n); - swapl(&pEv->changedIndicators,n); - swaps(&pEv->changedVirtualMods,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); + swaps(&pEv->changed); + swapl(&pEv->changedIndicators); + swaps(&pEv->changedVirtualMods); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } @@ -692,12 +684,11 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0; pEv->nSI = nSI; pEv->nTotalSI = nTotalSI; if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); - swaps(&pEv->firstSI,n); - swaps(&pEv->nSI,n); - swaps(&pEv->nTotalSI,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); + swaps(&pEv->firstSI); + swaps(&pEv->nSI); + swaps(&pEv->nTotalSI); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } @@ -739,9 +730,8 @@ Time time = 0; pEv->sequenceNumber = interest->client->sequence; pEv->time = time; if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } @@ -791,13 +781,12 @@ CARD16 reason; pEv->supported= XkbXI_AllFeaturesMask; } if ( interest->client->swapped ) { - register int n; - swaps(&pEv->sequenceNumber,n); - swapl(&pEv->time,n); - swapl(&pEv->ledsDefined,n); - swapl(&pEv->ledState,n); - swaps(&pEv->reason,n); - swaps(&pEv->supported,n); + swaps(&pEv->sequenceNumber); + swapl(&pEv->time); + swapl(&pEv->ledsDefined); + swapl(&pEv->ledState); + swaps(&pEv->reason); + swaps(&pEv->supported); } WriteToClient(interest->client, sizeof(xEvent), (char *)pEv); } diff --git a/xkb/xkbSwap.c b/xkb/xkbSwap.c index ffd66b563..fcae918a9 100644 --- a/xkb/xkbSwap.c +++ b/xkb/xkbSwap.c @@ -44,32 +44,28 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. static int SProcXkbUseExtension(ClientPtr client) { -register int n; - REQUEST(xkbUseExtensionReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbUseExtensionReq); - swaps(&stuff->wantedMajor,n); - swaps(&stuff->wantedMinor,n); + swaps(&stuff->wantedMajor); + swaps(&stuff->wantedMinor); return ProcXkbUseExtension(client); } static int SProcXkbSelectEvents(ClientPtr client) { -register int n; - REQUEST(xkbSelectEventsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->affectWhich,n); - swaps(&stuff->clear,n); - swaps(&stuff->selectAll,n); - swaps(&stuff->affectMap,n); - swaps(&stuff->map,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->affectWhich); + swaps(&stuff->clear); + swaps(&stuff->selectAll); + swaps(&stuff->affectMap); + swaps(&stuff->map); if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) { union { BOOL *b; @@ -113,12 +109,12 @@ register int n; if (dataLeft<(size*2)) return BadLength; if (size==2) { - swaps(&from.c16[0],n); - swaps(&from.c16[1],n); + swaps(&from.c16[0]); + swaps(&from.c16[1]); } else if (size==4) { - swapl(&from.c32[0],n); - swapl(&from.c32[1],n); + swapl(&from.c32[0]); + swapl(&from.c32[1]); } else { size= 2; @@ -137,128 +133,114 @@ register int n; static int SProcXkbBell(ClientPtr client) { -register int n; - REQUEST(xkbBellReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbBellReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->bellClass,n); - swaps(&stuff->bellID,n); - swapl(&stuff->name,n); - swapl(&stuff->window,n); - swaps(&stuff->pitch,n); - swaps(&stuff->duration,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->bellClass); + swaps(&stuff->bellID); + swapl(&stuff->name); + swapl(&stuff->window); + swaps(&stuff->pitch); + swaps(&stuff->duration); return ProcXkbBell(client); } static int SProcXkbGetState(ClientPtr client) { -register int n; - REQUEST(xkbGetStateReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetStateReq); - swaps(&stuff->deviceSpec,n); + swaps(&stuff->deviceSpec); return ProcXkbGetState(client); } static int SProcXkbLatchLockState(ClientPtr client) { -register int n; - REQUEST(xkbLatchLockStateReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbLatchLockStateReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->groupLatch,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->groupLatch); return ProcXkbLatchLockState(client); } static int SProcXkbGetControls(ClientPtr client) { -register int n; - REQUEST(xkbGetControlsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetControlsReq); - swaps(&stuff->deviceSpec,n); + swaps(&stuff->deviceSpec); return ProcXkbGetControls(client); } static int SProcXkbSetControls(ClientPtr client) { -register int n; - REQUEST(xkbSetControlsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbSetControlsReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->affectInternalVMods,n); - swaps(&stuff->internalVMods,n); - swaps(&stuff->affectIgnoreLockVMods,n); - swaps(&stuff->ignoreLockVMods,n); - swaps(&stuff->axOptions,n); - swapl(&stuff->affectEnabledCtrls,n); - swapl(&stuff->enabledCtrls,n); - swapl(&stuff->changeCtrls,n); - swaps(&stuff->repeatDelay,n); - swaps(&stuff->repeatInterval,n); - swaps(&stuff->slowKeysDelay,n); - swaps(&stuff->debounceDelay,n); - swaps(&stuff->mkDelay,n); - swaps(&stuff->mkInterval,n); - swaps(&stuff->mkTimeToMax,n); - swaps(&stuff->mkMaxSpeed,n); - swaps(&stuff->mkCurve,n); - swaps(&stuff->axTimeout,n); - swapl(&stuff->axtCtrlsMask,n); - swapl(&stuff->axtCtrlsValues,n); - swaps(&stuff->axtOptsMask,n); - swaps(&stuff->axtOptsValues,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->affectInternalVMods); + swaps(&stuff->internalVMods); + swaps(&stuff->affectIgnoreLockVMods); + swaps(&stuff->ignoreLockVMods); + swaps(&stuff->axOptions); + swapl(&stuff->affectEnabledCtrls); + swapl(&stuff->enabledCtrls); + swapl(&stuff->changeCtrls); + swaps(&stuff->repeatDelay); + swaps(&stuff->repeatInterval); + swaps(&stuff->slowKeysDelay); + swaps(&stuff->debounceDelay); + swaps(&stuff->mkDelay); + swaps(&stuff->mkInterval); + swaps(&stuff->mkTimeToMax); + swaps(&stuff->mkMaxSpeed); + swaps(&stuff->mkCurve); + swaps(&stuff->axTimeout); + swapl(&stuff->axtCtrlsMask); + swapl(&stuff->axtCtrlsValues); + swaps(&stuff->axtOptsMask); + swaps(&stuff->axtOptsValues); return ProcXkbSetControls(client); } static int SProcXkbGetMap(ClientPtr client) { -register int n; - REQUEST(xkbGetMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetMapReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->full,n); - swaps(&stuff->partial,n); - swaps(&stuff->virtualMods,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->full); + swaps(&stuff->partial); + swaps(&stuff->virtualMods); return ProcXkbGetMap(client); } static int SProcXkbSetMap(ClientPtr client) { -register int n; - REQUEST(xkbSetMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetMapReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->present,n); - swaps(&stuff->flags,n); - swaps(&stuff->totalSyms,n); - swaps(&stuff->totalActs,n); - swaps(&stuff->virtualMods,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->present); + swaps(&stuff->flags); + swaps(&stuff->totalSyms); + swaps(&stuff->totalActs); + swaps(&stuff->virtualMods); return ProcXkbSetMap(client); } @@ -266,105 +248,91 @@ register int n; static int SProcXkbGetCompatMap(ClientPtr client) { -register int n; - REQUEST(xkbGetCompatMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetCompatMapReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->firstSI,n); - swaps(&stuff->nSI,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->firstSI); + swaps(&stuff->nSI); return ProcXkbGetCompatMap(client); } static int SProcXkbSetCompatMap(ClientPtr client) { -register int n; - REQUEST(xkbSetCompatMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->firstSI,n); - swaps(&stuff->nSI,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->firstSI); + swaps(&stuff->nSI); return ProcXkbSetCompatMap(client); } static int SProcXkbGetIndicatorState(ClientPtr client) { -register int n; - REQUEST(xkbGetIndicatorStateReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); - swaps(&stuff->deviceSpec,n); + swaps(&stuff->deviceSpec); return ProcXkbGetIndicatorState(client); } static int SProcXkbGetIndicatorMap(ClientPtr client) { -register int n; - REQUEST(xkbGetIndicatorMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->which,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->which); return ProcXkbGetIndicatorMap(client); } static int SProcXkbSetIndicatorMap(ClientPtr client) { -register int n; - REQUEST(xkbSetIndicatorMapReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->which,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->which); return ProcXkbSetIndicatorMap(client); } static int SProcXkbGetNamedIndicator(ClientPtr client) { -register int n; - REQUEST(xkbGetNamedIndicatorReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->ledClass,n); - swaps(&stuff->ledID,n); - swapl(&stuff->indicator,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); + swapl(&stuff->indicator); return ProcXkbGetNamedIndicator(client); } static int SProcXkbSetNamedIndicator(ClientPtr client) { -register int n; - REQUEST(xkbSetNamedIndicatorReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->ledClass,n); - swaps(&stuff->ledID,n); - swapl(&stuff->indicator,n); - swaps(&stuff->virtualMods,n); - swapl(&stuff->ctrls,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); + swapl(&stuff->indicator); + swaps(&stuff->virtualMods); + swapl(&stuff->ctrls); return ProcXkbSetNamedIndicator(client); } @@ -372,160 +340,140 @@ register int n; static int SProcXkbGetNames(ClientPtr client) { -register int n; - REQUEST(xkbGetNamesReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetNamesReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->which,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->which); return ProcXkbGetNames(client); } static int SProcXkbSetNames(ClientPtr client) { -register int n; - REQUEST(xkbSetNamesReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->virtualMods,n); - swapl(&stuff->which,n); - swapl(&stuff->indicators,n); - swaps(&stuff->totalKTLevelNames,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->virtualMods); + swapl(&stuff->which); + swapl(&stuff->indicators); + swaps(&stuff->totalKTLevelNames); return ProcXkbSetNames(client); } static int SProcXkbGetGeometry(ClientPtr client) { -register int n; - REQUEST(xkbGetGeometryReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetGeometryReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->name,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->name); return ProcXkbGetGeometry(client); } static int SProcXkbSetGeometry(ClientPtr client) { -register int n; - REQUEST(xkbSetGeometryReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->name,n); - swaps(&stuff->widthMM,n); - swaps(&stuff->heightMM,n); - swaps(&stuff->nProperties,n); - swaps(&stuff->nColors,n); - swaps(&stuff->nDoodads,n); - swaps(&stuff->nKeyAliases,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->name); + swaps(&stuff->widthMM); + swaps(&stuff->heightMM); + swaps(&stuff->nProperties); + swaps(&stuff->nColors); + swaps(&stuff->nDoodads); + swaps(&stuff->nKeyAliases); return ProcXkbSetGeometry(client); } static int SProcXkbPerClientFlags(ClientPtr client) { -register int n; - REQUEST(xkbPerClientFlagsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); - swaps(&stuff->deviceSpec,n); - swapl(&stuff->change,n); - swapl(&stuff->value,n); - swapl(&stuff->ctrlsToChange,n); - swapl(&stuff->autoCtrls,n); - swapl(&stuff->autoCtrlValues,n); + swaps(&stuff->deviceSpec); + swapl(&stuff->change); + swapl(&stuff->value); + swapl(&stuff->ctrlsToChange); + swapl(&stuff->autoCtrls); + swapl(&stuff->autoCtrlValues); return ProcXkbPerClientFlags(client); } static int SProcXkbListComponents(ClientPtr client) { -register int n; - REQUEST(xkbListComponentsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->maxNames,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->maxNames); return ProcXkbListComponents(client); } static int SProcXkbGetKbdByName(ClientPtr client) { -register int n; - REQUEST(xkbGetKbdByNameReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->want,n); - swaps(&stuff->need,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->want); + swaps(&stuff->need); return ProcXkbGetKbdByName(client); } static int SProcXkbGetDeviceInfo(ClientPtr client) { -register int n; - REQUEST(xkbGetDeviceInfoReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->wanted,n); - swaps(&stuff->ledClass,n); - swaps(&stuff->ledID,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->wanted); + swaps(&stuff->ledClass); + swaps(&stuff->ledID); return ProcXkbGetDeviceInfo(client); } static int SProcXkbSetDeviceInfo(ClientPtr client) { -register int n; - REQUEST(xkbSetDeviceInfoReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); - swaps(&stuff->deviceSpec,n); - swaps(&stuff->change,n); - swaps(&stuff->nDeviceLedFBs,n); + swaps(&stuff->deviceSpec); + swaps(&stuff->change); + swaps(&stuff->nDeviceLedFBs); return ProcXkbSetDeviceInfo(client); } static int SProcXkbSetDebuggingFlags(ClientPtr client) { -register int n; - REQUEST(xkbSetDebuggingFlagsReq); - swaps(&stuff->length,n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); - swapl(&stuff->affectFlags,n); - swapl(&stuff->flags,n); - swapl(&stuff->affectCtrls,n); - swapl(&stuff->ctrls,n); - swaps(&stuff->msgLength,n); + swapl(&stuff->affectFlags); + swapl(&stuff->flags); + swapl(&stuff->affectCtrls); + swapl(&stuff->ctrls); + swaps(&stuff->msgLength); return ProcXkbSetDebuggingFlags(client); } From 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 21 Sep 2011 17:14:16 -0400 Subject: [PATCH 05/12] Use correct swap{l,s} (or none at all for CARD8) Swapping the wrong size was never caught because swap{l,s} are macros. It's clear in the case of Xext/xres.c, that the author believed client_major/minor to be CARD16 from looking at the code in the first hunk. v2: dmx.c fixes from Keith. Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- Xext/saver.c | 1 - Xext/xres.c | 12 ++---------- Xi/getdctl.c | 2 -- Xi/xichangehierarchy.c | 2 +- Xi/xiquerydevice.c | 2 +- hw/dmx/dmx.c | 10 +++++----- hw/xfree86/dixmods/extmod/xf86vmode.c | 4 ++-- randr/rrcrtc.c | 4 ++-- xkb/xkb.c | 1 - 9 files changed, 13 insertions(+), 25 deletions(-) diff --git a/Xext/saver.c b/Xext/saver.c index 9e91b717b..142758c87 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -1443,7 +1443,6 @@ SProcScreenSaverSuspend (ClientPtr client) swaps(&stuff->length); REQUEST_SIZE_MATCH(xScreenSaverSuspendReq); - swapl(&stuff->suspend); return ProcScreenSaverSuspend (client); } diff --git a/Xext/xres.c b/Xext/xres.c index 9df12ae81..b95272882 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -28,15 +28,9 @@ ProcXResQueryVersion (ClientPtr client) { REQUEST(xXResQueryVersionReq); xXResQueryVersionReply rep; - CARD16 client_major, client_minor; /* not used */ REQUEST_SIZE_MATCH (xXResQueryVersionReq); - client_major = stuff->client_major; - client_minor = stuff->client_minor; - (void) client_major; - (void) client_minor; - rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -316,8 +310,6 @@ SProcXResQueryVersion (ClientPtr client) { REQUEST(xXResQueryVersionReq); REQUEST_SIZE_MATCH (xXResQueryVersionReq); - swaps(&stuff->client_major); - swaps(&stuff->client_minor); return ProcXResQueryVersion(client); } @@ -326,7 +318,7 @@ SProcXResQueryClientResources (ClientPtr client) { REQUEST(xXResQueryClientResourcesReq); REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq); - swaps(&stuff->xid); + swapl(&stuff->xid); return ProcXResQueryClientResources(client); } @@ -335,7 +327,7 @@ SProcXResQueryClientPixmapBytes (ClientPtr client) { REQUEST(xXResQueryClientPixmapBytesReq); REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq); - swaps(&stuff->xid); + swapl(&stuff->xid); return ProcXResQueryClientPixmapBytes(client); } diff --git a/Xi/getdctl.c b/Xi/getdctl.c index 4287028db..6090b814a 100644 --- a/Xi/getdctl.c +++ b/Xi/getdctl.c @@ -127,7 +127,6 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf) if (client->swapped) { swaps(&c->control); swaps(&c->length); - swaps(&c->status); } } @@ -142,7 +141,6 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf) if (client->swapped) { swaps(&e->control); swaps(&e->length); - swaps(&e->enable); } } diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index f2bd8bb05..614d23116 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -434,7 +434,7 @@ ProcXIChangeHierarchy(ClientPtr client) any = (xXIAnyHierarchyChangeInfo*)&stuff[1]; while(stuff->num_changes--) { - SWAPIF(swapl(&any->type)); + SWAPIF(swaps(&any->type)); SWAPIF(swaps(&any->length)); required_len += any->length; diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c index f5fca0d69..902eb918c 100644 --- a/Xi/xiquerydevice.c +++ b/Xi/xiquerydevice.c @@ -281,7 +281,7 @@ SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info) swaps(&info->sourceid); for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++) - swaps(btn); + swapl(btn); swaps(&info->num_buttons); } diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index c05bd523a..01a744849 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -653,10 +653,10 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client) if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swapl(&rep.width); - swapl(&rep.height); - swapl(&rep.shiftX); - swapl(&rep.shiftY); + swaps(&rep.width); + swaps(&rep.height); + swaps(&rep.shiftX); + swaps(&rep.shiftY); } WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep); return Success; @@ -891,7 +891,7 @@ static int SProcDMXForceWindowCreation(ClientPtr client) swaps(&stuff->length); REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq); - swaps(&stuff->window); + swapl(&stuff->window); return ProcDMXForceWindowCreation(client); } diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 46ff3bf63..6d3d5fcbc 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -464,7 +464,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) swaps(&mdinf.hsyncstart); swaps(&mdinf.hsyncend); swaps(&mdinf.htotal); - swaps(&mdinf.hskew); + swapl(&mdinf.hskew); swaps(&mdinf.vdisplay); swaps(&mdinf.vsyncstart); swaps(&mdinf.vsyncend); @@ -1846,7 +1846,7 @@ SProcXF86VidModeSwitchToMode(ClientPtr client) REQUEST(xXF86VidModeSwitchToModeReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq); - swaps(&stuff->screen); + swapl(&stuff->screen); return ProcXF86VidModeSwitchToMode(client); } diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index a8b73d9b7..e6a38ae60 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1117,7 +1117,7 @@ ProcRRGetPanning (ClientPtr client) if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.timestamp); + swapl(&rep.timestamp); swaps(&rep.left); swaps(&rep.top); swaps(&rep.width); @@ -1197,7 +1197,7 @@ sendReply: if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.newTimestamp); + swapl(&rep.newTimestamp); } WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep); return Success; diff --git a/xkb/xkb.c b/xkb/xkb.c index 9ae9b9ec8..8e42a7fb2 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -6190,7 +6190,6 @@ char * str; swaps(&rep.supported); swaps(&rep.unsupported); swaps(&rep.nDeviceLedFBs); - swapl(&rep.type); } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); From 54770c980cd2b91a8377f975a58ed69def5cfa42 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 16:59:07 -0400 Subject: [PATCH 06/12] Cast char* buffers to swap functions Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- dix/swaprep.c | 4 ++-- render/render.c | 6 +++--- xkb/xkb.c | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dix/swaprep.c b/dix/swaprep.c index a02333d10..28c354cd9 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -397,9 +397,9 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) * they are always 2 4 byte values */ for(i = 0; i < nprops; i++) { - swapl(pby); + swapl((int *)pby); pby += 4; - swapl(pby); + swapl((int *)pby); pby += 4; } if (hasGlyphs) diff --git a/render/render.c b/render/render.c index facc32a29..cc13dbc2a 100644 --- a/render/render.c +++ b/render/render.c @@ -2375,7 +2375,7 @@ SProcRenderCompositeGlyphs (ClientPtr client) i = elt->len; if (i == 0xff) { - swapl(buffer); + swapl((int *)buffer); buffer += 4; } else @@ -2388,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client) case 2: while (i--) { - swaps(buffer); + swaps((short *)buffer); buffer += 2; } break; case 4: while (i--) { - swapl(buffer); + swapl((int *)buffer); buffer += 4; } break; diff --git a/xkb/xkb.c b/xkb/xkb.c index 8e42a7fb2..0b85953f4 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -1109,7 +1109,7 @@ register unsigned i; register int nSyms= outMap->nSyms; swaps(&outMap->nSyms); while (nSyms-->0) { - swapl(buf); + swapl((int *)buf); buf+= 4; } } @@ -3646,21 +3646,21 @@ char * desc; if (which&XkbKeycodesNameMask) { *((CARD32 *)desc)= xkb->names->keycodes; if (client->swapped) { - swapl(desc); + swapl((int *)desc); } desc+= 4; } if (which&XkbGeometryNameMask) { *((CARD32 *)desc)= xkb->names->geometry; if (client->swapped) { - swapl(desc); + swapl((int *)desc); } desc+= 4; } if (which&XkbSymbolsNameMask) { *((CARD32 *)desc)= xkb->names->symbols; if (client->swapped) { - swapl(desc); + swapl((int *)desc); } desc+= 4; } @@ -3675,14 +3675,14 @@ char * desc; if (which&XkbTypesNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->types; if (client->swapped) { - swapl(desc); + swapl((int *)desc); } desc+= 4; } if (which&XkbCompatNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->compat; if (client->swapped) { - swapl(desc); + swapl((int *)desc); } desc+= 4; } From 893e86a49e3e381cff48a9e86dc2d9b3d5431d95 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 19:03:26 -0400 Subject: [PATCH 07/12] Introduce swap_uint{16,32} functions, used in swap{l,s} Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- include/misc.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/include/misc.h b/include/misc.h index cca30d2d0..99046ae76 100644 --- a/include/misc.h +++ b/include/misc.h @@ -256,20 +256,30 @@ version_compare(uint16_t a_major, uint16_t a_minor, SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) /* byte swap a 32-bit value */ +static inline void swap_uint32(uint32_t *x) +{ + char n = ((char *) &x)[0]; + ((char *) x)[0] = ((char *) x)[3]; + ((char *) x)[3] = n; + n = ((char *) x)[1]; + ((char *) x)[1] = ((char *) x)[2]; + ((char *) x)[2] = n; +} + #define swapl(x) do { \ - char n = ((char *) (x))[0];\ - ((char *) (x))[0] = ((char *) (x))[3];\ - ((char *) (x))[3] = n;\ - n = ((char *) (x))[1];\ - ((char *) (x))[1] = ((char *) (x))[2];\ - ((char *) (x))[2] = n;\ + swap_uint32((uint32_t *)(x)); \ } while (0) -/* byte swap a short */ +/* byte swap a 16-bit value */ +static inline void swap_uint16(uint16_t *x) +{ + char n = ((char *) x)[0]; + ((char *) x)[0] = ((char *) x)[1]; + ((char *) x)[1] = n; +} + #define swaps(x) do { \ - char n = ((char *) (x))[0];\ - ((char *) (x))[0] = ((char *) (x))[1];\ - ((char *) (x))[1] = n;\ + swap_uint16((uint16_t *)(x)); \ } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ From e8ff555b95baab66cc7d060c1e7f9fdd49d3802f Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 19:07:24 -0400 Subject: [PATCH 08/12] Add type checking to swap macros The original macros are retained (instead of replacing them with inline functions) because of implicit type promotion. That is, an int16 passed to an inline function taking int32 would be implicitly promoted to int32 without a warning. Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- include/misc.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/misc.h b/include/misc.h index 99046ae76..ac27a81f3 100644 --- a/include/misc.h +++ b/include/misc.h @@ -255,6 +255,14 @@ version_compare(uint16_t a_major, uint16_t a_minor, #define SwapRestL(stuff) \ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) +#ifdef __GNUC__ +void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void); +#else +static inline void wrong_size(void) +{ +} +#endif + /* byte swap a 32-bit value */ static inline void swap_uint32(uint32_t *x) { @@ -267,6 +275,8 @@ static inline void swap_uint32(uint32_t *x) } #define swapl(x) do { \ + if (sizeof(*(x)) != 4) \ + wrong_size(); \ swap_uint32((uint32_t *)(x)); \ } while (0) @@ -279,11 +289,15 @@ static inline void swap_uint16(uint16_t *x) } #define swaps(x) do { \ + if (sizeof(*(x)) != 2) \ + wrong_size(); \ swap_uint16((uint16_t *)(x)); \ } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ #define cpswapl(src, dst) { \ + if (sizeof((src)) != 4 || sizeof((dst)) != 4) \ + wrong_size(); \ ((char *)&(dst))[0] = ((char *) &(src))[3];\ ((char *)&(dst))[1] = ((char *) &(src))[2];\ ((char *)&(dst))[2] = ((char *) &(src))[1];\ @@ -291,6 +305,8 @@ static inline void swap_uint16(uint16_t *x) /* copy short from src to dst byteswapping on the way */ #define cpswaps(src, dst) { \ + if (sizeof((src)) != 2 || sizeof((dst)) != 2) \ + wrong_size(); \ ((char *) &(dst))[0] = ((char *) &(src))[1];\ ((char *) &(dst))[1] = ((char *) &(src))[0]; } From a2f0ff5f73db204a9d61e65148b28f6acc5121df Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 19:30:20 -0400 Subject: [PATCH 09/12] Make lswap{l,s} inline functions text data bss dec hex filename before: 1875668 52136 78040 2005844 1e9b54 hw/xfree86/Xorg after: 1875588 52136 78040 2005764 1e9b04 hw/xfree86/Xorg Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- include/misc.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/misc.h b/include/misc.h index ac27a81f3..096a31ad0 100644 --- a/include/misc.h +++ b/include/misc.h @@ -122,13 +122,19 @@ typedef struct _xReq *xReqPtr; /* byte swap a 32-bit literal */ -#define lswapl(x) ((((x) & 0xff) << 24) |\ - (((x) & 0xff00) << 8) |\ - (((x) & 0xff0000) >> 8) |\ - (((x) >> 24) & 0xff)) +static inline uint32_t lswapl(uint32_t x) +{ + return ((x & 0xff) << 24) | + ((x & 0xff00) << 8) | + ((x & 0xff0000) >> 8) | + ((x >> 24) & 0xff); +} -/* byte swap a short literal */ -#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) +/* byte swap a 16-bit literal */ +static inline uint16_t lswaps(uint16_t x) +{ + return ((x & 0xff) << 8) | ((x >> 8) & 0xff); +} #undef min #undef max From 889b700e7760ced38bcf5f3aff2d31d3d9a058d7 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 19:12:21 -0400 Subject: [PATCH 10/12] Use lswap{l,s} in cpswap{l,s} Should be safe since cpswap isn't used on pointers. text data bss dec hex filename before: 1875588 52136 78040 2005764 1e9b04 hw/xfree86/Xorg after: 1872820 52136 78040 2002996 1e9034 hw/xfree86/Xorg bswap instructions: 5 -> 131 (used in lswapl) rol instructions: 811 -> 943 (used in lswaps) Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- include/misc.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/misc.h b/include/misc.h index 096a31ad0..fb235edeb 100644 --- a/include/misc.h +++ b/include/misc.h @@ -301,20 +301,18 @@ static inline void swap_uint16(uint16_t *x) } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ -#define cpswapl(src, dst) { \ +#define cpswapl(src, dst) do { \ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \ wrong_size(); \ - ((char *)&(dst))[0] = ((char *) &(src))[3];\ - ((char *)&(dst))[1] = ((char *) &(src))[2];\ - ((char *)&(dst))[2] = ((char *) &(src))[1];\ - ((char *)&(dst))[3] = ((char *) &(src))[0]; } + (dst) = lswapl((src)); \ + } while (0) /* copy short from src to dst byteswapping on the way */ -#define cpswaps(src, dst) { \ +#define cpswaps(src, dst) do { \ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \ wrong_size(); \ - ((char *) &(dst))[0] = ((char *) &(src))[1];\ - ((char *) &(dst))[1] = ((char *) &(src))[0]; } + (dst) = lswaps((src)); \ + } while (0) extern _X_EXPORT void SwapLongs( CARD32 *list, From d206d52f657cb63a0f6ba8b62d788c1812b57c81 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 16 Aug 2011 19:19:24 -0400 Subject: [PATCH 11/12] Use __builtin_constant_p to determine if we can use lswapl If the address of the swapped memory location is known at compile time, we can check its alignment at no runtime cost and use lswapl instead. text data bss dec hex filename before: 1872820 52136 78040 2002996 1e9034 hw/xfree86/Xorg after: 1864396 52136 78040 1994572 1e6f4c hw/xfree86/Xorg bswap instructions: 131 -> 308 (used in lswapl) rol instructions: 943 -> 1174 (used in lswaps) Reviewed-by: Peter Harris Signed-off-by: Matt Turner --- include/misc.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/misc.h b/include/misc.h index fb235edeb..1fea73ec3 100644 --- a/include/misc.h +++ b/include/misc.h @@ -267,6 +267,11 @@ void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(vo static inline void wrong_size(void) { } + +static inline void __builtin_constant_p(int x) +{ + return 0; +} #endif /* byte swap a 32-bit value */ @@ -283,7 +288,10 @@ static inline void swap_uint32(uint32_t *x) #define swapl(x) do { \ if (sizeof(*(x)) != 4) \ wrong_size(); \ - swap_uint32((uint32_t *)(x)); \ + if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \ + *(x) = lswapl(*(x)); \ + else \ + swap_uint32((uint32_t *)(x)); \ } while (0) /* byte swap a 16-bit value */ @@ -297,7 +305,10 @@ static inline void swap_uint16(uint16_t *x) #define swaps(x) do { \ if (sizeof(*(x)) != 2) \ wrong_size(); \ - swap_uint16((uint16_t *)(x)); \ + if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \ + *(x) = lswaps(*(x)); \ + else \ + swap_uint16((uint16_t *)(x)); \ } while (0) /* copy 32-bit value from src to dst byteswapping on the way */ From c90903b4f7a826ae6826a8dd0a901c8362500e46 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Fri, 2 Sep 2011 18:45:16 -0400 Subject: [PATCH 12/12] xkb: add missing swaps for xkbGetDeviceInfoReply Caught during review of e095369bf. Signed-off-by: Peter Harris Reviewed-by-by: Matt Turner Signed-off-by: Matt Turner --- xkb/xkb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xkb/xkb.c b/xkb/xkb.c index 0b85953f4..ac0b4278f 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -6190,6 +6190,9 @@ char * str; swaps(&rep.supported); swaps(&rep.unsupported); swaps(&rep.nDeviceLedFBs); + swaps(&rep.dfltKbdFB); + swaps(&rep.dfltLedFB); + swapl(&rep.devType); } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);