From f26b31d8f768567d45c12e735b3a425ca2fbe248 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 3 Dec 2025 15:00:49 +0100 Subject: [PATCH] randr: consistenly name reply structs "reply" instead of "rep" Preparation for future use of generic reply assembly macros. Signed-off-by: Enrico Weigelt, metux IT consult --- randr/rrcrtc.c | 146 ++++++++++++++++++------------------- randr/rrdispatch.c | 12 +-- randr/rrlease.c | 4 +- randr/rrmode.c | 6 +- randr/rrmonitor.c | 10 +-- randr/rroutput.c | 50 ++++++------- randr/rrproperty.c | 40 +++++----- randr/rrprovider.c | 42 +++++------ randr/rrproviderproperty.c | 10 +-- randr/rrscreen.c | 114 ++++++++++++++--------------- randr/rrxinerama.c | 44 +++++------ 11 files changed, 239 insertions(+), 239 deletions(-) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 3a3ae6970..f4b1e65a8 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1168,7 +1168,7 @@ ProcRRGetCrtcInfo(ClientPtr client) RRModePtr mode = crtc->mode; - xRRGetCrtcInfoReply rep = { + xRRGetCrtcInfoReply reply = { .status = RRSetConfigSuccess, .timestamp = pScrPriv->lastSetTime.milliseconds, .rotation = crtc->rotation, @@ -1178,34 +1178,34 @@ ProcRRGetCrtcInfo(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; if (leased) { - rep.rotation = RR_Rotate_0; - rep.rotations = RR_Rotate_0; + reply.rotation = RR_Rotate_0; + reply.rotations = RR_Rotate_0; } else { BoxRec panned_area; if (pScrPriv->rrGetPanning && pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) && (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) { - rep.x = panned_area.x1; - rep.y = panned_area.y1; - rep.width = panned_area.x2 - panned_area.x1; - rep.height = panned_area.y2 - panned_area.y1; + reply.x = panned_area.x1; + reply.y = panned_area.y1; + reply.width = panned_area.x2 - panned_area.x1; + reply.height = panned_area.y2 - panned_area.y1; } else { int width, height; RRCrtcGetScanoutSize(crtc, &width, &height); - rep.x = crtc->x; - rep.y = crtc->y; - rep.width = width; - rep.height = height; + reply.x = crtc->x; + reply.y = crtc->y; + reply.width = width; + reply.height = height; } - rep.mode = mode ? mode->mode.id : 0; - rep.nOutput = crtc->numOutputs; + reply.mode = mode ? mode->mode.id : 0; + reply.nOutput = crtc->numOutputs; for (int i = 0; i < pScrPriv->numOutputs; i++) { if (!RROutputIsLeased(pScrPriv->outputs[i])) { for (int j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) if (pScrPriv->outputs[i]->crtcs[j] == crtc) - rep.nPossibleOutput++; + reply.nPossibleOutput++; } } @@ -1224,22 +1224,22 @@ ProcRRGetCrtcInfo(ClientPtr client) } if (pScrPriv->rrCrtcGet) - pScrPriv->rrCrtcGet(pScreen, crtc, &rep); + pScrPriv->rrCrtcGet(pScreen, crtc, &reply); if (client->swapped) { - 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); + swapl(&reply.timestamp); + swaps(&reply.x); + swaps(&reply.y); + swaps(&reply.width); + swaps(&reply.height); + swapl(&reply.mode); + swaps(&reply.rotation); + swaps(&reply.rotations); + swaps(&reply.nOutput); + swaps(&reply.nPossibleOutput); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -1449,16 +1449,16 @@ ProcRRSetCrtcConfig(ClientPtr client) sendReply: free(outputs); - xRRSetCrtcConfigReply rep = { + xRRSetCrtcConfigReply reply = { .status = status, .newTimestamp = pScrPriv->lastSetTime.milliseconds }; if (client->swapped) { - swapl(&rep.newTimestamp); + swapl(&reply.newTimestamp); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -1488,43 +1488,43 @@ ProcRRGetPanning(ClientPtr client) if (!pScrPriv) return RRErrorBase + BadRRCrtc; - xRRGetPanningReply rep = { + xRRGetPanningReply reply = { .status = RRSetConfigSuccess, .timestamp = pScrPriv->lastSetTime.milliseconds }; if (pScrPriv->rrGetPanning && pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) { - rep.left = total.x1; - rep.top = total.y1; - rep.width = total.x2 - total.x1; - rep.height = total.y2 - total.y1; - rep.track_left = tracking.x1; - rep.track_top = tracking.y1; - rep.track_width = tracking.x2 - tracking.x1; - rep.track_height = tracking.y2 - tracking.y1; - rep.border_left = border[0]; - rep.border_top = border[1]; - rep.border_right = border[2]; - rep.border_bottom = border[3]; + reply.left = total.x1; + reply.top = total.y1; + reply.width = total.x2 - total.x1; + reply.height = total.y2 - total.y1; + reply.track_left = tracking.x1; + reply.track_top = tracking.y1; + reply.track_width = tracking.x2 - tracking.x1; + reply.track_height = tracking.y2 - tracking.y1; + reply.border_left = border[0]; + reply.border_top = border[1]; + reply.border_right = border[2]; + reply.border_bottom = border[3]; } if (client->swapped) { - swapl(&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); + swapl(&reply.timestamp); + swaps(&reply.left); + swaps(&reply.top); + swaps(&reply.width); + swaps(&reply.height); + swaps(&reply.track_left); + swaps(&reply.track_top); + swaps(&reply.track_width); + swaps(&reply.track_height); + swaps(&reply.border_left); + swaps(&reply.border_top); + swaps(&reply.border_right); + swaps(&reply.border_bottom); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -1602,15 +1602,15 @@ ProcRRSetPanning(ClientPtr client) status = RRSetConfigSuccess; sendReply: ; - xRRSetPanningReply rep = { + xRRSetPanningReply reply = { .status = status, .newTimestamp = pScrPriv->lastSetTime.milliseconds }; if (client->swapped) { - swapl(&rep.newTimestamp); + swapl(&reply.newTimestamp); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -1779,37 +1779,37 @@ ProcRRGetCrtcTransform(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - xRRGetCrtcTransformReply rep = { + xRRGetCrtcTransformReply reply = { .hasTransforms = crtc->transforms, }; - xRenderTransform_from_PictTransform(&rep.pendingTransform, &pending->transform); - xRenderTransform_from_PictTransform(&rep.currentTransform, ¤t->transform); + xRenderTransform_from_PictTransform(&reply.pendingTransform, &pending->transform); + xRenderTransform_from_PictTransform(&reply.currentTransform, ¤t->transform); if (pending->filter) { - rep.pendingNbytesFilter = strlen(pending->filter->name); - rep.pendingNparamsFilter = pending->nparams; + reply.pendingNbytesFilter = strlen(pending->filter->name); + reply.pendingNparamsFilter = pending->nparams; x_rpcbuf_write_string_pad(&rpcbuf, pending->filter->name); x_rpcbuf_write_CARD32s(&rpcbuf, (CARD32*)pending->params, pending->nparams); } if (current->filter) { - rep.currentNbytesFilter = strlen(current->filter->name); - rep.currentNparamsFilter = current->nparams; + reply.currentNbytesFilter = strlen(current->filter->name); + reply.currentNparamsFilter = current->nparams; x_rpcbuf_write_string_pad(&rpcbuf, current->filter->name); x_rpcbuf_write_CARD32s(&rpcbuf, (CARD32*)current->params, current->nparams); } if (client->swapped) { - SwapLongs((CARD32 *) &rep.pendingTransform, bytes_to_int32(sizeof(xRenderTransform))); - SwapLongs((CARD32 *) &rep.currentTransform, bytes_to_int32(sizeof(xRenderTransform))); - swaps(&rep.pendingNbytesFilter); - swaps(&rep.currentNbytesFilter); - swaps(&rep.pendingNparamsFilter); - swaps(&rep.currentNparamsFilter); + SwapLongs((CARD32 *) &reply.pendingTransform, bytes_to_int32(sizeof(xRenderTransform))); + SwapLongs((CARD32 *) &reply.currentTransform, bytes_to_int32(sizeof(xRenderTransform))); + swaps(&reply.pendingNbytesFilter); + swaps(&reply.currentNbytesFilter); + swaps(&reply.pendingNparamsFilter); + swaps(&reply.currentNparamsFilter); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } static Bool diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index 09433f580..7f312cba5 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -54,7 +54,7 @@ ProcRRQueryVersion(ClientPtr client) pRRClient->major_version = stuff->majorVersion; pRRClient->minor_version = stuff->minorVersion; - xRRQueryVersionReply rep = { + xRRQueryVersionReply reply = { .majorVersion = SERVER_RANDR_MAJOR_VERSION, .minorVersion = SERVER_RANDR_MINOR_VERSION }; @@ -62,16 +62,16 @@ ProcRRQueryVersion(ClientPtr client) if (version_compare(stuff->majorVersion, stuff->minorVersion, SERVER_RANDR_MAJOR_VERSION, SERVER_RANDR_MINOR_VERSION) < 0) { - rep.majorVersion = stuff->majorVersion; - rep.minorVersion = stuff->minorVersion; + reply.majorVersion = stuff->majorVersion; + reply.minorVersion = stuff->minorVersion; } if (client->swapped) { - swapl(&rep.majorVersion); - swapl(&rep.minorVersion); + swapl(&reply.majorVersion); + swapl(&reply.minorVersion); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int diff --git a/randr/rrlease.c b/randr/rrlease.c index f4ed6a4dc..b015bd794 100644 --- a/randr/rrlease.c +++ b/randr/rrlease.c @@ -342,11 +342,11 @@ leaseReturned: RRLeaseChangeState(lease, RRLeaseCreating, RRLeaseRunning); - xRRCreateLeaseReply rep = { + xRRCreateLeaseReply reply = { .nfd = 1, }; - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); bail_lease: free(lease); diff --git a/randr/rrmode.c b/randr/rrmode.c index 43c663db7..9ef2d9184 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -333,7 +333,7 @@ ProcRRCreateMode(ClientPtr client) if (!mode) return error; - xRRCreateModeReply rep = { + xRRCreateModeReply reply = { .mode = mode->mode.id }; @@ -341,10 +341,10 @@ ProcRRCreateMode(ClientPtr client) RRModeDestroy(mode); if (client->swapped) { - swapl(&rep.mode); + swapl(&reply.mode); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int diff --git a/randr/rrmonitor.c b/randr/rrmonitor.c index 711cc4db3..80c099af7 100644 --- a/randr/rrmonitor.c +++ b/randr/rrmonitor.c @@ -641,19 +641,19 @@ ProcRRGetMonitors(ClientPtr client) } RRMonitorFreeList(monitors, nmonitors); - xRRGetMonitorsReply rep = { + xRRGetMonitorsReply reply = { .timestamp = RRMonitorTimestamp(screen), .nmonitors = nmonitors, .noutputs = noutputs, }; if (client->swapped) { - swapl(&rep.timestamp); - swapl(&rep.nmonitors); - swapl(&rep.noutputs); + swapl(&reply.timestamp); + swapl(&reply.nmonitors); + swapl(&reply.noutputs); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int diff --git a/randr/rroutput.c b/randr/rroutput.c index 1c4000fc5..d0cbaddb2 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -466,7 +466,7 @@ ProcRRGetOutputInfo(ClientPtr client) pScreen = output->pScreen; pScrPriv = rrGetScrPriv(pScreen); - xRRGetOutputInfoReply rep = { + xRRGetOutputInfoReply reply = { .status = RRSetConfigSuccess, .timestamp = pScrPriv->lastSetTime.milliseconds, .nameLength = output->nameLength, @@ -475,18 +475,18 @@ ProcRRGetOutputInfo(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; if (leased) { - rep.connection = RR_Disconnected; - rep.subpixelOrder = SubPixelUnknown; + reply.connection = RR_Disconnected; + reply.subpixelOrder = SubPixelUnknown; } else { - rep.crtc = output->crtc ? output->crtc->id : None; - rep.mmWidth = output->mmWidth; - rep.mmHeight = output->mmHeight; - rep.connection = output->nonDesktop ? RR_Disconnected : output->connection; - rep.subpixelOrder = output->subpixelOrder; - rep.nCrtcs = output->numCrtcs; - rep.nModes = output->numModes + output->numUserModes; - rep.nPreferred = output->numPreferred; - rep.nClones = output->numClones; + reply.crtc = output->crtc ? output->crtc->id : None; + reply.mmWidth = output->mmWidth; + reply.mmHeight = output->mmHeight; + reply.connection = output->nonDesktop ? RR_Disconnected : output->connection; + reply.subpixelOrder = output->subpixelOrder; + reply.nCrtcs = output->numCrtcs; + reply.nModes = output->numModes + output->numUserModes; + reply.nPreferred = output->numPreferred; + reply.nClones = output->numClones; for (i = 0; i < output->numCrtcs; i++) x_rpcbuf_write_CARD32(&rpcbuf, output->crtcs[i]->id); @@ -505,18 +505,18 @@ ProcRRGetOutputInfo(ClientPtr client) x_rpcbuf_write_string_pad(&rpcbuf, output->name); /* indeed 0-terminated */ if (client->swapped) { - swapl(&rep.timestamp); - swapl(&rep.crtc); - swapl(&rep.mmWidth); - swapl(&rep.mmHeight); - swaps(&rep.nCrtcs); - swaps(&rep.nModes); - swaps(&rep.nPreferred); - swaps(&rep.nClones); - swaps(&rep.nameLength); + swapl(&reply.timestamp); + swapl(&reply.crtc); + swapl(&reply.mmWidth); + swapl(&reply.mmHeight); + swaps(&reply.nCrtcs); + swaps(&reply.nModes); + swaps(&reply.nPreferred); + swaps(&reply.nClones); + swaps(&reply.nameLength); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } static void @@ -617,13 +617,13 @@ ProcRRGetOutputPrimary(ClientPtr client) if (pScrPriv) primary = pScrPriv->primaryOutput; - xRRGetOutputPrimaryReply rep = { + xRRGetOutputPrimaryReply reply = { .output = primary ? primary->id : None }; if (client->swapped) { - swapl(&rep.output); + swapl(&reply.output); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } diff --git a/randr/rrproperty.c b/randr/rrproperty.c index febf05203..e1392ecfa 100644 --- a/randr/rrproperty.c +++ b/randr/rrproperty.c @@ -434,15 +434,15 @@ ProcRRListOutputProperties(ClientPtr client) x_rpcbuf_write_CARD32(&rpcbuf, prop->propertyName); } - xRRListOutputPropertiesReply rep = { + xRRListOutputPropertiesReply reply = { .nAtoms = numProps }; if (client->swapped) { - swaps(&rep.nAtoms); + swaps(&reply.nAtoms); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -468,13 +468,13 @@ ProcRRQueryOutputProperty(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; x_rpcbuf_write_CARD32s(&rpcbuf, (CARD32*)prop->valid_values, prop->num_valid); - xRRQueryOutputPropertyReply rep = { + xRRQueryOutputPropertyReply reply = { .pending = prop->is_pending, .range = prop->range, .immutable = prop->immutable }; - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -660,7 +660,7 @@ ProcRRGetOutputProperty(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - xRRGetOutputPropertyReply rep = { 0 }; + xRRGetOutputPropertyReply reply = { 0 }; if (!prop) goto sendout; @@ -677,9 +677,9 @@ ProcRRGetOutputProperty(ClientPtr client) if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType)) ) { - rep.bytesAfter = prop_value->size; - rep.format = prop_value->format; - rep.propertyType = prop_value->type; + reply.bytesAfter = prop_value->size; + reply.format = prop_value->format; + reply.propertyType = prop_value->type; goto sendout; } @@ -699,13 +699,13 @@ ProcRRGetOutputProperty(ClientPtr client) size_t len = min(n - ind, 4 * stuff->longLength); - rep.bytesAfter = n - (ind + len); - rep.format = prop_value->format; + reply.bytesAfter = n - (ind + len); + reply.format = prop_value->format; if (prop_value->format) - rep.nItems = len / (prop_value->format / 8); - rep.propertyType = prop_value->type; + reply.nItems = len / (prop_value->format / 8); + reply.propertyType = prop_value->type; - if (stuff->delete && (rep.bytesAfter == 0)) { + if (stuff->delete && (reply.bytesAfter == 0)) { xRROutputPropertyNotifyEvent event = { .type = RREventBase + RRNotify, .subCode = RRNotify_OutputProperty, @@ -719,7 +719,7 @@ ProcRRGetOutputProperty(ClientPtr client) if (len) { const char *src = (char*) prop_value->data + ind; - switch (rep.format) { + switch (reply.format) { case 32: x_rpcbuf_write_CARD32s(&rpcbuf, (CARD32*)src, len / sizeof(CARD32)); break; @@ -737,15 +737,15 @@ sendout: return BadAlloc; if (client->swapped) { - swapl(&rep.propertyType); - swapl(&rep.bytesAfter); - swapl(&rep.nItems); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); } - if (prop && stuff->delete && (rep.bytesAfter == 0)) { /* delete the Property */ + if (prop && stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ *prev = prop->next; RRDestroyOutputProperty(prop); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } diff --git a/randr/rrprovider.c b/randr/rrprovider.c index a4dc979b2..9e377911f 100644 --- a/randr/rrprovider.c +++ b/randr/rrprovider.c @@ -92,16 +92,16 @@ ProcRRGetProviders (ClientPtr client) ADD_PROVIDER(iter); } - xRRGetProvidersReply rep = { + xRRGetProvidersReply reply = { .timestamp = pScrPriv->lastSetTime.milliseconds, .nProviders = count_providers, }; if (client->swapped) { - swapl(&rep.timestamp); - swaps(&rep.nProviders); + swapl(&reply.timestamp); + swaps(&reply.nProviders); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -133,7 +133,7 @@ ProcRRGetProviderInfo (ClientPtr client) pScreen = provider->pScreen; pScrPriv = rrGetScrPriv(pScreen); - xRRGetProviderInfoReply rep = { + xRRGetProviderInfoReply reply = { .status = RRSetConfigSuccess, .capabilities = provider->capabilities, .nameLength = provider->nameLength, @@ -144,21 +144,21 @@ ProcRRGetProviderInfo (ClientPtr client) /* count associated providers */ if (provider->offload_sink) - rep.nAssociatedProviders++; + reply.nAssociatedProviders++; if (provider->output_source && provider->output_source != provider->offload_sink) - rep.nAssociatedProviders++; + reply.nAssociatedProviders++; xorg_list_for_each_entry(provscreen, &pScreen->secondary_list, secondary_head) { if (provscreen->is_output_secondary || provscreen->is_offload_secondary) - rep.nAssociatedProviders++; + reply.nAssociatedProviders++; } - rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + - (rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength)); + reply.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + + (reply.nAssociatedProviders * 2) + bytes_to_int32(reply.nameLength)); x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - extraLen = rep.length << 2; + extraLen = reply.length << 2; if (extraLen) { extra = x_rpcbuf_reserve(&rpcbuf, extraLen); if (!extra) @@ -168,10 +168,10 @@ ProcRRGetProviderInfo (ClientPtr client) extra = NULL; crtcs = (RRCrtc *)extra; - outputs = (RROutput *)(crtcs + rep.nCrtcs); - providers = (RRProvider *)(outputs + rep.nOutputs); - prov_cap = (unsigned int *)(providers + rep.nAssociatedProviders); - name = (char *)(prov_cap + rep.nAssociatedProviders); + outputs = (RROutput *)(crtcs + reply.nCrtcs); + providers = (RRProvider *)(outputs + reply.nOutputs); + prov_cap = (unsigned int *)(providers + reply.nAssociatedProviders); + name = (char *)(prov_cap + reply.nAssociatedProviders); for (i = 0; i < pScrPriv->numCrtcs; i++) { crtcs[i] = pScrPriv->crtcs[i]->id; @@ -221,15 +221,15 @@ ProcRRGetProviderInfo (ClientPtr client) i++; } - memcpy(name, provider->name, rep.nameLength); + memcpy(name, provider->name, reply.nameLength); if (client->swapped) { - swapl(&rep.capabilities); - swaps(&rep.nCrtcs); - swaps(&rep.nOutputs); - swaps(&rep.nameLength); + swapl(&reply.capabilities); + swaps(&reply.nCrtcs); + swaps(&reply.nOutputs); + swaps(&reply.nameLength); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } static void diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c index 8af811a8d..d8ecc57ea 100644 --- a/randr/rrproviderproperty.c +++ b/randr/rrproviderproperty.c @@ -359,14 +359,14 @@ ProcRRListProviderProperties(ClientPtr client) numProps++; } - xRRListProviderPropertiesReply rep = { + xRRListProviderPropertiesReply reply = { .nAtoms = numProps }; if (client->swapped) - swaps(&rep.nAtoms); + swaps(&reply.nAtoms); - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -392,13 +392,13 @@ ProcRRQueryProviderProperty(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; x_rpcbuf_write_INT32s(&rpcbuf, prop->valid_values, prop->num_valid); - xRRQueryProviderPropertyReply rep = { + xRRQueryProviderPropertyReply reply = { .pending = prop->is_pending, .range = prop->range, .immutable = prop->immutable }; - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int diff --git a/randr/rrscreen.c b/randr/rrscreen.c index 168e4c6bf..c120dcc1c 100644 --- a/randr/rrscreen.c +++ b/randr/rrscreen.c @@ -209,27 +209,27 @@ ProcRRGetScreenSizeRange(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); - xRRGetScreenSizeRangeReply rep = { 0 }; + xRRGetScreenSizeRangeReply reply = { 0 }; if (pScrPriv) { if (!RRGetInfo(pScreen, FALSE)) return BadAlloc; - rep.minWidth = pScrPriv->minWidth; - rep.minHeight = pScrPriv->minHeight; - rep.maxWidth = pScrPriv->maxWidth; - rep.maxHeight = pScrPriv->maxHeight; + reply.minWidth = pScrPriv->minWidth; + reply.minHeight = pScrPriv->minHeight; + reply.maxWidth = pScrPriv->maxWidth; + reply.maxHeight = pScrPriv->maxHeight; } else { - rep.maxWidth = rep.minWidth = pScreen->width; - rep.maxHeight = rep.minHeight = pScreen->height; + reply.maxWidth = reply.minWidth = pScreen->width; + reply.maxHeight = reply.minHeight = pScreen->height; } if (client->swapped) { - swaps(&rep.minWidth); - swaps(&rep.minHeight); - swaps(&rep.maxWidth); - swaps(&rep.maxHeight); + swaps(&reply.minWidth); + swaps(&reply.minHeight); + swaps(&reply.maxWidth); + swaps(&reply.maxHeight); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -412,7 +412,7 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) pScrPriv = rrGetScrPriv(pScreen); - xRRGetScreenResourcesReply rep = { + xRRGetScreenResourcesReply reply = { .timestamp = pScrPriv->lastSetTime.milliseconds, .configTimestamp = pScrPriv->lastConfigTime.milliseconds, .nCrtcs = total_crtcs, @@ -421,13 +421,13 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) .nbytesNames = total_name_len }; - rep.length = (total_crtcs + total_outputs + + reply.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) + bytes_to_int32(total_name_len)); x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - extraLen = rep.length << 2; + extraLen = reply.length << 2; if (extraLen) { extra = x_rpcbuf_reserve(&rpcbuf, extraLen); if (!extra) { @@ -466,18 +466,18 @@ rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) update_arrays(iter, pScrPriv, primary_crtc, has_primary); } - assert(bytes_to_int32((char *) names - (char *) extra) == rep.length); + assert(bytes_to_int32((char *) names - (char *) extra) == reply.length); if (client->swapped) { - swapl(&rep.timestamp); - swapl(&rep.configTimestamp); - swaps(&rep.nCrtcs); - swaps(&rep.nOutputs); - swaps(&rep.nModes); - swaps(&rep.nbytesNames); + swapl(&reply.timestamp); + swapl(&reply.configTimestamp); + swaps(&reply.nCrtcs); + swaps(&reply.nOutputs); + swaps(&reply.nModes); + swaps(&reply.nbytesNames); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } static int @@ -489,7 +489,7 @@ rrGetScreenResources(ClientPtr client, Bool query) if (client->swapped) swapl(&stuff->window); - xRRGetScreenResourcesReply rep; + xRRGetScreenResourcesReply reply; WindowPtr pWin; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; @@ -514,7 +514,7 @@ rrGetScreenResources(ClientPtr client, Bool query) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; if (!pScrPriv) { - rep = (xRRGetScreenResourcesReply) { + reply = (xRRGetScreenResourcesReply) { .timestamp = currentTime.milliseconds, .configTimestamp = currentTime.milliseconds, }; @@ -527,7 +527,7 @@ rrGetScreenResources(ClientPtr client, Bool query) if (!modes) return BadAlloc; - rep = (xRRGetScreenResourcesReply) { + reply = (xRRGetScreenResourcesReply) { .timestamp = pScrPriv->lastSetTime.milliseconds, .configTimestamp = pScrPriv->lastConfigTime.milliseconds, .nCrtcs = pScrPriv->numCrtcs, @@ -536,14 +536,14 @@ rrGetScreenResources(ClientPtr client, Bool query) }; for (i = 0; i < num_modes; i++) - rep.nbytesNames += modes[i]->mode.nameLength; + reply.nbytesNames += modes[i]->mode.nameLength; - rep.length = (pScrPriv->numCrtcs + + reply.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + num_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) + - bytes_to_int32(rep.nbytesNames)); + bytes_to_int32(reply.nbytesNames)); - extraLen = rep.length << 2; + extraLen = reply.length << 2; if (!extraLen) goto finish; @@ -604,20 +604,20 @@ rrGetScreenResources(ClientPtr client, Bool query) memcpy(names, mode->name, mode->mode.nameLength); names += mode->mode.nameLength; } - assert(bytes_to_int32((char *) names - (char *) extra) == rep.length); + assert(bytes_to_int32((char *) names - (char *) extra) == reply.length); finish: free(modes); } if (client->swapped) { - swapl(&rep.timestamp); - swapl(&rep.configTimestamp); - swaps(&rep.nCrtcs); - swaps(&rep.nOutputs); - swaps(&rep.nModes); - swaps(&rep.nbytesNames); + swapl(&reply.timestamp); + swapl(&reply.configTimestamp); + swaps(&reply.nCrtcs); + swaps(&reply.nOutputs); + swaps(&reply.nModes); + swaps(&reply.nbytesNames); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -738,7 +738,7 @@ ProcRRGetScreenInfo(ClientPtr client) if (client->swapped) swapl(&stuff->window); - xRRGetScreenInfoReply rep; + xRRGetScreenInfoReply reply; WindowPtr pWin; int rc; ScreenPtr pScreen; @@ -763,7 +763,7 @@ ProcRRGetScreenInfo(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; if (!pScrPriv || !output) { - rep = (xRRGetScreenInfoReply) { + reply = (xRRGetScreenInfoReply) { .setOfRotations = RR_Rotate_0, .root = pWin->drawable.pScreen->root->drawable.id, .timestamp = currentTime.milliseconds, @@ -782,7 +782,7 @@ ProcRRGetScreenInfo(ClientPtr client) if (!pData) return BadAlloc; - rep = (xRRGetScreenInfoReply) { + reply = (xRRGetScreenInfoReply) { .setOfRotations = output->crtc->rotations, .root = pWin->drawable.pScreen->root->drawable.id, .timestamp = pScrPriv->lastSetTime.milliseconds, @@ -794,9 +794,9 @@ ProcRRGetScreenInfo(ClientPtr client) .rate = pData->refresh }; - extraLen = rep.nSizes * sizeof(xScreenSizes); + extraLen = reply.nSizes * sizeof(xScreenSizes); if (has_rate) - extraLen += rep.nrateEnts * sizeof(CARD16); + extraLen += reply.nrateEnts * sizeof(CARD16); if (!extraLen) goto finish; // no extra payload @@ -811,7 +811,7 @@ ProcRRGetScreenInfo(ClientPtr client) * First comes the size information */ xScreenSizes *size = (xScreenSizes *) extra; - CARD16 *rates = (CARD16 *) (size + rep.nSizes); + CARD16 *rates = (CARD16 *) (size + reply.nSizes); for (i = 0; i < pData->nsize; i++) { pSize = &pData->sizes[i]; size->widthInPixels = pSize->width; @@ -851,15 +851,15 @@ finish: free(pData); } if (client->swapped) { - swapl(&rep.timestamp); - swapl(&rep.configTimestamp); - swaps(&rep.rotation); - swaps(&rep.nSizes); - swaps(&rep.sizeID); - swaps(&rep.rate); - swaps(&rep.nrateEnts); + swapl(&reply.timestamp); + swapl(&reply.configTimestamp); + swaps(&reply.rotation); + swaps(&reply.nSizes); + swaps(&reply.sizeID); + swaps(&reply.rate); + swaps(&reply.nrateEnts); } - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } int @@ -1069,7 +1069,7 @@ ProcRRSetScreenConfig(ClientPtr client) free(pData); - xRRSetScreenConfigReply rep = { + xRRSetScreenConfigReply reply = { .status = status, .newTimestamp = pScrPriv->lastSetTime.milliseconds, .newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds, @@ -1078,11 +1078,11 @@ ProcRRSetScreenConfig(ClientPtr client) }; if (client->swapped) { - swapl(&rep.newTimestamp); - swapl(&rep.newConfigTimestamp); - swapl(&rep.root); + swapl(&reply.newTimestamp); + swapl(&reply.newConfigTimestamp); + swapl(&reply.root); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } static CARD16 diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index a2c9c7c31..98648fe05 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -98,17 +98,17 @@ Bool noRRXineramaExtension = FALSE; int ProcRRXineramaQueryVersion(ClientPtr client) { - xPanoramiXQueryVersionReply rep = { + xPanoramiXQueryVersionReply reply = { .majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION, .minorVersion = SERVER_RRXINERAMA_MINOR_VERSION }; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); if (client->swapped) { - swaps(&rep.majorVersion); - swaps(&rep.minorVersion); + swaps(&reply.majorVersion); + swaps(&reply.minorVersion); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -137,14 +137,14 @@ ProcRRXineramaGetState(ClientPtr client) active = TRUE; } - xPanoramiXGetStateReply rep = { + xPanoramiXGetStateReply reply = { .state = active, .window = stuff->window }; if (client->swapped) { - swapl(&rep.window); + swapl(&reply.window); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } static int @@ -175,14 +175,14 @@ ProcRRXineramaGetScreenCount(ClientPtr client) if (rc != Success) return rc; - xPanoramiXGetScreenCountReply rep = { + xPanoramiXGetScreenCountReply reply = { .ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen), .window = stuff->window }; if (client->swapped) { - swapl(&rep.window); + swapl(&reply.window); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -207,19 +207,19 @@ ProcRRXineramaGetScreenSize(ClientPtr client) pScreen = pWin->drawable.pScreen; pRoot = pScreen->root; - xPanoramiXGetScreenSizeReply rep = { + xPanoramiXGetScreenSizeReply reply = { .width = pRoot->drawable.width, .height = pRoot->drawable.height, .window = stuff->window, .screen = stuff->screen }; if (client->swapped) { - swapl(&rep.width); - swapl(&rep.height); - swapl(&rep.window); - swapl(&rep.screen); + swapl(&reply.width); + swapl(&reply.height); + swapl(&reply.window); + swapl(&reply.screen); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -227,13 +227,13 @@ ProcRRXineramaIsActive(ClientPtr client) { REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - xXineramaIsActiveReply rep = { + xXineramaIsActiveReply reply = { .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]) }; if (client->swapped) { - swapl(&rep.state); + swapl(&reply.state); } - return X_SEND_REPLY_SIMPLE(client, rep); + return X_SEND_REPLY_SIMPLE(client, reply); } int @@ -254,11 +254,11 @@ ProcRRXineramaQueryScreens(ClientPtr client) x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE }; - xXineramaQueryScreensReply rep = { + xXineramaQueryScreensReply reply = { .number = nmonitors }; if (client->swapped) { - swapl(&rep.number); + swapl(&reply.number); } for (m = 0; m < nmonitors; m++) { @@ -274,7 +274,7 @@ ProcRRXineramaQueryScreens(ClientPtr client) if (monitors) RRMonitorFreeList(monitors, nmonitors); - return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf); + return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf); } static int