mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
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>
This commit is contained in:
parent
11c69880c7
commit
92ed75ac59
52 changed files with 475 additions and 621 deletions
|
|
@ -129,7 +129,7 @@ ProcXDGAQueryVersion(ClientPtr client)
|
|||
rep.minorVersion = SERVER_XDGA_MINOR_VERSION;
|
||||
|
||||
WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
|
|||
if(rep.length)
|
||||
WriteToClient(client, nameSize, deviceName);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ ProcXDGACloseFramebuffer(ClientPtr client)
|
|||
|
||||
DGACloseFramebuffer(stuff->screen);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -210,12 +210,12 @@ ProcXDGAQueryModes(ClientPtr client)
|
|||
rep.number = 0;
|
||||
rep.length = 0;
|
||||
WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if(!(num = DGAGetModes(stuff->screen))) {
|
||||
WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if(!(mode = (XDGAModePtr)malloc(num * sizeof(XDGAModeRec))))
|
||||
|
|
@ -269,7 +269,7 @@ ProcXDGAQueryModes(ClientPtr client)
|
|||
|
||||
free(mode);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ ProcXDGASetMode(ClientPtr client)
|
|||
DGASelectInput(stuff->screen, NULL, 0);
|
||||
DGASetMode(stuff->screen, 0, &mode, &pPix);
|
||||
WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
|
||||
|
|
@ -397,7 +397,7 @@ ProcXDGASetMode(ClientPtr client)
|
|||
WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
|
||||
WriteToClient(client, size, mode.name);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -415,7 +415,7 @@ ProcXDGASetViewport(ClientPtr client)
|
|||
|
||||
DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -435,14 +435,10 @@ ProcXDGAInstallColormap(ClientPtr client)
|
|||
|
||||
rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP,
|
||||
client, DixInstallAccess);
|
||||
if (rc == Success) {
|
||||
DGAInstallCmap(cmap);
|
||||
return (client->noClientException);
|
||||
} else {
|
||||
if (rc != Success)
|
||||
return (rc == BadValue) ? BadColor : rc;
|
||||
}
|
||||
|
||||
return (client->noClientException);
|
||||
DGAInstallCmap(cmap);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -462,7 +458,7 @@ ProcXDGASelectInput(ClientPtr client)
|
|||
if(DGA_GETCLIENT(stuff->screen) == client)
|
||||
DGASelectInput(stuff->screen, client, stuff->mask);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -483,7 +479,7 @@ ProcXDGAFillRectangle(ClientPtr client)
|
|||
stuff->width, stuff->height, stuff->color))
|
||||
return BadMatch;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -503,7 +499,7 @@ ProcXDGACopyArea(ClientPtr client)
|
|||
stuff->width, stuff->height, stuff->dstx, stuff->dsty))
|
||||
return BadMatch;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -524,7 +520,7 @@ ProcXDGACopyTransparentArea(ClientPtr client)
|
|||
stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key))
|
||||
return BadMatch;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -548,7 +544,7 @@ ProcXDGAGetViewportStatus(ClientPtr client)
|
|||
rep.status = DGAGetViewportStatus(stuff->screen);
|
||||
|
||||
WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -571,7 +567,7 @@ ProcXDGASync(ClientPtr client)
|
|||
DGASync(stuff->screen);
|
||||
|
||||
WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -592,7 +588,7 @@ ProcXDGASetClientVersion(ClientPtr client)
|
|||
pPriv->major = stuff->major;
|
||||
pPriv->minor = stuff->minor;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -623,7 +619,7 @@ ProcXDGAChangePixmapMode(ClientPtr client)
|
|||
rep.y = y;
|
||||
WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -649,7 +645,7 @@ ProcXDGACreateColormap(ClientPtr client)
|
|||
if(result != Success)
|
||||
return result;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -707,7 +703,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
|
|||
rep.ram_size = rep.bank_size >> 10;
|
||||
|
||||
WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -762,7 +758,7 @@ ProcXF86DGADirectVideo(ClientPtr client)
|
|||
DGA_SETCLIENT(stuff->screen, NULL);
|
||||
}
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -793,7 +789,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
|
|||
rep.height = mode.viewportHeight;
|
||||
|
||||
WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -819,7 +815,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
|
|||
!= Success)
|
||||
return DGAErrorBase + XF86DGADirectNotActivated;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -838,7 +834,7 @@ ProcXF86DGAGetVidPage(ClientPtr client)
|
|||
rep.vpage = 0; /* silently fail */
|
||||
|
||||
WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -854,7 +850,7 @@ ProcXF86DGASetVidPage(ClientPtr client)
|
|||
|
||||
/* silently fail */
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -880,7 +876,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
|
|||
client, DixInstallAccess);
|
||||
if (rc == Success) {
|
||||
DGAInstallCmap(pcmp);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
} else {
|
||||
return (rc == BadValue) ? BadColor : rc;
|
||||
}
|
||||
|
|
@ -905,7 +901,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client)
|
|||
rep.flags = XF86DGADirectPresent;
|
||||
|
||||
WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -931,7 +927,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
|
|||
rep.result = 1;
|
||||
|
||||
WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
#endif /* DGA_PROTOCOL_OLD_SUPPORT */
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ ProcXF86VidModeQueryVersion(ClientPtr client)
|
|||
swaps(&rep.minorVersion, n);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -495,7 +495,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
|
|||
WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
|
||||
(char *)&rep);
|
||||
}
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -590,7 +590,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
|
|||
|
||||
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
#define MODEMATCH(mode,stuff) \
|
||||
|
|
@ -761,7 +761,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
|
|||
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
ErrorF("AddModeLine - Succeeded\n");
|
||||
return client->noClientException;
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -874,7 +874,7 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
|
|||
VidModeDeleteModeline(stuff->screen, mode);
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
ErrorF("DeleteModeLine - Succeeded\n");
|
||||
return(client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
|
||||
|
||||
|
|
@ -1002,7 +1002,7 @@ ProcXF86VidModeModModeLine(ClientPtr client)
|
|||
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
ErrorF("ModModeLine - Succeeded\n");
|
||||
return(client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1120,7 +1120,7 @@ status_reply:
|
|||
WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
|
||||
return(client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1137,7 +1137,7 @@ ProcXF86VidModeSwitchMode(ClientPtr client)
|
|||
|
||||
VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1201,7 +1201,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
|
|||
|
||||
if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
|
||||
&& MODEMATCH(mode, stuff))
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
|
||||
if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
|
||||
return BadValue;
|
||||
|
|
@ -1230,7 +1230,7 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
|
|||
|
||||
if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
|
||||
ErrorF("SwitchToMode - Succeeded\n");
|
||||
return(client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
} while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
|
||||
|
||||
|
|
@ -1252,7 +1252,7 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client)
|
|||
if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
|
||||
return VidModeErrorBase + XF86VidModeZoomLocked;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1339,7 +1339,7 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
|
|||
free(hsyncdata);
|
||||
free(vsyncdata);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1371,7 +1371,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client)
|
|||
swapl(&rep.y, n);
|
||||
}
|
||||
WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1389,7 +1389,7 @@ ProcXF86VidModeSetViewPort(ClientPtr client)
|
|||
if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
|
||||
return BadValue;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1453,7 +1453,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client)
|
|||
}
|
||||
|
||||
free(Clocks);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1472,7 +1472,7 @@ ProcXF86VidModeSetGamma(ClientPtr client)
|
|||
((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
|
||||
return BadValue;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1506,7 +1506,7 @@ ProcXF86VidModeGetGamma(ClientPtr client)
|
|||
swapl(&rep.blue, n);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1533,7 +1533,7 @@ ProcXF86VidModeSetGammaRamp(ClientPtr client)
|
|||
if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
|
||||
return BadValue;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1584,7 +1584,7 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client)
|
|||
free(ramp);
|
||||
}
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1611,7 +1611,7 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client)
|
|||
}
|
||||
WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -1641,7 +1641,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client)
|
|||
}
|
||||
WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1665,7 +1665,7 @@ ProcXF86VidModeSetClientVersion(ClientPtr client)
|
|||
pPriv->major = stuff->major;
|
||||
pPriv->minor = stuff->minor;
|
||||
|
||||
return (client->noClientException);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in a new issue