summaryrefslogtreecommitdiff
path: root/dix
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 /dix
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 'dix')
-rw-r--r--dix/devices.c8
-rw-r--r--dix/dispatch.c354
-rw-r--r--dix/extension.c4
-rw-r--r--dix/property.c14
-rw-r--r--dix/selection.c8
5 files changed, 139 insertions, 249 deletions
diff --git a/dix/devices.c b/dix/devices.c
index db5c4a136..de72c8834 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1535,7 +1535,7 @@ ProcSetModifierMapping(ClientPtr client)
rep.success = rc;
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
- return client->noClientException;
+ return Success;
}
int
@@ -1561,7 +1561,7 @@ ProcGetModifierMapping(ClientPtr client)
free(modkeymap);
- return client->noClientException;
+ return Success;
}
int
@@ -1619,7 +1619,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
stuff->keyCodes, NULL, client);
}
- return client->noClientException;
+ return Success;
}
int
@@ -1722,7 +1722,7 @@ ProcGetKeyboardMapping(ClientPtr client)
free(syms->map);
free(syms);
- return client->noClientException;
+ return Success;
}
int
diff --git a/dix/dispatch.c b/dix/dispatch.c
index aee9143e9..fe9ddb2a8 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -437,16 +437,18 @@ Dispatch(void)
client->sequence, client->index, result);
#endif
- if (result != Success)
+ if (client->noClientException != Success)
{
- if (client->noClientException != Success)
- CloseDownClient(client);
- else
- SendErrorToClient(client, MAJOROP,
- MinorOpcodeOfRequest(client),
- client->errorValue, result);
+ CloseDownClient(client);
break;
- }
+ }
+ else if (result != Success)
+ {
+ SendErrorToClient(client, MAJOROP,
+ MinorOpcodeOfRequest(client),
+ client->errorValue, result);
+ break;
+ }
}
FlushAllOutput();
client = clients[clientReady[nready]];
@@ -668,10 +670,7 @@ ProcCreateWindow(ClientPtr client)
return BadAlloc;
pWin->eventMask = mask;
}
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return rc;
}
int
@@ -679,7 +678,7 @@ ProcChangeWindowAttributes(ClientPtr client)
{
WindowPtr pWin;
REQUEST(xChangeWindowAttributesReq);
- int result, len, rc;
+ int len, rc;
Mask access_mode = 0;
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
@@ -691,14 +690,10 @@ ProcChangeWindowAttributes(ClientPtr client)
len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq));
if (len != Ones(stuff->valueMask))
return BadLength;
- result = ChangeWindowAttributes(pWin,
+ return ChangeWindowAttributes(pWin,
stuff->valueMask,
(XID *) &stuff[1],
client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
}
int
@@ -716,7 +711,7 @@ ProcGetWindowAttributes(ClientPtr client)
memset(&wa, 0, sizeof(xGetWindowAttributesReply));
GetWindowAttributes(pWin, client, &wa);
WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa);
- return(client->noClientException);
+ return Success;
}
int
@@ -737,7 +732,7 @@ ProcDestroyWindow(ClientPtr client)
return rc;
FreeResource(stuff->id, RT_NONE);
}
- return(client->noClientException);
+ return Success;
}
int
@@ -752,7 +747,7 @@ ProcDestroySubwindows(ClientPtr client)
if (rc != Success)
return rc;
DestroySubwindows(pWin, client);
- return(client->noClientException);
+ return Success;
}
int
@@ -760,7 +755,7 @@ ProcChangeSaveSet(ClientPtr client)
{
WindowPtr pWin;
REQUEST(xChangeSaveSetReq);
- int result, rc;
+ int rc;
REQUEST_SIZE_MATCH(xChangeSaveSetReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
@@ -769,18 +764,9 @@ ProcChangeSaveSet(ClientPtr client)
if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
return BadMatch;
if ((stuff->mode == SetModeInsert) || (stuff->mode == SetModeDelete))
- {
- result = AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- else
- {
- client->errorValue = stuff->mode;
- return( BadValue );
- }
+ return AlterSaveSetForClient(client, pWin, stuff->mode, FALSE, TRUE);
+ client->errorValue = stuff->mode;
+ return BadValue;
}
int
@@ -788,7 +774,7 @@ ProcReparentWindow(ClientPtr client)
{
WindowPtr pWin, pParent;
REQUEST(xReparentWindowReq);
- int result, rc;
+ int rc;
REQUEST_SIZE_MATCH(xReparentWindowReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
@@ -797,23 +783,16 @@ ProcReparentWindow(ClientPtr client)
rc = dixLookupWindow(&pParent, stuff->parent, client, DixAddAccess);
if (rc != Success)
return rc;
- if (SAME_SCREENS(pWin->drawable, pParent->drawable))
- {
- if ((pWin->backgroundState == ParentRelative) &&
- (pParent->drawable.depth != pWin->drawable.depth))
- return BadMatch;
- if ((pWin->drawable.class != InputOnly) &&
- (pParent->drawable.class == InputOnly))
- return BadMatch;
- result = ReparentWindow(pWin, pParent,
- (short)stuff->x, (short)stuff->y, client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
- }
- else
- return (BadMatch);
+ if (!SAME_SCREENS(pWin->drawable, pParent->drawable))
+ return BadMatch;
+ if ((pWin->backgroundState == ParentRelative) &&
+ (pParent->drawable.depth != pWin->drawable.depth))
+ return BadMatch;
+ if ((pWin->drawable.class != InputOnly) &&
+ (pParent->drawable.class == InputOnly))
+ return BadMatch;
+ return ReparentWindow(pWin, pParent,
+ (short)stuff->x, (short)stuff->y, client);
}
int
@@ -829,7 +808,7 @@ ProcMapWindow(ClientPtr client)
return rc;
MapWindow(pWin, client);
/* update cache to say it is mapped */
- return(client->noClientException);
+ return Success;
}
int
@@ -845,7 +824,7 @@ ProcMapSubwindows(ClientPtr client)
return rc;
MapSubwindows(pWin, client);
/* update cache to say it is mapped */
- return(client->noClientException);
+ return Success;
}
int
@@ -861,7 +840,7 @@ ProcUnmapWindow(ClientPtr client)
return rc;
UnmapWindow(pWin, FALSE);
/* update cache to say it is mapped */
- return(client->noClientException);
+ return Success;
}
int
@@ -876,7 +855,7 @@ ProcUnmapSubwindows(ClientPtr client)
if (rc != Success)
return rc;
UnmapSubwindows(pWin);
- return(client->noClientException);
+ return Success;
}
int
@@ -884,7 +863,6 @@ ProcConfigureWindow(ClientPtr client)
{
WindowPtr pWin;
REQUEST(xConfigureWindowReq);
- int result;
int len, rc;
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
@@ -895,12 +873,7 @@ ProcConfigureWindow(ClientPtr client)
len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq));
if (Ones((Mask)stuff->mask) != len)
return BadLength;
- result = ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1],
- client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
+ return ConfigureWindow(pWin, (Mask)stuff->mask, (XID *) &stuff[1], client);
}
int
@@ -921,7 +894,7 @@ ProcCirculateWindow(ClientPtr client)
if (rc != Success)
return rc;
CirculateWindow(pWin, (int)stuff->direction, client);
- return(client->noClientException);
+ return Success;
}
static int
@@ -980,7 +953,7 @@ ProcGetGeometry(ClientPtr client)
return status;
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
- return(client->noClientException);
+ return Success;
}
@@ -1030,7 +1003,7 @@ ProcQueryTree(ClientPtr client)
free(childIDs);
}
- return(client->noClientException);
+ return Success;
}
int
@@ -1057,7 +1030,7 @@ ProcInternAtom(ClientPtr client)
reply.sequenceNumber = client->sequence;
reply.atom = atom;
WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
- return(client->noClientException);
+ return Success;
}
else
return (BadAlloc);
@@ -1082,7 +1055,7 @@ ProcGetAtomName(ClientPtr client)
reply.nameLength = len;
WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
(void)WriteToClient(client, len, str);
- return(client->noClientException);
+ return Success;
}
else
{
@@ -1102,7 +1075,7 @@ ProcGrabServer(ClientPtr client)
client->sequence--;
BITSET(grabWaiters, client->index);
IgnoreClient(client);
- return(client->noClientException);
+ return Success;
}
rc = OnlyListenToOneClient(client);
if (rc != Success)
@@ -1118,7 +1091,7 @@ ProcGrabServer(ClientPtr client)
CallCallbacks(&ServerGrabCallback, (pointer)&grabinfo);
}
- return(client->noClientException);
+ return Success;
}
static void
@@ -1153,7 +1126,7 @@ ProcUngrabServer(ClientPtr client)
{
REQUEST_SIZE_MATCH(xReq);
UngrabServer(client);
- return(client->noClientException);
+ return Success;
}
int
@@ -1227,7 +1200,7 @@ ProcTranslateCoords(ClientPtr client)
rep.dstY = y - pDst->drawable.y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
- return(client->noClientException);
+ return Success;
}
int
@@ -1243,7 +1216,7 @@ ProcOpenFont(ClientPtr client)
stuff->nbytes, (char *)&stuff[1]);
if (err == Success)
{
- return(client->noClientException);
+ return Success;
}
else
return err;
@@ -1262,7 +1235,7 @@ ProcCloseFont(ClientPtr client)
if (rc == Success)
{
FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
+ return Success;
}
else
{
@@ -1314,7 +1287,7 @@ ProcQueryFont(ClientPtr client)
WriteReplyToClient(client, rlength, reply);
free(reply);
- return(client->noClientException);
+ return Success;
}
}
@@ -1355,7 +1328,7 @@ ProcQueryTextExtents(ClientPtr client)
reply.overallLeft = info.overallLeft;
reply.overallRight = info.overallRight;
WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
- return(client->noClientException);
+ return Success;
}
int
@@ -1456,7 +1429,7 @@ CreatePmap:
return rc;
}
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
- return(client->noClientException);
+ return Success;
(*pDraw->pScreen->DestroyPixmap)(pMap);
}
return (BadAlloc);
@@ -1475,7 +1448,7 @@ ProcFreePixmap(ClientPtr client)
if (rc == Success)
{
FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
+ return Success;
}
else
{
@@ -1510,7 +1483,7 @@ ProcCreateGC(ClientPtr client)
return error;
if (!AddResource(stuff->gc, RT_GC, (pointer)pGC))
return (BadAlloc);
- return(client->noClientException);
+ return Success;
}
int
@@ -1530,11 +1503,7 @@ ProcChangeGC(ClientPtr client)
if (len != Ones(stuff->mask))
return BadLength;
- result = ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
+ return ChangeGCXIDs(client, pGC, stuff->mask, (CARD32 *) &stuff[1]);
}
int
@@ -1559,11 +1528,7 @@ ProcCopyGC(ClientPtr client)
client->errorValue = stuff->mask;
return BadValue;
}
- result = CopyGC(pGC, dstGC, stuff->mask);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
+ return CopyGC(pGC, dstGC, stuff->mask);
}
int
@@ -1584,17 +1549,11 @@ ProcSetDashes(ClientPtr client)
if (result != Success)
return result;
- result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes,
+ /* If there's an error, either there's no sensible errorValue,
+ * or there was a dash segment of 0. */
+ client->errorValue = 0;
+ return SetDashes(pGC, stuff->dashOffset, stuff->nDashes,
(unsigned char *)&stuff[1]);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- {
- /* If there's an error, either there's no sensible errorValue,
- * or there was a dash segment of 0. */
- client->errorValue = 0;
- return(result);
- }
}
int
@@ -1619,12 +1578,8 @@ ProcSetClipRectangles(ClientPtr client)
if (nr & 4)
return(BadLength);
nr >>= 3;
- result = SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin,
+ return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin,
nr, (xRectangle *)&stuff[1], (int)stuff->ordering);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
}
int
@@ -1640,7 +1595,7 @@ ProcFreeGC(ClientPtr client)
return rc;
FreeResource(stuff->id, RT_NONE);
- return(client->noClientException);
+ return Success;
}
int
@@ -1667,7 +1622,7 @@ ProcClearToBackground(ClientPtr client)
(*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y,
stuff->width, stuff->height,
(Bool)stuff->exposures);
- return(client->noClientException);
+ return Success;
}
int
@@ -1709,7 +1664,7 @@ ProcCopyArea(ClientPtr client)
REGION_DESTROY(pDst->pScreen, pRgn);
}
- return(client->noClientException);
+ return Success;
}
int
@@ -1758,7 +1713,7 @@ ProcCopyPlane(ClientPtr client)
if (pRgn)
REGION_DESTROY(pdstDraw->pScreen, pRgn);
}
- return(client->noClientException);
+ return Success;
}
int
@@ -1781,7 +1736,7 @@ ProcPolyPoint(ClientPtr client)
if (npoint)
(*pGC->ops->PolyPoint)(pDraw, pGC, stuff->coordMode, npoint,
(xPoint *) &stuff[1]);
- return (client->noClientException);
+ return Success;
}
int
@@ -1804,7 +1759,7 @@ ProcPolyLine(ClientPtr client)
if (npoint > 1)
(*pGC->ops->Polylines)(pDraw, pGC, stuff->coordMode, npoint,
(DDXPointPtr) &stuff[1]);
- return(client->noClientException);
+ return Success;
}
int
@@ -1823,7 +1778,7 @@ ProcPolySegment(ClientPtr client)
nsegs >>= 3;
if (nsegs)
(*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]);
- return (client->noClientException);
+ return Success;
}
int
@@ -1843,7 +1798,7 @@ ProcPolyRectangle (ClientPtr client)
if (nrects)
(*pGC->ops->PolyRectangle)(pDraw, pGC,
nrects, (xRectangle *) &stuff[1]);
- return(client->noClientException);
+ return Success;
}
int
@@ -1862,7 +1817,7 @@ ProcPolyArc(ClientPtr client)
narcs /= sizeof(xArc);
if (narcs)
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]);
- return (client->noClientException);
+ return Success;
}
int
@@ -1893,7 +1848,7 @@ ProcFillPoly(ClientPtr client)
(*pGC->ops->FillPolygon) (pDraw, pGC, stuff->shape,
stuff->coordMode, things,
(DDXPointPtr) &stuff[1]);
- return(client->noClientException);
+ return Success;
}
int
@@ -1914,7 +1869,7 @@ ProcPolyFillRectangle(ClientPtr client)
if (things)
(*pGC->ops->PolyFillRect) (pDraw, pGC, things,
(xRectangle *) &stuff[1]);
- return (client->noClientException);
+ return Success;
}
int
@@ -1933,7 +1888,7 @@ ProcPolyFillArc(ClientPtr client)
narcs /= sizeof(xArc);
if (narcs)
(*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]);
- return (client->noClientException);
+ return Success;
}
#ifdef MATCH_CLIENT_ENDIAN
@@ -2044,7 +1999,7 @@ ProcPutImage(ClientPtr client)
stuff->width, stuff->height,
stuff->leftPad, stuff->format, tmpImage);
- return (client->noClientException);
+ return Success;
}
static int
@@ -2288,7 +2243,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
if (!im_return)
free(pBuf);
- return (client->noClientException);
+ return Success;
}
int
@@ -2327,7 +2282,7 @@ ProcPolyText(ClientPtr client)
if (err == Success)
{
- return(client->noClientException);
+ return Success;
}
else
return err;
@@ -2357,7 +2312,7 @@ ProcImageText8(ClientPtr client)
if (err == Success)
{
- return(client->noClientException);
+ return Success;
}
else
return err;
@@ -2387,7 +2342,7 @@ ProcImageText16(ClientPtr client)
if (err == Success)
{
- return(client->noClientException);
+ return Success;
}
else
return err;
@@ -2425,12 +2380,8 @@ ProcCreateColormap(ClientPtr client)
{
if (pVisual->vid != stuff->visual)
continue;
- result = CreateColormap(mid, pScreen, pVisual, &pmap,
+ return CreateColormap(mid, pScreen, pVisual, &pmap,
(int)stuff->alloc, client->index);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
}
client->errorValue = stuff->visual;
return(BadMatch);
@@ -2451,7 +2402,7 @@ ProcFreeColormap(ClientPtr client)
/* Freeing a default colormap is a no-op */
if (!(pmap->flags & IsDefault))
FreeResource(stuff->id, RT_NONE);
- return (client->noClientException);
+ return Success;
}
else
{
@@ -2475,18 +2426,9 @@ ProcCopyColormapAndFree(ClientPtr client)
rc = dixLookupResourceByType((pointer *)&pSrcMap, stuff->srcCmap, RT_COLORMAP,
client, DixReadAccess|DixRemoveAccess);
if (rc == Success)
- {
- rc = CopyColormapAndFree(mid, pSrcMap, client->index);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
- }
- else
- {
- client->errorValue = stuff->srcCmap;
- return (rc == BadValue) ? BadColor : rc;
- }
+ return CopyColormapAndFree(mid, pSrcMap, client->index);
+ client->errorValue = stuff->srcCmap;
+ return (rc == BadValue) ? BadColor : rc;
}
int
@@ -2507,8 +2449,8 @@ ProcInstallColormap(ClientPtr client)
goto out;
(*(pcmp->pScreen->InstallColormap)) (pcmp);
+ return Success;
- rc = client->noClientException;
out:
client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc;
@@ -2533,8 +2475,8 @@ ProcUninstallColormap(ClientPtr client)
if(pcmp->mid != pcmp->pScreen->defColormap)
(*(pcmp->pScreen->UninstallColormap)) (pcmp);
+ return Success;
- rc = client->noClientException;
out:
client->errorValue = stuff->id;
return (rc == BadValue) ? BadColor : rc;
@@ -2551,12 +2493,12 @@ ProcListInstalledColormaps(ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
if (rc != Success)
- goto out;
+ return rc;
rc = XaceHook(XACE_SCREEN_ACCESS, client, pWin->drawable.pScreen,
DixGetAttrAccess);
if (rc != Success)
- goto out;
+ return rc;
preply = malloc(sizeof(xListInstalledColormapsReply) +
pWin->drawable.pScreen->maxInstalledCmaps *
@@ -2574,9 +2516,7 @@ ProcListInstalledColormaps(ClientPtr client)
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
free(preply);
- rc = client->noClientException;
-out:
- return rc;
+ return Success;
}
int
@@ -2601,17 +2541,12 @@ ProcAllocColor (ClientPtr client)
acr.pixel = 0;
if( (rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
&acr.pixel, client->index)) )
- {
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
- }
+ return rc;
#ifdef PANORAMIX
if (noPanoramiXExtension || !pmap->pScreen->myNum)
#endif
WriteReplyToClient(client, sizeof(xAllocColorReply), &acr);
- return (client->noClientException);
+ return Success;
}
else
@@ -2649,17 +2584,12 @@ ProcAllocNamedColor (ClientPtr client)
if( (rc = AllocColor(pcmp,
&ancr.screenRed, &ancr.screenGreen, &ancr.screenBlue,
&ancr.pixel, client->index)) )
- {
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
- }
+ return rc;
#ifdef PANORAMIX
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif
WriteReplyToClient(client, sizeof (xAllocNamedColorReply), &ancr);
- return (client->noClientException);
+ return Success;
}
else
return(BadName);
@@ -2711,10 +2641,7 @@ ProcAllocColorCells (ClientPtr client)
(Bool)stuff->contiguous, ppixels, pmasks)) )
{
free(ppixels);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return rc;
}
#ifdef PANORAMIX
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
@@ -2730,7 +2657,7 @@ ProcAllocColorCells (ClientPtr client)
WriteSwappedDataToClient(client, length, ppixels);
}
free(ppixels);
- return (client->noClientException);
+ return Success;
}
else
{
@@ -2780,10 +2707,7 @@ ProcAllocColorPlanes(ClientPtr client)
&acpr.redMask, &acpr.greenMask, &acpr.blueMask)) )
{
free(ppixels);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return rc;
}
acpr.length = bytes_to_int32(length);
#ifdef PANORAMIX
@@ -2795,7 +2719,7 @@ ProcAllocColorPlanes(ClientPtr client)
WriteSwappedDataToClient(client, length, ppixels);
}
free(ppixels);
- return (client->noClientException);
+ return Success;
}
else
{
@@ -2821,13 +2745,8 @@ ProcFreeColors(ClientPtr client)
if(pcmp->flags & AllAllocated)
return(BadAccess);
count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq));
- rc = FreeColors(pcmp, client->index, count,
+ return FreeColors(pcmp, client->index, count,
(Pixel *)&stuff[1], (Pixel)stuff->planeMask);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
-
}
else
{
@@ -2854,11 +2773,7 @@ ProcStoreColors (ClientPtr client)
if (count % sizeof(xColorItem))
return(BadLength);
count /= sizeof(xColorItem);
- rc = StoreColors(pcmp, count, (xColorItem *)&stuff[1], client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return StoreColors(pcmp, count, (xColorItem *)&stuff[1], client);
}
else
{
@@ -2886,11 +2801,7 @@ ProcStoreNamedColor (ClientPtr client)
{
def.flags = stuff->flags;
def.pixel = stuff->pixel;
- rc = StoreColors(pcmp, 1, &def, client);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return StoreColors(pcmp, 1, &def, client);
}
return (BadName);
}
@@ -2924,10 +2835,7 @@ ProcQueryColors(ClientPtr client)
if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) )
{
if (prgbs) free(prgbs);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return rc;
+ return rc;
}
memset(&qcr, 0, sizeof(xQueryColorsReply));
qcr.type = X_Reply;
@@ -2941,7 +2849,7 @@ ProcQueryColors(ClientPtr client)
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
}
if (prgbs) free(prgbs);
- return(client->noClientException);
+ return Success;
}
else
@@ -2979,7 +2887,7 @@ ProcLookupColor(ClientPtr client)
&lcr.screenBlue,
pcmp->pVisual);
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
- return(client->noClientException);
+ return Success;
}
return (BadName);
}
@@ -3078,7 +2986,7 @@ ProcCreateCursor (ClientPtr client)
if (!AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
return BadAlloc;
- return client->noClientException;
+ return Success;
}
int
@@ -3100,7 +3008,7 @@ ProcCreateGlyphCursor (ClientPtr client)
if (res != Success)
return res;
if (AddResource(stuff->cid, RT_CURSOR, (pointer)pCursor))
- return client->noClientException;
+ return Success;
return BadAlloc;
}
@@ -3118,7 +3026,7 @@ ProcFreeCursor (ClientPtr client)
if (rc == Success)
{
FreeResource(stuff->id, RT_NONE);
- return (client->noClientException);
+ return Success;
}
else
{
@@ -3164,7 +3072,7 @@ ProcQueryBestSize (ClientPtr client)
reply.width = stuff->width;
reply.height = stuff->height;
WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
- return (client->noClientException);
+ return Success;
}
@@ -3228,7 +3136,7 @@ ProcSetScreenSaver (ClientPtr client)
ScreenSaverInterval = defaultScreenSaverInterval;
SetScreenSaverTimer();
- return (client->noClientException);
+ return Success;
}
int
@@ -3253,31 +3161,24 @@ ProcGetScreenSaver(ClientPtr client)
rep.preferBlanking = ScreenSaverBlanking;
rep.allowExposures = ScreenSaverAllowExposures;
WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
- return (client->noClientException);
+ return Success;
}
int
ProcChangeHosts(ClientPtr client)
{
REQUEST(xChangeHostsReq);
- int result;
REQUEST_FIXED_SIZE(xChangeHostsReq, stuff->hostLength);
if(stuff->mode == HostInsert)
- result = AddHost(client, (int)stuff->hostFamily,
+ return AddHost(client, (int)stuff->hostFamily,
stuff->hostLength, (pointer)&stuff[1]);
- else if (stuff->mode == HostDelete)
- result = RemoveHost(client, (int)stuff->hostFamily,
+ if (stuff->mode == HostDelete)
+ return RemoveHost(client, (int)stuff->hostFamily,
stuff->hostLength, (pointer)&stuff[1]);
- else
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
- if (!result)
- result = client->noClientException;
- return (result);
+ client->errorValue = stuff->mode;
+ return BadValue;
}
int
@@ -3309,13 +3210,12 @@ ProcListHosts(ClientPtr client)
WriteSwappedDataToClient(client, len, pdata);
}
free(pdata);
- return (client->noClientException);
+ return Success;
}
int
ProcChangeAccessControl(ClientPtr client)
{
- int result;
REQUEST(xSetAccessControlReq);
REQUEST_SIZE_MATCH(xSetAccessControlReq);
@@ -3324,10 +3224,7 @@ ProcChangeAccessControl(ClientPtr client)
client->errorValue = stuff->mode;
return BadValue;
}
- result = ChangeAccessControl(client, stuff->mode == EnableAccess);
- if (!result)
- result = client->noClientException;
- return (result);
+ return ChangeAccessControl(client, stuff->mode == EnableAccess);
}
/*********************
@@ -3363,7 +3260,7 @@ ProcKillClient(ClientPtr client)
if (stuff->id == AllTemporary)
{
CloseDownRetainedResources();
- return (client->noClientException);
+ return Success;
}
rc = dixLookupClient(&killclient, stuff->id, client, DixDestroyAccess);
@@ -3378,7 +3275,7 @@ ProcKillClient(ClientPtr client)
isItTimeToYield = TRUE;
return (Success);
}
- return (client->noClientException);
+ return Success;
}
else
return rc;
@@ -3390,7 +3287,7 @@ ProcSetFontPath(ClientPtr client)
unsigned char *ptr;
unsigned long nbytes, total;
long nfonts;
- int n, result;
+ int n;
REQUEST(xSetFontPathReq);
REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
@@ -3408,10 +3305,7 @@ ProcSetFontPath(ClientPtr client)
}
if (total >= 4)
return(BadLength);
- result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
- if (!result)
- result = client->noClientException;
- return (result);
+ return SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
}
int
@@ -3435,7 +3329,7 @@ ProcGetFontPath(ClientPtr client)
WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
if (stringLens || numpaths)
(void)WriteToClient(client, stringLens + numpaths, (char *)bufferStart);
- return(client->noClientException);
+ return Success;
}
int
@@ -3454,7 +3348,7 @@ ProcChangeCloseDownMode(ClientPtr client)
(stuff->mode == RetainTemporary))
{
client->closeDownMode = stuff->mode;
- return (client->noClientException);
+ return Success;
}
else
{
@@ -3479,7 +3373,7 @@ int ProcForceScreenSaver(ClientPtr client)
rc = dixSaveScreens(client, SCREEN_SAVER_FORCER, (int)stuff->mode);
if (rc != Success)
return rc;
- return client->noClientException;
+ return Success;
}
int ProcNoOperation(ClientPtr client)
@@ -3487,7 +3381,7 @@ int ProcNoOperation(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xReq);
/* noop -- don't do anything */
- return(client->noClientException);
+ return Success;
}
void
@@ -3705,7 +3599,7 @@ ProcInitialConnection(ClientPtr client)
swaps(&stuff->length, whichbyte);
}
ResetCurrentRequest(client);
- return (client->noClientException);
+ return Success;
}
static int
@@ -3802,7 +3696,7 @@ SendConnSetup(ClientPtr client, char *reason)
clientinfo.setup = (xConnSetup *)lConnectionInfo;
CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
}
- return (client->noClientException);
+ return Success;
}
int
@@ -3836,7 +3730,7 @@ ProcEstablishConnection(ClientPtr client)
client->clientState = ClientStateCheckedSecurity;
else if (client->clientState != ClientStateAuthenticating)
return(SendConnSetup(client, reason));
- return(client->noClientException);
+ return Success;
}
void
diff --git a/dix/extension.c b/dix/extension.c
index 6940b68b0..d3d4db042 100644
--- a/dix/extension.c
+++ b/dix/extension.c
@@ -293,7 +293,7 @@ ProcQueryExtension(ClientPtr client)
}
}
WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply);
- return(client->noClientException);
+ return Success;
}
int
@@ -354,5 +354,5 @@ ProcListExtensions(ClientPtr client)
WriteToClient(client, total_length, buffer);
free(buffer);
}
- return(client->noClientException);
+ return Success;
}
diff --git a/dix/property.c b/dix/property.c
index 74d3d7826..03b70efc6 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -244,7 +244,7 @@ ProcChangeProperty(ClientPtr client)
if (err != Success)
return err;
else
- return client->noClientException;
+ return Success;
}
int
@@ -442,7 +442,7 @@ NullPropertyReply(
reply->propertyType = propertyType;
reply->format = format;
WriteReplyToClient(client, sizeof(xGenericReply), reply);
- return(client->noClientException);
+ return Success;
}
/*****************
@@ -574,7 +574,7 @@ ProcGetProperty(ClientPtr client)
free(pProp->data);
free(pProp);
}
- return(client->noClientException);
+ return Success;
}
int
@@ -620,7 +620,7 @@ ProcListProperties(ClientPtr client)
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
}
free(pAtoms);
- return(client->noClientException);
+ return Success;
}
int
@@ -641,9 +641,5 @@ ProcDeleteProperty(ClientPtr client)
return (BadAtom);
}
- result = DeleteProperty(client, pWin, stuff->property);
- if (client->noClientException != Success)
- return(client->noClientException);
- else
- return(result);
+ return DeleteProperty(client, pWin, stuff->property);
}
diff --git a/dix/selection.c b/dix/selection.c
index 6a13572fb..4f592d123 100644
--- a/dix/selection.c
+++ b/dix/selection.c
@@ -225,7 +225,7 @@ ProcSetSelectionOwner(ClientPtr client)
pSel->client = (pWin ? client : NullClient);
CallSelectionCallback(pSel, client, SelectionSetOwner);
- return client->noClientException;
+ return Success;
}
int
@@ -257,7 +257,7 @@ ProcGetSelectionOwner(ClientPtr client)
return rc;
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
- return client->noClientException;
+ return Success;
}
int
@@ -298,7 +298,7 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionRequest.property = stuff->property;
if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab))
- return client->noClientException;
+ return Success;
}
event.u.u.type = SelectionNotify;
@@ -309,5 +309,5 @@ ProcConvertSelection(ClientPtr client)
event.u.selectionNotify.property = None;
TryClientEvents(client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab);
- return client->noClientException;
+ return Success;
}