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; PanoramiXRes *res = (PanoramiXRes*)resource;
PanoramiXSearchData *data = (PanoramiXSearchData*)privdata; PanoramiXSearchData *data = (PanoramiXSearchData*)privdata;
return (res->info[data->screen].id == data->id); return res->info[data->screen].id == data->id;
} }
PanoramiXRes * PanoramiXRes *

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -164,7 +164,7 @@ XEventClass
*buf++ = (id << 8) | EventInfo[j].type; *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); *buf += sizeof(xAxisInfo);
} }
} }
return (i); return i;
} }
static void static void

View File

@ -154,7 +154,7 @@ ProcXOpenDevice(ClientPtr client)
rep.num_classes = j; rep.num_classes = j;
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep); WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase); 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++) { for (i = 0; i < stuff->num_events; i++, eventP++) {
proc = EventSwapVector[eventP->u.u.type & 0177]; proc = EventSwapVector[eventP->u.u.type & 0177];
if (proc == NotImplemented) /* no swapping proc; invalid event type? */ if (proc == NotImplemented) /* no swapping proc; invalid event type? */
return (BadValue); return BadValue;
(*proc) (eventP, &eventT); (*proc) (eventP, &eventT);
*eventP = eventT; *eventP = eventT;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -331,7 +331,7 @@ IsKeyboardDevice(DeviceIntPtr dev)
Bool Bool
IsMaster(DeviceIntPtr dev) IsMaster(DeviceIntPtr dev)
{ {
return (dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD); return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
} }
static WindowPtr XYToWindow( static WindowPtr XYToWindow(
@ -4083,7 +4083,7 @@ OtherClientGone(pointer value, XID id)
} }
free(other); free(other);
RecalculateDeliverableEvents(pWin); RecalculateDeliverableEvents(pWin);
return(Success); return Success;
} }
prev = other; prev = other;
} }
@ -4488,7 +4488,7 @@ SetInputFocus(
/* It is a match error to try to set the input focus to an /* It is a match error to try to set the input focus to an
unviewable window. */ unviewable window. */
if(!focusWin->realized) if(!focusWin->realized)
return(BadMatch); return BadMatch;
} }
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess); rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess);
if (rc != Success) if (rc != Success)
@ -5005,7 +5005,7 @@ ProcQueryPointer(ClientPtr client)
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
return(Success); return Success;
} }
/** /**
@ -5209,8 +5209,8 @@ ProcUngrabKey(ClientPtr client)
tempGrab.next = NULL; tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab)) if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc); return BadAlloc;
return(Success); return Success;
} }
/** /**
@ -5404,8 +5404,8 @@ ProcUngrabButton(ClientPtr client)
tempGrab.next = NULL; tempGrab.next = NULL;
if (!DeletePassiveGrabFromList(&tempGrab)) if (!DeletePassiveGrabFromList(&tempGrab))
return(BadAlloc); return BadAlloc;
return(Success); return Success;
} }
/** /**
@ -5619,7 +5619,7 @@ ProcRecolorCursor(ClientPtr client)
( *pscr->RecolorCursor)(PickPointer(client), pscr, pCursor, ( *pscr->RecolorCursor)(PickPointer(client), pscr, pCursor,
(pCursor == pSprite->current) && displayed); (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); ext = calloc(sizeof (ExtensionEntry), 1);
if (!ext) if (!ext)
return(NULL); return NULL;
if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) { if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) {
free(ext); free(ext);
return(NULL); return NULL;
} }
ext->name = malloc(strlen(name) + 1); ext->name = malloc(strlen(name) + 1);
ext->num_aliases = 0; ext->num_aliases = 0;
@ -149,7 +149,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
} }
RegisterExtensionNames(ext); RegisterExtensionNames(ext);
return(ext); return ext;
} }
Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
@ -335,7 +335,7 @@ ProcListExtensions(ClientPtr client)
reply.length = bytes_to_int32(total_length); reply.length = bytes_to_int32(total_length);
buffer = bufptr = malloc(total_length); buffer = bufptr = malloc(total_length);
if (!buffer) if (!buffer)
return(BadAlloc); return BadAlloc;
for (i=0; i<NumExtensions; i++) for (i=0; i<NumExtensions; i++)
{ {
int len; int len;

View File

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

View File

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

View File

@ -230,12 +230,12 @@ ProcChangeProperty(ClientPtr client)
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
return(BadAtom); return BadAtom;
} }
if (!ValidAtom(stuff->type)) if (!ValidAtom(stuff->type))
{ {
client->errorValue = stuff->type; client->errorValue = stuff->type;
return(BadAtom); return BadAtom;
} }
err = dixChangeWindowProperty(client, pWin, stuff->property, stuff->type, 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 (rc == BadMatch) /* just add to list */
{ {
if (!pWin->optional && !MakeWindowOptional (pWin)) if (!pWin->optional && !MakeWindowOptional (pWin))
return(BadAlloc); return BadAlloc;
pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY); pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY);
if (!pProp) if (!pProp)
return(BadAlloc); return BadAlloc;
data = malloc(totalSize); data = malloc(totalSize);
if (!data && len) if (!data && len)
{ {
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
return(BadAlloc); return BadAlloc;
} }
memcpy(data, value, totalSize); memcpy(data, value, totalSize);
pProp->propertyName = property; pProp->propertyName = property;
@ -304,9 +304,9 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
"PropModeReplace" since they will be written over. */ "PropModeReplace" since they will be written over. */
if ((format != pProp->format) && (mode != PropModeReplace)) if ((format != pProp->format) && (mode != PropModeReplace))
return(BadMatch); return BadMatch;
if ((pProp->type != type) && (mode != PropModeReplace)) if ((pProp->type != type) && (mode != PropModeReplace))
return(BadMatch); return BadMatch;
/* save the old values for later */ /* save the old values for later */
savedProp = *pProp; savedProp = *pProp;
@ -315,7 +315,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{ {
data = malloc(totalSize); data = malloc(totalSize);
if (!data && len) if (!data && len)
return(BadAlloc); return BadAlloc;
memcpy(data, value, totalSize); memcpy(data, value, totalSize);
pProp->data = data; pProp->data = data;
pProp->size = len; pProp->size = len;
@ -330,7 +330,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{ {
data = malloc((pProp->size + len) * sizeInBytes); data = malloc((pProp->size + len) * sizeInBytes);
if (!data) if (!data)
return(BadAlloc); return BadAlloc;
memcpy(data, pProp->data, pProp->size * sizeInBytes); memcpy(data, pProp->data, pProp->size * sizeInBytes);
memcpy(data + pProp->size * sizeInBytes, value, totalSize); memcpy(data + pProp->size * sizeInBytes, value, totalSize);
pProp->data = data; pProp->data = data;
@ -340,7 +340,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
{ {
data = malloc(sizeInBytes * (len + pProp->size)); data = malloc(sizeInBytes * (len + pProp->size));
if (!data) if (!data)
return(BadAlloc); return BadAlloc;
memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes); memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes);
memcpy(data, value, totalSize); memcpy(data, value, totalSize);
pProp->data = data; pProp->data = data;
@ -369,7 +369,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
if (sendevent) if (sendevent)
deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName); deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName);
return(Success); return Success;
} }
int int
@ -477,17 +477,17 @@ ProcGetProperty(ClientPtr client)
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
return(BadAtom); return BadAtom;
} }
if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) if ((stuff->delete != xTrue) && (stuff->delete != xFalse))
{ {
client->errorValue = stuff->delete; client->errorValue = stuff->delete;
return(BadValue); return BadValue;
} }
if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type))
{ {
client->errorValue = stuff->type; client->errorValue = stuff->type;
return(BadAtom); return BadAtom;
} }
memset(&reply, 0, sizeof(xGetPropertyReply)); memset(&reply, 0, sizeof(xGetPropertyReply));
@ -513,7 +513,7 @@ ProcGetProperty(ClientPtr client)
reply.nItems = 0; reply.nItems = 0;
reply.propertyType = pProp->type; reply.propertyType = pProp->type;
WriteReplyToClient(client, sizeof(xGenericReply), &reply); WriteReplyToClient(client, sizeof(xGenericReply), &reply);
return(Success); return Success;
} }
/* /*
@ -635,7 +635,7 @@ ProcDeleteProperty(ClientPtr client)
if (!ValidAtom(stuff->property)) if (!ValidAtom(stuff->property))
{ {
client->errorValue = stuff->property; client->errorValue = stuff->property;
return (BadAtom); return BadAtom;
} }
return DeleteProperty(client, pWin, stuff->property); 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); + vel->tracker[index].dy * vel->tracker[index].dy);
int dtime = cur_t - vel->tracker[index].time; int dtime = cur_t - vel->tracker[index].time;
if(dtime > 0) if(dtime > 0)
return (dist / dtime); return dist / dtime;
else else
return 0;/* synonymous for NaN, since we're not C99 */ 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); RegionInit (pReg, rect, size);
return(pReg); return pReg;
} }
void void
@ -290,7 +290,7 @@ RegionIsValid(RegionPtr reg)
(reg->extents.y1 == reg->extents.y2) && (reg->extents.y1 == reg->extents.y2) &&
(reg->data->size || (reg->data == &RegionEmptyData))); (reg->data->size || (reg->data == &RegionEmptyData)));
else if (numRects == 1) else if (numRects == 1)
return (!reg->data); return !reg->data;
else else
{ {
BoxPtr pboxP, pboxN; BoxPtr pboxP, pboxN;
@ -428,7 +428,7 @@ RegionCoalesce (
do { do {
if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) {
return (curStart); return curStart;
} }
pPrevBox++; pPrevBox++;
pCurBox++; 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, rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
DixGetAttrAccess); DixGetAttrAccess);
return (rc == BadValue); return rc == BadValue;
} }
return FALSE; return FALSE;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -43,13 +43,13 @@ fbCloseScreen (int index, ScreenPtr pScreen)
Bool Bool
fbRealizeFont(ScreenPtr pScreen, FontPtr pFont) fbRealizeFont(ScreenPtr pScreen, FontPtr pFont)
{ {
return (TRUE); return TRUE;
} }
Bool Bool
fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
{ {
return (TRUE); return TRUE;
} }
void 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. ** The query above might fail, but then order will be zero anyway.
*/ */
return (order * k); return order * k;
case GL_DOMAIN: case GL_DOMAIN:
return 2; return 2;
case GL_ORDER: 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 ** 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: case GL_DOMAIN:
return 4; return 4;
case GL_ORDER: case GL_ORDER:

View File

@ -51,7 +51,7 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
int num_good_visuals; int num_good_visuals;
if (!XQueryExtension(dpy, "GLX", &majorOpcode, &dummy, &dummy)) { if (!XQueryExtension(dpy, "GLX", &majorOpcode, &dummy, &dummy)) {
return(NULL); return NULL;
} }
/* Send the glXGetVisualConfigs request */ /* Send the glXGetVisualConfigs request */
@ -228,7 +228,7 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
SyncHandle(); SyncHandle();
*nconfigs = nvisuals; *nconfigs = nvisuals;
return( configs ); return configs;
} }
@ -500,7 +500,7 @@ GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig *fbconfigs, int nfbconfigs,
__GLXvisualConfig *configs = NULL; __GLXvisualConfig *configs = NULL;
int i; int i;
if (!fbconfigs || !nfbconfigs || !nconfigs) return(NULL); if (!fbconfigs || !nfbconfigs || !nconfigs) return NULL;
*nconfigs = 0; *nconfigs = 0;
/* Allocate memory for our config structure */ /* 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, visual,
(pVisual->class & DynamicClass ? (pVisual->class & DynamicClass ?
AllocAll : AllocNone)); AllocAll : AllocNone));
return (pCmapPriv->cmap != 0); return pCmapPriv->cmap != 0;
} }
else { else {
dmxLog(dmxWarning, "dmxBECreateColormap: No visual found\n"); 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 */ dmxSync(dmxScreen, TRUE); /* Must complete before removing handler */
XSetErrorHandler(oldErrorHandler); XSetErrorHandler(oldErrorHandler);
return (dmxFontLastError == 0); return dmxFontLastError == 0;
} }
static int dmxSetFontPath(DMXScreenInfo *dmxScreen) static int dmxSetFontPath(DMXScreenInfo *dmxScreen)

View File

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

View File

@ -247,5 +247,5 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
RegionValidate(pReg, &overlap); RegionValidate(pReg, &overlap);
dmxSync(dmxScreen, FALSE); 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: default:
return 0; return 0;
} }
return (elements * esize * w * h); return elements * esize * w * h;
} }
GLint __glBitmap_size(GLsizei w, GLsizei h) GLint __glBitmap_size(GLsizei w, GLsizei h)
@ -294,7 +294,7 @@ GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w)
default: default:
return 0; return 0;
} }
return (elements * esize * w); return elements * esize * w;
} }
GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h) 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: default:
return 0; return 0;
} }
return (elements * esize * w * h); return elements * esize * w * h;
} }
GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei 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: default:
return 0; return 0;
} }
return (elements * esize * w * h * d); return elements * esize * w * h * d;
} }
GLint __glLightfv_size(GLenum pname) GLint __glLightfv_size(GLenum pname)

View File

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

View File

@ -90,7 +90,7 @@ int AreFBConfigsMatch( __GLXFBConfig *c1, __GLXFBConfig *c2 )
(c1->maxAlpha == c2->maxAlpha) (c1->maxAlpha == c2->maxAlpha)
); );
return( match ); return match;
} }
__GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, int nconfigs ) __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++) { for (i=0; i<nconfigs; i++) {
if ( AreFBConfigsMatch( c, configs + 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; break;
} }
return( ret ); return ret;
} }
@ -338,10 +338,10 @@ __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id )
for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) { for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->id == id) if ( __glXFBConfigs[j]->id == id)
return( __glXFBConfigs[j] ); return __glXFBConfigs[j];
} }
return(NULL); return NULL;
} }
__GLXFBConfig *glxLookupFBConfigByVID( VisualID vid ) __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
@ -350,10 +350,10 @@ __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) { for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->associatedVisualId == vid) if ( __glXFBConfigs[j]->associatedVisualId == vid)
return( __glXFBConfigs[j] ); return __glXFBConfigs[j];
} }
return(NULL); return NULL;
} }
__GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen ) __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) ) { for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
if ( __glXFBConfigs[j]->id == id) 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 (elementbits_return) *elementbits_return = elements;
if (rowbytes_return) *rowbytes_return = rowsize; if (rowbytes_return) *rowbytes_return = rowsize;
return (rowsize * h); return rowsize * h;
} else { } else {
return -1; 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 (elementbits_return) *elementbits_return = esize*elements*8;
if (rowbytes_return) *rowbytes_return = rowsize; if (rowbytes_return) *rowbytes_return = rowsize;
return (rowsize * h); return rowsize * h;
} }
static int intersectRect( int x1, int x2, int y1, int y2, 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) ) { if ( (width <= 0) || (height <= 0) ) {
*ix1 = *ix2 = *iy1 = *iy2 = 0; *ix1 = *ix2 = *iy1 = *iy2 = 0;
return(0); return 0;
} }
else { else {
*ix1 = left; *ix1 = left;
*ix2 = right; *ix2 = right;
*iy1 = top; *iy1 = top;
*iy2 = bottom; *iy2 = bottom;
return( width * height ); return width * height;
} }
} }
@ -811,7 +811,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
if (buf_size > 0) { if (buf_size > 0) {
buf = (char *) malloc( buf_size ); buf = (char *) malloc( buf_size );
if ( !buf ) { if ( !buf ) {
return( BadAlloc ); return BadAlloc;
} }
} }
else { else {

View File

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

View File

@ -1173,7 +1173,7 @@ KdXVQueryAdaptors(
*p_nAdaptors = pxvs->nAdaptors; *p_nAdaptors = pxvs->nAdaptors;
*p_pAdaptors = pxvs->pAdaptors; *p_pAdaptors = pxvs->pAdaptors;
return (Success); return Success;
} }
static Bool 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 /* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */ * is always a colormap installed */
*pmaps = GetInstalledColormap(pScreen)->mid; *pmaps = GetInstalledColormap(pScreen)->mid;
return (1); return 1;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -745,7 +745,7 @@ xf86IsOptionSet(const OptionInfoRec *table, int token)
OptionInfoPtr p; OptionInfoPtr p;
p = xf86TokenToOptinfo(table, token); 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; LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
if (device->button && device->button->buttonsDown > 0) if (device->button && device->button->buttonsDown > 0)
return (local->flags & XI86_SEND_DRAG_EVENTS); return local->flags & XI86_SEND_DRAG_EVENTS;
else else
return (TRUE); return TRUE;
} }
/*********************************************************************** /***********************************************************************
@ -1193,7 +1193,7 @@ xf86ScaleAxis(int Cx,
if (X < Sxlow) if (X < Sxlow)
X = Sxlow; X = Sxlow;
return (X); return X;
} }
/* /*

View File

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

View File

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

View File

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

View File

@ -69,12 +69,12 @@ XisbNew (int fd, ssize_t size)
b = malloc(sizeof (XISBuffer)); b = malloc(sizeof (XISBuffer));
if (!b) if (!b)
return (NULL); return NULL;
b->buf = malloc((sizeof (unsigned char) * size)); b->buf = malloc((sizeof (unsigned char) * size));
if (!b->buf) if (!b->buf)
{ {
free(b); free(b);
return (NULL); return NULL;
} }
b->fd = fd; 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->current = 1; /* force it to be past the end to trigger initial read */
b->end = 0; b->end = 0;
b->buffer_size = size; b->buffer_size = size;
return (b); return b;
} }
void void
@ -103,7 +103,7 @@ XisbRead (XISBuffer *b)
if (b->block_duration >= 0) if (b->block_duration >= 0)
{ {
if (xf86WaitForInput (b->fd, b->block_duration) < 1) if (xf86WaitForInput (b->fd, b->block_duration) < 1)
return (-1); return -1;
} }
else else
{ {
@ -119,9 +119,9 @@ XisbRead (XISBuffer *b)
switch (ret) switch (ret)
{ {
case 0: case 0:
return (-1); /* timeout */ return -1; /* timeout */
case -1: case -1:
return (-2); /* error */ return -2; /* error */
default: default:
b->end = ret; b->end = ret;
b->current = 0; b->current = 0;
@ -132,7 +132,7 @@ XisbRead (XISBuffer *b)
ErrorF ("read 0x%02x (%c)\n", b->buf[b->current], ErrorF ("read 0x%02x (%c)\n", b->buf[b->current],
isprint(b->buf[b->current])?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 */ /* 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++) for (i=0;i<9;i++)
if (test[i]) return (i+1); if (test[i]) return i+1;
return (-1); return -1;
} }
static unsigned char * static unsigned char *
@ -75,8 +75,8 @@ find_header(unsigned char *block)
if (i==8) break; if (i==8) break;
ptr++; ptr++;
} }
if (ptr == end) return (NULL); if (ptr == end) return NULL;
return (ptr); return ptr;
} }
static unsigned char * static unsigned char *
@ -98,7 +98,7 @@ resort(unsigned char *s_block)
if (s_ptr == s_end) s_ptr = s_block; if (s_ptr == s_end) s_ptr = s_block;
} }
free(s_block); free(s_block);
return (d_new); return d_new;
} }
static int static int
@ -120,7 +120,7 @@ DDC_checksum(unsigned char *block, int len)
/* catch the trivial case where all bytes are 0 */ /* catch the trivial case where all bytes are 0 */
if (!not_null) return 1; if (!not_null) return 1;
return (result&0xFF); return result&0xFF;
} }
static unsigned char * static unsigned char *
@ -169,7 +169,7 @@ FetchEDID_DDC1(register ScrnInfoPtr pScrn,
*xp = read_DDC(pScrn); *xp = read_DDC(pScrn);
xp++; xp++;
} while(--count); } while(--count);
return (ptr); return ptr;
} }
/* test if DDC1 return 0 if not */ /* test if DDC1 return 0 if not */
@ -184,7 +184,7 @@ TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC)(ScrnInfoPtr))
/* wait for next retrace */ /* wait for next retrace */
if (old != read_DDC(pScrn)) break; if (old != read_DDC(pScrn)) break;
} while(count--); } while(count--);
return (count); return count;
} }
/* /*

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -57,7 +57,7 @@ xf86VTSwitchPending()
{ {
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
return(xf86Info.vtRequestsPending ? TRUE : FALSE); return xf86Info.vtRequestsPending ? TRUE : FALSE;
} }
#endif #endif
return FALSE; return FALSE;
@ -70,9 +70,9 @@ xf86VTSwitchAway()
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
return(FALSE); return FALSE;
else else
return(TRUE); return TRUE;
} }
#endif #endif
return FALSE; return FALSE;
@ -85,19 +85,19 @@ xf86VTSwitchTo()
if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) { if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT) {
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
return(FALSE); return FALSE;
else else
return(TRUE); return TRUE;
} }
#endif #endif
return(TRUE); return TRUE;
} }
Bool Bool
xf86VTActivate(int vtno) xf86VTActivate(int vtno)
{ {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { 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")) if (!strcmp(argv[i], "-keeptty"))
{ {
KeepTty = TRUE; KeepTty = TRUE;
return(1); return 1;
} }
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
if (!strcmp(argv[i], "-sharevts")) if (!strcmp(argv[i], "-sharevts"))
{ {
ShareVTs = TRUE; ShareVTs = TRUE;
return(1); return 1;
} }
if ((argv[i][0] == 'v') && (argv[i][1] == 't')) if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{ {
@ -739,12 +739,12 @@ xf86ProcessArgument(int argc, char *argv[], int i)
{ {
UseMsg(); UseMsg();
VTnum = -1; VTnum = -1;
return(0); return 0;
} }
return(1); return 1;
} }
#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
return(0); return 0;
} }
void void

View File

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

View File

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

View File

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

View File

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

View File

@ -58,7 +58,7 @@ xf86VTRequest(int sig)
Bool Bool
xf86VTSwitchPending(void) xf86VTSwitchPending(void)
{ {
return(xf86Info.vtRequestsPending ? TRUE : FALSE); return xf86Info.vtRequestsPending ? TRUE : FALSE;
} }
/* /*
@ -79,9 +79,9 @@ xf86VTSwitchAway(void)
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) { if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_TRUE) < 0) {
return(FALSE); return FALSE;
} else { } else {
return(TRUE); return TRUE;
} }
} }
@ -97,7 +97,7 @@ xf86VTSwitchTo(void)
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) { if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
return(FALSE); return FALSE;
} else { } else {
if (sco_ledstatus >= 0) { if (sco_ledstatus >= 0) {
ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate); ioctl (xf86Info.consoleFd, KDSETLED, sco_ledstate);
@ -120,8 +120,8 @@ Bool
xf86VTActivate(int vtno) xf86VTActivate(int vtno)
{ {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) { 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")) { if (!strcmp(argv[i], "-keeptty")) {
KeepTty = TRUE; KeepTty = TRUE;
return(1); return 1;
} }
/* /*
@ -246,7 +246,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
*/ */
if (!strcmp(argv[i], "-nompxlock")) { if (!strcmp(argv[i], "-nompxlock")) {
mpxLock = FALSE; 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) { if (sscanf(argv[i], "vt%2d", &VTnum) == 0) {
UseMsg(); UseMsg();
VTnum = -1; VTnum = -1;
return(0); return 0;
} }
if (VTnum <= 0) { if (VTnum <= 0) {
UseMsg(); UseMsg();
VTnum = -1; VTnum = -1;
return(0); return 0;
} }
return(1); return 1;
} }
/* /*
@ -273,14 +273,14 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (++i > argc) { if (++i > argc) {
UseMsg(); UseMsg();
VTnum = -1; VTnum = -1;
return(0); return 0;
} else { } else {
VTnum = -2; VTnum = -2;
strlcpy (vtdevice, argv[i], sizeof(vtdevice)); strlcpy (vtdevice, argv[i], sizeof(vtdevice));
return(2); return 2;
} }
} }
return(0); return 0;
} }
void void

View File

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

View File

@ -55,7 +55,7 @@ xf86VTRequest(int sig)
Bool Bool
xf86VTSwitchPending(void) xf86VTSwitchPending(void)
{ {
return(xf86Info.vtRequestsPending ? TRUE : FALSE); return xf86Info.vtRequestsPending ? TRUE : FALSE;
} }
Bool Bool
@ -64,14 +64,14 @@ xf86VTSwitchAway(void)
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, 1) < 0)
{ {
return(FALSE); return FALSE;
} }
else else
{ {
#ifdef OSSWITCHAWAY #ifdef OSSWITCHAWAY
OSSWITCHAWAY; OSSWITCHAWAY;
#endif #endif
return(TRUE); return TRUE;
} }
} }
@ -81,11 +81,11 @@ xf86VTSwitchTo(void)
xf86Info.vtRequestsPending = FALSE; xf86Info.vtRequestsPending = FALSE;
if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0) if (ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ) < 0)
{ {
return(FALSE); return FALSE;
} }
else else
{ {
return(TRUE); return TRUE;
} }
} }
@ -94,8 +94,8 @@ xf86VTActivate(int vtno)
{ {
#ifdef VT_ACTIVATE #ifdef VT_ACTIVATE
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) {
return(FALSE); return FALSE;
} }
#endif #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", xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
return(-1); return -1;
} }
if (lseek(fd, (Base+Offset), SEEK_SET) < 0) 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", xf86Msg(X_WARNING, "xf86ReadBIOS: %s seek failed (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
close(fd); close(fd);
return(-1); return -1;
} }
if (read(fd, Buf, Len) != Len) if (read(fd, Buf, Len) != Len)
{ {
xf86Msg(X_WARNING, "xf86ReadBIOS: %s read failed (%s)\n", xf86Msg(X_WARNING, "xf86ReadBIOS: %s read failed (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
close(fd); close(fd);
return(-1); return -1;
} }
close(fd); 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", xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
return(-1); return -1;
} }
psize = getpagesize(); psize = getpagesize();
Offset += Base & (psize - 1); 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", xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
close(fd); close(fd);
return(-1); return -1;
} }
DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", DebugF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
Base, ptr[0] | (ptr[1] << 8)); Base, ptr[0] | (ptr[1] << 8));
(void)memcpy(Buf, (void *)(ptr + Offset), Len); (void)memcpy(Buf, (void *)(ptr + Offset), Len);
(void)munmap((caddr_t)ptr, mlen); (void)munmap((caddr_t)ptr, mlen);
(void)close(fd); (void)close(fd);
return(Len); return Len;
} }
#else /* __alpha__ */ #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", xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
return(-1); return -1;
} }
psize = getpagesize(); 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", xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to mmap %s (%s)\n",
DEV_MEM, strerror(errno)); DEV_MEM, strerror(errno));
return(-1); return -1;
} }
xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len); xf86SlowBCopyFromBus((unsigned char *)(base+Offset), Buf, Len);
munmap((caddr_t)base, mlen); munmap((caddr_t)base, mlen);
close(fd); close(fd);
return(Len); return Len;
} }
#endif /* __alpha__ */ #endif /* __alpha__ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -318,10 +318,10 @@ xf86findOption (XF86OptionPtr list, const char *name)
while (list) while (list)
{ {
if (xf86nameCompare (list->opt_name, name) == 0) if (xf86nameCompare (list->opt_name, name) == 0)
return (list); return list;
list = list->list.next; list = list->list.next;
} }
return (NULL); return NULL;
} }
/* /*
@ -339,11 +339,11 @@ xf86findOptionValue (XF86OptionPtr list, const char *name)
if (p) if (p)
{ {
if (p->opt_val) if (p->opt_val)
return (p->opt_val); return p->opt_val;
else else
return ""; return "";
} }
return (NULL); return NULL;
} }
XF86OptionPtr XF86OptionPtr
@ -361,7 +361,7 @@ xf86optionListCreate( const char **options, int count, int used )
if( (count % 2) != 0 ) if( (count % 2) != 0 )
{ {
fprintf( stderr, "xf86optionListCreate: count must be an even number.\n" ); fprintf( stderr, "xf86optionListCreate: count must be an even number.\n" );
return (NULL); return NULL;
} }
for (i = 0; i < count; i += 2) 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); 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 /* 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 } else
head = tail; head = tail;
return (head); return head;
} }
char * char *
@ -452,7 +452,7 @@ xf86parseOption(XF86OptionPtr head)
if ((token = xf86getSubToken(&comment)) != STRING) { if ((token = xf86getSubToken(&comment)) != STRING) {
xf86parseError(BAD_OPTION_MSG, NULL); xf86parseError(BAD_OPTION_MSG, NULL);
free(comment); free(comment);
return (head); return head;
} }
name = val.str; name = val.str;
@ -489,7 +489,7 @@ xf86parseOption(XF86OptionPtr head)
if (old == NULL) if (old == NULL)
return ((XF86OptionPtr)xf86addListItem((glp)head, (glp)cnew)); return ((XF86OptionPtr)xf86addListItem((glp)head, (glp)cnew));
return (head); return head;
} }
void void

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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