summaryrefslogtreecommitdiff
path: root/Xext/xvmc.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-04-24 23:56:36 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-19 12:32:48 -0700
commitc38552d115e3bc71ad6179a8ad0d68778e943793 (patch)
treeaf6a02d6e34896c2a91b49ba568dab6bbad8b7d8 /Xext/xvmc.c
parente291c561821ae86b7dd74269d5cd29bc31703962 (diff)
Add typed resource-lookup errors for non-core resource types.
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'Xext/xvmc.c')
-rw-r--r--Xext/xvmc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index abb8e0250..755038631 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -40,7 +40,6 @@ unsigned long XvMCGeneration = 0;
int XvMCReqCode;
int XvMCEventBase;
-int XvMCErrorBase;
unsigned long XvMCRTContext;
unsigned long XvMCRTSurface;
@@ -276,7 +275,7 @@ ProcXvMCDestroyContext(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
client, DixDestroyAccess);
if (rc != Success)
- return (rc == BadValue) ? XvMCBadContext + XvMCErrorBase : rc;
+ return rc;
FreeResource(stuff->context_id, RT_NONE);
@@ -299,7 +298,7 @@ ProcXvMCCreateSurface(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess);
if (result != Success)
- return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result;
+ return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@@ -346,7 +345,7 @@ ProcXvMCDestroySurface(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
client, DixDestroyAccess);
if (rc != Success)
- return (rc == BadValue) ? XvMCBadSurface + XvMCErrorBase : rc;
+ return rc;
FreeResource(stuff->surface_id, RT_NONE);
@@ -371,7 +370,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
result = dixLookupResourceByType((pointer *)&pContext, stuff->context_id,
XvMCRTContext, client, DixUseAccess);
if (result != Success)
- return (result == BadValue) ? XvMCBadContext + XvMCErrorBase : result;
+ return result;
pScreenPriv = XVMC_GET_PRIVATE(pContext->pScreen);
@@ -463,7 +462,7 @@ ProcXvMCDestroySubpicture(ClientPtr client)
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
client, DixDestroyAccess);
if (rc != Success)
- return (rc == BadValue) ? XvMCBadSubpicture + XvMCErrorBase : rc;
+ return rc;
FreeResource(stuff->subpicture_id, RT_NONE);
@@ -694,7 +693,9 @@ XvMCExtensionInit(void)
XvMCReqCode = extEntry->base;
XvMCEventBase = extEntry->eventBase;
- XvMCErrorBase = extEntry->errorBase;
+ SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext);
+ SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface);
+ SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture);
}
static Bool