[PATCH v2 02/10] Xext: Fix buggy check.

Cyril Brulebois kibi at debian.org
Thu Jun 2 18:00:37 PDT 2011


XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be
NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston
instead.

This warning goes 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]

Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
 Xext/xvmc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index d790d3c..bc78b55 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 */
-- 
1.7.5.3



More information about the xorg-devel mailing list