From 9da5aa09d70e26dd4d2ef878a21317dae7bf24de Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:11 +0200 Subject: [PATCH 1/9] Xext: Fix buggy checks. XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston instead. Those warnings go away accordingly: | CC xvmc.lo | xvmc.c: In function 'ProcXvMCListSubpictureTypes': | xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCExtensionInit': | xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] | xvmc.c: In function 'XvMCFindXvImage': | xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress] Reviewed-by: Alan Coopersmith Signed-off-by: Cyril Brulebois --- Xext/xvmc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 4d29941ee..bc78b55ae 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client) pScreen = pPort->pAdaptor->pScreen; - if(XvMCScreenKey == NULL) /* No XvMC adaptors */ - return BadMatch; + if (!dixPrivateKeyRegistered(XvMCScreenKey)) + return BadMatch; /* No XvMC adaptors */ if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) return BadMatch; /* None this screen */ @@ -668,8 +668,8 @@ XvMCExtensionInit(void) { ExtensionEntry *extEntry; - if(XvMCScreenKey == NULL) /* nobody supports it */ - return; + if (!dixPrivateKeyRegistered(XvMCScreenKey)) + return; if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes, "XvMCRTContext"))) @@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id) XvMCAdaptorPtr adaptor = NULL; int i; - if(XvMCScreenKey == NULL) return NULL; + if (!dixPrivateKeyRegistered(XvMCScreenKey)) + return NULL; if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) return NULL; From 9a8bfc2c06f0a9206b64ae01a783cf5513f021a6 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:16 +0200 Subject: [PATCH 2/9] configure: Bump dependency on xproto. Bumping this dependency means some additional macros can be used, like _X_UNUSED. Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 22566c9ef..9b831b035 100644 --- a/configure.ac +++ b/configure.ac @@ -785,7 +785,7 @@ WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" dnl Core modules for most extensions, et al. -SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" +SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc AC_SUBST(SDK_REQUIRED_MODULES) From 8da16898d9de5da1f80b789f0b371070968285f8 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 3/9] fb: Simplify logic, get rid of set but unused variable. wrapped is only useful is FB_ACCESS_WRAPPER is set; simplify the logic accordingly, and only set it when that's defined. The following warning goes away accordingly: | CC libfb_la-fbarc.lo | fbarc.c: In function 'fbPolyArc': | fbarc.c:71:11: warning: variable 'wrapped' set but not used [-Wunused-but-set-variable] Reviewed-by: Alan Coopersmith Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- fb/fbarc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fb/fbarc.c b/fb/fbarc.c index a0c5343e0..e54c80491 100644 --- a/fb/fbarc.c +++ b/fb/fbarc.c @@ -68,15 +68,12 @@ fbPolyArc (DrawablePtr pDrawable, BoxRec box; int x2, y2; RegionPtr cclip; - int wrapped = 0; +#ifdef FB_ACCESS_WRAPPER + int wrapped = 1; +#endif cclip = fbGetCompositeClip (pGC); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); -#ifdef FB_ACCESS_WRAPPER - wrapped = 1; -#else - wrapped = 0; -#endif while (narcs--) { if (miCanZeroArc (parcs)) From fe6f489d21d77aacf0a073883625619018d764b3 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 4/9] fb: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC libfb_la-fb24_32.lo | fb24_32.c: In function 'fb24_32ReformatTile': | fb24_32.c:544:19: warning: variable 'newYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:544:10: warning: variable 'newXoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:19: warning: variable 'oldYoff' set but not used [-Wunused-but-set-variable] | fb24_32.c:543:10: warning: variable 'oldXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbfill.lo | fbfill.c: In function 'fbFill': | fbfill.c:72:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:72:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:21: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:100:11: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:20: warning: variable 'tileYoff' set but not used [-Wunused-but-set-variable] | fbfill.c:142:10: warning: variable 'tileXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbgc.lo | fbgc.c: In function 'fbPadPixmap': | fbgc.c:92:19: warning: variable 'yOff' set but not used [-Wunused-but-set-variable] | fbgc.c:92:13: warning: variable 'xOff' set but not used [-Wunused-but-set-variable] | fbgc.c: In function 'fbCanEvenStipple': | fbgc.c:166:23: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbgc.c:166:13: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] | CC libfb_la-fbpush.lo | fbpush.c: In function 'fbPushPixels': | fbpush.c:238:20: warning: variable 'stipYoff' set but not used [-Wunused-but-set-variable] | fbpush.c:238:10: warning: variable 'stipXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- fb/fb24_32.c | 4 ++-- fb/fbfill.c | 6 +++--- fb/fbgc.c | 4 ++-- fb/fbpush.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fb/fb24_32.c b/fb/fb24_32.c index 2e600edc0..033fa46c5 100644 --- a/fb/fb24_32.c +++ b/fb/fb24_32.c @@ -540,8 +540,8 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel) FbStride oldStride, newStride; int oldBpp, newBpp; fb24_32BltFunc blt; - int oldXoff, oldYoff; - int newXoff, newYoff; + _X_UNUSED int oldXoff, oldYoff; + _X_UNUSED int newXoff, newYoff; pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width, pOldTile->drawable.height, diff --git a/fb/fbfill.c b/fb/fbfill.c index 801a0d0a9..e62a48ae0 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -69,7 +69,7 @@ fbFill (DrawablePtr pDrawable, FbBits *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* XXX assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; if (pGC->fillStyle == FillStippled) alu = FbStipple1Rop(pGC->alu,pGC->fgPixel); @@ -97,7 +97,7 @@ fbFill (DrawablePtr pDrawable, FbStip *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* XXX assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; FbBits fgand, fgxor, bgand, bgxor; fgand = pPriv->and; @@ -139,7 +139,7 @@ fbFill (DrawablePtr pDrawable, int tileBpp; int tileWidth; int tileHeight; - int tileXoff, tileYoff; /* XXX assumed to be zero */ + _X_UNUSED int tileXoff, tileYoff; fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff); tileWidth = pTile->drawable.width; diff --git a/fb/fbgc.c b/fb/fbgc.c index cc504c1b8..8108c3acb 100644 --- a/fb/fbgc.c +++ b/fb/fbgc.c @@ -89,7 +89,7 @@ fbPadPixmap (PixmapPtr pPixmap) int w; int stride; int bpp; - int xOff, yOff; + _X_UNUSED int xOff, yOff; fbGetDrawable (&pPixmap->drawable, bits, stride, bpp, xOff, yOff); @@ -163,7 +163,7 @@ fbCanEvenStipple (PixmapPtr pStipple, int bpp) FbBits *bits; int stride; int stip_bpp; - int stipXoff, stipYoff; + _X_UNUSED int stipXoff, stipYoff; int h; /* can't even stipple 24bpp drawables */ diff --git a/fb/fbpush.c b/fb/fbpush.c index 9d827181d..8dd7c2b59 100644 --- a/fb/fbpush.c +++ b/fb/fbpush.c @@ -235,7 +235,7 @@ fbPushPixels (GCPtr pGC, FbStip *stip; FbStride stipStride; int stipBpp; - int stipXoff, stipYoff; /* Assumed to be zero */ + _X_UNUSED int stipXoff, stipYoff; fbGetStipDrawable (&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff); From f41ac25d932ef34ab912201ab5ce65f85f2ff171 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 5/9] miext: Mark some variables as unused. There's no use for the values set through the various macro calls (fbGetDrawable and fbGetDrawablePixmap), so mark those variables as unused. The following warnings go away accordingly: | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c: In function 'shadowUpdateRotatePacked': | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shpacked.lo | shpacked.c: In function 'shadowUpdatePacked': | shpacked.c:55:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shpacked.c:55:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar8.lo | shplanar8.c: In function 'shadowUpdatePlanar4x8': | shplanar8.c:105:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar8.c:105:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shplanar.lo | shplanar.c: In function 'shadowUpdatePlanar4': | shplanar.c:101:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shplanar.c:101:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_180.lo | In file included from shrot16pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270.lo | In file included from shrot16pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_270YX.lo | In file included from shrot16pack_270YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_270YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90.lo | In file included from shrot16pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate16_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack_90YX.lo | In file included from shrot16pack_90YX.c:31:0: | shrotpackYX.h: In function 'shadowUpdateRotate16_90YX': | shrotpackYX.h:72:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpackYX.h:72:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot16pack.lo | In file included from shrot16pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate16': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_180.lo | In file included from shrot32pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_270.lo | In file included from shrot32pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack_90.lo | In file included from shrot32pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate32_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot32pack.lo | In file included from shrot32pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate32': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_180.lo | In file included from shrot8pack_180.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_180': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_270.lo | In file included from shrot8pack_270.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_270': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack_90.lo | In file included from shrot8pack_90.c:31:0: | shrotpack.h: In function 'shadowUpdateRotate8_90': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrot8pack.lo | In file included from shrot8pack.c:30:0: | shrotpack.h: In function 'shadowUpdateRotate8': | shrotpack.h:109:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotpack.h:109:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] | CC shrotate.lo | shrotate.c:62:19: warning: variable 'shaYoff' set but not used [-Wunused-but-set-variable] | shrotate.c:62:10: warning: variable 'shaXoff' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- miext/shadow/shpacked.c | 2 +- miext/shadow/shplanar.c | 2 +- miext/shadow/shplanar8.c | 2 +- miext/shadow/shrotate.c | 2 +- miext/shadow/shrotpack.h | 2 +- miext/shadow/shrotpackYX.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c index 06606bcf3..c37dca175 100644 --- a/miext/shadow/shpacked.c +++ b/miext/shadow/shpacked.c @@ -52,7 +52,7 @@ shadowUpdatePacked (ScreenPtr pScreen, FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; - int shaXoff, shaYoff; /* XXX assumed to be zero */ + _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; FbBits *winBase = NULL, *win; diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c index 9ca3f3f89..350405186 100644 --- a/miext/shadow/shplanar.c +++ b/miext/shadow/shplanar.c @@ -98,7 +98,7 @@ shadowUpdatePlanar4 (ScreenPtr pScreen, FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; - int shaXoff, shaYoff; /* XXX assumed to be zero */ + _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; CARD32 *winBase = NULL, *win; diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c index f8b255d8f..d0648147a 100644 --- a/miext/shadow/shplanar8.c +++ b/miext/shadow/shplanar8.c @@ -102,7 +102,7 @@ shadowUpdatePlanar4x8 (ScreenPtr pScreen, FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; - int shaXoff, shaYoff; /* XXX assumed to be zero */ + _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; CARD32 *winBase = NULL, *win; diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c index c3898266c..090120387 100644 --- a/miext/shadow/shrotate.c +++ b/miext/shadow/shrotate.c @@ -59,7 +59,7 @@ shadowUpdateRotatePacked (ScreenPtr pScreen, FbBits *shaBits; FbStride shaStride; int shaBpp; - int shaXoff, shaYoff; + _X_UNUSED int shaXoff, shaYoff; int box_x1, box_x2, box_y1, box_y2; int sha_x1 = 0, sha_y1 = 0; int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h; diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h index 2d1a87c19..16afff184 100644 --- a/miext/shadow/shrotpack.h +++ b/miext/shadow/shrotpack.h @@ -106,7 +106,7 @@ FUNC (ScreenPtr pScreen, FbStride shaStride; int scrBase, scrLine, scr; int shaBpp; - int shaXoff, shaYoff; /* XXX assumed to be zero */ + _X_UNUSED int shaXoff, shaYoff; int x, y, w, h, width; int i; Data *winBase = NULL, *win; diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h index 7d36bd1bd..d7b01ec2a 100644 --- a/miext/shadow/shrotpackYX.h +++ b/miext/shadow/shrotpackYX.h @@ -69,7 +69,7 @@ FUNC (ScreenPtr pScreen, Data *shaBase, *shaLine, *sha; FbStride shaStride, winStride; int shaBpp; - int shaXoff, shaYoff; /* XXX assumed to be zero */ + _X_UNUSED int shaXoff, shaYoff; int x, y, w, h; Data *winBase, *win, *winLine; CARD32 winSize; From ad0d0833d45ea24d7af1f724b9905133fe3b065f Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 6/9] xfixes: Mark some variables as unused. Calling Unwrap() is just a way of performing an assignment while keeping a backup of the original value. In the CursorCloseScreen function, the backup value doesn't seem to be useful, but Unwrap() is used anyway (probably to stay in line with other functions). As a consequence, mark those variables as unused. The following warnings go away accordingly: | CC cursor.lo | cursor.c: In function 'CursorCloseScreen': | cursor.c:186:26: warning: variable 'display_proc' set but not used [-Wunused-but-set-variable] | cursor.c:185:24: warning: variable 'close_proc' set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- xfixes/cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 01eb70d92..ecbed4016 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -196,8 +196,8 @@ CursorCloseScreen (int index, ScreenPtr pScreen) { CursorScreenPtr cs = GetCursorScreen (pScreen); Bool ret; - CloseScreenProcPtr close_proc; - DisplayCursorProcPtr display_proc; + _X_UNUSED CloseScreenProcPtr close_proc; + _X_UNUSED DisplayCursorProcPtr display_proc; ConstrainCursorHarderProcPtr constrain_proc; Unwrap (cs, pScreen, CloseScreen, close_proc); From 34a9f2a90d34a2ab7ecf56d329e75e8da569f939 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 7/9] xfixes: Remove unused variable. The last use of pScreen in ProcXFixesSetPictureClipRegion was removed in aa7096ca6f108e399d9916639cf20c57f9776305 so remove it entirely. Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- xfixes/region.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xfixes/region.c b/xfixes/region.c index f49349629..be2d391dd 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -756,12 +756,10 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) { PicturePtr pPicture; RegionPtr pRegion; - ScreenPtr pScreen; REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess); - pScreen = pPicture->pDrawable->pScreen; VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, From 33dad2b74e3489c8a6b5fa574172d6cd2b6de037 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:17 +0200 Subject: [PATCH 8/9] hw/dmx: Stop using variables for text widgets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are unused in the sense they're not getting any callback set up, so there's no point in storing them into variables. Keep the initial alignment of the parameters to try and reduce the diff noise. Those warnings go away accordingly: | CC xdmxconfig-xdmxconfig.o | xdmxconfig.c: In function ‘main’: | xdmxconfig.c:881:29: warning: variable ‘quittext’ set but not used [-Wunused-but-set-variable] | xdmxconfig.c:880:53: warning: variable ‘abouttext’ set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- hw/dmx/config/xdmxconfig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c index c67077aec..2de7f2b85 100644 --- a/hw/dmx/config/xdmxconfig.c +++ b/hw/dmx/config/xdmxconfig.c @@ -877,8 +877,8 @@ int main(int argc, char **argv) Widget parent, menubox, bottombox, databox, canvasbox; Widget filebutton, helpbutton; Widget filemenu, openbutton, savebutton, quitbutton; - Widget helpmenu, aboutbutton, aboutbox, abouttext, aboutok; - Widget quitbox, quittext, quitok, quitcan; + Widget helpmenu, aboutbutton, aboutbox, aboutok; + Widget quitbox, quitok, quitcan; Widget ncbutton; Widget canbutton; Widget ecbox, ecokbutton, eccanbutton; @@ -1096,7 +1096,7 @@ int main(int argc, char **argv) toplevel, NULL); aboutbox = XtVaCreateManagedWidget("aboutbox", boxWidgetClass, aboutpopup, NULL); - abouttext = XtVaCreateManagedWidget("abouttext", labelWidgetClass, + XtVaCreateManagedWidget("abouttext", labelWidgetClass, aboutbox, XtNlabel, DMX_INFO, NULL); @@ -1108,7 +1108,7 @@ int main(int argc, char **argv) toplevel, NULL); quitbox = XtVaCreateManagedWidget("quitbox", boxWidgetClass, quitpopup, NULL); - quittext = XtVaCreateManagedWidget("quittext", labelWidgetClass, + XtVaCreateManagedWidget("quittext", labelWidgetClass, quitbox, XtNlabel, "Changes to the configuration\n" From 4edf49d032028aa4b9887d02b926b0c372c4451d Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 24 May 2011 18:33:18 +0200 Subject: [PATCH 9/9] dmx/examples: Fix missing key_click_percent assignment. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to gcc's -Wunused-but-set-variable, stop ignoring the percent parameter, and add it to the XKeyboardControl structure before the XChangeKeyboardControl call. This warning goes away accordingly: | CC xbell-xbell.o | xbell.c: In function ‘main’: | xbell.c:74:22: warning: variable ‘percent’ set but not used [-Wunused-but-set-variable] Reviewed-by: Jeremy Huddleston Signed-off-by: Cyril Brulebois --- hw/dmx/examples/xbell.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/dmx/examples/xbell.c b/hw/dmx/examples/xbell.c index f3e3be1b8..79419d324 100644 --- a/hw/dmx/examples/xbell.c +++ b/hw/dmx/examples/xbell.c @@ -71,7 +71,6 @@ int main(int argc, char **argv) XKeyboardControl kc; XKeyboardState ks; unsigned long vm; - int percent; if (argc != 5) { printf("Usage: xbell percent baseVolume pitch duration\n"); @@ -81,7 +80,7 @@ int main(int argc, char **argv) vm = (KBBellPercent | KBBellPitch | KBBellDuration); - percent = atoi(argv[1]); + kc.key_click_percent = atoi(argv[1]); kc.bell_percent = atoi(argv[2]); kc.bell_pitch = atoi(argv[3]); kc.bell_duration = atoi(argv[4]);