Commit 7402eaa0 authored by Keith Packard's avatar Keith Packard Committed by Dave Airlie

libXrandr: Clean up compiler warnings

This removes warnings about shadowing local variables with the same
name, and type mismatches with _XRead32.
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent bc00b4fb
......@@ -219,62 +219,62 @@ static Status XRREventToWire(Display *dpy, XEvent *event, xEvent *wire)
awire->subCode = aevent->subtype;
switch (aevent->subtype) {
case RRNotify_OutputChange: {
xRROutputChangeNotifyEvent *awire = (xRROutputChangeNotifyEvent *) wire;
XRROutputChangeNotifyEvent *aevent = (XRROutputChangeNotifyEvent *) event;
awire->window = aevent->window;
awire->output = aevent->output;
awire->crtc = aevent->crtc;
awire->mode = aevent->mode;
awire->rotation = aevent->rotation;
awire->connection = aevent->connection;
awire->subpixelOrder = aevent->subpixel_order;
xRROutputChangeNotifyEvent *sawire = (xRROutputChangeNotifyEvent *) wire;
XRROutputChangeNotifyEvent *saevent = (XRROutputChangeNotifyEvent *) event;
sawire->window = saevent->window;
sawire->output = saevent->output;
sawire->crtc = saevent->crtc;
sawire->mode = saevent->mode;
sawire->rotation = saevent->rotation;
sawire->connection = saevent->connection;
sawire->subpixelOrder = saevent->subpixel_order;
return True;
}
case RRNotify_CrtcChange: {
xRRCrtcChangeNotifyEvent *awire = (xRRCrtcChangeNotifyEvent *) wire;
XRRCrtcChangeNotifyEvent *aevent = (XRRCrtcChangeNotifyEvent *) event;
awire->window = aevent->window;
awire->crtc = aevent->crtc;
awire->mode = aevent->mode;
awire->rotation = aevent->rotation;
awire->x = aevent->x;
awire->y = aevent->y;
awire->width = aevent->width;
awire->height = aevent->height;
xRRCrtcChangeNotifyEvent *sawire = (xRRCrtcChangeNotifyEvent *) wire;
XRRCrtcChangeNotifyEvent *saevent = (XRRCrtcChangeNotifyEvent *) event;
sawire->window = saevent->window;
sawire->crtc = saevent->crtc;
sawire->mode = saevent->mode;
sawire->rotation = saevent->rotation;
sawire->x = saevent->x;
sawire->y = saevent->y;
sawire->width = saevent->width;
sawire->height = saevent->height;
return True;
}
case RRNotify_OutputProperty: {
xRROutputPropertyNotifyEvent *awire = (xRROutputPropertyNotifyEvent *) wire;
XRROutputPropertyNotifyEvent *aevent = (XRROutputPropertyNotifyEvent *) event;
awire->window = aevent->window;
awire->output = aevent->output;
awire->atom = aevent->property;
awire->timestamp = aevent->timestamp;
awire->state = aevent->state;
xRROutputPropertyNotifyEvent *sawire = (xRROutputPropertyNotifyEvent *) wire;
XRROutputPropertyNotifyEvent *saevent = (XRROutputPropertyNotifyEvent *) event;
sawire->window = saevent->window;
sawire->output = saevent->output;
sawire->atom = saevent->property;
sawire->timestamp = saevent->timestamp;
sawire->state = saevent->state;
return True;
}
case RRNotify_ProviderChange: {
xRRProviderChangeNotifyEvent *awire = (xRRProviderChangeNotifyEvent *) wire;
XRRProviderChangeNotifyEvent *aevent = (XRRProviderChangeNotifyEvent *) event;
awire->window = aevent->window;
awire->provider = aevent->provider;
xRRProviderChangeNotifyEvent *sawire = (xRRProviderChangeNotifyEvent *) wire;
XRRProviderChangeNotifyEvent *saevent = (XRRProviderChangeNotifyEvent *) event;
sawire->window = saevent->window;
sawire->provider = saevent->provider;
return True;
}
case RRNotify_ProviderProperty: {
xRRProviderPropertyNotifyEvent *awire = (xRRProviderPropertyNotifyEvent *) wire;
XRRProviderPropertyNotifyEvent *aevent = (XRRProviderPropertyNotifyEvent *) event;
awire->window = aevent->window;
awire->provider = aevent->provider;
awire->atom = aevent->property;
awire->timestamp = aevent->timestamp;
awire->state = aevent->state;
xRRProviderPropertyNotifyEvent *sawire = (xRRProviderPropertyNotifyEvent *) wire;
XRRProviderPropertyNotifyEvent *saevent = (XRRProviderPropertyNotifyEvent *) event;
sawire->window = saevent->window;
sawire->provider = saevent->provider;
sawire->atom = saevent->property;
sawire->timestamp = saevent->timestamp;
sawire->state = saevent->state;
return True;
}
case RRNotify_ResourceChange: {
xRRResourceChangeNotifyEvent *awire = (xRRResourceChangeNotifyEvent *) wire;
XRRResourceChangeNotifyEvent *aevent = (XRRResourceChangeNotifyEvent *) event;
awire->window = aevent->window;
awire->timestamp = aevent->timestamp;
xRRResourceChangeNotifyEvent *sawire = (xRRResourceChangeNotifyEvent *) wire;
XRRResourceChangeNotifyEvent *saevent = (XRRResourceChangeNotifyEvent *) event;
sawire->window = saevent->window;
sawire->timestamp = saevent->timestamp;
return True;
}
}
......
......@@ -93,8 +93,8 @@ XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, RRCrtc crtc)
xci->npossible = rep.nPossibleOutput;
xci->possible = (RROutput *) (xci->outputs + rep.nOutput);
_XRead32 (dpy, xci->outputs, rep.nOutput << 2);
_XRead32 (dpy, xci->possible, rep.nPossibleOutput << 2);
_XRead32 (dpy, (long *) xci->outputs, rep.nOutput << 2);
_XRead32 (dpy, (long *) xci->possible, rep.nPossibleOutput << 2);
/*
* Skip any extra data
......
......@@ -102,9 +102,9 @@ XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output)
xoi->clones = (RROutput *) (xoi->modes + rep.nModes);
xoi->name = (char *) (xoi->clones + rep.nClones);
_XRead32 (dpy, xoi->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, xoi->modes, rep.nModes << 2);
_XRead32 (dpy, xoi->clones, rep.nClones << 2);
_XRead32 (dpy, (long *) xoi->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, (long *) xoi->modes, rep.nModes << 2);
_XRead32 (dpy, (long *) xoi->clones, rep.nClones << 2);
/*
* Read name and '\0' terminate
......
......@@ -70,7 +70,7 @@ XRRListOutputProperties (Display *dpy, RROutput output, int *nprop)
return NULL;
}
_XRead32 (dpy, props, nbytes);
_XRead32 (dpy, (long *) props, nbytes);
}
*nprop = rep.nAtoms;
......
......@@ -77,7 +77,7 @@ XRRGetProviderResources(Display *dpy, Window window)
xrpr->nproviders = rep.nProviders;
xrpr->providers = (RRProvider *)(xrpr + 1);
_XRead32(dpy, xrpr->providers, rep.nProviders << 2);
_XRead32(dpy, (long *) xrpr->providers, rep.nProviders << 2);
if (nbytes > nbytesRead)
_XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
......@@ -152,10 +152,10 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi
xpi->associated_capability = (unsigned int *)(xpi->associated_providers + rep.nAssociatedProviders);
xpi->name = (char *)(xpi->associated_capability + rep.nAssociatedProviders);
_XRead32(dpy, xpi->crtcs, rep.nCrtcs << 2);
_XRead32(dpy, xpi->outputs, rep.nOutputs << 2);
_XRead32(dpy, (long *) xpi->crtcs, rep.nCrtcs << 2);
_XRead32(dpy, (long *) xpi->outputs, rep.nOutputs << 2);
_XRead32(dpy, xpi->associated_providers, rep.nAssociatedProviders << 2);
_XRead32(dpy, (long *) xpi->associated_providers, rep.nAssociatedProviders << 2);
/*
* _XRead32 reads a series of 32-bit values from the protocol and writes
......
......@@ -70,7 +70,7 @@ XRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop)
return NULL;
}
_XRead32 (dpy, props, nbytes);
_XRead32 (dpy, (long *) props, nbytes);
}
*nprop = rep.nAtoms;
......
......@@ -145,8 +145,8 @@ doGetScreenResources (Display *dpy, Window window, int poll)
xrsr->modes = (XRRModeInfo *) (xrsr->outputs + rep.nOutputs);
names = (char *) (xrsr->modes + rep.nModes);
_XRead32 (dpy, xrsr->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, xrsr->outputs, rep.nOutputs << 2);
_XRead32 (dpy, (long *) xrsr->crtcs, rep.nCrtcs << 2);
_XRead32 (dpy, (long *) xrsr->outputs, rep.nOutputs << 2);
for (i = 0; i < rep.nModes; i++) {
xRRModeInfo modeInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment