From 7402eaa0185110a60cf4aae32d7b470c1372b45b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 16 Dec 2014 17:05:18 -0800 Subject: libXrandr: Clean up compiler warnings This removes warnings about shadowing local variables with the same name, and type mismatches with _XRead32. Reviewed-by: Dave Airlie Signed-off-by: Keith Packard --- src/Xrandr.c | 82 +++++++++++++++++++++++------------------------ src/XrrCrtc.c | 4 +-- src/XrrOutput.c | 6 ++-- src/XrrProperty.c | 2 +- src/XrrProvider.c | 8 ++--- src/XrrProviderProperty.c | 2 +- src/XrrScreen.c | 4 +-- 7 files changed, 54 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/Xrandr.c b/src/Xrandr.c index a9fba87..fd247e0 100644 --- a/src/Xrandr.c +++ b/src/Xrandr.c @@ -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; } } diff --git a/src/XrrCrtc.c b/src/XrrCrtc.c index a704a52..5ae35c5 100644 --- a/src/XrrCrtc.c +++ b/src/XrrCrtc.c @@ -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 diff --git a/src/XrrOutput.c b/src/XrrOutput.c index 4df894e..85f0b6e 100644 --- a/src/XrrOutput.c +++ b/src/XrrOutput.c @@ -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 diff --git a/src/XrrProperty.c b/src/XrrProperty.c index 2096c56..502e834 100644 --- a/src/XrrProperty.c +++ b/src/XrrProperty.c @@ -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; diff --git a/src/XrrProvider.c b/src/XrrProvider.c index 014ddd9..9e620c7 100644 --- a/src/XrrProvider.c +++ b/src/XrrProvider.c @@ -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 diff --git a/src/XrrProviderProperty.c b/src/XrrProviderProperty.c index 34cc082..241e8ee 100644 --- a/src/XrrProviderProperty.c +++ b/src/XrrProviderProperty.c @@ -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; diff --git a/src/XrrScreen.c b/src/XrrScreen.c index 08710b6..f29071c 100644 --- a/src/XrrScreen.c +++ b/src/XrrScreen.c @@ -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; -- cgit v1.2.3