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 <alan.coopersmith@oracle.com> Signed-off-by: Cyril Brulebois <kibi@debian.org>
This commit is contained in:
parent
d9bda34d0d
commit
9da5aa09d7
|
@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
|
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
|
|
||||||
if(XvMCScreenKey == NULL) /* No XvMC adaptors */
|
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||||
return BadMatch;
|
return BadMatch; /* No XvMC adaptors */
|
||||||
|
|
||||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||||
return BadMatch; /* None this screen */
|
return BadMatch; /* None this screen */
|
||||||
|
@ -668,7 +668,7 @@ XvMCExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry *extEntry;
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
if(XvMCScreenKey == NULL) /* nobody supports it */
|
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
|
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
|
||||||
|
@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(XvMCScreenKey == NULL) return NULL;
|
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue