From 286d83260216e8e53db701eed5c785aae1c716bf Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 29 Jun 2016 01:36:31 +0200 Subject: Use internal temp variable for swap macros. Make swaps/swapl type safe (introducing wrong_size check at build time). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While working on this changeset, various spots got discovered where swapl or swaps was used on a wrong type, where byte swapping calls had been forgotten or done on the wrong variable. This backport at least includes changes from the following X.org commits, listed in non-chronological order: commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8 Author: Matt Turner Date: Thu Aug 4 15:35:41 2011 -0400 Use internal temp variable for swap macros Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris Signed-off-by: Matt Turner commit 9edcae78c46286baff42e74bfe26f6ae4d00fe01 Author: Matt Turner Date: Wed Sep 21 17:14:16 2011 -0400 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 commit dab064fa5e0b1f5c67222562ad5367005832cba1 Author: Andrea Canciani Date: Tue Nov 2 20:10:32 2010 +0100 render: Fix byteswapping of gradient stops The function swapStops repeatedly swaps the color components as CARD16, but incorrectly steps over them as if they were CARD32. This causes half of the stops not to be swapped at all and some unrelated data be swapped instead. Signed-off-by: Andrea Canciani Reviewed-by: Soren Sandmann Reviewed-by: Julien Cristau Signed-off-by: Keith Packard commit 54770c980cd2b91a8377f975a58ed69def5cfa42 Author: Matt Turner Date: Tue Aug 16 16:59:07 2011 -0400 Cast char* buffers to swap functions Reviewed-by: Peter Harris Signed-off-by: Matt Turner commit 6844bd2e63490870bab3c469eec6030354ef2865 Author: Alan Coopersmith Date: Wed Jan 9 19:52:00 2008 -0800 More Xv extension byte swapping fixes commit e46f6ddeccd082b2d507a1e8b57ea30e6b0a2c83 Author: Michel Dänzer Date: Wed Jan 16 14:24:22 2008 +0100 Yet another Xv extension byte swapping fix. --- nx-X11/programs/Xserver/xkb/ddxList.c | 5 +- nx-X11/programs/Xserver/xkb/xkb.c | 423 ++++++++++++++------------------ nx-X11/programs/Xserver/xkb/xkbEvents.c | 108 ++++---- nx-X11/programs/Xserver/xkb/xkbSwap.c | 336 +++++++++++-------------- 4 files changed, 375 insertions(+), 497 deletions(-) (limited to 'nx-X11/programs/Xserver/xkb') diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c index 2b8f90bad..90ac3d892 100644 --- a/nx-X11/programs/Xserver/xkb/ddxList.c +++ b/nx-X11/programs/Xserver/xkb/ddxList.c @@ -118,9 +118,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/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c index 7085fbfe4..6c6e67f1e 100644 --- a/nx-X11/programs/Xserver/xkb/xkb.c +++ b/nx-X11/programs/Xserver/xkb/xkb.c @@ -165,7 +165,6 @@ ProcXkbUseExtension(ClientPtr client) { REQUEST(xkbUseExtensionReq); xkbUseExtensionReply rep; - register int n; int supported; REQUEST_SIZE_MATCH(xkbUseExtensionReq); @@ -201,9 +200,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 client->noClientException; @@ -535,9 +534,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 client->noClientException; @@ -610,7 +608,6 @@ ProcXkbGetControls(ClientPtr client) xkbGetControlsReply rep; XkbControlsPtr xkb; DeviceIntPtr dev; - register int n; REQUEST(xkbGetControlsReq); REQUEST_SIZE_MATCH(xkbGetControlsReq); @@ -653,26 +650,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(client->noClientException); @@ -940,8 +937,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]; @@ -957,8 +953,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; @@ -972,8 +967,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; @@ -1053,10 +1047,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((int *)buf); buf+= 4; } } @@ -1345,12 +1339,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); @@ -1532,8 +1525,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; @@ -1559,8 +1551,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, @@ -1578,8 +1569,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, @@ -1643,7 +1633,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) { @@ -2023,9 +2013,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]); } } } @@ -2516,8 +2505,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) { @@ -2528,8 +2516,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++; } @@ -2542,12 +2529,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); @@ -2662,8 +2648,7 @@ ProcXkbSetCompatMap(ClientPtr client) sym = &compat->sym_interpret[stuff->firstSI]; for (i=0;inSI;i++,wire++,sym++) { if (client->swapped) { - register int n; - swapl(&wire->sym,n); + swapl(&wire->sym); } sym->sym= wire->sym; sym->mods= wire->mods; @@ -2685,8 +2670,7 @@ ProcXkbSetCompatMap(ClientPtr client) for (i=0,bit=1;igroups&bit) { if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); + swaps(&wire->virtualMods); } compat->groups[i].mask= wire->realMods; compat->groups[i].real_mods= wire->realMods; @@ -2742,7 +2726,6 @@ ProcXkbGetIndicatorState(ClientPtr client) xkbGetIndicatorStateReply rep; XkbSrvLedInfoPtr sli; DeviceIntPtr dev; - register int i; REQUEST(xkbGetIndicatorStateReq); REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); @@ -2764,8 +2747,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 client->noClientException; @@ -2817,9 +2800,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++; } @@ -2834,10 +2816,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) { @@ -2920,9 +2902,8 @@ ProcXkbSetIndicatorMap(ClientPtr client) for (i=0,bit=1;iwhich&bit) { if (client->swapped) { - register 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); @@ -3037,12 +3018,11 @@ ProcXkbGetNamedIndicator(ClientPtr client) rep.supported= supported; } 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); @@ -3203,8 +3183,7 @@ Atom *atm; if (atoms[i]!=None) { *atm= atoms[i]; if (swap) { - register int n; - swapl(atm,n); + swapl(atm); } atm++; } @@ -3327,12 +3306,11 @@ char * desc; length= rep->length*4; which= rep->which; if (client->swapped) { - register int n; - 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 = (char *)ALLOCATE_LOCAL(length); @@ -3341,24 +3319,21 @@ char * desc; if (which&XkbKeycodesNameMask) { *((CARD32 *)desc)= xkb->names->keycodes; if (client->swapped) { - register int n; - swapl(desc,n); + swapl((int *)desc); } desc+= 4; } if (which&XkbGeometryNameMask) { *((CARD32 *)desc)= xkb->names->geometry; if (client->swapped) { - register int n; - swapl(desc,n); + swapl((int *)desc); } desc+= 4; } if (which&XkbSymbolsNameMask) { *((CARD32 *)desc)= xkb->names->symbols; if (client->swapped) { - register int n; - swapl(desc,n); + swapl((int *)desc); } desc+= 4; } @@ -3366,24 +3341,21 @@ char * desc; register CARD32 *atm= (CARD32 *)desc; atm[0]= (CARD32)xkb->names->phys_symbols; if (client->swapped) { - register int n; - swapl(&atm[0],n); + swapl(&atm[0]); } desc+= 4; } if (which&XkbTypesNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->types; if (client->swapped) { - register int n; - swapl(desc,n); + swapl((int *)desc); } desc+= 4; } if (which&XkbCompatNameMask) { *((CARD32 *)desc)= (CARD32)xkb->names->compat; if (client->swapped) { - register int n; - swapl(desc,n); + swapl((int *)desc); } desc+= 4; } @@ -3394,8 +3366,7 @@ char * desc; for (i=0;imap->num_types;i++,atm++,type++) { *atm= (CARD32)type->name; if (client->swapped) { - register int n; - swapl(atm,n); + swapl(atm); } } desc= (char *)atm; @@ -3416,8 +3387,7 @@ char * desc; for (l=0;lnum_levels;l++,atm++) { *atm= type->level_names[l]; if (client->swapped) { - register unsigned n; - swapl(atm,n); + swapl(atm); } } desc+= type->num_levels*4; @@ -3453,8 +3423,7 @@ char * desc; for (i=0;inRadioGroups;i++,atm++) { *atm= (CARD32)xkb->names->radio_groups[i]; if (client->swapped) { - register unsigned n; - swapl(atm,n); + swapl(atm); } } desc+= rep->nRadioGroups*4; @@ -3515,8 +3484,7 @@ register int i; for (i=0;iapproxNdx= XkbOutlineIndex(shape,shape->approx); else shapeWire->approxNdx= XkbNoShape; 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++) { @@ -4063,9 +4028,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]; @@ -4108,10 +4072,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: @@ -4120,8 +4083,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: @@ -4130,10 +4092,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); @@ -4171,8 +4132,7 @@ xkbOverlayWireDesc * olWire; olWire->name= ol->name; olWire->nRows= ol->num_rows; 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++) { @@ -4250,13 +4210,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) { @@ -4271,9 +4230,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) { @@ -4287,8 +4245,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]; @@ -4390,18 +4347,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) @@ -4453,8 +4409,7 @@ CARD16 len; wire= *wire_inout; len= (CARD16 *)wire; if (client->swapped) { - register int n; - swaps(&len, n); + swaps(&len); } next = wire + XkbPaddedSize(len + 2); /* Check we're still within the size of the request */ @@ -4487,11 +4442,10 @@ Status status; any = dWire->any; wire= (char *)&dWire[1]; if (client->swapped) { - register int n; - swapl(&any.name, n); - swaps(&any.top, n); - swaps(&any.left, n); - swaps(&any.angle, n); + swapl(&any.name); + swaps(&any.top); + swaps(&any.left); + swaps(&any.angle); } CHK_ATOM_ONLY(dWire->any.name); doodad = XkbAddGeomDoodad(geom, section, any.name); @@ -4526,9 +4480,8 @@ Status status; } text = dWire->text; if (client->swapped) { - register int n; - swaps(&text.width, n); - swaps(&text.height, n); + swaps(&text.width); + swaps(&text.height); } doodad->text.width= text.width; doodad->text.height= text.height; @@ -4602,8 +4555,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); @@ -4655,13 +4607,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, @@ -4680,9 +4631,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) @@ -4777,9 +4727,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; @@ -5022,12 +4971,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 client->noClientException; @@ -5148,16 +5096,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) { @@ -5416,11 +5363,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)) @@ -5606,13 +5552,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); @@ -5624,8 +5569,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; @@ -5645,9 +5589,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); @@ -5802,14 +5745,16 @@ char * str; supported= rep.supported; 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); + + // FIXME: rep.type here is an Atom... this might go terribly wrong... + + swapl((int *)&rep.type); } WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); @@ -5871,12 +5816,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, @@ -5899,8 +5843,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); @@ -5911,9 +5854,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, @@ -6165,12 +6107,11 @@ xkbSetDebuggingFlagsReply rep; 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 client->noClientException; diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c index 6c0aa0761..c36653f2e 100644 --- a/nx-X11/programs/Xserver/xkb/xkbEvents.c +++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c @@ -67,10 +67,9 @@ CARD16 changed; pNKN->time = time; pNKN->changed = changed; if ( clients[i]->swapped ) { - register 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),(char *)pNKN); if (changed&XkbNKN_KeycodesMask) { @@ -87,8 +86,7 @@ CARD16 changed; event.u.mappingNotify.count= clients[i]->maxKC-clients[i]->minKC+1; event.u.u.sequenceNumber= clients[i]->sequence; if (clients[i]->swapped) { - int n; - swaps(&event.u.u.sequenceNumber,n); + swaps(&event.u.u.sequenceNumber); } WriteToClient(clients[i],SIZEOF(xEvent), (char *)&event); event.u.mappingNotify.request= MappingModifier; @@ -146,11 +144,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); } @@ -192,10 +189,9 @@ CARD16 changed; pMN->sequenceNumber = clients[i]->sequence; pMN->changed = changed; if ( clients[i]->swapped ) { - register 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),(char *)pMN); } @@ -315,12 +311,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); } @@ -364,11 +359,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); } @@ -447,13 +441,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); } @@ -494,11 +487,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); } @@ -542,12 +534,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); } @@ -590,12 +581,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); } @@ -636,9 +626,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); } @@ -696,13 +685,12 @@ CARD16 reason, supported = 0; continue; } 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/nx-X11/programs/Xserver/xkb/xkbSwap.c b/nx-X11/programs/Xserver/xkb/xkbSwap.c index c16209153..1aaff519e 100644 --- a/nx-X11/programs/Xserver/xkb/xkbSwap.c +++ b/nx-X11/programs/Xserver/xkb/xkbSwap.c @@ -48,32 +48,30 @@ 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; @@ -117,12 +115,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; @@ -141,128 +139,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); } @@ -270,105 +254,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); } @@ -376,160 +346,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); } -- cgit v1.2.3