Use C99 designated initializers in randr Replies

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Alan Coopersmith 2012-07-09 19:12:43 -07:00
parent a406bd0759
commit bd6f948c41
7 changed files with 203 additions and 158 deletions

View File

@ -900,11 +900,13 @@ ProcRRGetCrtcInfo(ClientPtr client)
mode = crtc->mode; mode = crtc->mode;
rep.type = X_Reply; rep = (xRRGetCrtcInfoReply) {
rep.status = RRSetConfigSuccess; .type = X_Reply,
rep.sequenceNumber = client->sequence; .status = RRSetConfigSuccess,
rep.length = 0; .sequenceNumber = client->sequence,
rep.timestamp = pScrPriv->lastSetTime.milliseconds; .length = 0,
.timestamp = pScrPriv->lastSetTime.milliseconds
};
if (pScrPriv->rrGetPanning && if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) && pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
(panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1))
@ -1171,11 +1173,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
sendReply: sendReply:
free(outputs); free(outputs);
rep.type = X_Reply; rep = (xRRSetCrtcConfigReply) {
rep.status = status; .type = X_Reply,
rep.length = 0; .status = status,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; .length = 0,
.newTimestamp = pScrPriv->lastSetTime.milliseconds
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
@ -1211,12 +1215,13 @@ ProcRRGetPanning(ClientPtr client)
if (!pScrPriv) if (!pScrPriv)
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
memset(&rep, 0, sizeof(rep)); rep = (xRRGetPanningReply) {
rep.type = X_Reply; .type = X_Reply,
rep.status = RRSetConfigSuccess; .status = RRSetConfigSuccess,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.length = 1; .length = 1,
rep.timestamp = pScrPriv->lastSetTime.milliseconds; .timestamp = pScrPriv->lastSetTime.milliseconds
};
if (pScrPriv->rrGetPanning && if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) { pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) {
@ -1310,11 +1315,13 @@ ProcRRSetPanning(ClientPtr client)
status = RRSetConfigSuccess; status = RRSetConfigSuccess;
sendReply: sendReply:
rep.type = X_Reply; rep = (xRRSetPanningReply) {
rep.status = status; .type = X_Reply,
rep.sequenceNumber = client->sequence; .status = status,
rep.length = 0; .sequenceNumber = client->sequence,
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; .length = 0,
.newTimestamp = pScrPriv->lastSetTime.milliseconds
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
@ -1339,10 +1346,12 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
if (!RRCrtcGammaGet(crtc)) if (!RRCrtcGammaGet(crtc))
return RRErrorBase + BadRRCrtc; return RRErrorBase + BadRRCrtc;
reply.type = X_Reply; reply = (xRRGetCrtcGammaSizeReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = 0; .sequenceNumber = client->sequence,
reply.size = crtc->gammaSize; .length = 0,
.size = crtc->gammaSize
};
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber); swaps(&reply.sequenceNumber);
swapl(&reply.length); swapl(&reply.length);
@ -1376,10 +1385,12 @@ ProcRRGetCrtcGamma(ClientPtr client)
return BadAlloc; return BadAlloc;
} }
reply.type = X_Reply; reply = (xRRGetCrtcGammaReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = bytes_to_int32(len); .sequenceNumber = client->sequence,
reply.size = crtc->gammaSize; .length = bytes_to_int32(len),
.size = crtc->gammaSize
};
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber); swaps(&reply.sequenceNumber);
swapl(&reply.length); swapl(&reply.length);

View File

@ -35,16 +35,17 @@ RRClientKnowsRates(ClientPtr pClient)
static int static int
ProcRRQueryVersion(ClientPtr client) ProcRRQueryVersion(ClientPtr client)
{ {
xRRQueryVersionReply rep = { 0 }; xRRQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
REQUEST(xRRQueryVersionReq); REQUEST(xRRQueryVersionReq);
rrClientPriv(client); rrClientPriv(client);
REQUEST_SIZE_MATCH(xRRQueryVersionReq); REQUEST_SIZE_MATCH(xRRQueryVersionReq);
pRRClient->major_version = stuff->majorVersion; pRRClient->major_version = stuff->majorVersion;
pRRClient->minor_version = stuff->minorVersion; pRRClient->minor_version = stuff->minorVersion;
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
if (version_compare(stuff->majorVersion, stuff->minorVersion, if (version_compare(stuff->majorVersion, stuff->minorVersion,
SERVER_RANDR_MAJOR_VERSION, SERVER_RANDR_MAJOR_VERSION,

View File

@ -282,7 +282,7 @@ int
ProcRRCreateMode(ClientPtr client) ProcRRCreateMode(ClientPtr client)
{ {
REQUEST(xRRCreateModeReq); REQUEST(xRRCreateModeReq);
xRRCreateModeReply rep = { 0 }; xRRCreateModeReply rep;
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
xRRModeInfo *modeInfo; xRRModeInfo *modeInfo;
@ -310,11 +310,12 @@ ProcRRCreateMode(ClientPtr client)
if (!mode) if (!mode)
return error; return error;
rep.type = X_Reply; rep = (xRRCreateModeReply) {
rep.pad0 = 0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.length = 0; .length = 0,
rep.mode = mode->mode.id; .mode = mode->mode.id
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);

View File

@ -425,22 +425,23 @@ ProcRRGetOutputInfo(ClientPtr client)
pScreen = output->pScreen; pScreen = output->pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.type = X_Reply; rep = (xRRGetOutputInfoReply) {
rep.status = RRSetConfigSuccess; .type = X_Reply,
rep.sequenceNumber = client->sequence; .status = RRSetConfigSuccess,
rep.length = bytes_to_int32(OutputInfoExtra); .sequenceNumber = client->sequence,
rep.timestamp = pScrPriv->lastSetTime.milliseconds; .length = bytes_to_int32(OutputInfoExtra),
rep.crtc = output->crtc ? output->crtc->id : None; .timestamp = pScrPriv->lastSetTime.milliseconds,
rep.mmWidth = output->mmWidth; .crtc = output->crtc ? output->crtc->id : None,
rep.mmHeight = output->mmHeight; .mmWidth = output->mmWidth,
rep.connection = output->connection; .mmHeight = output->mmHeight,
rep.subpixelOrder = output->subpixelOrder; .connection = output->connection,
rep.nCrtcs = output->numCrtcs; .subpixelOrder = output->subpixelOrder,
rep.nModes = output->numModes + output->numUserModes; .nCrtcs = output->numCrtcs,
rep.nPreferred = output->numPreferred; .nModes = output->numModes + output->numUserModes,
rep.nClones = output->numClones; .nPreferred = output->numPreferred,
rep.nameLength = output->nameLength; .nClones = output->numClones,
.nameLength = output->nameLength
};
extraLen = ((output->numCrtcs + extraLen = ((output->numCrtcs +
output->numModes + output->numUserModes + output->numModes + output->numUserModes +
output->numClones + bytes_to_int32(rep.nameLength)) << 2); output->numClones + bytes_to_int32(rep.nameLength)) << 2);
@ -573,10 +574,11 @@ ProcRRGetOutputPrimary(ClientPtr client)
if (pScrPriv) if (pScrPriv)
primary = pScrPriv->primaryOutput; primary = pScrPriv->primaryOutput;
memset(&rep, 0, sizeof(rep)); rep = (xRRGetOutputPrimaryReply) {
rep.type = X_Reply; .type = X_Reply,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.output = primary ? primary->id : None; .output = primary ? primary->id : None
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);

View File

@ -394,10 +394,12 @@ ProcRRListOutputProperties(ClientPtr client)
if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom)))) if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom))))
return BadAlloc; return BadAlloc;
rep.type = X_Reply; rep = (xRRListOutputPropertiesReply) {
rep.length = bytes_to_int32(numProps * sizeof(Atom)); .type = X_Reply,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.nAtoms = numProps; .length = bytes_to_int32(numProps * sizeof(Atom)),
.nAtoms = numProps
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -440,12 +442,16 @@ ProcRRQueryOutputProperty(ClientPtr client)
if (!extra) if (!extra)
return BadAlloc; return BadAlloc;
} }
rep.type = X_Reply;
rep.length = prop->num_valid; rep = (xRRQueryOutputPropertyReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.pending = prop->is_pending; .sequenceNumber = client->sequence,
rep.range = prop->range; .length = prop->num_valid,
rep.immutable = prop->immutable; .pending = prop->is_pending,
.range = prop->range,
.immutable = prop->immutable
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -596,8 +602,10 @@ ProcRRGetOutputProperty(ClientPtr client)
if (prop->propertyName == stuff->property) if (prop->propertyName == stuff->property)
break; break;
reply.type = X_Reply; reply = (xRRGetOutputPropertyReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
.sequenceNumber = client->sequence
};
if (!prop) { if (!prop) {
reply.nItems = 0; reply.nItems = 0;
reply.length = 0; reply.length = 0;

View File

@ -203,10 +203,12 @@ ProcRRGetScreenSizeRange(ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.type = X_Reply; rep = (xRRGetScreenSizeRangeReply) {
rep.pad = 0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .pad = 0,
rep.length = 0; .sequenceNumber = client->sequence,
.length = 0
};
if (pScrPriv) { if (pScrPriv) {
if (!RRGetInfo(pScreen, FALSE)) if (!RRGetInfo(pScreen, FALSE))
@ -481,7 +483,6 @@ rrGetScreenResources(ClientPtr client, Bool query)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.pad = 0;
if (query && pScrPriv) if (query && pScrPriv)
if (!RRGetInfo(pScreen, query)) if (!RRGetInfo(pScreen, query))
@ -491,15 +492,17 @@ rrGetScreenResources(ClientPtr client, Bool query)
return rrGetMultiScreenResources(client, query, pScreen); return rrGetMultiScreenResources(client, query, pScreen);
if (!pScrPriv) { if (!pScrPriv) {
rep.type = X_Reply; rep = (xRRGetScreenResourcesReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.timestamp = currentTime.milliseconds; .length = 0,
rep.configTimestamp = currentTime.milliseconds; .timestamp = currentTime.milliseconds,
rep.nCrtcs = 0; .configTimestamp = currentTime.milliseconds,
rep.nOutputs = 0; .nCrtcs = 0,
rep.nModes = 0; .nOutputs = 0,
rep.nbytesNames = 0; .nModes = 0,
.nbytesNames = 0
};
extra = NULL; extra = NULL;
extraLen = 0; extraLen = 0;
} }
@ -511,15 +514,18 @@ rrGetScreenResources(ClientPtr client, Bool query)
if (!modes) if (!modes)
return BadAlloc; return BadAlloc;
rep.type = X_Reply; rep = (xRRGetScreenResourcesReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.timestamp = pScrPriv->lastSetTime.milliseconds; .length = 0,
rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; .timestamp = pScrPriv->lastSetTime.milliseconds,
rep.nCrtcs = pScrPriv->numCrtcs; .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
rep.nOutputs = pScrPriv->numOutputs; .nCrtcs = pScrPriv->numCrtcs,
rep.nModes = num_modes; .nOutputs = pScrPriv->numOutputs,
rep.nbytesNames = 0; .nModes = num_modes,
.nbytesNames = 0
};
for (i = 0; i < num_modes; i++) for (i = 0; i < num_modes; i++)
rep.nbytesNames += modes[i]->mode.nameLength; rep.nbytesNames += modes[i]->mode.nameLength;
@ -744,7 +750,6 @@ ProcRRGetScreenInfo(ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
rep.pad = 0;
if (pScrPriv) if (pScrPriv)
if (!RRGetInfo(pScreen, TRUE)) if (!RRGetInfo(pScreen, TRUE))
@ -753,18 +758,20 @@ ProcRRGetScreenInfo(ClientPtr client)
output = RRFirstOutput(pScreen); output = RRFirstOutput(pScreen);
if (!pScrPriv || !output) { if (!pScrPriv || !output) {
rep.type = X_Reply; rep = (xRRGetScreenInfoReply) {
rep.setOfRotations = RR_Rotate_0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .setOfRotations = RR_Rotate_0,
rep.length = 0; .sequenceNumber = client->sequence,
rep.root = pWin->drawable.pScreen->root->drawable.id; .length = 0,
rep.timestamp = currentTime.milliseconds; .root = pWin->drawable.pScreen->root->drawable.id,
rep.configTimestamp = currentTime.milliseconds; .timestamp = currentTime.milliseconds,
rep.nSizes = 0; .configTimestamp = currentTime.milliseconds,
rep.sizeID = 0; .nSizes = 0,
rep.rotation = RR_Rotate_0; .sizeID = 0,
rep.rate = 0; .rotation = RR_Rotate_0,
rep.nrateEnts = 0; .rate = 0,
.nrateEnts = 0
};
extra = 0; extra = 0;
extraLen = 0; extraLen = 0;
} }
@ -781,18 +788,20 @@ ProcRRGetScreenInfo(ClientPtr client)
if (!pData) if (!pData)
return BadAlloc; return BadAlloc;
rep.type = X_Reply; rep = (xRRGetScreenInfoReply) {
rep.setOfRotations = output->crtc->rotations; .type = X_Reply,
rep.sequenceNumber = client->sequence; .setOfRotations = output->crtc->rotations,
rep.length = 0; .sequenceNumber = client->sequence,
rep.root = pWin->drawable.pScreen->root->drawable.id; .length = 0,
rep.timestamp = pScrPriv->lastSetTime.milliseconds; .root = pWin->drawable.pScreen->root->drawable.id,
rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; .timestamp = pScrPriv->lastSetTime.milliseconds,
rep.rotation = output->crtc->rotation; .configTimestamp = pScrPriv->lastConfigTime.milliseconds,
rep.nSizes = pData->nsize; .rotation = output->crtc->rotation,
rep.nrateEnts = pData->nrefresh + pData->nsize; .nSizes = pData->nsize,
rep.sizeID = pData->size; .nrateEnts = pData->nrefresh + pData->nsize,
rep.rate = pData->refresh; .sizeID = pData->size,
.rate = pData->refresh
};
extraLen = rep.nSizes * sizeof(xScreenSizes); extraLen = rep.nSizes * sizeof(xScreenSizes);
if (has_rate) if (has_rate)
@ -1078,14 +1087,17 @@ ProcRRSetScreenConfig(ClientPtr client)
free(pData); free(pData);
rep.type = X_Reply; rep = (xRRSetScreenConfigReply) {
rep.status = status; .type = X_Reply,
rep.length = 0; .status = status,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
.length = 0,
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; .newTimestamp = pScrPriv->lastSetTime.milliseconds,
rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; .newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds,
rep.root = pDraw->pScreen->root->drawable.id; .root = pDraw->pScreen->root->drawable.id,
/* .subpixelOrder = ?? */
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);

View File

@ -89,14 +89,15 @@ static int SProcRRXineramaDispatch(ClientPtr client);
int int
ProcRRXineramaQueryVersion(ClientPtr client) ProcRRXineramaQueryVersion(ClientPtr client)
{ {
xPanoramiXQueryVersionReply rep; xPanoramiXQueryVersionReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION,
.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION
};
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -130,11 +131,13 @@ ProcRRXineramaGetState(ClientPtr client)
active = TRUE; active = TRUE;
} }
rep.type = X_Reply; rep = (xPanoramiXGetStateReply) {
rep.length = 0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .state = active,
rep.state = active; .sequenceNumber = client->sequence,
rep.window = stuff->window; .length = 0,
.window = stuff->window
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -184,11 +187,13 @@ ProcRRXineramaGetScreenCount(ClientPtr client)
if (rc != Success) if (rc != Success)
return rc; return rc;
rep.type = X_Reply; rep = (xPanoramiXGetScreenCountReply) {
rep.length = 0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen),
rep.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen); .sequenceNumber = client->sequence,
rep.window = stuff->window; .length = 0,
.window = stuff->window
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -215,13 +220,15 @@ ProcRRXineramaGetScreenSize(ClientPtr client)
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pRoot = pScreen->root; pRoot = pScreen->root;
rep.type = X_Reply; rep = (xPanoramiXGetScreenSizeReply) {
rep.length = 0; .type = X_Reply,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.width = pRoot->drawable.width; .length = 0,
rep.height = pRoot->drawable.height; .width = pRoot->drawable.width,
rep.window = stuff->window; .height = pRoot->drawable.height,
rep.screen = stuff->screen; .window = stuff->window,
.screen = stuff->screen
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -241,11 +248,12 @@ ProcRRXineramaIsActive(ClientPtr client)
REQUEST_SIZE_MATCH(xXineramaIsActiveReq); REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
memset(&rep, 0, sizeof(xXineramaIsActiveReply)); rep = (xXineramaIsActiveReply) {
rep.type = X_Reply; .type = X_Reply,
rep.length = 0; .length = 0,
rep.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
rep.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]); .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN])
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -308,10 +316,12 @@ ProcRRXineramaQueryScreens(ClientPtr client)
n = RRXineramaScreenCount(pScreen); n = RRXineramaScreenCount(pScreen);
} }
rep.type = X_Reply; rep = (xXineramaQueryScreensReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.number = n; .sequenceNumber = client->sequence,
rep.length = bytes_to_int32(n * sz_XineramaScreenInfo); .length = bytes_to_int32(n * sz_XineramaScreenInfo),
.number = n
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);