summaryrefslogtreecommitdiff
path: root/xfixes
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2010-05-10 20:22:05 -0700
committerJamey Sharp <jamey@minilop.net>2010-05-13 17:14:07 -0700
commit92ed75ac59e2d3af149cddb962efd05fc8487750 (patch)
treec05f3b03627ebd67a921fcec5cef3655083bb345 /xfixes
parent11c69880c7c48ef9e755c4e09fadef7a629d7bc7 (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')
-rw-r--r--xfixes/cursor.c16
-rw-r--r--xfixes/region.c49
-rw-r--r--xfixes/saveset.c6
-rw-r--r--xfixes/xfixes.c2
4 files changed, 30 insertions, 43 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index b7e6c7b8c..d5f8b290b 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -424,7 +424,7 @@ ProcXFixesGetCursorImage (ClientPtr client)
WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
(npixels << 2), (char *) rep);
free(rep);
- return client->noClientException;
+ return Success;
}
int
@@ -452,7 +452,7 @@ ProcXFixesSetCursorName (ClientPtr client)
return BadAlloc;
pCursor->name = atom;
- return(client->noClientException);
+ return Success;
}
int
@@ -501,7 +501,7 @@ ProcXFixesGetCursorName (ClientPtr client)
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
WriteToClient(client, len, str);
- return(client->noClientException);
+ return Success;
}
int
@@ -584,7 +584,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
(npixels << 2) + nbytesRound, (char *) rep);
free(rep);
- return client->noClientException;
+ return Success;
}
int
@@ -719,7 +719,7 @@ ProcXFixesChangeCursor (ClientPtr client)
DixWriteAccess|DixSetAttrAccess);
ReplaceCursor (pSource, TestForCursor, (pointer) pDestination);
- return (client->noClientException);
+ return Success;
}
int
@@ -757,7 +757,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
name = MakeAtom (tchar, stuff->nbytes, FALSE);
if (name)
ReplaceCursor (pSource, TestForCursorName, &name);
- return (client->noClientException);
+ return Success;
}
int
@@ -895,7 +895,7 @@ ProcXFixesHideCursor (ClientPtr client)
pChc = findCursorHideCount(client, pWin->drawable.pScreen);
if (pChc != NULL) {
pChc->hideCount++;
- return client->noClientException;
+ return Success;
}
/*
@@ -969,7 +969,7 @@ ProcXFixesShowCursor (ClientPtr client)
FreeResource(pChc->resource, 0);
}
- return (client->noClientException);
+ return Success;
}
int
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
diff --git a/xfixes/saveset.c b/xfixes/saveset.c
index 29de0d8f2..3c0504f7f 100644
--- a/xfixes/saveset.c
+++ b/xfixes/saveset.c
@@ -57,11 +57,7 @@ ProcXFixesChangeSaveSet(ClientPtr client)
}
toRoot = (stuff->target == SaveSetRoot);
map = (stuff->map == SaveSetMap);
- result = AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
+ return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
}
int
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index 5163dc11e..49ed5a0d5 100644
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -92,7 +92,7 @@ ProcXFixesQueryVersion(ClientPtr client)
swapl(&rep.minorVersion, n);
}
WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep);
- return(client->noClientException);
+ return Success;
}
/* Major version controls available requests */