randr: Clean up compiler warnings about unused and shadowing variables

set but not used variables
shadowing a previous local

A hidden problem was that the VERIFY_RR_* macros define local 'rc'
variables, any other local definitions for those would be shadowed and
generate warnings from gcc. I've renamed the other locals 'ret'
instead of 'rc'.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2012-06-21 18:42:46 -07:00
parent 3ef3ce069d
commit 4ba340cfaa
4 changed files with 13 additions and 16 deletions

View File

@ -825,10 +825,9 @@ ProcRRSetCrtcConfig(ClientPtr client)
int numOutputs; int numOutputs;
RROutputPtr *outputs = NULL; RROutputPtr *outputs = NULL;
RROutput *outputIds; RROutput *outputIds;
TimeStamp configTime;
TimeStamp time; TimeStamp time;
Rotation rotation; Rotation rotation;
int rc, i, j; int ret, i, j;
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq))); numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq)));
@ -855,11 +854,11 @@ ProcRRSetCrtcConfig(ClientPtr client)
outputIds = (RROutput *) (stuff + 1); outputIds = (RROutput *) (stuff + 1);
for (i = 0; i < numOutputs; i++) { for (i = 0; i < numOutputs; i++) {
rc = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i],
RROutputType, client, DixSetAttrAccess); RROutputType, client, DixSetAttrAccess);
if (rc != Success) { if (ret != Success) {
free(outputs); free(outputs);
return rc; return ret;
} }
/* validate crtc for this output */ /* validate crtc for this output */
for (j = 0; j < outputs[i]->numCrtcs; j++) for (j = 0; j < outputs[i]->numCrtcs; j++)
@ -904,7 +903,6 @@ ProcRRSetCrtcConfig(ClientPtr client)
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
time = ClientTimeToServerTime(stuff->timestamp); time = ClientTimeToServerTime(stuff->timestamp);
configTime = ClientTimeToServerTime(stuff->configTimestamp);
if (!pScrPriv) { if (!pScrPriv) {
time = currentTime; time = currentTime;

View File

@ -82,6 +82,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
int i; int i;
CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT;
CARD16 maxWidth = 0, maxHeight = 0; CARD16 maxWidth = 0, maxHeight = 0;
CARD16 width, height;
/* /*
* First time through, create a crtc and output and hook * First time through, create a crtc and output and hook
@ -141,11 +142,11 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations)
/* find size bounds */ /* find size bounds */
for (i = 0; i < output->numModes + output->numUserModes; i++) { for (i = 0; i < output->numModes + output->numUserModes; i++) {
RRModePtr mode = (i < output->numModes ? mode = (i < output->numModes ?
output->modes[i] : output->modes[i] :
output->userModes[i - output->numModes]); output->userModes[i - output->numModes]);
CARD16 width = mode->mode.width; width = mode->mode.width;
CARD16 height = mode->mode.height; height = mode->mode.height;
if (width < minWidth) if (width < minWidth)
minWidth = width; minWidth = width;

View File

@ -173,7 +173,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret)
*/ */
for (o = 0; o < pScrPriv->numOutputs; o++) { for (o = 0; o < pScrPriv->numOutputs; o++) {
RROutputPtr output = pScrPriv->outputs[o]; RROutputPtr output = pScrPriv->outputs[o];
int m, n; int n;
for (m = 0; m < output->numModes + output->numUserModes; m++) { for (m = 0; m < output->numModes + output->numUserModes; m++) {
RRModePtr mode = (m < output->numModes ? RRModePtr mode = (m < output->numModes ?
@ -285,7 +285,6 @@ ProcRRCreateMode(ClientPtr client)
xRRCreateModeReply rep = { 0 }; xRRCreateModeReply rep = { 0 };
WindowPtr pWin; WindowPtr pWin;
ScreenPtr pScreen; ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
xRRModeInfo *modeInfo; xRRModeInfo *modeInfo;
long units_after; long units_after;
char *name; char *name;
@ -298,7 +297,6 @@ ProcRRCreateMode(ClientPtr client)
return rc; return rc;
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
modeInfo = &stuff->modeInfo; modeInfo = &stuff->modeInfo;
name = (char *) (stuff + 1); name = (char *) (stuff + 1);

View File

@ -528,13 +528,13 @@ ProcRRSetOutputPrimary(ClientPtr client)
RROutputPtr output = NULL; RROutputPtr output = NULL;
WindowPtr pWin; WindowPtr pWin;
rrScrPrivPtr pScrPriv; rrScrPrivPtr pScrPriv;
int rc; int ret;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success) if (ret != Success)
return rc; return ret;
if (stuff->output) { if (stuff->output) {
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);