Remove unnecessary parentheses around return values in functions

This patch was generated by the following Perl code:

perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;'

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Mikhail Gusarov 2010-06-06 21:18:40 +07:00 committed by Keith Packard
parent b3a7b229e1
commit 7287ef9e6c
145 changed files with 847 additions and 847 deletions

View File

@ -339,7 +339,7 @@ XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
PanoramiXRes *res = (PanoramiXRes*)resource;
PanoramiXSearchData *data = (PanoramiXSearchData*)privdata;
return (res->info[data->screen].id == data->id);
return res->info[data->screen].id == data->id;
}
PanoramiXRes *

View File

@ -155,7 +155,7 @@ int PanoramiXCreateWindow(ClientPtr client)
else
free(newWin);
return (result);
return result;
}
@ -227,7 +227,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
result = (*SavedProcVector[X_ChangeWindowAttributes])(client);
}
return (result);
return result;
}
@ -253,7 +253,7 @@ int PanoramiXDestroyWindow(ClientPtr client)
/* Since ProcDestroyWindow is using FreeResource, it will free
our resource for us on the last pass through the loop above */
return (result);
return result;
}
@ -279,7 +279,7 @@ int PanoramiXDestroySubwindows(ClientPtr client)
/* DestroySubwindows is using FreeResource which will free
our resources for us on the last pass through the loop above */
return (result);
return result;
}
@ -302,7 +302,7 @@ int PanoramiXChangeSaveSet(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -341,7 +341,7 @@ int PanoramiXReparentWindow(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -364,7 +364,7 @@ int PanoramiXMapWindow(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -387,7 +387,7 @@ int PanoramiXMapSubwindows(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -410,7 +410,7 @@ int PanoramiXUnmapWindow(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -433,7 +433,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -502,7 +502,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -525,7 +525,7 @@ int PanoramiXCirculateWindow(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -679,7 +679,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
else
free(newPix);
return (result);
return result;
}
@ -707,7 +707,7 @@ int PanoramiXFreePixmap(ClientPtr client)
/* Since ProcFreePixmap is using FreeResource, it will free
our resource for us on the last pass through the loop above */
return (result);
return result;
}
@ -789,7 +789,7 @@ int PanoramiXCreateGC(ClientPtr client)
else
free(newGC);
return (result);
return result;
}
int PanoramiXChangeGC(ClientPtr client)
@ -855,7 +855,7 @@ int PanoramiXChangeGC(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -884,7 +884,7 @@ int PanoramiXCopyGC(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -907,7 +907,7 @@ int PanoramiXSetDashes(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -930,7 +930,7 @@ int PanoramiXSetClipRectangles(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -956,7 +956,7 @@ int PanoramiXFreeGC(ClientPtr client)
/* Since ProcFreeGC is using FreeResource, it will free
our resource for us on the last pass through the loop above */
return (result);
return result;
}
@ -987,7 +987,7 @@ int PanoramiXClearToBackground(ClientPtr client)
if(result != Success) break;
}
return (result);
return result;
}
@ -1069,7 +1069,7 @@ int PanoramiXCopyArea(ClientPtr client)
if(drawables[0]->depth != pDst->depth) {
client->errorValue = stuff->dstDrawable;
free(data);
return (BadMatch);
return BadMatch;
}
(*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
@ -1112,7 +1112,7 @@ int PanoramiXCopyArea(ClientPtr client)
if ((pDst->pScreen != pSrc->pScreen) ||
(pDst->depth != pSrc->depth)) {
client->errorValue = stuff->dstDrawable;
return (BadMatch);
return BadMatch;
}
} else
pSrc = pDst;
@ -1215,7 +1215,7 @@ int PanoramiXCopyPlane(ClientPtr client)
if (pdstDraw->pScreen != psrcDraw->pScreen) {
client->errorValue = stuff->dstDrawable;
return (BadMatch);
return BadMatch;
}
} else
psrcDraw = pdstDraw;
@ -1223,7 +1223,7 @@ int PanoramiXCopyPlane(ClientPtr client)
if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
(stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) {
client->errorValue = stuff->bitPlane;
return(BadValue);
return BadValue;
}
pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC,
@ -1305,7 +1305,7 @@ int PanoramiXPolyPoint(ClientPtr client)
if(result != Success) break;
}
free(origPts);
return (result);
return result;
} else
return Success;
}
@ -1365,7 +1365,7 @@ int PanoramiXPolyLine(ClientPtr client)
if(result != Success) break;
}
free(origPts);
return (result);
return result;
} else
return Success;
}
@ -1428,7 +1428,7 @@ int PanoramiXPolySegment(ClientPtr client)
if(result != Success) break;
}
free(origSegs);
return (result);
return result;
} else
return Success;
}
@ -1490,7 +1490,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
if(result != Success) break;
}
free(origRecs);
return (result);
return result;
} else
return Success;
}
@ -1550,7 +1550,7 @@ int PanoramiXPolyArc(ClientPtr client)
if(result != Success) break;
}
free(origArcs);
return (result);
return result;
} else
return Success;
}
@ -1611,7 +1611,7 @@ int PanoramiXFillPoly(ClientPtr client)
if(result != Success) break;
}
free(locPts);
return (result);
return result;
} else
return Success;
}
@ -1672,7 +1672,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
if(result != Success) break;
}
free(origRects);
return (result);
return result;
} else
return Success;
}
@ -1733,7 +1733,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
if(result != Success) break;
}
free(origArcs);
return (result);
return result;
} else
return Success;
}
@ -1775,7 +1775,7 @@ int PanoramiXPutImage(ClientPtr client)
result = (* SavedProcVector[X_PutImage])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -1798,7 +1798,7 @@ int PanoramiXGetImage(ClientPtr client)
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
return(BadValue);
return BadValue;
}
rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
@ -1815,7 +1815,7 @@ int PanoramiXGetImage(ClientPtr client)
return rc;
if(!((WindowPtr)pDraw)->realized)
return(BadMatch);
return BadMatch;
x = stuff->x;
y = stuff->y;
@ -1830,7 +1830,7 @@ int PanoramiXGetImage(ClientPtr client)
if( /* check for being onscreen */
x < 0 || x + w > PanoramiXPixWidth ||
y < 0 || y + h > PanoramiXPixHeight )
return(BadMatch);
return BadMatch;
} else {
if( /* check for being onscreen */
screenInfo.screens[0]->x + pDraw->x + x < 0 ||
@ -1842,7 +1842,7 @@ int PanoramiXGetImage(ClientPtr client)
x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
y < -wBorderWidth((WindowPtr)pDraw) ||
y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
return(BadMatch);
return BadMatch;
}
drawables[0] = pDraw;
@ -1884,7 +1884,7 @@ int PanoramiXGetImage(ClientPtr client)
}
length = linesPerBuf * widthBytesLine;
if(!(pBuf = malloc(length)))
return (BadAlloc);
return BadAlloc;
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
@ -1976,7 +1976,7 @@ PanoramiXPolyText8(ClientPtr client)
result = (*SavedProcVector[X_PolyText8])(client);
if(result != Success) break;
}
return (result);
return result;
}
int
@ -2017,7 +2017,7 @@ PanoramiXPolyText16(ClientPtr client)
result = (*SavedProcVector[X_PolyText16])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2058,7 +2058,7 @@ int PanoramiXImageText8(ClientPtr client)
result = (*SavedProcVector[X_ImageText8])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2099,7 +2099,7 @@ int PanoramiXImageText16(ClientPtr client)
result = (*SavedProcVector[X_ImageText16])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2139,7 +2139,7 @@ int PanoramiXCreateColormap(ClientPtr client)
else
free(newCmap);
return (result);
return result;
}
@ -2167,7 +2167,7 @@ int PanoramiXFreeColormap(ClientPtr client)
/* Since ProcFreeColormap is using FreeResource, it will free
our resource for us on the last pass through the loop above */
return (result);
return result;
}
@ -2208,7 +2208,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
else
free(newCmap);
return (result);
return result;
}
@ -2232,7 +2232,7 @@ int PanoramiXInstallColormap(ClientPtr client)
result = (* SavedProcVector[X_InstallColormap])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2256,7 +2256,7 @@ int PanoramiXUninstallColormap(ClientPtr client)
result = (* SavedProcVector[X_UninstallColormap])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2280,7 +2280,7 @@ int PanoramiXAllocColor(ClientPtr client)
result = (* SavedProcVector[X_AllocColor])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2304,7 +2304,7 @@ int PanoramiXAllocNamedColor(ClientPtr client)
result = (* SavedProcVector[X_AllocNamedColor])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2328,7 +2328,7 @@ int PanoramiXAllocColorCells(ClientPtr client)
result = (* SavedProcVector[X_AllocColorCells])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2352,7 +2352,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client)
result = (* SavedProcVector[X_AllocColorPlanes])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2376,7 +2376,7 @@ int PanoramiXFreeColors(ClientPtr client)
stuff->cmap = cmap->info[j].id;
result = (* SavedProcVector[X_FreeColors])(client);
}
return (result);
return result;
}
@ -2400,7 +2400,7 @@ int PanoramiXStoreColors(ClientPtr client)
result = (* SavedProcVector[X_StoreColors])(client);
if(result != Success) break;
}
return (result);
return result;
}
@ -2424,5 +2424,5 @@ int PanoramiXStoreNamedColor(ClientPtr client)
result = (* SavedProcVector[X_StoreNamedColor])(client);
if(result != Success) break;
}
return (result);
return result;
}

View File

@ -242,7 +242,7 @@ SecurityDeleteAuthorizationEventClient(
else
pAuth->eventClients = pEventClient->next;
free(pEventClient);
return(Success);
return Success;
}
prev = pEventClient;
}

View File

@ -363,7 +363,7 @@ ProcPanoramiXShapeRectangles(
result = ProcShapeRectangles (client);
if (result != Success) break;
}
return (result);
return result;
}
#endif
@ -472,7 +472,7 @@ ProcPanoramiXShapeMask(
result = ProcShapeMask (client);
if (result != Success) break;
}
return (result);
return result;
}
#endif
@ -596,7 +596,7 @@ ProcPanoramiXShapeCombine(
result = ProcShapeCombine (client);
if (result != Success) break;
}
return (result);
return result;
}
#endif
@ -662,7 +662,7 @@ ProcPanoramiXShapeOffset(
result = ProcShapeOffset (client);
if(result != Success) break;
}
return (result);
return result;
}
#endif

View File

@ -213,7 +213,7 @@ static Bool CheckForShmSyscall(void)
badSysCall = TRUE;
}
signal(SIGSYS, oldHandler);
return(!badSysCall);
return !badSysCall;
}
#define MUST_CHECK_FOR_SHM_SYSCALL
@ -456,7 +456,7 @@ ProcShmAttach(ClientPtr client)
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse))
{
client->errorValue = stuff->readOnly;
return(BadValue);
return BadValue;
}
for (shmdesc = Shmsegs;
shmdesc && (shmdesc->shmid != stuff->shmid);
@ -619,7 +619,7 @@ ProcPanoramiXShmPutImage(ClientPtr client)
result = ProcShmPutImage(client);
if(result != Success) break;
}
return(result);
return result;
}
static int
@ -641,7 +641,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
client->errorValue = stuff->format;
return(BadValue);
return BadValue;
}
rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
@ -672,7 +672,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
if( /* check for being onscreen */
x < 0 || x + w > PanoramiXPixWidth ||
y < 0 || y + h > PanoramiXPixHeight )
return(BadMatch);
return BadMatch;
} else {
if( /* check for being onscreen */
screenInfo.screens[0]->x + pDraw->x + x < 0 ||
@ -684,12 +684,12 @@ ProcPanoramiXShmGetImage(ClientPtr client)
x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
y < -wBorderWidth((WindowPtr)pDraw) ||
y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
return(BadMatch);
return BadMatch;
}
drawables = calloc(PanoramiXNumScreens, sizeof(DrawablePtr));
if(!drawables)
return(BadAlloc);
return BadAlloc;
drawables[0] = pDraw;
for(i = 1; i < PanoramiXNumScreens; i++) {
@ -987,7 +987,7 @@ ProcShmGetImage(ClientPtr client)
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
{
client->errorValue = stuff->format;
return(BadValue);
return BadValue;
}
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
DixReadAccess);
@ -1011,7 +1011,7 @@ ProcShmGetImage(ClientPtr client)
stuff->y + (int)stuff->height >
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
)
return(BadMatch);
return BadMatch;
xgi.visual = wVisual(((WindowPtr)pDraw));
}
else
@ -1021,7 +1021,7 @@ ProcShmGetImage(ClientPtr client)
stuff->y < 0 ||
stuff->y+(int)stuff->height > pDraw->height
)
return(BadMatch);
return BadMatch;
xgi.visual = None;
}
xgi.type = X_Reply;
@ -1181,7 +1181,7 @@ CreatePmap:
}
pDraw->pScreen->DestroyPixmap(pMap);
}
return (BadAlloc);
return BadAlloc;
}
static int

View File

@ -134,7 +134,7 @@ CheckForShmSyscall(void)
badSysCall = TRUE;
}
signal(SIGSYS, oldHandler);
return (!badSysCall);
return !badSysCall;
}
#define MUST_CHECK_FOR_SHM_SYSCALL

View File

@ -465,7 +465,7 @@ ProcXTestGrabControl(ClientPtr client)
if ((stuff->impervious != xTrue) && (stuff->impervious != xFalse))
{
client->errorValue = stuff->impervious;
return(BadValue);
return BadValue;
}
if (stuff->impervious)
MakeClientGrabImpervious(client);

View File

@ -483,7 +483,7 @@ ProcXvQueryEncodings(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
rep.type = X_Reply;
@ -540,14 +540,14 @@ ProcXvPutVideo(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvInputMask) ||
!(pPort->pAdaptor->type & XvVideoMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -578,14 +578,14 @@ ProcXvPutStill(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvInputMask) ||
!(pPort->pAdaptor->type & XvStillMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -616,14 +616,14 @@ ProcXvGetVideo(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvOutputMask) ||
!(pPort->pAdaptor->type & XvVideoMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -654,14 +654,14 @@ ProcXvGetStill(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvOutputMask) ||
!(pPort->pAdaptor->type & XvStillMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -703,7 +703,7 @@ ProcXvSelectPortNotify(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
return XvdiSelectPortNotify(client, pPort, stuff->onoff);
@ -723,7 +723,7 @@ ProcXvGrabPort(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
status = XvdiGrabPort(client, pPort, stuff->time, &result);
@ -756,7 +756,7 @@ ProcXvUngrabPort(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
return XvdiUngrabPort(client, pPort, stuff->time);
@ -776,7 +776,7 @@ ProcXvStopVideo(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess);
@ -799,13 +799,13 @@ ProcXvSetPortAttribute(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!ValidAtom(stuff->attribute))
{
client->errorValue = stuff->attribute;
return(BadAtom);
return BadAtom;
}
status = XvdiSetPortAttribute(client, pPort, stuff->attribute, stuff->value);
@ -833,13 +833,13 @@ ProcXvGetPortAttribute(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!ValidAtom(stuff->attribute))
{
client->errorValue = stuff->attribute;
return(BadAtom);
return BadAtom;
}
status = XvdiGetPortAttribute(client, pPort, stuff->attribute, &value);
@ -874,7 +874,7 @@ ProcXvQueryBestSize(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
rep.type = X_Reply;
@ -911,7 +911,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
rep.type = X_Reply;
@ -967,14 +967,14 @@ ProcXvPutImage(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvImageMask) ||
!(pPort->pAdaptor->type & XvInputMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -1047,14 +1047,14 @@ ProcXvShmPutImage(ClientPtr client)
if ((status = _AllocatePort(stuff->port, pPort)) != Success)
{
client->errorValue = stuff->port;
return (status);
return status;
}
if (!(pPort->pAdaptor->type & XvImageMask) ||
!(pPort->pAdaptor->type & XvInputMask))
{
client->errorValue = stuff->port;
return (BadMatch);
return BadMatch;
}
status = XvdiMatchPort(pPort, pDraw);
@ -1113,7 +1113,7 @@ static int
ProcXvShmPutImage(ClientPtr client)
{
SendErrorToClient(client, XvReqCode, xv_ShmPutImage, 0, BadImplementation);
return(BadImplementation);
return BadImplementation;
}
#endif
@ -1267,7 +1267,7 @@ ProcXvDispatch(ClientPtr client)
if (stuff->data > xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return(BadRequest);
return BadRequest;
}
return XvProcVector[stuff->data](client);
@ -1591,7 +1591,7 @@ SProcXvDispatch(ClientPtr client)
if (stuff->data > xvNumRequests) {
SendErrorToClient(client, XvReqCode, stuff->data, 0, BadRequest);
return(BadRequest);
return BadRequest;
}
return SXvProcVector[stuff->data](client);

View File

@ -634,7 +634,7 @@ XvdiPutVideo(
pPort->time = currentTime;
return (Success);
return Success;
}
@ -764,7 +764,7 @@ XvdiGetVideo(
pPort->time = currentTime;
return (Success);
return Success;
}

View File

@ -1702,7 +1702,7 @@ InputClientGone(WindowPtr pWin, XID id)
InputClientsPtr other, prev;
if (!wOtherInputMasks(pWin))
return (Success);
return Success;
prev = 0;
for (other = wOtherInputMasks(pWin)->inputClients; other;
other = other->next) {
@ -1728,7 +1728,7 @@ InputClientGone(WindowPtr pWin, XID id)
free(other);
}
RecalculateDeviceDeliverableEvents(pWin);
return (Success);
return Success;
}
prev = other;
}
@ -1829,7 +1829,7 @@ ChangeKeyMapping(ClientPtr client,
KeyClassPtr k = dev->key;
if (k == NULL)
return (BadMatch);
return BadMatch;
if (len != (keyCodes * keySymsPerKeyCode))
return BadLength;
@ -1972,7 +1972,7 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask)
pEvents->detail = NotifyNormal;
}
}
return (0);
return 0;
}
void

View File

@ -164,7 +164,7 @@ XEventClass
*buf++ = (id << 8) | EventInfo[j].type;
}
}
return (buf);
return buf;
}
/***********************************************************************

View File

@ -269,7 +269,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
*buf += sizeof(xAxisInfo);
}
}
return (i);
return i;
}
static void

View File

@ -154,7 +154,7 @@ ProcXOpenDevice(ClientPtr client)
rep.num_classes = j;
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
return (Success);
return Success;
}
/***********************************************************************

View File

@ -97,7 +97,7 @@ SProcXSendExtensionEvent(ClientPtr client)
for (i = 0; i < stuff->num_events; i++, eventP++) {
proc = EventSwapVector[eventP->u.u.type & 0177];
if (proc == NotImplemented) /* no swapping proc; invalid event type? */
return (BadValue);
return BadValue;
(*proc) (eventP, &eventT);
*eventP = eventT;
}

View File

@ -207,14 +207,14 @@ ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev,
{
switch (control->control) {
case DEVICE_RESOLUTION:
return (BadMatch);
return BadMatch;
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
return (BadMatch);
return BadMatch;
case DEVICE_CORE:
return (BadMatch);
return BadMatch;
default:
return (BadMatch);
return BadMatch;
}
}

View File

@ -254,18 +254,18 @@ get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
if (!ValidAtom(property))
{
client->errorValue = property;
return(BadAtom);
return BadAtom;
}
if ((delete != xTrue) && (delete != xFalse))
{
client->errorValue = delete;
return(BadValue);
return BadValue;
}
if ((type != AnyPropertyType) && !ValidAtom(type))
{
client->errorValue = type;
return(BadAtom);
return BadAtom;
}
for (prop = dev->properties.properties; prop; prop = prop->next)
@ -350,12 +350,12 @@ check_change_property(ClientPtr client, Atom property, Atom type, int format,
if (!ValidAtom(property))
{
client->errorValue = property;
return(BadAtom);
return BadAtom;
}
if (!ValidAtom(type))
{
client->errorValue = type;
return(BadAtom);
return BadAtom;
}
return Success;
@ -683,7 +683,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
if (handler->DeleteProperty)
rc = handler->DeleteProperty(device, prop->propertyName);
if (rc != Success)
return (rc);
return rc;
handler = handler->next;
}
}
@ -720,7 +720,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
{
prop = XICreateDeviceProperty (property);
if (!prop)
return(BadAlloc);
return BadAlloc;
add = TRUE;
mode = PropModeReplace;
}
@ -732,9 +732,9 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
"PropModeReplace" since they will be written over. */
if ((format != prop_value->format) && (mode != PropModeReplace))
return(BadMatch);
return BadMatch;
if ((prop_value->type != type) && (mode != PropModeReplace))
return(BadMatch);
return BadMatch;
new_value = *prop_value;
if (mode == PropModeReplace)
total_len = len;
@ -798,7 +798,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
if (checkonly && rc != Success)
{
free(new_value.data);
return (rc);
return rc;
}
}
handler = handler->next;
@ -823,7 +823,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
send_property_event(dev, prop->propertyName,
(add) ? XIPropertyCreated : XIPropertyModified);
return(Success);
return Success;
}
int
@ -956,7 +956,7 @@ ProcXDeleteDeviceProperty (ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
return BadAtom;
}
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
@ -1199,7 +1199,7 @@ ProcXIDeleteProperty(ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
return BadAtom;
}
rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);

View File

@ -199,7 +199,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* The window must be InputOutput. */
if (pWin->drawable.class != InputOutput)
{
return(BadMatch);
return BadMatch;
}
/* The swap action must be valid. */
@ -209,7 +209,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
(swapAction != XdbeUntouched ) &&
(swapAction != XdbeCopied ))
{
return(BadValue);
return BadValue;
}
/* The id must be in range and not already in use. */
@ -220,12 +220,12 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
*/
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
if (!pDbeScreenPriv->GetVisualInfo)
return(BadMatch); /* screen doesn't support double buffering */
return BadMatch; /* screen doesn't support double buffering */
if (!(*pDbeScreenPriv->GetVisualInfo)(pWin->drawable.pScreen, &scrVisInfo))
{
/* GetVisualInfo() failed to allocate visual info data. */
return(BadAlloc);
return BadAlloc;
}
/* See if the window's visual is on the list. */
@ -243,7 +243,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
if (!visualMatched)
{
return(BadMatch);
return BadMatch;
}
if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)) == NULL)
@ -254,7 +254,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
pDbeWindowPriv = dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW);
if (!pDbeWindowPriv)
return(BadAlloc);
return BadAlloc;
/* Fill out window priv information. */
pDbeWindowPriv->pWindow = pWin;
@ -321,7 +321,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
(pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID));
if (!pDbeWindowPriv->IDs)
{
return(BadAlloc);
return BadAlloc;
}
memset(&pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs], 0,
(pDbeWindowPriv->maxAvailableIDs + DBE_INCR_MAX_IDS -
@ -377,12 +377,12 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* Set swap action on all calls. */
pDbeWindowPriv->swapAction = stuff->swapAction;
return(status);
return status;
out_free:
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, NULL);
free(pDbeWindowPriv);
return (status);
return status;
} /* ProcDbeAllocateBackBufferName() */
@ -445,12 +445,12 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
{
/* We did not find the ID in the ID list. */
client->errorValue = stuff->buffer;
return(dbeErrorBase + DbeBadBuffer);
return dbeErrorBase + DbeBadBuffer;
}
FreeResource(stuff->buffer, RT_NONE);
return(Success);
return Success;
} /* ProcDbeDeallocateBackBufferName() */
@ -496,7 +496,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (nStuff == 0)
{
return(Success);
return Success;
}
if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
@ -509,7 +509,7 @@ ProcDbeSwapBuffers(ClientPtr client)
swapInfo = (DbeSwapInfoPtr)malloc(nStuff * sizeof(DbeSwapInfoRec));
if (swapInfo == NULL)
{
return(BadAlloc);
return BadAlloc;
}
@ -529,7 +529,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (DBE_WINDOW_PRIV(pWin) == NULL)
{
free(swapInfo);
return(BadMatch);
return BadMatch;
}
/* Each window must only be specified once - BadMatch. */
@ -538,7 +538,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
{
free(swapInfo);
return(BadMatch);
return BadMatch;
}
}
@ -549,7 +549,7 @@ ProcDbeSwapBuffers(ClientPtr client)
(dbeSwapInfo[i].swapAction != XdbeCopied ))
{
free(swapInfo);
return(BadValue);
return BadValue;
}
/* Everything checks out OK. Fill in the swap info array. */
@ -579,12 +579,12 @@ ProcDbeSwapBuffers(ClientPtr client)
if (error != Success)
{
free(swapInfo);
return(error);
return error;
}
}
free(swapInfo);
return(Success);
return Success;
} /* ProcDbeSwapBuffers() */
@ -626,7 +626,7 @@ ProcDbeBeginIdiom(ClientPtr client)
}
}
return(Success);
return Success;
} /* ProcDbeBeginIdiom() */
@ -673,7 +673,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
if (!(pDrawables = (DrawablePtr *)malloc(stuff->n *
sizeof(DrawablePtr))))
{
return(BadAlloc);
return BadAlloc;
}
drawables = (Drawable *)&stuff[1];
@ -695,7 +695,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
{
free(pDrawables);
return(BadAlloc);
return BadAlloc;
}
length = 0;
@ -894,7 +894,7 @@ ProcDbeDispatch(ClientPtr client)
return(ProcDbeBeginIdiom(client));
case X_DbeEndIdiom:
return(Success);
return Success;
case X_DbeGetVisualInfo:
return(ProcDbeGetVisualInfo(client));
@ -903,7 +903,7 @@ ProcDbeDispatch(ClientPtr client)
return(ProcDbeGetBackBufferAttributes(client));
default:
return(BadRequest);
return BadRequest;
}
} /* ProcDbeDispatch() */
@ -1195,7 +1195,7 @@ SProcDbeDispatch(ClientPtr client)
return(SProcDbeBeginIdiom(client));
case X_DbeEndIdiom:
return(Success);
return Success;
case X_DbeGetVisualInfo:
return(SProcDbeGetVisualInfo(client));
@ -1204,7 +1204,7 @@ SProcDbeDispatch(ClientPtr client)
return(SProcDbeGetBackBufferAttributes(client));
default:
return (BadRequest);
return BadRequest;
}
} /* SProcDbeDispatch() */
@ -1269,7 +1269,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
default:
/* pWin->backgroundState == None */
return(FALSE);
return FALSE;
}
return ChangeGC(NullClient, pGC, gcmask, gcvalues) == 0;
@ -1295,7 +1295,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
static int
DbeDrawableDelete(pointer pDrawable, XID id)
{
return(Success);
return Success;
} /* DbeDrawableDelete() */
@ -1335,7 +1335,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
if (i == pDbeWindowPriv->nBufferIDs)
{
/* We did not find the ID in the array. We should never get here. */
return(BadValue);
return BadValue;
}
/* Remove the ID from the array. */
@ -1402,7 +1402,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW);
}
return(Success);
return Success;
} /* DbeWindowPrivDelete() */
@ -1523,7 +1523,7 @@ DbeDestroyWindow(WindowPtr pWin)
**************************************************************************
*/
return(ret);
return ret;
} /* DbeDestroyWindow() */

View File

@ -96,7 +96,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo)
/* Allocate an array of XdbeVisualInfo items. */
if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo))))
{
return(FALSE); /* memory alloc failure */
return FALSE; /* memory alloc failure */
}
for (i = 0, k = 0; i < pScreen->numDepths; i++)
@ -125,7 +125,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo)
pScrVisInfo->count = count;
pScrVisInfo->visinfo = visInfo;
return(TRUE); /* success */
return TRUE; /* success */
} /* miDbeGetVisualInfo() */
@ -175,7 +175,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
pDbeWindowPriv->height,
pWin->drawable.depth, 0)))
{
return(BadAlloc);
return BadAlloc;
}
/* Get a back pixmap. */
@ -185,7 +185,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
pWin->drawable.depth, 0)))
{
(*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
return(BadAlloc);
return BadAlloc;
}
/* Security creation/labeling check. */
@ -235,12 +235,12 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!AddResource(bufId, dbeDrawableResType,
(pointer)pDbeWindowPrivPriv->pBackBuffer))
{
return(BadAlloc);
return BadAlloc;
}
}
return(Success);
return Success;
} /* miDbeAllocBackBufferName() */
@ -409,7 +409,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
FreeScratchGC(pGC);
return(Success);
return Success;
} /* miSwapBuffers() */
@ -571,13 +571,13 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
{
return(ret);
return ret;
}
if (pDbeWindowPriv->width == pWin->drawable.width &&
pDbeWindowPriv->height == pWin->drawable.height)
{
return(ret);
return ret;
}
width = pWin->drawable.width;
@ -678,7 +678,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
}
FreeScratchGC(pGC);
return(FALSE);
return FALSE;
}
else
@ -737,7 +737,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
FreeScratchGC(pGC);
}
return(ret);
return ret;
} /* miDbePositionWindow() */
@ -783,7 +783,7 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
sizeof(MiDbeWindowPrivPrivRec)))
return(FALSE);
return FALSE;
/* Wrap functions. */
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
@ -798,6 +798,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
return(TRUE);
return TRUE;
} /* miDbeInit() */

View File

@ -264,7 +264,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
class = pVisual->class;
if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID))
return (BadMatch);
return BadMatch;
size = pVisual->ColormapEntries;
sizebytes = (size * sizeof(Entry)) +
@ -276,16 +276,16 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if (mid == pScreen->defColormap) {
pmap = malloc(sizebytes);
if (!pmap)
return (BadAlloc);
return BadAlloc;
if (!dixAllocatePrivates(&pmap->devPrivates, PRIVATE_COLORMAP)) {
free (pmap);
return (BadAlloc);
return BadAlloc;
}
} else {
pmap = _dixAllocateObjectWithPrivates(sizebytes, sizebytes,
offsetof(ColormapRec, devPrivates), PRIVATE_COLORMAP);
if (!pmap)
return (BadAlloc);
return BadAlloc;
}
#if defined(_XSERVER64)
pmap->pad0 = 0;
@ -324,7 +324,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if (!ppix)
{
free(pmap);
return (BadAlloc);
return BadAlloc;
}
pmap->clientPixelsRed[client] = ppix;
for(i = 0; i < size; i++)
@ -371,7 +371,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
{
free(pmap->clientPixelsRed[client]);
free(pmap);
return(BadAlloc);
return BadAlloc;
}
pmap->clientPixelsGreen[client] = ppix;
for(i = 0; i < size; i++)
@ -388,7 +388,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
free(pmap->clientPixelsGreen[client]);
free(pmap->clientPixelsRed[client]);
free(pmap);
return(BadAlloc);
return BadAlloc;
}
pmap->clientPixelsBlue[client] = ppix;
for(i = 0; i < size; i++)
@ -399,7 +399,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
pmap->flags |= BeingCreated;
if (!AddResource(mid, RT_COLORMAP, (pointer)pmap))
return (BadAlloc);
return BadAlloc;
/*
* Security creation/labeling check
@ -421,7 +421,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
}
pmap->flags &= ~BeingCreated;
*ppcmap = pmap;
return (Success);
return Success;
}
/**
@ -482,7 +482,7 @@ FreeColormap (pointer value, XID mid)
free(pmap);
} else
dixFreeObjectWithPrivates(pmap, PRIVATE_COLORMAP);
return(Success);
return Success;
}
/* Tell window that pmid has disappeared */
@ -509,7 +509,7 @@ TellNoMap (WindowPtr pwin, Colormap *pmid)
}
}
return (WT_WALKCHILDREN);
return WT_WALKCHILDREN;
}
/* Tell window that pmid got uninstalled */
@ -534,7 +534,7 @@ TellLostMap (WindowPtr pwin, pointer value)
DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL);
}
return (WT_WALKCHILDREN);
return WT_WALKCHILDREN;
}
/* Tell window that pmid got installed */
@ -559,7 +559,7 @@ TellGainedMap (WindowPtr pwin, pointer value)
DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL);
}
return (WT_WALKCHILDREN);
return WT_WALKCHILDREN;
}
@ -582,7 +582,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client)
/* If the create returns non-0, it failed */
result = CreateColormap (mid, pScreen, pVisual, &pmap, alloc, client);
if(result != Success)
return(result);
return result;
if(alloc == AllocAll)
{
memmove((char *)pmap->red, (char *)pSrc->red, size * sizeof(Entry));
@ -594,7 +594,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client)
pSrc->flags &= ~AllAllocated;
FreePixels(pSrc, client);
UpdateColors(pmap);
return(Success);
return Success;
}
CopyFree(REDMAP, client, pSrc, pmap);
@ -606,7 +606,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client)
if (pmap->class & DynamicClass)
UpdateColors(pmap);
/* XXX should worry about removing any RT_CMAPENTRY resource */
return(Success);
return Success;
}
/* Helper routine for freeing large numbers of cells from a map */
@ -855,7 +855,7 @@ AllocColor (ColormapPtr pmap,
ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
return BadAlloc;
ppix[npix] = pixR;
pmap->clientPixelsRed[client] = ppix;
pmap->numPixelsRed[client]++;
@ -878,21 +878,21 @@ AllocColor (ColormapPtr pmap,
ppix = (Pixel *) realloc(pmap->clientPixelsRed[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
return BadAlloc;
ppix[npix] = pixR;
pmap->clientPixelsRed[client] = ppix;
npix = pmap->numPixelsGreen[client];
ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
return BadAlloc;
ppix[npix] = pixG;
pmap->clientPixelsGreen[client] = ppix;
npix = pmap->numPixelsBlue[client];
ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client],
(npix + 1) * sizeof(Pixel));
if (!ppix)
return (BadAlloc);
return BadAlloc;
ppix[npix] = pixB;
pmap->clientPixelsBlue[client] = ppix;
pmap->numPixelsRed[client]++;
@ -915,7 +915,7 @@ AllocColor (ColormapPtr pmap,
}
if (FindColor(pmap, pmap->red, entries, &rgb, pPix, PSEUDOMAP,
client, AllComp) != Success)
return (BadAlloc);
return BadAlloc;
break;
case DirectColor:
@ -944,13 +944,13 @@ AllocColor (ColormapPtr pmap,
pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed;
if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP,
client, RedComp) != Success)
return (BadAlloc);
return BadAlloc;
pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen;
if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG,
GREENMAP, client, GreenComp) != Success)
{
(void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
return (BadAlloc);
return BadAlloc;
}
pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue;
if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP,
@ -958,7 +958,7 @@ AllocColor (ColormapPtr pmap,
{
(void)FreeCo(pmap, client, GREENMAP, 1, &pixG, (Pixel)0);
(void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
return (BadAlloc);
return BadAlloc;
}
*pPix = pixR | pixG | pixB | ALPHAMASK(pVisual);
@ -978,14 +978,14 @@ AllocColor (ColormapPtr pmap,
if (!pcr)
{
(void)FreeColors(pmap, client, 1, pPix, (Pixel)0);
return (BadAlloc);
return BadAlloc;
}
pcr->mid = pmap->mid;
pcr->client = client;
if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr))
return (BadAlloc);
return BadAlloc;
}
return (Success);
return Success;
}
/*
@ -1172,7 +1172,7 @@ FindBestPixel(EntryPtr pentFirst, int size, xrgb *prgb, int channel)
minval = sum;
}
}
return(final);
return final;
}
static void
@ -1280,7 +1280,7 @@ FindColor (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb,
* a free entry, we're out of luck. Otherwise, we'll usurp a free
* entry and fill it in */
if (!foundFree)
return (BadAlloc);
return BadAlloc;
pent = pentFirst + Free;
pent->fShared = FALSE;
pent->refcnt = (client >= 0) ? 1 : AllocTemporary;
@ -1339,7 +1339,7 @@ FindColor (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb,
gotit:
if (pmap->flags & BeingCreated || client == -1)
return(Success);
return Success;
/* Now remember the pixel, for freeing later */
switch (channel)
{
@ -1378,13 +1378,13 @@ gotit:
pmap->freeBlue++;
break;
}
return(BadAlloc);
return BadAlloc;
}
ppix[npix] = pixel;
pixp[client] = ppix;
nump[client]++;
return(Success);
return Success;
}
/* Comparison functions -- passed to FindColor to determine if an
@ -1395,32 +1395,32 @@ AllComp (EntryPtr pent, xrgb *prgb)
if((pent->co.local.red == prgb->red) &&
(pent->co.local.green == prgb->green) &&
(pent->co.local.blue == prgb->blue) )
return (1);
return (0);
return 1;
return 0;
}
static int
RedComp (EntryPtr pent, xrgb *prgb)
{
if (pent->co.local.red == prgb->red)
return (1);
return (0);
return 1;
return 0;
}
static int
GreenComp (EntryPtr pent, xrgb *prgb)
{
if (pent->co.local.green == prgb->green)
return (1);
return (0);
return 1;
return 0;
}
static int
BlueComp (EntryPtr pent, xrgb *prgb)
{
if (pent->co.local.blue == prgb->blue)
return (1);
return (0);
return 1;
return 0;
}
@ -1508,7 +1508,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList, ClientP
}
}
}
return (errVal);
return errVal;
}
static void
@ -1586,7 +1586,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
class = pmap->class;
if (!(class & DynamicClass))
return (BadAlloc); /* Shouldn't try on this type */
return BadAlloc; /* Shouldn't try on this type */
oldcount = pmap->numPixelsRed[client];
if (pmap->class == DirectColor)
oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
@ -1594,7 +1594,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
{
pcr = malloc(sizeof(colorResource));
if (!pcr)
return (BadAlloc);
return BadAlloc;
}
if (pmap->class == DirectColor)
@ -1641,7 +1641,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes,
ok = BadAlloc;
} else free(pcr);
return (ok);
return ok;
}
@ -1660,7 +1660,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
class = pmap->class;
if (!(class & DynamicClass))
return (BadAlloc); /* Shouldn't try on this type */
return BadAlloc; /* Shouldn't try on this type */
oldcount = pmap->numPixelsRed[client];
if (class == DirectColor)
oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client];
@ -1668,7 +1668,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
{
pcr = malloc(sizeof(colorResource));
if (!pcr)
return (BadAlloc);
return BadAlloc;
}
if (class == DirectColor)
@ -1731,7 +1731,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors,
ok = BadAlloc;
} else free(pcr);
return (ok);
return ok;
}
static int
@ -1765,7 +1765,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
free(ppixBlue);
free(ppixGreen);
free(ppixRed);
return(BadAlloc);
return BadAlloc;
}
okR = AllocCP(pmap, pmap->red, c, r, contig, ppixRed, prmask);
@ -1805,7 +1805,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
free(ppixBlue);
free(ppixGreen);
free(ppixRed);
return(BadAlloc);
return BadAlloc;
}
*prmask <<= pmap->pVisual->offsetRed;
@ -1850,7 +1850,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont
free(ppixGreen);
free(ppixRed);
return (Success);
return Success;
}
static int
@ -1863,9 +1863,9 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
npix = c << r;
if ((r >= 32) || (npix > pmap->freeRed) || (npix < c))
return(BadAlloc);
return BadAlloc;
if(!(ppixTemp = malloc(npix * sizeof(Pixel))))
return(BadAlloc);
return BadAlloc;
ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask);
if (ok)
@ -1879,7 +1879,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
{
for (p = ppixTemp; p < ppixTemp + npix; p++)
pmap->red[*p].refcnt = 0;
return (BadAlloc);
return BadAlloc;
}
pmap->clientPixelsRed[client] = ppix;
ppix += pmap->numPixelsRed[client];
@ -1895,7 +1895,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig,
pmap->freeRed -= npix;
}
free(ppixTemp);
return (ok ? Success : BadAlloc);
return ok ? Success : BadAlloc;
}
/* Allocates count << planes pixels from colormap pmap for client. If
@ -1941,11 +1941,11 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes,
ent->fShared = FALSE;
}
*pMask = 0;
return (TRUE);
return TRUE;
}
else if (planes > dplanes)
{
return (FALSE);
return FALSE;
}
/* General case count pixels * 2 ^ planes cells to be allocated */
@ -1992,7 +1992,7 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes,
}
}
*pMask = mask;
return (TRUE);
return TRUE;
}
}
pixel = save + 1;
@ -2003,7 +2003,7 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes,
dplanes = pmap->pVisual->nplanes;
if (contig || planes == 1 || dplanes < 3)
return (FALSE);
return FALSE;
/* this will be very slow for large maps, need a better algorithm */
@ -2073,10 +2073,10 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes,
}
*pMask = mask;
return (TRUE);
return TRUE;
}
}
return (FALSE);
return FALSE;
}
/**
@ -2224,7 +2224,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask)
class = pmap->class;
if (pmap->flags & AllAllocated)
return(BadAccess);
return BadAccess;
if ((class | DynamicClass) == DirectColor)
{
rmask = mask & RGBMASK(pmap->pVisual);
@ -2252,7 +2252,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask)
result = BadValue;
}
/* XXX should worry about removing any RT_CMAPENTRY resource */
return (result);
return result;
}
/**
@ -2278,7 +2278,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
int offset, numents;
if (npixIn == 0)
return (errVal);
return errVal;
bits = 0;
zapped = 0;
base = lowbit (mask);
@ -2404,7 +2404,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe
break;
}
}
return (errVal);
return errVal;
}
@ -2426,7 +2426,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client)
class = pmap->class;
if(!(class & DynamicClass) && !(pmap->flags & BeingCreated))
{
return(BadAccess);
return BadAccess;
}
pVisual = pmap->pVisual;
@ -2674,7 +2674,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client)
* count, the count of proposed entries */
if (idef != 0)
( *pmap->pScreen->StoreColors) (pmap, idef, defs);
return (errVal);
return errVal;
}
int
@ -2685,7 +2685,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
pmaps = malloc(pWin->drawable.pScreen->maxInstalledCmaps*sizeof(Colormap));
if(!pmaps)
return(FALSE);
return FALSE;
nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
(pWin->drawable.pScreen, pmaps);
found = FALSE;
@ -2698,7 +2698,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin)
}
}
free(pmaps);
return (found);
return found;
}
struct colormap_lookup_data {

View File

@ -122,7 +122,7 @@ FreeCursor(pointer value, XID cid)
DeviceIntPtr pDev = NULL; /* unused anyway */
if ( --pCurs->refcnt != 0)
return(Success);
return Success;
for (nscr = 0; nscr < screenInfo.numScreens; nscr++)
{
@ -132,7 +132,7 @@ FreeCursor(pointer value, XID cid)
FreeCursorBits(pCurs->bits);
dixFiniPrivates(pCurs, PRIVATE_CURSOR);
free( pCurs);
return(Success);
return Success;
}

View File

@ -2117,11 +2117,11 @@ ProcChangePointerControl(ClientPtr client)
ctrl = mouse->ptrfeed->ctrl;
if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) {
client->errorValue = stuff->doAccel;
return(BadValue);
return BadValue;
}
if ((stuff->doThresh != xTrue) && (stuff->doThresh != xFalse)) {
client->errorValue = stuff->doThresh;
return(BadValue);
return BadValue;
}
if (stuff->doAccel) {
if (stuff->accelNum == -1) {

View File

@ -631,7 +631,7 @@ CreateConnectionBlock(void)
int
ProcBadRequest(ClientPtr client)
{
return (BadRequest);
return BadRequest;
}
int
@ -1017,7 +1017,7 @@ ProcInternAtom(ClientPtr client)
if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse))
{
client->errorValue = stuff->onlyIfExists;
return(BadValue);
return BadValue;
}
tchar = (char *) &stuff[1];
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
@ -1033,7 +1033,7 @@ ProcInternAtom(ClientPtr client)
return Success;
}
else
return (BadAlloc);
return BadAlloc;
}
int
@ -1060,7 +1060,7 @@ ProcGetAtomName(ClientPtr client)
else
{
client->errorValue = stuff->id;
return (BadAtom);
return BadAtom;
}
}
@ -1275,7 +1275,7 @@ ProcQueryFont(ClientPtr client)
reply = calloc(1, rlength);
if(!reply)
{
return(BadAlloc);
return BadAlloc;
}
reply->type = X_Reply;
@ -1309,11 +1309,11 @@ ProcQueryTextExtents(ClientPtr client)
if (stuff->oddLength)
{
if (length == 0)
return(BadLength);
return BadLength;
length--;
}
if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info))
return(BadAlloc);
return BadAlloc;
reply.type = X_Reply;
reply.length = 0;
reply.sequenceNumber = client->sequence;
@ -1430,7 +1430,7 @@ CreatePmap:
return Success;
(*pDraw->pScreen->DestroyPixmap)(pMap);
}
return (BadAlloc);
return BadAlloc;
}
int
@ -1480,7 +1480,7 @@ ProcCreateGC(ClientPtr client)
if (error != Success)
return error;
if (!AddResource(stuff->gc, RT_GC, (pointer)pGC))
return (BadAlloc);
return BadAlloc;
return Success;
}
@ -1520,7 +1520,7 @@ ProcCopyGC(ClientPtr client)
if (result != Success)
return result;
if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth))
return (BadMatch);
return BadMatch;
if (stuff->mask & ~GCAllBits)
{
client->errorValue = stuff->mask;
@ -1574,7 +1574,7 @@ ProcSetClipRectangles(ClientPtr client)
nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq);
if (nr & 4)
return(BadLength);
return BadLength;
nr >>= 3;
return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin,
nr, (xRectangle *)&stuff[1], (int)stuff->ordering);
@ -1610,12 +1610,12 @@ ProcClearToBackground(ClientPtr client)
if (pWin->drawable.class == InputOnly)
{
client->errorValue = stuff->window;
return (BadMatch);
return BadMatch;
}
if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse))
{
client->errorValue = stuff->exposures;
return(BadValue);
return BadValue;
}
(*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y,
stuff->width, stuff->height,
@ -1645,7 +1645,7 @@ ProcCopyArea(ClientPtr client)
if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth))
{
client->errorValue = stuff->dstDrawable;
return (BadMatch);
return BadMatch;
}
}
else
@ -1687,7 +1687,7 @@ ProcCopyPlane(ClientPtr client)
if (pdstDraw->pScreen != psrcDraw->pScreen)
{
client->errorValue = stuff->dstDrawable;
return (BadMatch);
return BadMatch;
}
}
else
@ -1698,7 +1698,7 @@ ProcCopyPlane(ClientPtr client)
(stuff->bitPlane > (1L << (psrcDraw->depth - 1))))
{
client->errorValue = stuff->bitPlane;
return(BadValue);
return BadValue;
}
pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY,
@ -1772,7 +1772,7 @@ ProcPolySegment(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
if (nsegs & 4)
return(BadLength);
return BadLength;
nsegs >>= 3;
if (nsegs)
(*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]);
@ -1791,7 +1791,7 @@ ProcPolyRectangle (ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
if (nrects & 4)
return(BadLength);
return BadLength;
nrects >>= 3;
if (nrects)
(*pGC->ops->PolyRectangle)(pDraw, pGC,
@ -1811,7 +1811,7 @@ ProcPolyArc(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
if (narcs % sizeof(xArc))
return(BadLength);
return BadLength;
narcs /= sizeof(xArc);
if (narcs)
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]);
@ -1861,7 +1861,7 @@ ProcPolyFillRectangle(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
if (things & 4)
return(BadLength);
return BadLength;
things >>= 3;
if (things)
@ -1882,7 +1882,7 @@ ProcPolyFillArc(ClientPtr client)
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
if (narcs % sizeof(xArc))
return(BadLength);
return BadLength;
narcs /= sizeof(xArc);
if (narcs)
(*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]);
@ -2019,7 +2019,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if ((format != XYPixmap) && (format != ZPixmap))
{
client->errorValue = format;
return(BadValue);
return BadValue;
}
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixReadAccess);
if (rc != Success)
@ -2103,7 +2103,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (im_return) {
pBuf = calloc(1, sz_xGetImageReply + length);
if (!pBuf)
return (BadAlloc);
return BadAlloc;
if (widthBytesLine == 0)
linesPerBuf = 0;
else
@ -2140,7 +2140,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
}
}
if(!(pBuf = calloc(1, length)))
return (BadAlloc);
return BadAlloc;
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
}
@ -2362,7 +2362,7 @@ ProcCreateColormap(ClientPtr client)
if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll))
{
client->errorValue = stuff->alloc;
return(BadValue);
return BadValue;
}
mid = stuff->mid;
LEGAL_NEW_RESOURCE(mid, client);
@ -2381,7 +2381,7 @@ ProcCreateColormap(ClientPtr client)
(int)stuff->alloc, client->index);
}
client->errorValue = stuff->visual;
return(BadMatch);
return BadMatch;
}
int
@ -2507,7 +2507,7 @@ ProcListInstalledColormaps(ClientPtr client)
pWin->drawable.pScreen->maxInstalledCmaps *
sizeof(Colormap));
if(!preply)
return(BadAlloc);
return BadAlloc;
preply->type = X_Reply;
preply->sequenceNumber = client->sequence;
@ -2595,7 +2595,7 @@ ProcAllocNamedColor (ClientPtr client)
return Success;
}
else
return(BadName);
return BadName;
}
else
@ -2626,18 +2626,18 @@ ProcAllocColorCells (ClientPtr client)
if (!npixels)
{
client->errorValue = npixels;
return (BadValue);
return BadValue;
}
if (stuff->contiguous != xTrue && stuff->contiguous != xFalse)
{
client->errorValue = stuff->contiguous;
return (BadValue);
return BadValue;
}
nmasks = stuff->planes;
length = ((long)npixels + (long)nmasks) * sizeof(Pixel);
ppixels = malloc(length);
if(!ppixels)
return(BadAlloc);
return BadAlloc;
pmasks = ppixels + npixels;
if( (rc = AllocColorCells(client->index, pcmp, npixels, nmasks,
@ -2690,12 +2690,12 @@ ProcAllocColorPlanes(ClientPtr client)
if (!npixels)
{
client->errorValue = npixels;
return (BadValue);
return BadValue;
}
if (stuff->contiguous != xTrue && stuff->contiguous != xFalse)
{
client->errorValue = stuff->contiguous;
return (BadValue);
return BadValue;
}
acpr.type = X_Reply;
acpr.sequenceNumber = client->sequence;
@ -2703,7 +2703,7 @@ ProcAllocColorPlanes(ClientPtr client)
length = (long)npixels * sizeof(Pixel);
ppixels = malloc(length);
if(!ppixels)
return(BadAlloc);
return BadAlloc;
if( (rc = AllocColorPlanes(client->index, pcmp, npixels,
(int)stuff->red, (int)stuff->green, (int)stuff->blue,
(Bool)stuff->contiguous, ppixels,
@ -2746,7 +2746,7 @@ ProcFreeColors(ClientPtr client)
int count;
if(pcmp->flags & AllAllocated)
return(BadAccess);
return BadAccess;
count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq));
return FreeColors(pcmp, client->index, count,
(Pixel *)&stuff[1], (Pixel)stuff->planeMask);
@ -2774,7 +2774,7 @@ ProcStoreColors (ClientPtr client)
count = (client->req_len << 2) - sizeof(xStoreColorsReq);
if (count % sizeof(xColorItem))
return(BadLength);
return BadLength;
count /= sizeof(xColorItem);
return StoreColors(pcmp, count, (xColorItem *)&stuff[1], client);
}
@ -2806,7 +2806,7 @@ ProcStoreNamedColor (ClientPtr client)
def.pixel = stuff->pixel;
return StoreColors(pcmp, 1, &def, client);
}
return (BadName);
return BadName;
}
else
{
@ -2834,7 +2834,7 @@ ProcQueryColors(ClientPtr client)
count = bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq));
prgbs = calloc(1, count * sizeof(xrgb));
if(!prgbs && count)
return(BadAlloc);
return BadAlloc;
if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) )
{
free(prgbs);
@ -2892,7 +2892,7 @@ ProcLookupColor(ClientPtr client)
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
return Success;
}
return (BadName);
return BadName;
}
else
{
@ -2940,24 +2940,24 @@ ProcCreateCursor (ClientPtr client)
|| src->drawable.height != msk->drawable.height
|| src->drawable.depth != 1
|| msk->drawable.depth != 1)
return (BadMatch);
return BadMatch;
width = src->drawable.width;
height = src->drawable.height;
if ( stuff->x > width
|| stuff->y > height )
return (BadMatch);
return BadMatch;
n = BitmapBytePad(width)*height;
srcbits = calloc(1, n);
if (!srcbits)
return (BadAlloc);
return BadAlloc;
mskbits = malloc(n);
if (!mskbits)
{
free(srcbits);
return (BadAlloc);
return BadAlloc;
}
(* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height,
@ -3053,7 +3053,7 @@ ProcQueryBestSize (ClientPtr client)
(stuff->class != StippleShape))
{
client->errorValue = stuff->class;
return(BadValue);
return BadValue;
}
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY,
@ -3061,7 +3061,7 @@ ProcQueryBestSize (ClientPtr client)
if (rc != Success)
return rc;
if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW)
return (BadMatch);
return BadMatch;
pScreen = pDraw->pScreen;
rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess);
if (rc != Success)
@ -3201,7 +3201,7 @@ ProcListHosts(ClientPtr client)
result = GetHosts(&pdata, &nHosts, &len, &reply.enabled);
if (result != Success)
return(result);
return result;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.nHosts = nHosts;
@ -3276,7 +3276,7 @@ ProcKillClient(ClientPtr client)
* doesn't try to touch client
*/
isItTimeToYield = TRUE;
return (Success);
return Success;
}
return Success;
}
@ -3302,12 +3302,12 @@ ProcSetFontPath(ClientPtr client)
while (--nfonts >= 0)
{
if ((total == 0) || (total < (n = (*ptr + 1))))
return(BadLength);
return BadLength;
total -= n;
ptr += n;
}
if (total >= 4)
return(BadLength);
return BadLength;
return SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
}
@ -3356,7 +3356,7 @@ ProcChangeCloseDownMode(ClientPtr client)
else
{
client->errorValue = stuff->mode;
return (BadValue);
return BadValue;
}
}
@ -3573,7 +3573,7 @@ ClientPtr NextAvailableClient(pointer ospriv)
clientinfo.setup = (xConnSetup *) NULL;
CallCallbacks((&ClientStateCallback), (pointer)&clientinfo);
}
return(client);
return client;
}
int
@ -3585,7 +3585,7 @@ ProcInitialConnection(ClientPtr client)
prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq);
if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B'))
return (client->noClientException = -1);
return client->noClientException = -1;
if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) ||
(!(*(char *) &whichbyte) && (prefix->byteOrder == 'l')))
{
@ -3626,7 +3626,7 @@ SendConnSetup(ClientPtr client, char *reason)
else
(void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp);
(void)WriteToClient(client, (int)csp.lengthReason, reason);
return (client->noClientException = -1);
return client->noClientException = -1;
}
numScreens = screenInfo.numScreens;

View File

@ -482,7 +482,7 @@ CloseFont(pointer value, XID fid)
FontPtr pfont = (FontPtr)value;
if (pfont == NullFont)
return (Success);
return Success;
if (--pfont->refcnt == 0) {
if (patternCache)
RemoveCachedFontPattern (patternCache, pfont);
@ -504,7 +504,7 @@ CloseFont(pointer value, XID fid)
(*fpe_functions[fpe->type].close_font) (fpe, pfont);
FreeFPE(fpe);
}
return (Success);
return Success;
}

View File

@ -296,17 +296,17 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
if (mode == SetModeInsert)
{
if (j < numnow) /* duplicate */
return(Success);
return Success;
numnow++;
pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow);
if (!pTmp)
return(BadAlloc);
return BadAlloc;
client->saveSet = pTmp;
client->numSaved = numnow;
SaveSetAssignWindow(client->saveSet[numnow - 1], pWin);
SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot);
SaveSetAssignMap(client->saveSet[numnow - 1], map);
return(Success);
return Success;
}
else if ((mode == SetModeDelete) && (j < numnow))
{
@ -328,9 +328,9 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode,
client->saveSet = (SaveSetElt *)NULL;
}
client->numSaved = numnow;
return(Success);
return Success;
}
return(Success);
return Success;
}
void

View File

@ -331,7 +331,7 @@ IsKeyboardDevice(DeviceIntPtr dev)
Bool
IsMaster(DeviceIntPtr dev)
{
return (dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD);
return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
}
static WindowPtr XYToWindow(
@ -4083,7 +4083,7 @@ OtherClientGone(pointer value, XID id)
}
free(other);
RecalculateDeliverableEvents(pWin);
return(Success);
return Success;
}
prev = other;
}
@ -4488,7 +4488,7 @@ SetInputFocus(
/* It is a match error to try to set the input focus to an
unviewable window. */
if(!focusWin->realized)
return(BadMatch);
return BadMatch;
}
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess);
if (rc != Success)
@ -5005,7 +5005,7 @@ ProcQueryPointer(ClientPtr client)
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
return(Success);
return Success;
}
/**
@ -5209,8 +5209,8 @@ ProcUngrabKey(ClientPtr client)
tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc);
return(Success);
return BadAlloc;
return Success;
}
/**
@ -5404,8 +5404,8 @@ ProcUngrabButton(ClientPtr client)
tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc);
return(Success);
return BadAlloc;
return Success;
}
/**
@ -5619,7 +5619,7 @@ ProcRecolorCursor(ClientPtr client)
( *pscr->RecolorCursor)(PickPointer(client), pscr, pCursor,
(pCursor == pSprite->current) && displayed);
}
return (Success);
return Success;
}
/**

View File

@ -91,10 +91,10 @@ AddExtension(char *name, int NumEvents, int NumErrors,
ext = calloc(sizeof (ExtensionEntry), 1);
if (!ext)
return(NULL);
return NULL;
if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) {
free(ext);
return(NULL);
return NULL;
}
ext->name = malloc(strlen(name) + 1);
ext->num_aliases = 0;
@ -149,7 +149,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
}
RegisterExtensionNames(ext);
return(ext);
return ext;
}
Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
@ -335,7 +335,7 @@ ProcListExtensions(ClientPtr client)
reply.length = bytes_to_int32(total_length);
buffer = bufptr = malloc(total_length);
if (!buffer)
return(BadAlloc);
return BadAlloc;
for (i=0; i<NumExtensions; i++)
{
int len;

View File

@ -562,7 +562,7 @@ out:
pGC = (GCPtr)NULL;
}
return (pGC);
return pGC;
}
static Bool
@ -785,7 +785,7 @@ FreeGC(pointer value, XID gid)
if (pGC->dash != DefaultDash)
free(pGC->dash);
dixFreeObjectWithPrivates(pGC, PRIVATE_GC);
return(Success);
return Success;
}
/* CreateScratchGC(pScreen, depth)
@ -1066,7 +1066,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects,
newct = VerifyRectOrder(nrects, prects, ordering);
if (newct < 0)
return(BadMatch);
return BadMatch;
size = nrects * sizeof(xRectangle);
prectsNew = malloc(size);
if (!prectsNew && size)

View File

@ -348,6 +348,6 @@ int main(int argc, char *argv[], char *envp[])
free(ConnectionInfo);
ConnectionInfo = NULL;
}
return(0);
return 0;
}

View File

@ -230,12 +230,12 @@ ProcChangeProperty(ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return(BadAtom);
return BadAtom;
}
if (!ValidAtom(stuff->type))
{
client->errorValue = stuff->type;
return(BadAtom);
return BadAtom;
}
err = dixChangeWindowProperty(client, pWin, stuff->property, stuff->type,
@ -268,15 +268,15 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
if (rc == BadMatch) /* just add to list */
{
if (!pWin->optional && !MakeWindowOptional (pWin))
return(BadAlloc);
return BadAlloc;
pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY);
if (!pProp)
return(BadAlloc);
return BadAlloc;
data = malloc(totalSize);
if (!data && len)
{
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
return(BadAlloc);
return BadAlloc;
}
memcpy(data, value, totalSize);
pProp->propertyName = property;
@ -304,9 +304,9 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
"PropModeReplace" since they will be written over. */
if ((format != pProp->format) && (mode != PropModeReplace))
return(BadMatch);
return BadMatch;
if ((pProp->type != type) && (mode != PropModeReplace))
return(BadMatch);
return BadMatch;
/* save the old values for later */
savedProp = *pProp;
@ -315,7 +315,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{
data = malloc(totalSize);
if (!data && len)
return(BadAlloc);
return BadAlloc;
memcpy(data, value, totalSize);
pProp->data = data;
pProp->size = len;
@ -330,7 +330,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{
data = malloc((pProp->size + len) * sizeInBytes);
if (!data)
return(BadAlloc);
return BadAlloc;
memcpy(data, pProp->data, pProp->size * sizeInBytes);
memcpy(data + pProp->size * sizeInBytes, value, totalSize);
pProp->data = data;
@ -340,7 +340,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{
data = malloc(sizeInBytes * (len + pProp->size));
if (!data)
return(BadAlloc);
return BadAlloc;
memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes);
memcpy(data, value, totalSize);
pProp->data = data;
@ -369,7 +369,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
if (sendevent)
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName);
return(Success);
return Success;
}
int
@ -477,17 +477,17 @@ ProcGetProperty(ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return(BadAtom);
return BadAtom;
}
if ((stuff->delete != xTrue) && (stuff->delete != xFalse))
{
client->errorValue = stuff->delete;
return(BadValue);
return BadValue;
}
if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type))
{
client->errorValue = stuff->type;
return(BadAtom);
return BadAtom;
}
memset(&reply, 0, sizeof(xGetPropertyReply));
@ -513,7 +513,7 @@ ProcGetProperty(ClientPtr client)
reply.nItems = 0;
reply.propertyType = pProp->type;
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
return(Success);
return Success;
}
/*
@ -635,7 +635,7 @@ ProcDeleteProperty(ClientPtr client)
if (!ValidAtom(stuff->property))
{
client->errorValue = stuff->property;
return (BadAtom);
return BadAtom;
}
return DeleteProperty(client, pWin, stuff->property);

View File

@ -494,7 +494,7 @@ CalcTracker(DeviceVelocityPtr vel, int offset, int cur_t){
+ vel->tracker[index].dy * vel->tracker[index].dy);
int dtime = cur_t - vel->tracker[index].time;
if(dtime > 0)
return (dist / dtime);
return dist / dtime;
else
return 0;/* synonymous for NaN, since we're not C99 */
}

View File

@ -245,7 +245,7 @@ RegionCreate(BoxPtr rect, int size)
RegionInit (pReg, rect, size);
return(pReg);
return pReg;
}
void
@ -290,7 +290,7 @@ RegionIsValid(RegionPtr reg)
(reg->extents.y1 == reg->extents.y2) &&
(reg->data->size || (reg->data == &RegionEmptyData)));
else if (numRects == 1)
return (!reg->data);
return !reg->data;
else
{
BoxPtr pboxP, pboxN;
@ -428,7 +428,7 @@ RegionCoalesce (
do {
if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) {
return (curStart);
return curStart;
}
pPrevBox++;
pCurBox++;
@ -1655,5 +1655,5 @@ RegionClipSpans(
}
}
}
return (pwidthNew - pwidthNewStart);
return pwidthNew - pwidthNewStart;
}

View File

@ -901,7 +901,7 @@ LegalNewID(XID id, ClientPtr client)
rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
DixGetAttrAccess);
return (rc == BadValue);
return rc == BadValue;
}
return FALSE;
}

View File

@ -318,7 +318,7 @@ SProcSendEvent(ClientPtr client)
/* Swap event */
proc = EventSwapVector[stuff->event.u.u.type & 0177];
if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
return (BadValue);
return BadValue;
(*proc)(&stuff->event, &eventT);
stuff->event = eventT;

View File

@ -221,12 +221,12 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data)
WindowPtr pChild;
if (!(pChild = pWin))
return(WT_NOMATCH);
return WT_NOMATCH;
while (1)
{
result = (* func)(pChild, data);
if (result == WT_STOPWALKING)
return(WT_STOPWALKING);
return WT_STOPWALKING;
if ((result == WT_WALKCHILDREN) && pChild->firstChild)
{
pChild = pChild->firstChild;
@ -238,7 +238,7 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data)
break;
pChild = pChild->nextSib;
}
return(WT_NOMATCH);
return WT_NOMATCH;
}
/*****
@ -529,9 +529,9 @@ RealChildHead(WindowPtr pWin)
if (!pWin->parent &&
(screenIsSaved == SCREEN_SAVER_ON) &&
(HasSaverWindow (pWin->drawable.pScreen)))
return (pWin->firstChild);
return pWin->firstChild;
else
return (NullWindow);
return NullWindow;
}
/*****
@ -1549,7 +1549,7 @@ MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib)
(*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib);
#endif
return( pFirstChange );
return pFirstChange;
}
void
@ -1795,12 +1795,12 @@ IsSiblingAboveMe(
while (pWin)
{
if (pWin == pSib)
return(Above);
return Above;
else if (pWin == pMe)
return(Below);
return Below;
pWin = pWin->nextSib;
}
return(Below);
return Below;
}
static BoxPtr
@ -1814,7 +1814,7 @@ WindowExtents(
+ wBorderWidth (pWin);
pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height
+ wBorderWidth (pWin);
return(pBox);
return pBox;
}
#define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL)
@ -1872,10 +1872,10 @@ AnyWindowOverlapsMe(
if (BOXES_OVERLAP(sbox, box)
&& ShapeOverlap (pWin, box, pSib, sbox)
)
return(TRUE);
return TRUE;
}
}
return(FALSE);
return FALSE;
}
static Bool
@ -1895,10 +1895,10 @@ IOverlapAnyWindow(
if (BOXES_OVERLAP(sbox, box)
&& ShapeOverlap (pWin, box, pSib, sbox)
)
return(TRUE);
return TRUE;
}
}
return(FALSE);
return FALSE;
}
/*
@ -1955,63 +1955,63 @@ WhereDoIGoInTheStack(
{
case Above:
if (pSib)
return(pSib);
return pSib;
else if (pWin == pFirst)
return(pWin->nextSib);
return pWin->nextSib;
else
return(pFirst);
return pFirst;
case Below:
if (pSib)
if (pSib->nextSib != pWin)
return(pSib->nextSib);
return pSib->nextSib;
else
return(pWin->nextSib);
return pWin->nextSib;
else
return NullWindow;
case TopIf:
if ((!pWin->mapped || (pSib && !pSib->mapped)))
return(pWin->nextSib);
return pWin->nextSib;
else if (pSib)
{
if ((IsSiblingAboveMe(pWin, pSib) == Above) &&
(RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
return(pFirst);
return pFirst;
else
return(pWin->nextSib);
return pWin->nextSib;
}
else if (AnyWindowOverlapsMe(pWin, pHead, &box))
return(pFirst);
return pFirst;
else
return(pWin->nextSib);
return pWin->nextSib;
case BottomIf:
if ((!pWin->mapped || (pSib && !pSib->mapped)))
return(pWin->nextSib);
return pWin->nextSib;
else if (pSib)
{
if ((IsSiblingAboveMe(pWin, pSib) == Below) &&
(RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
return NullWindow;
else
return(pWin->nextSib);
return pWin->nextSib;
}
else if (IOverlapAnyWindow(pWin, &box))
return NullWindow;
else
return(pWin->nextSib);
return pWin->nextSib;
case Opposite:
if ((!pWin->mapped || (pSib && !pSib->mapped)))
return(pWin->nextSib);
return pWin->nextSib;
else if (pSib)
{
if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)
{
if (IsSiblingAboveMe(pWin, pSib) == Above)
return(pFirst);
return pFirst;
else
return NullWindow;
}
else
return(pWin->nextSib);
return pWin->nextSib;
}
else if (AnyWindowOverlapsMe(pWin, pHead, &box))
{
@ -2019,7 +2019,7 @@ WhereDoIGoInTheStack(
* if (pWin == pWin->parent->firstChild)
* return pWin->nextSib;
*/
return(pFirst);
return pFirst;
}
else if (IOverlapAnyWindow(pWin, &box))
return NullWindow;
@ -2094,10 +2094,10 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
xEvent event;
if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask))
return(BadMatch);
return BadMatch;
if ((mask & CWSibling) && !(mask & CWStackMode))
return(BadMatch);
return BadMatch;
pVlist = vlist;
@ -2154,9 +2154,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
return rc;
}
if (pSib->parent != pParent)
return(BadMatch);
return BadMatch;
if (pSib == pWin)
return(BadMatch);
return BadMatch;
break;
case CWStackMode:
GET_CARD8(CWStackMode, smode);
@ -2164,12 +2164,12 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
(smode != Opposite) && (smode != Above) && (smode != Below))
{
client->errorValue = smode;
return(BadValue);
return BadValue;
}
break;
default:
client->errorValue = mask;
return(BadValue);
return BadValue;
}
}
/* root really can't be reconfigured, so just return */
@ -2217,7 +2217,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
event.u.configureRequest.parent = pParent->drawable.id;
if (MaybeDeliverEventsToClient(pParent, &event, 1,
SubstructureRedirectMask, client) == 1)
return(Success);
return Success;
}
if (action == RESIZE_WIN)
{
@ -2268,7 +2268,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
#endif
goto ActuallyDoSomething;
}
return(Success);
return Success;
ActuallyDoSomething:
if (pWin->drawable.pScreen->ConfigNotify)
@ -2331,7 +2331,7 @@ ActuallyDoSomething:
if (action != RESTACK_WIN)
CheckCursorConfinement(pWin);
return(Success);
return Success;
#undef RESTACK_WIN
#undef MOVE_WIN
#undef RESIZE_WIN
@ -2392,7 +2392,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
event.u.u.type = CirculateRequest;
if (MaybeDeliverEventsToClient(pParent, &event, 1,
SubstructureRedirectMask, client) == 1)
return(Success);
return Success;
}
event.u.u.type = CirculateNotify;
@ -2401,7 +2401,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client)
(direction == RaiseLowest) ? pFirst : NullWindow,
VTStack);
return(Success);
return Success;
}
static int
@ -2412,9 +2412,9 @@ CompareWIDs(
Window *wid = (Window *)value;
if (pWin->drawable.id == *wid)
return(WT_STOPWALKING);
return WT_STOPWALKING;
else
return(WT_WALKCHILDREN);
return WT_WALKCHILDREN;
}
/*****
@ -2433,9 +2433,9 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
pScreen = pWin->drawable.pScreen;
if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING)
return(BadMatch);
return BadMatch;
if (!MakeWindowOptional(pWin))
return(BadAlloc);
return BadAlloc;
if (WasMapped)
UnmapWindow(pWin, FALSE);
@ -2511,7 +2511,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
if (WasMapped)
MapWindow(pWin, client);
RecalculateDeliverableEvents(pWin);
return(Success);
return Success;
}
static void
@ -2584,7 +2584,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
WindowPtr pLayerWin;
if (pWin->mapped)
return(Success);
return Success;
/* general check for permission to map window */
if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW,
@ -2608,7 +2608,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
if (MaybeDeliverEventsToClient(pParent, &event, 1,
SubstructureRedirectMask, client) == 1)
return(Success);
return Success;
}
pWin->mapped = TRUE;
@ -2622,7 +2622,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
}
if (!pParent->realized)
return(Success);
return Success;
RealizeTree(pWin);
if (pWin->viewable)
{
@ -2657,7 +2657,7 @@ MapWindow(WindowPtr pWin, ClientPtr client)
RegionUninit(&temp);
}
return(Success);
return Success;
}
@ -2813,7 +2813,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
WindowPtr pLayerWin = pWin;
if ((!pWin->mapped) || (!(pParent = pWin->parent)))
return(Success);
return Success;
if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin))
{
memset(&event, 0, sizeof(xEvent));
@ -2843,7 +2843,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure)
}
if (wasRealized && !fromConfigure)
WindowsRestructured ();
return(Success);
return Success;
}
/*****
@ -2986,15 +2986,15 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y)
BoxRec box;
if (!pWin->realized)
return (FALSE);
return FALSE;
if (RegionContainsPoint(&pWin->borderClip,
x, y, &box)
&& (!wInputShape(pWin) ||
RegionContainsPoint(wInputShape(pWin),
x - pWin->drawable.x,
y - pWin->drawable.y, &box)))
return(TRUE);
return(FALSE);
return TRUE;
return FALSE;
}
@ -3008,7 +3008,7 @@ NotClippedByChildren(WindowPtr pWin)
{
RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize);
}
return(pReg);
return pReg;
}
void

View File

@ -48,7 +48,7 @@ fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
*pmaps = GetInstalledColormap(pScreen)->mid;
return (1);
return 1;
}

View File

@ -318,7 +318,7 @@ fbPixmapToRegion(PixmapPtr pPix)
if (!RegionIsValid(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
#endif
return(pReg);
return pReg;
}
#ifdef FB_DEBUG

View File

@ -43,13 +43,13 @@ fbCloseScreen (int index, ScreenPtr pScreen)
Bool
fbRealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
return (TRUE);
return TRUE;
}
Bool
fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
return (TRUE);
return TRUE;
}
void

View File

@ -77,7 +77,7 @@ GLint __glGetMap_size(GLenum target, GLenum query)
/*
** The query above might fail, but then order will be zero anyway.
*/
return (order * k);
return order * k;
case GL_DOMAIN:
return 2;
case GL_ORDER:
@ -101,7 +101,7 @@ GLint __glGetMap_size(GLenum target, GLenum query)
/*
** The query above might fail, but then majorMinor will be zeroes
*/
return (majorMinor[0] * majorMinor[1] * k);
return majorMinor[0] * majorMinor[1] * k;
case GL_DOMAIN:
return 4;
case GL_ORDER:

View File

@ -51,7 +51,7 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
int num_good_visuals;
if (!XQueryExtension(dpy, "GLX", &majorOpcode, &dummy, &dummy)) {
return(NULL);
return NULL;
}
/* Send the glXGetVisualConfigs request */
@ -228,7 +228,7 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
SyncHandle();
*nconfigs = nvisuals;
return( configs );
return configs;
}
@ -500,7 +500,7 @@ GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig *fbconfigs, int nfbconfigs,
__GLXvisualConfig *configs = NULL;
int i;
if (!fbconfigs || !nfbconfigs || !nconfigs) return(NULL);
if (!fbconfigs || !nfbconfigs || !nconfigs) return NULL;
*nconfigs = 0;
/* Allocate memory for our config structure */
@ -596,6 +596,6 @@ GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig *fbconfigs, int nfbconfigs,
}
}
return( configs );
return configs;
}

View File

@ -75,7 +75,7 @@ Bool dmxBECreateColormap(ColormapPtr pColormap)
visual,
(pVisual->class & DynamicClass ?
AllocAll : AllocNone));
return (pCmapPriv->cmap != 0);
return pCmapPriv->cmap != 0;
}
else {
dmxLog(dmxWarning, "dmxBECreateColormap: No visual found\n");

View File

@ -108,7 +108,7 @@ static Bool dmxCheckFontPathElement(DMXScreenInfo *dmxScreen, char *fp)
dmxSync(dmxScreen, TRUE); /* Must complete before removing handler */
XSetErrorHandler(oldErrorHandler);
return (dmxFontLastError == 0);
return dmxFontLastError == 0;
}
static int dmxSetFontPath(DMXScreenInfo *dmxScreen)

View File

@ -404,7 +404,7 @@ Bool dmxGetVisualInfo(DMXScreenInfo *dmxScreen)
dmxLogVisual(dmxScreen, &dmxScreen->beVisuals[i],
(i == dmxScreen->beDefVisualIndex));
return (dmxScreen->beDefVisualIndex >= 0);
return dmxScreen->beDefVisualIndex >= 0;
}
void dmxGetColormaps(DMXScreenInfo *dmxScreen)

View File

@ -247,5 +247,5 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
RegionValidate(pReg, &overlap);
dmxSync(dmxScreen, FALSE);
return(pReg);
return pReg;
}

View File

@ -145,7 +145,7 @@ GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
default:
return 0;
}
return (elements * esize * w * h);
return elements * esize * w * h;
}
GLint __glBitmap_size(GLsizei w, GLsizei h)
@ -294,7 +294,7 @@ GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w)
default:
return 0;
}
return (elements * esize * w);
return elements * esize * w;
}
GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
@ -371,7 +371,7 @@ GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
default:
return 0;
}
return (elements * esize * w * h);
return elements * esize * w * h;
}
GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h,
@ -450,7 +450,7 @@ GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h,
default:
return 0;
}
return (elements * esize * w * h * d);
return elements * esize * w * h * d;
}
GLint __glLightfv_size(GLenum pname)

View File

@ -80,7 +80,7 @@ Display *GetBackEndDisplay( __GLXclientState *cl, int s )
if (! cl->be_displays[s] ) {
cl->be_displays[s] = XOpenDisplay( DisplayString(dmxScreens[s].beDisplay) );
}
return( cl->be_displays[s] );
return cl->be_displays[s];
}
/*
@ -628,7 +628,7 @@ int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s)
return( cl->be_currentCTag[ (tag-1)*screenInfo.numScreens + s ] );
}
else {
return( 0 );
return 0;
}
}

View File

@ -90,7 +90,7 @@ int AreFBConfigsMatch( __GLXFBConfig *c1, __GLXFBConfig *c2 )
(c1->maxAlpha == c2->maxAlpha)
);
return( match );
return match;
}
__GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, int nconfigs )
@ -99,8 +99,8 @@ __GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, i
for (i=0; i<nconfigs; i++) {
if ( AreFBConfigsMatch( c, configs + i ) )
return( configs + i );
return configs + i;
}
return(0);
return 0;
}

View File

@ -327,7 +327,7 @@ char *__glXGetServerString( unsigned int name )
break;
}
return( ret );
return ret;
}
@ -338,10 +338,10 @@ __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id )
for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->id == id)
return( __glXFBConfigs[j] );
return __glXFBConfigs[j];
}
return(NULL);
return NULL;
}
__GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
@ -350,10 +350,10 @@ __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->associatedVisualId == vid)
return( __glXFBConfigs[j] );
return __glXFBConfigs[j];
}
return(NULL);
return NULL;
}
__GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen )
@ -363,10 +363,10 @@ __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen )
for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->id == id)
return( __glXFBConfigs[j+screen+1] );
return __glXFBConfigs[j+screen+1];
}
return(NULL);
return NULL;
}

View File

@ -668,7 +668,7 @@ static GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h,
}
if (elementbits_return) *elementbits_return = elements;
if (rowbytes_return) *rowbytes_return = rowsize;
return (rowsize * h);
return rowsize * h;
} else {
return -1;
}
@ -718,7 +718,7 @@ static GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h,
if (elementbits_return) *elementbits_return = esize*elements*8;
if (rowbytes_return) *rowbytes_return = rowsize;
return (rowsize * h);
return rowsize * h;
}
static int intersectRect( int x1, int x2, int y1, int y2,
@ -734,14 +734,14 @@ static int intersectRect( int x1, int x2, int y1, int y2,
if ( (width <= 0) || (height <= 0) ) {
*ix1 = *ix2 = *iy1 = *iy2 = 0;
return(0);
return 0;
}
else {
*ix1 = left;
*ix2 = right;
*iy1 = top;
*iy2 = bottom;
return( width * height );
return width * height;
}
}
@ -811,7 +811,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
if (buf_size > 0) {
buf = (char *) malloc( buf_size );
if ( !buf ) {
return( BadAlloc );
return BadAlloc;
}
}
else {

View File

@ -77,11 +77,11 @@ int glxVisualsMatch( __GLXvisualConfig *v1, __GLXvisualConfig *v2 )
(v1->nMultiSampleBuffers == v2->nMultiSampleBuffers) &&
(v1->visualSelectGroup == v2->visualSelectGroup) ) {
return(1);
return 1;
}
return(0);
return 0;
}
@ -93,12 +93,12 @@ VisualID glxMatchGLXVisualInConfigList( __GLXvisualConfig *pGlxVisual, __GLXvisu
if (glxVisualsMatch( pGlxVisual, &configs[i] )) {
return( configs[i].vid );
return configs[i].vid;
}
}
return(0);
return 0;
}
VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLXvisualConfig *configs, int nconfigs )
@ -109,7 +109,7 @@ VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLX
/* check that the glx extension has been initialized */
if ( !__glXActiveScreens )
return(0);
return 0;
pGlxScreen = &__glXActiveScreens[pScreen->myNum];
pGlxVisual = pGlxScreen->pGlxVisual;
@ -124,7 +124,7 @@ VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLX
/*
* the visual is not supported by glx
*/
return(0);
return 0;
}
return( glxMatchGLXVisualInConfigList(pGlxVisual, configs, nconfigs) );
@ -151,12 +151,12 @@ VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatch
*/
for (j=0; j<pMatchScreen->numVisuals; j++) {
if (vid == pMatchScreen->visuals[j].vid) {
return( &pMatchScreen->visuals[j] );
return &pMatchScreen->visuals[j];
}
}
}
return(0);
return 0;
}
void glxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
@ -198,7 +198,7 @@ static VisualID FindClosestVisual( VisualPtr pVisual, int rootDepth,
while( pdepth[d].vids[v] != vis->vid ) vis++;
if (vis->class == pVisual->class) {
return( pdepth[d].vids[v] );
return pdepth[d].vids[v];
}
}
}
@ -216,7 +216,7 @@ static VisualID FindClosestVisual( VisualPtr pVisual, int rootDepth,
while( pdepth[d].vids[v] != vis->vid ) vis++;
if (vis->class == pVisual->class) {
return( pdepth[d].vids[v] );
return pdepth[d].vids[v];
}
}
}
@ -224,7 +224,7 @@ static VisualID FindClosestVisual( VisualPtr pVisual, int rootDepth,
/*
* if not found - just take the first visual
*/
return( pdepth[0].vids[0] );
return pdepth[0].vids[0];
}
Bool glxInitVisuals(int *nvisualp, VisualPtr *visualp,

View File

@ -532,7 +532,7 @@ hostx_get_server_depth (EphyrScreenInfo screen)
{
struct EphyrHostScreen *host_screen = host_screen_from_screen_info (screen);
return (host_screen ? host_screen->server_depth : 0);
return host_screen ? host_screen->server_depth : 0;
}
void

View File

@ -1173,7 +1173,7 @@ KdXVQueryAdaptors(
*p_nAdaptors = pxvs->nAdaptors;
*p_pAdaptors = pxvs->pAdaptors;
return (Success);
return Success;
}
static Bool

View File

@ -401,7 +401,7 @@ vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
*pmaps = GetInstalledColormap(pScreen)->mid;
return (1);
return 1;
}

View File

@ -185,7 +185,7 @@ xf86AutoConfig(void)
if (ret != CONFIG_OK)
xf86Msg(X_ERROR, "Error parsing the built-in default configuration.\n");
return (ret == CONFIG_OK);
return ret == CONFIG_OK;
}
static void

View File

@ -245,7 +245,7 @@ xf86AllocateEntity(void)
xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec));
xf86Entities[xf86NumEntities - 1]->entityPrivates =
xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1);
return (xf86NumEntities - 1);
return xf86NumEntities - 1;
}
Bool
@ -257,9 +257,9 @@ xf86IsEntityPrimary(int entityIndex)
switch (pEnt->bus.type) {
case BUS_PCI:
return (pEnt->bus.id.pci == primaryBus.id.pci);
return pEnt->bus.id.pci == primaryBus.id.pci;
case BUS_SBUS:
return (pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum);
return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum;
default:
return FALSE;
}
@ -342,7 +342,7 @@ xf86FindScreenForEntity(int entityIndex)
for (i = 0; i < xf86NumScreens; i++) {
for (j = 0; j < xf86Screens[i]->numEntities; j++) {
if ( xf86Screens[i]->entityList[j] == entityIndex )
return (xf86Screens[i]);
return xf86Screens[i];
}
}
}
@ -557,7 +557,7 @@ int
xf86GetLastScrnFlag(int entityIndex)
{
if(entityIndex < xf86NumEntities) {
return(xf86Entities[entityIndex]->lastScrnFlag);
return xf86Entities[entityIndex]->lastScrnFlag;
} else {
return -1;
}

View File

@ -163,7 +163,7 @@ xf86GetPathElem(char **pnt)
**pnt = '\0';
*pnt += 1;
}
return(p1);
return p1;
}
/*
@ -239,7 +239,7 @@ xf86ValidateFontPath(char *path)
strcat(out_pnt, path_elem);
out_pnt += strlen(path_elem);
}
return(tmp_path);
return tmp_path;
}

View File

@ -1360,7 +1360,7 @@ xf86TokenToString(SymTabPtr table, int token)
if (table[i].token < 0)
return NULL;
else
return(table[i].name);
return table[i].name;
}
int
@ -1374,7 +1374,7 @@ xf86StringToToken(SymTabPtr table, const char *string)
for (i = 0; table[i].token >= 0 && xf86NameCmp(string, table[i].name); i++)
;
return(table[i].token);
return table[i].token;
}
/*
@ -1993,7 +1993,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
ScrnIndex, property, type, format, len, value);
if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
return(BadMatch);
return BadMatch;
}
if (xf86RegisteredPropertiesTable &&
@ -2007,7 +2007,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
if (!pNewProp) {
if ((pNewProp = (RootWinPropPtr)malloc(sizeof(RootWinProp))) == NULL) {
return(BadAlloc);
return BadAlloc;
}
/*
* We will put this property at the end of the list so that
@ -2031,7 +2031,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
DebugF("creating xf86RegisteredPropertiesTable[] size %d\n",
xf86NumScreens);
if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) {
return(BadAlloc);
return BadAlloc;
}
for (i=0; i<xf86NumScreens; i++) {
xf86RegisteredPropertiesTable[i] = NULL;
@ -2056,7 +2056,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
}
}
DebugF("xf86RegisterRootWindowProperty succeeded\n");
return(Success);
return Success;
}
Bool

View File

@ -294,7 +294,7 @@ xf86CreateRootWindow(WindowPtr pWin)
}
DebugF("xf86CreateRootWindow() returns %d\n", ret);
return (ret);
return ret;
}

View File

@ -745,7 +745,7 @@ xf86IsOptionSet(const OptionInfoRec *table, int token)
OptionInfoPtr p;
p = xf86TokenToOptinfo(table, token);
return (p && p->found);
return p && p->found;
}

View File

@ -278,9 +278,9 @@ xf86SendDragEvents(DeviceIntPtr device)
LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
if (device->button && device->button->buttonsDown > 0)
return (local->flags & XI86_SEND_DRAG_EVENTS);
return local->flags & XI86_SEND_DRAG_EVENTS;
else
return (TRUE);
return TRUE;
}
/***********************************************************************
@ -1193,7 +1193,7 @@ xf86ScaleAxis(int Cx,
if (X < Sxlow)
X = Sxlow;
return (X);
return X;
}
/*

View File

@ -465,7 +465,7 @@ xf86PciAddMatchingDev(DriverPtr drvp)
pci_iterator_destroy(iter);
return (numFound != 0);
return numFound != 0;
}
Bool

View File

@ -530,7 +530,7 @@ xf86GetSbusInfoForEntity(int entityIndex)
for (psdpp = xf86SbusInfo; *psdpp != NULL; psdpp++) {
if (p->bus.id.sbus.fbNum == (*psdpp)->fbNum)
return (*psdpp);
return *psdpp;
}
return NULL;
}

View File

@ -1220,7 +1220,7 @@ xf86XVQueryAdaptors(
*p_nAdaptors = pxvs->nAdaptors;
*p_pAdaptors = pxvs->pAdaptors;
return (Success);
return Success;
}

View File

@ -69,12 +69,12 @@ XisbNew (int fd, ssize_t size)
b = malloc(sizeof (XISBuffer));
if (!b)
return (NULL);
return NULL;
b->buf = malloc((sizeof (unsigned char) * size));
if (!b->buf)
{
free(b);
return (NULL);
return NULL;
}
b->fd = fd;
@ -83,7 +83,7 @@ XisbNew (int fd, ssize_t size)
b->current = 1; /* force it to be past the end to trigger initial read */
b->end = 0;
b->buffer_size = size;
return (b);
return b;
}
void
@ -103,7 +103,7 @@ XisbRead (XISBuffer *b)
if (b->block_duration >= 0)
{
if (xf86WaitForInput (b->fd, b->block_duration) < 1)
return (-1);
return -1;
}
else
{
@ -119,9 +119,9 @@ XisbRead (XISBuffer *b)
switch (ret)
{
case 0:
return (-1); /* timeout */
return -1; /* timeout */
case -1:
return (-2); /* error */
return -2; /* error */
default:
b->end = ret;
b->current = 0;
@ -132,7 +132,7 @@ XisbRead (XISBuffer *b)
ErrorF ("read 0x%02x (%c)\n", b->buf[b->current],
isprint(b->buf[b->current])?b->buf[b->current]:'.');
return (b->buf[b->current++]);
return b->buf[b->current++];
}
/* the only purpose of this function is to provide output tracing */

View File

@ -53,8 +53,8 @@ find_start(unsigned int *ptr)
}
}
for (i=0;i<9;i++)
if (test[i]) return (i+1);
return (-1);
if (test[i]) return i+1;
return -1;
}
static unsigned char *
@ -75,8 +75,8 @@ find_header(unsigned char *block)
if (i==8) break;
ptr++;
}
if (ptr == end) return (NULL);
return (ptr);
if (ptr == end) return NULL;
return ptr;
}
static unsigned char *
@ -98,7 +98,7 @@ resort(unsigned char *s_block)
if (s_ptr == s_end) s_ptr = s_block;
}
free(s_block);
return (d_new);
return d_new;
}
static int
@ -120,7 +120,7 @@ DDC_checksum(unsigned char *block, int len)
/* catch the trivial case where all bytes are 0 */
if (!not_null) return 1;
return (result&0xFF);
return result&0xFF;
}
static unsigned char *
@ -169,7 +169,7 @@ FetchEDID_DDC1(register ScrnInfoPtr pScrn,
*xp = read_DDC(pScrn);
xp++;
} while(--count);
return (ptr);
return ptr;
}
/* test if DDC1 return 0 if not */
@ -184,7 +184,7 @@ TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC)(ScrnInfoPtr))
/* wait for next retrace */
if (old != read_DDC(pScrn)) break;
} while(count--);
return (count);
return count;
}
/*

View File

@ -183,7 +183,7 @@ xf86InterpretEDID(int scrnIndex, Uchar *block)
handle_edid_quirks(m);
encode_aspect_ratio(m);
return (m);
return m;
error:
free(m);

View File

@ -692,10 +692,10 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
rep.sequenceNumber = client->sequence;
if(!DGAAvailable(stuff->screen))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
if(!(num = DGAGetOldDGAMode(stuff->screen)))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
/* get the parameters for the mode that best matches */
DGAGetModeInfo(stuff->screen, &mode, num);
@ -736,12 +736,12 @@ ProcXF86DGADirectVideo(ClientPtr client)
if (stuff->enable & XF86DGADirectGraphics) {
if(!(num = DGAGetOldDGAMode(stuff->screen)))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
} else
num = 0;
if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
return (DGAErrorBase + XF86DGAScreenNotActive);
return DGAErrorBase + XF86DGAScreenNotActive;
DGASetInputMode (stuff->screen,
(stuff->enable & XF86DGADirectKeyb) != 0,
@ -785,10 +785,10 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
rep.sequenceNumber = client->sequence;
if (!DGAAvailable(stuff->screen))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
if(!(num = DGAGetOldDGAMode(stuff->screen)))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
DGAGetModeInfo(stuff->screen, &mode, num);
@ -813,7 +813,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq);
if (!DGAAvailable(stuff->screen))
return (DGAErrorBase + XF86DGANoDirectVideoMode);
return DGAErrorBase + XF86DGANoDirectVideoMode;
if (!DGAActive(stuff->screen))
return DGAErrorBase + XF86DGADirectNotActivated;
@ -877,7 +877,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq);
if (!DGAActive(stuff->screen))
return (DGAErrorBase + XF86DGADirectNotActivated);
return DGAErrorBase + XF86DGADirectNotActivated;
rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP,
client, DixInstallAccess);
@ -926,7 +926,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq);
if (!DGAActive(stuff->screen))
return (DGAErrorBase + XF86DGADirectNotActivated);
return DGAErrorBase + XF86DGADirectNotActivated;
rep.type = X_Reply;
rep.length = 0;

View File

@ -520,7 +520,7 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client)
modecount = VidModeGetNumOfModes(stuff->screen);
if (modecount < 1)
return (VidModeErrorBase + XF86VidModeExtensionDisabled);
return VidModeErrorBase + XF86VidModeExtensionDisabled;
if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
return BadValue;

View File

@ -949,7 +949,7 @@ DRI2HasSwapControl(ScreenPtr pScreen)
{
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
return (ds->ScheduleSwap && ds->GetMSC);
return ds->ScheduleSwap && ds->GetMSC;
}
Bool

View File

@ -163,7 +163,7 @@ get_node(const char *name)
for (n = graph; n && n->n_name && strcmp(n->n_name, name);
n = n->n_next) ;
if (n)
return (n);
return n;
n = xnfalloc(sizeof(NODE));
@ -180,7 +180,7 @@ get_node(const char *name)
n->n_prevp = &graph;
graph = n;
return (n);
return n;
}
/*
@ -285,7 +285,7 @@ find_cycle(NODE * from, NODE * to, int longest_len, int depth)
* to be acyclic
*/
if (from->n_flags & (NF_NODEST | NF_MARK | NF_ACYCLIC))
return (0);
return 0;
from->n_flags |= NF_MARK;
for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) {
@ -317,7 +317,7 @@ find_cycle(NODE * from, NODE * to, int longest_len, int depth)
}
}
from->n_flags &= ~NF_MARK;
return (longest_len);
return longest_len;
}
/* do topological sort on graph */

View File

@ -114,7 +114,7 @@ static char **defaultPathList = NULL;
static Bool
PathIsAbsolute(const char *path)
{
return (*path == '/');
return *path == '/';
}
/*
@ -739,7 +739,7 @@ static ModuleDescPtr
AddSibling(ModuleDescPtr head, ModuleDescPtr new)
{
new->sib = head;
return (new);
return new;
}
pointer
@ -789,7 +789,7 @@ NewModuleDesc(const char *name)
mdp->TearDownData = NULL;
}
return (mdp);
return mdp;
}
ModuleDescPtr

View File

@ -577,7 +577,7 @@ xf86OutputInitialRotation (xf86OutputPtr output)
for (i = 0; i < 4; i++)
if (xf86nameCompare (direction[i], rotate_name) == 0)
return (1 << i);
return 1 << i;
return RR_Rotate_0;
}
@ -2201,7 +2201,7 @@ xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
target_rotation, width, height);
}
return (target_mode != NULL);
return target_mode != NULL;
}
static Bool
@ -3220,7 +3220,7 @@ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn)
return FALSE;
crtc = xf86_config->crtc[0];
return (crtc->funcs->gamma_set != NULL);
return crtc->funcs->gamma_set != NULL;
}
return FALSE;

View File

@ -328,7 +328,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
"xf86MapVidMem", DEV_MEM, Size, Base,
strerror(errno));
}
return(base);
return base;
}
/* else, mmap /dev/vga */
@ -347,7 +347,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
strerror(errno));
}
return(base);
return base;
}
static void
@ -370,7 +370,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
checkDevMem(TRUE);
if (devMemFd == -1) {
return(-1);
return -1;
}
psize = getpagesize();
@ -384,7 +384,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
xf86Msg(X_WARNING,
"xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
DEV_MEM, Len, Base, Offset, strerror(errno));
return(-1);
return -1;
}
#ifdef DEBUG
xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
@ -397,7 +397,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
"-> %02x %02x %02x %02x...\n",
Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
#endif
return(Len);
return Len;
}

View File

@ -201,7 +201,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
"xf86MapVidMem", DEV_MEM, Size, Base,
strerror(errno));
}
return(base);
return base;
}
/* else, mmap /dev/vga */
@ -220,7 +220,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
strerror(errno));
}
return(base);
return base;
}
static void
@ -243,7 +243,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
checkDevMem(TRUE);
if (devMemFd == -1) {
return(-1);
return -1;
}
psize = getpagesize();
@ -257,7 +257,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
xf86Msg(X_WARNING,
"xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
DEV_MEM, Len, Base, Offset, strerror(errno));
return(-1);
return -1;
}
#ifdef DEBUG
ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
@ -270,7 +270,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
"-> %02x %02x %02x %02x...\n",
Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
#endif
return(Len);
return Len;
}
@ -430,7 +430,7 @@ armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
}
base = xf86MapInfoMap(memInfoP, Base, Size);
return (base);
return base;
}
return mapVidMem(ScreenNum, Base, Size, flags);
}

View File

@ -57,7 +57,7 @@ xf86VTSwitchPending()
{
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
return xf86Info.vtRequestsPending ? TRUE : FALSE;
}
#endif
return FALSE;
@ -70,9 +70,9 @@ xf86VTSwitchAway()
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
return(FALSE);
return FALSE;
else
return(TRUE);
return TRUE;
}
#endif
return FALSE;
@ -85,19 +85,19 @@ xf86VTSwitchTo()
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
return(FALSE);
return FALSE;
else
return(TRUE);
return TRUE;
}
#endif
return(TRUE);
return TRUE;
}
Bool
xf86VTActivate(int vtno)
{
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) {
return(FALSE);
return FALSE;
}
return(TRUE);
return TRUE;
}

View File

@ -724,13 +724,13 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-keeptty"))
{
KeepTty = TRUE;
return(1);
return 1;
}
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
if (!strcmp(argv[i], "-sharevts"))
{
ShareVTs = TRUE;
return(1);
return 1;
}
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
@ -739,12 +739,12 @@ xf86ProcessArgument(int argc, char *argv[], int i)
{
UseMsg();
VTnum = -1;
return(0);
return 0;
}
return(1);
return 1;
}
#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
return(0);
return 0;
}
void

View File

@ -246,7 +246,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
"xf86MapVidMem", DEV_MEM, Size, Base,
strerror(errno));
}
return(base);
return base;
}
/* else, mmap /dev/vga */
@ -266,7 +266,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)",
strerror(errno));
}
return(base);
return base;
}
static void
@ -289,7 +289,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
checkDevMem(TRUE);
if (devMemFd == -1) {
return(-1);
return -1;
}
psize = getpagesize();
@ -308,7 +308,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
xf86Msg(X_WARNING, SYSCTL_MSG2);
}
#endif
return(-1);
return -1;
}
#ifdef DEBUG
ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
@ -321,7 +321,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
"-> %02x %02x %02x %02x...\n",
Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
#endif
return(Len);
return Len;
}
#ifdef USE_I386_IOPL

View File

@ -87,5 +87,5 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
int Len)
{
return (0);
return 0;
}

View File

@ -64,7 +64,7 @@ GARTInit(int screenNum)
struct _agp_info agpinf;
if (initDone)
return (gartFd != -1);
return gartFd != -1;
initDone = TRUE;

View File

@ -365,17 +365,17 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-keeptty"))
{
KeepTty = TRUE;
return(1);
return 1;
}
if (!strcmp(argv[i], "-novtswitch"))
{
VTSwitch = FALSE;
return(1);
return 1;
}
if (!strcmp(argv[i], "-sharevts"))
{
ShareVTs = TRUE;
return(1);
return 1;
}
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
@ -383,11 +383,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
{
UseMsg();
VTnum = -1;
return(0);
return 0;
}
return(1);
return 1;
}
return(0);
return 0;
}
void

View File

@ -58,7 +58,7 @@ xf86VTRequest(int sig)
Bool
xf86VTSwitchPending(void)
{
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
return xf86Info.vtRequestsPending ? TRUE : FALSE;
}
/*
@ -79,9 +79,9 @@ xf86VTSwitchAway(void)
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) {
return(FALSE);
return FALSE;
} else {
return(TRUE);
return TRUE;
}
}
@ -97,7 +97,7 @@ xf86VTSwitchTo(void)
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
return(FALSE);
return FALSE;
} else {
if (sco_ledstatus >= 0) {
ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
@ -120,8 +120,8 @@ Bool
xf86VTActivate(int vtno)
{
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) {
return(FALSE);
return FALSE;
}
return(TRUE);
return TRUE;
}

View File

@ -233,7 +233,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
*/
if (!strcmp(argv[i], "-keeptty")) {
KeepTty = TRUE;
return(1);
return 1;
}
/*
@ -246,7 +246,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
*/
if (!strcmp(argv[i], "-nompxlock")) {
mpxLock = FALSE;
return (1);
return 1;
}
/*
@ -256,14 +256,14 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (sscanf(argv[i], "vt%2d", &VTnum) == 0) {
UseMsg();
VTnum = -1;
return(0);
return 0;
}
if (VTnum <= 0) {
UseMsg();
VTnum = -1;
return(0);
return 0;
}
return(1);
return 1;
}
/*
@ -273,14 +273,14 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (++i > argc) {
UseMsg();
VTnum = -1;
return(0);
return 0;
} else {
VTnum = -2;
strlcpy (vtdevice, argv[i], sizeof(vtdevice));
return(2);
return 2;
}
}
return(0);
return 0;
}
void

View File

@ -38,23 +38,23 @@
Bool
xf86VTSwitchPending(void)
{
return(FALSE);
return FALSE;
}
Bool
xf86VTSwitchAway(void)
{
return(FALSE);
return FALSE;
}
Bool
xf86VTSwitchTo(void)
{
return(TRUE);
return TRUE;
}
Bool
xf86VTActivate(int vtno)
{
return(TRUE);
return TRUE;
}

View File

@ -55,7 +55,7 @@ xf86VTRequest(int sig)
Bool
xf86VTSwitchPending(void)
{
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
return xf86Info.vtRequestsPending ? TRUE : FALSE;
}
Bool
@ -64,14 +64,14 @@ xf86VTSwitchAway(void)
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
{
return(FALSE);
return FALSE;
}
else
{
#ifdef OSSWITCHAWAY
OSSWITCHAWAY;
#endif
return(TRUE);
return TRUE;
}
}
@ -81,11 +81,11 @@ xf86VTSwitchTo(void)
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
{
return(FALSE);
return FALSE;
}
else
{
return(TRUE);
return TRUE;
}
}
@ -94,8 +94,8 @@ xf86VTActivate(int vtno)
{
#ifdef VT_ACTIVATE
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) {
return(FALSE);
return FALSE;
}
#endif
return(TRUE);
return TRUE;
}

View File

@ -53,7 +53,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
{
xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno));
return(-1);
return -1;
}
if (lseek(fd, (Base+Offset), SEEK_SET) < 0)
@ -61,15 +61,15 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
xf86Msg(X_WARNING, "xf86ReadBIOS: %s seek failed (%s)\n",
DEV_MEM, strerror(errno));
close(fd);
return(-1);
return -1;
}
if (read(fd, Buf, Len) != Len)
{
xf86Msg(X_WARNING, "xf86ReadBIOS: %s read failed (%s)\n",
DEV_MEM, strerror(errno));
close(fd);
return(-1);
return -1;
}
close(fd);
return(Len);
return Len;
}

View File

@ -53,7 +53,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
{
xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno));
return(-1);
return -1;
}
psize = getpagesize();
Offset += Base & (psize - 1);
@ -66,14 +66,14 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed (%s)\n",
DEV_MEM, strerror(errno));
close(fd);
return(-1);
return -1;
}
DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
Base, ptr[0] | (ptr[1] << 8));
(void)memcpy(Buf, (void *)(ptr + Offset), Len);
(void)munmap((caddr_t)ptr, mlen);
(void)close(fd);
return(Len);
return Len;
}
#else /* __alpha__ */
@ -114,7 +114,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
{
xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno));
return(-1);
return -1;
}
psize = getpagesize();
@ -128,14 +128,14 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
{
xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to mmap %s (%s)\n",
DEV_MEM, strerror(errno));
return(-1);
return -1;
}
xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen);
close(fd);
return(Len);
return Len;
}
#endif /* __alpha__ */

View File

@ -108,7 +108,7 @@ GetBaud (int baudrate)
if (baudrate == 460800)
return B460800;
#endif
return (0);
return 0;
}
int
@ -122,7 +122,7 @@ xf86OpenSerial (pointer options)
if (!dev)
{
xf86Msg (X_ERROR, "xf86OpenSerial: No Device specified.\n");
return (-1);
return -1;
}
SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK));
@ -132,14 +132,14 @@ xf86OpenSerial (pointer options)
"xf86OpenSerial: Cannot open device %s\n\t%s.\n",
dev, strerror (errno));
free(dev);
return (-1);
return -1;
}
if (!isatty (fd))
{
/* Allow non-tty devices to be opened. */
free(dev);
return (fd);
return fd;
}
/* set up default port parameters */
@ -162,7 +162,7 @@ xf86OpenSerial (pointer options)
{
SYSCALL (close (fd));
free(dev);
return (-1);
return -1;
}
SYSCALL (i = fcntl (fd, F_GETFL, 0));
@ -170,7 +170,7 @@ xf86OpenSerial (pointer options)
{
SYSCALL (close (fd));
free(dev);
return (-1);
return -1;
}
i &= ~O_NONBLOCK;
SYSCALL (i = fcntl (fd, F_SETFL, i));
@ -178,10 +178,10 @@ xf86OpenSerial (pointer options)
{
SYSCALL (close (fd));
free(dev);
return (-1);
return -1;
}
free(dev);
return (fd);
return fd;
}
int
@ -212,7 +212,7 @@ xf86SetSerial (int fd, pointer options)
{
xf86Msg (X_ERROR,
"Invalid Option BaudRate value: %d\n", val);
return (-1);
return -1;
}
}
@ -229,7 +229,7 @@ xf86SetSerial (int fd, pointer options)
default:
xf86Msg (X_ERROR,
"Invalid Option StopBits value: %d\n", val);
return (-1);
return -1;
break;
}
}
@ -257,7 +257,7 @@ xf86SetSerial (int fd, pointer options)
default:
xf86Msg (X_ERROR,
"Invalid Option DataBits value: %d\n", val);
return (-1);
return -1;
break;
}
}
@ -281,7 +281,7 @@ xf86SetSerial (int fd, pointer options)
{
xf86Msg (X_ERROR, "Invalid Option Parity value: %s\n",
s);
return (-1);
return -1;
}
}
@ -317,7 +317,7 @@ xf86SetSerial (int fd, pointer options)
{
xf86Msg (X_ERROR,
"Invalid Option FlowControl value: %s\n", s);
return (-1);
return -1;
}
}
@ -333,7 +333,7 @@ xf86SetSerial (int fd, pointer options)
#else
xf86Msg (X_WARNING,
"Option ClearDTR not supported on this OS\n");
return (-1);
return -1;
#endif
xf86MarkOptionUsedByName (options, "ClearDTR");
}
@ -342,12 +342,12 @@ xf86SetSerial (int fd, pointer options)
{
xf86Msg (X_WARNING,
"Option ClearRTS not supported on this OS\n");
return (-1);
return -1;
xf86MarkOptionUsedByName (options, "ClearRTS");
}
SYSCALL (r = tcsetattr (fd, TCSANOW, &t));
return (r);
return r;
}
int
@ -374,11 +374,11 @@ xf86SetSerialSpeed (int fd, int speed)
{
xf86Msg (X_ERROR,
"Invalid Option BaudRate value: %d\n", speed);
return (-1);
return -1;
}
SYSCALL (r = tcsetattr (fd, TCSANOW, &t));
return (r);
return r;
}
int
@ -393,7 +393,7 @@ xf86ReadSerial (int fd, void *buf, int count)
for (i = 1; i < r; i++)
DebugF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
DebugF("\n");
return (r);
return r;
}
int
@ -407,7 +407,7 @@ xf86WriteSerial (int fd, const void *buf, int count)
ErrorF(", 0x%x",(unsigned char)*(((unsigned char *)buf) + i));
DebugF("\n");
SYSCALL (r = write (fd, buf, count));
return (r);
return r;
}
int
@ -416,7 +416,7 @@ xf86CloseSerial (int fd)
int r;
SYSCALL (r = close (fd));
return (r);
return r;
}
int
@ -442,7 +442,7 @@ xf86WaitForInput (int fd, int timeout)
SYSCALL (r = select (FD_SETSIZE, NULL, NULL, NULL, &to));
}
xf86ErrorFVerb (9,"select returned %d\n", r);
return (r);
return r;
}
int
@ -451,7 +451,7 @@ xf86SerialSendBreak (int fd, int duration)
int r;
SYSCALL (r = tcsendbreak (fd, duration));
return (r);
return r;
}

View File

@ -66,7 +66,7 @@ xf86VTAcquire(int sig)
Bool
xf86VTSwitchPending(void)
{
return(xf86Info.vtRequestsPending ? TRUE : FALSE);
return xf86Info.vtRequestsPending ? TRUE : FALSE;
}
Bool
@ -81,7 +81,7 @@ xf86VTSwitchAway(void)
if (xf86VTPruneDoor) {
xf86VTPruneDoor = 0;
ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
return (TRUE);
return TRUE;
}
vt_door_arg.vt_ev = VT_EV_HOTKEYS;
@ -94,15 +94,15 @@ xf86VTSwitchAway(void)
door_arg.desc_num = 0;
if ((door_fd = open(VT_DAEMON_DOOR_FILE, O_RDONLY)) < 0)
return (FALSE);
return FALSE;
if (door_call(door_fd, &door_arg) != 0) {
close(door_fd);
return (FALSE);
return FALSE;
}
close(door_fd);
return (TRUE);
return TRUE;
}
Bool
@ -111,11 +111,11 @@ xf86VTSwitchTo(void)
xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
{
return(FALSE);
return FALSE;
}
else
{
return(TRUE);
return TRUE;
}
}
@ -125,13 +125,13 @@ xf86VTActivate(int vtno)
struct vt_stat state;
if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
return(FALSE);
return FALSE;
if ((state.v_state & (1 << vtno)) == 0)
return(FALSE);
return FALSE;
xf86Info.vtRequestsPending = TRUE;
xf86Info.vtPendingNum = vtno;
return(TRUE);
return TRUE;
}

View File

@ -78,7 +78,7 @@ static Bool
GARTInit(int screenNum)
{
if (initDone)
return (gartFd != -1);
return gartFd != -1;
if (gartFd == -1)
gartFd = open(AGP_DEVICE, O_RDWR);

View File

@ -215,7 +215,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-keeptty"))
{
KeepTty = TRUE;
return(1);
return 1;
}
#ifdef SVR4
/*
@ -226,7 +226,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-protect0"))
{
Protect0 = TRUE;
return(1);
return 1;
}
#endif
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
@ -235,11 +235,11 @@ xf86ProcessArgument(int argc, char *argv[], int i)
{
UseMsg();
VTnum = -1;
return(0);
return 0;
}
return(1);
return 1;
}
return(0);
return 0;
}
void

View File

@ -106,7 +106,7 @@ mmapStat(pointer Base, unsigned long Size) {
}
}
if (region == -1 && nmmreg > 0) region=region * i;
return(region);
return region;
}
#endif
@ -211,7 +211,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
"xf86MapVidMem: SUCCEED Mapping FrameBuffer \n");
#endif /* HAS_SVR3_MMAPDRV */
#endif /* SVR4 */
return(base);
return base;
}
/* ARGSUSED */

View File

@ -105,7 +105,7 @@ if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return; }
if ((ptr->f=func) == NULL)\
{\
CLEANUP (ptr);\
return (NULL);\
return NULL;\
}
#define HANDLE_LIST(field,func,type)\
@ -114,7 +114,7 @@ type p = func ();\
if (p == NULL)\
{\
CLEANUP (ptr);\
return (NULL);\
return NULL;\
}\
else\
{\

View File

@ -363,9 +363,9 @@ xf86findDevice (const char *ident, XF86ConfDevicePtr p)
while (p)
{
if (xf86nameCompare (ident, p->dev_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}

View File

@ -318,10 +318,10 @@ xf86findOption (XF86OptionPtr list, const char *name)
while (list)
{
if (xf86nameCompare (list->opt_name, name) == 0)
return (list);
return list;
list = list->list.next;
}
return (NULL);
return NULL;
}
/*
@ -339,11 +339,11 @@ xf86findOptionValue (XF86OptionPtr list, const char *name)
if (p)
{
if (p->opt_val)
return (p->opt_val);
return p->opt_val;
else
return "";
}
return (NULL);
return NULL;
}
XF86OptionPtr
@ -361,7 +361,7 @@ xf86optionListCreate( const char **options, int count, int used )
if( (count % 2) != 0 )
{
fprintf( stderr, "xf86optionListCreate: count must be an even number.\n" );
return (NULL);
return NULL;
}
for (i = 0; i < count; i += 2)
{
@ -375,7 +375,7 @@ xf86optionListCreate( const char **options, int count, int used )
p = addNewOption2 (p, t1, t2, used);
}
return (p);
return p;
}
/* the 2 given lists are merged. If an option with the same name is present in
@ -425,7 +425,7 @@ xf86optionListMerge (XF86OptionPtr head, XF86OptionPtr tail)
} else
head = tail;
return (head);
return head;
}
char *
@ -452,7 +452,7 @@ xf86parseOption(XF86OptionPtr head)
if ((token = xf86getSubToken(&comment)) != STRING) {
xf86parseError(BAD_OPTION_MSG, NULL);
free(comment);
return (head);
return head;
}
name = val.str;
@ -489,7 +489,7 @@ xf86parseOption(XF86OptionPtr head)
if (old == NULL)
return ((XF86OptionPtr)xf86addListItem((glp)head, (glp)cnew));
return (head);
return head;
}
void

View File

@ -175,11 +175,11 @@ xf86validateInput (XF86ConfigPtr p)
while (input) {
if (!input->inp_driver) {
xf86validationError (UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier);
return (FALSE);
return FALSE;
}
input = input->list.next;
}
return (TRUE);
return TRUE;
}
XF86ConfInputPtr
@ -188,11 +188,11 @@ xf86findInput (const char *ident, XF86ConfInputPtr p)
while (p)
{
if (xf86nameCompare (ident, p->inp_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}
XF86ConfInputPtr
@ -201,10 +201,10 @@ xf86findInputByDriver (const char *driver, XF86ConfInputPtr p)
while (p)
{
if (xf86nameCompare (driver, p->inp_driver) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}

View File

@ -513,7 +513,7 @@ xf86validateLayout (XF86ConfigPtr p)
{
xf86validationError (UNDEFINED_SCREEN_MSG,
adj->adj_screen_str, layout->lay_identifier);
return (FALSE);
return FALSE;
}
else
adj->adj_screen = screen;
@ -529,7 +529,7 @@ xf86validateLayout (XF86ConfigPtr p)
{
xf86validationError (UNDEFINED_DEVICE_LAY_MSG,
iptr->inactive_device_str, layout->lay_identifier);
return (FALSE);
return FALSE;
}
else
iptr->inactive_device = device;
@ -541,7 +541,7 @@ xf86validateLayout (XF86ConfigPtr p)
layout = layout->list.next;
}
return (TRUE);
return TRUE;
}
XF86ConfLayoutPtr
@ -550,9 +550,9 @@ xf86findLayout (const char *name, XF86ConfLayoutPtr list)
while (list)
{
if (xf86nameCompare (list->lay_identifier, name) == 0)
return (list);
return list;
list = list->list.next;
}
return (NULL);
return NULL;
}

View File

@ -264,7 +264,7 @@ xf86parseModeLine (void)
#ifdef DEBUG
printf ("ModeLine parsed\n");
#endif
return (ptr);
return ptr;
}
static XF86ConfModeLinePtr
@ -413,7 +413,7 @@ xf86parseVerboseMode (void)
#ifdef DEBUG
printf ("Verbose Mode parsed\n");
#endif
return (ptr);
return ptr;
}
#undef CLEANUP
@ -848,11 +848,11 @@ xf86findMonitor (const char *ident, XF86ConfMonitorPtr p)
while (p)
{
if (xf86nameCompare (ident, p->mon_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}
XF86ConfModesPtr
@ -861,11 +861,11 @@ xf86findModes (const char *ident, XF86ConfModesPtr p)
while (p)
{
if (xf86nameCompare (ident, p->modes_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}
XF86ConfModeLinePtr
@ -874,11 +874,11 @@ xf86findModeLine (const char *ident, XF86ConfModeLinePtr p)
while (p)
{
if (xf86nameCompare (ident, p->ml_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}
int
@ -895,10 +895,10 @@ xf86validateMonitor (XF86ConfigPtr p, XF86ConfScreenPtr screen)
xf86validationError (UNDEFINED_MODES_MSG,
modeslnk->ml_modes_str,
screen->scrn_identifier);
return (FALSE);
return FALSE;
}
modeslnk->ml_modes = modes;
modeslnk = modeslnk->list.next;
}
return (TRUE);
return TRUE;
}

View File

@ -522,7 +522,7 @@ xf86validateScreen (XF86ConfigPtr p)
{
screen->scrn_monitor = monitor;
if (!xf86validateMonitor(p, screen))
return (FALSE);
return FALSE;
}
}
@ -535,13 +535,13 @@ xf86validateScreen (XF86ConfigPtr p)
if (!adaptor->al_adaptor)
{
xf86validationError (UNDEFINED_ADAPTOR_MSG, adaptor->al_adaptor_str, screen->scrn_identifier);
return (FALSE);
return FALSE;
}
else if (adaptor->al_adaptor->va_fwdref)
{
xf86validationError (ADAPTOR_REF_TWICE_MSG, adaptor->al_adaptor_str,
adaptor->al_adaptor->va_fwdref);
return (FALSE);
return FALSE;
}
adaptor->al_adaptor->va_fwdref = strdup(screen->scrn_identifier);
@ -551,7 +551,7 @@ xf86validateScreen (XF86ConfigPtr p)
screen = screen->list.next;
}
return (TRUE);
return TRUE;
}
XF86ConfScreenPtr
@ -560,10 +560,10 @@ xf86findScreen (const char *ident, XF86ConfScreenPtr p)
while (p)
{
if (xf86nameCompare (ident, p->scrn_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}

View File

@ -288,9 +288,9 @@ xf86findVideoAdaptor (const char *ident, XF86ConfVideoAdaptorPtr p)
while (p)
{
if (xf86nameCompare (ident, p->va_identifier) == 0)
return (p);
return p;
p = p->list.next;
}
return (NULL);
return NULL;
}

View File

@ -87,7 +87,7 @@ xf86validateConfig (XF86ConfigPtr p)
if (!xf86validateLayout (p))
return FALSE;
return (TRUE);
return TRUE;
}
XF86ConfigPtr
@ -113,7 +113,7 @@ xf86readConfigFile (void)
{
xf86parseError (QUOTE_MSG, "Section");
CLEANUP (ptr);
return (NULL);
return NULL;
}
xf86setSection (val.str);
if (xf86nameCompare (val.str, "files") == 0)
@ -232,11 +232,11 @@ xf86readConfigFile (void)
}
if (xf86validateConfig (ptr))
return (ptr);
return ptr;
else
{
CLEANUP (ptr);
return (NULL);
return NULL;
}
}
@ -263,10 +263,10 @@ xf86addListItem (GenericListPtr head, GenericListPtr new)
if (last)
{
last->next = new;
return (head);
return head;
}
else
return (new);
return new;
}
/*

View File

@ -155,11 +155,11 @@ xf86strToUL (char *str)
}
else
{
return (tot);
return tot;
}
p++;
}
return (tot);
return tot;
}
/*
@ -289,7 +289,7 @@ xf86getNextLine(void)
} while (!eolFound);
return (ret);
return ret;
}
/*
@ -308,7 +308,7 @@ xf86getToken (xf86ConfigSymTabRec * tab)
* oth * case the next token must be read from the input.
*/
if (pushToken == EOF_TOKEN)
return (EOF_TOKEN);
return EOF_TOKEN;
else if (pushToken == LOCK_TOKEN)
{
/*
@ -350,7 +350,7 @@ again:
goto again;
}
else
return (pushToken = EOF_TOKEN);
return pushToken = EOF_TOKEN;
}
configLineNo++;
configPos = 0;
@ -387,7 +387,7 @@ again:
* Use xf86addComment when setting a comment.
*/
val.str = configRBuf;
return (COMMENT);
return COMMENT;
}
/* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */
@ -436,7 +436,7 @@ again:
configRBuf[i] = '\0';
val.num = xf86strToUL (configRBuf);
val.realnum = atof (configRBuf);
return (NUMBER);
return NUMBER;
}
/*
@ -453,7 +453,7 @@ again:
configRBuf[i] = '\0';
val.str = malloc (strlen (configRBuf) + 1);
strcpy (val.str, configRBuf); /* private copy ! */
return (STRING);
return STRING;
}
/*
@ -486,9 +486,9 @@ again:
pushToken = LOCK_TOKEN;
if (temp == COMMA || temp == DASH)
return (temp);
return temp;
if (temp == NUMBER || temp == STRING)
return (temp);
return temp;
}
/*
@ -499,12 +499,12 @@ again:
i = 0;
while (tab[i].token != -1)
if (xf86nameCompare (configRBuf, tab[i].name) == 0)
return (tab[i].token);
return tab[i].token;
else
i++;
}
return (ERROR_TOKEN); /* Error catcher */
return ERROR_TOKEN; /* Error catcher */
}
int
@ -519,7 +519,7 @@ xf86getSubToken (char **comment)
*comment = xf86addComment(*comment, val.str);
}
else
return (token);
return token;
}
/*NOTREACHED*/
}
@ -536,7 +536,7 @@ xf86getSubTokenWithTab (char **comment, xf86ConfigSymTabRec *tab)
*comment = xf86addComment(*comment, val.str);
}
else
return (token);
return token;
}
/*NOTREACHED*/
}
@ -1112,7 +1112,7 @@ StringToToken (char *str, xf86ConfigSymTabRec * tab)
if (!xf86nameCompare (tab[i].name, str))
return tab[i].token;
}
return (ERROR_TOKEN);
return ERROR_TOKEN;
}
@ -1127,9 +1127,9 @@ xf86nameCompare (const char *s1, const char *s2)
if (!s1 || *s1 == 0) {
if (!s2 || *s2 == 0)
return (0);
return 0;
else
return (1);
return 1;
}
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
@ -1141,7 +1141,7 @@ xf86nameCompare (const char *s1, const char *s2)
while (c1 == c2)
{
if (c1 == '\0')
return (0);
return 0;
s1++;
s2++;
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
@ -1151,7 +1151,7 @@ xf86nameCompare (const char *s1, const char *s2)
c1 = (isupper (*s1) ? tolower (*s1) : *s1);
c2 = (isupper (*s2) ? tolower (*s2) : *s2);
}
return (c1 - c2);
return c1 - c2;
}
char *
@ -1161,7 +1161,7 @@ xf86addComment(char *cur, char *add)
int len, curlen, iscomment, hasnewline = 0, endnewline;
if (add == NULL || add[0] == '\0')
return (cur);
return cur;
if (cur) {
curlen = strlen(cur);
@ -1186,7 +1186,7 @@ xf86addComment(char *cur, char *add)
len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
if ((str = realloc(cur, len + curlen)) == NULL)
return (cur);
return cur;
cur = str;
@ -1198,7 +1198,7 @@ xf86addComment(char *cur, char *add)
if (!endnewline)
strcat(cur, "\n");
return (cur);
return cur;
}
Bool

Some files were not shown because too many files have changed in this diff Show More