diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-05-10 20:22:05 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-05-13 17:14:07 -0700 |
commit | 92ed75ac59e2d3af149cddb962efd05fc8487750 (patch) | |
tree | c05f3b03627ebd67a921fcec5cef3655083bb345 /xfixes/region.c | |
parent | 11c69880c7c48ef9e755c4e09fadef7a629d7bc7 (diff) |
Eliminate boilerplate around client->noClientException.
Just let Dispatch() check for a noClientException, rather than making
every single dispatch procedure take care of it.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'xfixes/region.c')
-rw-r--r-- | xfixes/region.c | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/xfixes/region.c b/xfixes/region.c index d5f583f1b..5f0c2c432 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -87,7 +87,7 @@ ProcXFixesCreateRegion (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -132,7 +132,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -194,7 +194,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -244,7 +244,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -291,7 +291,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); FreeResource (stuff->region, RT_NONE); - return(client->noClientException); + return Success; } int @@ -355,7 +355,7 @@ ProcXFixesSetRegion (ClientPtr client) return BadAlloc; } REGION_DESTROY (0, pNew); - return(client->noClientException); + return Success; } int @@ -383,7 +383,7 @@ ProcXFixesCopyRegion (ClientPtr client) if (!REGION_COPY(pScreen, pDestination, pSource)) return BadAlloc; - return(client->noClientException); + return Success; } int @@ -403,7 +403,6 @@ int ProcXFixesCombineRegion (ClientPtr client) { RegionPtr pSource1, pSource2, pDestination; - int ret = Success; REQUEST (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); @@ -414,21 +413,19 @@ ProcXFixesCombineRegion (ClientPtr client) switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: if (!REGION_UNION (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; case X_XFixesIntersectRegion: if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; case X_XFixesSubtractRegion: if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) - ret = BadAlloc; + return BadAlloc; break; } - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int @@ -450,7 +447,6 @@ ProcXFixesInvertRegion (ClientPtr client) { RegionPtr pSource, pDestination; BoxRec bounds; - int ret = Success; REQUEST(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); @@ -471,11 +467,9 @@ ProcXFixesInvertRegion (ClientPtr client) bounds.y2 = stuff->y + stuff->height; if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) - ret = BadAlloc; + return BadAlloc; - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int @@ -505,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client) VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); - return (client->noClientException); + return Success; } int @@ -534,7 +528,7 @@ ProcXFixesRegionExtents (ClientPtr client) REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); - return (client->noClientException); + return Success; } int @@ -602,7 +596,7 @@ ProcXFixesFetchRegion (ClientPtr client) (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle), (char *) reply); free(reply); - return (client->noClientException); + return Success; } int @@ -645,7 +639,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) ChangeGC (NullClient, pGC, GCClipXOrigin|GCClipYOrigin, vals); (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); - return (client->noClientException); + return Success; } int @@ -741,7 +735,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) *pDestRegion = pRegion; (*pScreen->SetShape) (pWin); SendShapeNotify (pWin, stuff->destKind); - return (client->noClientException); + return Success; } int @@ -797,7 +791,6 @@ int ProcXFixesExpandRegion (ClientPtr client) { RegionPtr pSource, pDestination; - int ret = Success; REQUEST (xXFixesExpandRegionReq); BoxPtr pTmp; BoxPtr pSrc; @@ -831,9 +824,7 @@ ProcXFixesExpandRegion (ClientPtr client) } free(pTmp); } - if (ret == Success) - ret = client->noClientException; - return ret; + return Success; } int |