diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-06-06 21:18:40 +0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-10 06:42:42 -0700 |
commit | 7287ef9e6cf953066e4a092cca9d0e4a279172bf (patch) | |
tree | b67414bd69d1a1afc881e224d2f04cd495eb81d2 /dix | |
parent | b3a7b229e1e1f212bdd185af5443311091824005 (diff) |
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>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/colormap.c | 136 | ||||
-rw-r--r-- | dix/cursor.c | 4 | ||||
-rw-r--r-- | dix/devices.c | 4 | ||||
-rw-r--r-- | dix/dispatch.c | 106 | ||||
-rw-r--r-- | dix/dixfonts.c | 4 | ||||
-rw-r--r-- | dix/dixutils.c | 10 | ||||
-rw-r--r-- | dix/events.c | 18 | ||||
-rw-r--r-- | dix/extension.c | 8 | ||||
-rw-r--r-- | dix/gc.c | 6 | ||||
-rw-r--r-- | dix/main.c | 2 | ||||
-rw-r--r-- | dix/property.c | 32 | ||||
-rw-r--r-- | dix/ptrveloc.c | 2 | ||||
-rw-r--r-- | dix/region.c | 8 | ||||
-rw-r--r-- | dix/resource.c | 2 | ||||
-rw-r--r-- | dix/swapreq.c | 2 | ||||
-rw-r--r-- | dix/window.c | 114 |
16 files changed, 229 insertions, 229 deletions
diff --git a/dix/colormap.c b/dix/colormap.c index ae9069066..2e9a80647 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -264,7 +264,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, class = pVisual->class; if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID)) - return (BadMatch); + return BadMatch; size = pVisual->ColormapEntries; sizebytes = (size * sizeof(Entry)) + @@ -276,16 +276,16 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, if (mid == pScreen->defColormap) { pmap = malloc(sizebytes); if (!pmap) - return (BadAlloc); + return BadAlloc; if (!dixAllocatePrivates(&pmap->devPrivates, PRIVATE_COLORMAP)) { free (pmap); - return (BadAlloc); + return BadAlloc; } } else { pmap = _dixAllocateObjectWithPrivates(sizebytes, sizebytes, offsetof(ColormapRec, devPrivates), PRIVATE_COLORMAP); if (!pmap) - return (BadAlloc); + return BadAlloc; } #if defined(_XSERVER64) pmap->pad0 = 0; @@ -324,7 +324,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, if (!ppix) { free(pmap); - return (BadAlloc); + return BadAlloc; } pmap->clientPixelsRed[client] = ppix; for(i = 0; i < size; i++) @@ -371,7 +371,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, { free(pmap->clientPixelsRed[client]); free(pmap); - return(BadAlloc); + return BadAlloc; } pmap->clientPixelsGreen[client] = ppix; for(i = 0; i < size; i++) @@ -388,7 +388,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, free(pmap->clientPixelsGreen[client]); free(pmap->clientPixelsRed[client]); free(pmap); - return(BadAlloc); + return BadAlloc; } pmap->clientPixelsBlue[client] = ppix; for(i = 0; i < size; i++) @@ -399,7 +399,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, pmap->flags |= BeingCreated; if (!AddResource(mid, RT_COLORMAP, (pointer)pmap)) - return (BadAlloc); + return BadAlloc; /* * Security creation/labeling check @@ -421,7 +421,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, } pmap->flags &= ~BeingCreated; *ppcmap = pmap; - return (Success); + return Success; } /** @@ -482,7 +482,7 @@ FreeColormap (pointer value, XID mid) free(pmap); } else dixFreeObjectWithPrivates(pmap, PRIVATE_COLORMAP); - return(Success); + return Success; } /* Tell window that pmid has disappeared */ @@ -509,7 +509,7 @@ TellNoMap (WindowPtr pwin, Colormap *pmid) } } - return (WT_WALKCHILDREN); + return WT_WALKCHILDREN; } /* Tell window that pmid got uninstalled */ @@ -534,7 +534,7 @@ TellLostMap (WindowPtr pwin, pointer value) DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL); } - return (WT_WALKCHILDREN); + return WT_WALKCHILDREN; } /* Tell window that pmid got installed */ @@ -559,7 +559,7 @@ TellGainedMap (WindowPtr pwin, pointer value) DeliverEvents(pwin, &xE, 1, (WindowPtr)NULL); } - return (WT_WALKCHILDREN); + return WT_WALKCHILDREN; } @@ -582,7 +582,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client) /* If the create returns non-0, it failed */ result = CreateColormap (mid, pScreen, pVisual, &pmap, alloc, client); if(result != Success) - return(result); + return result; if(alloc == AllocAll) { memmove((char *)pmap->red, (char *)pSrc->red, size * sizeof(Entry)); @@ -594,7 +594,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client) pSrc->flags &= ~AllAllocated; FreePixels(pSrc, client); UpdateColors(pmap); - return(Success); + return Success; } CopyFree(REDMAP, client, pSrc, pmap); @@ -606,7 +606,7 @@ CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client) if (pmap->class & DynamicClass) UpdateColors(pmap); /* XXX should worry about removing any RT_CMAPENTRY resource */ - return(Success); + return Success; } /* Helper routine for freeing large numbers of cells from a map */ @@ -855,7 +855,7 @@ AllocColor (ColormapPtr pmap, ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) - return (BadAlloc); + return BadAlloc; ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; pmap->numPixelsRed[client]++; @@ -878,21 +878,21 @@ AllocColor (ColormapPtr pmap, ppix = (Pixel *) realloc(pmap->clientPixelsRed[client], (npix + 1) * sizeof(Pixel)); if (!ppix) - return (BadAlloc); + return BadAlloc; ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; npix = pmap->numPixelsGreen[client]; ppix = (Pixel *) realloc(pmap->clientPixelsGreen[client], (npix + 1) * sizeof(Pixel)); if (!ppix) - return (BadAlloc); + return BadAlloc; ppix[npix] = pixG; pmap->clientPixelsGreen[client] = ppix; npix = pmap->numPixelsBlue[client]; ppix = (Pixel *) realloc(pmap->clientPixelsBlue[client], (npix + 1) * sizeof(Pixel)); if (!ppix) - return (BadAlloc); + return BadAlloc; ppix[npix] = pixB; pmap->clientPixelsBlue[client] = ppix; pmap->numPixelsRed[client]++; @@ -915,7 +915,7 @@ AllocColor (ColormapPtr pmap, } if (FindColor(pmap, pmap->red, entries, &rgb, pPix, PSEUDOMAP, client, AllComp) != Success) - return (BadAlloc); + return BadAlloc; break; case DirectColor: @@ -944,13 +944,13 @@ AllocColor (ColormapPtr pmap, pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed; if (FindColor(pmap, pmap->red, NUMRED(pVisual), &rgb, &pixR, REDMAP, client, RedComp) != Success) - return (BadAlloc); + return BadAlloc; pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen; if (FindColor(pmap, pmap->green, NUMGREEN(pVisual), &rgb, &pixG, GREENMAP, client, GreenComp) != Success) { (void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0); - return (BadAlloc); + return BadAlloc; } pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue; if (FindColor(pmap, pmap->blue, NUMBLUE(pVisual), &rgb, &pixB, BLUEMAP, @@ -958,7 +958,7 @@ AllocColor (ColormapPtr pmap, { (void)FreeCo(pmap, client, GREENMAP, 1, &pixG, (Pixel)0); (void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0); - return (BadAlloc); + return BadAlloc; } *pPix = pixR | pixG | pixB | ALPHAMASK(pVisual); @@ -978,14 +978,14 @@ AllocColor (ColormapPtr pmap, if (!pcr) { (void)FreeColors(pmap, client, 1, pPix, (Pixel)0); - return (BadAlloc); + return BadAlloc; } pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), RT_CMAPENTRY, (pointer)pcr)) - return (BadAlloc); + return BadAlloc; } - return (Success); + return Success; } /* @@ -1172,7 +1172,7 @@ FindBestPixel(EntryPtr pentFirst, int size, xrgb *prgb, int channel) minval = sum; } } - return(final); + return final; } static void @@ -1280,7 +1280,7 @@ FindColor (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb, * a free entry, we're out of luck. Otherwise, we'll usurp a free * entry and fill it in */ if (!foundFree) - return (BadAlloc); + return BadAlloc; pent = pentFirst + Free; pent->fShared = FALSE; pent->refcnt = (client >= 0) ? 1 : AllocTemporary; @@ -1339,7 +1339,7 @@ FindColor (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb, gotit: if (pmap->flags & BeingCreated || client == -1) - return(Success); + return Success; /* Now remember the pixel, for freeing later */ switch (channel) { @@ -1378,13 +1378,13 @@ gotit: pmap->freeBlue++; break; } - return(BadAlloc); + return BadAlloc; } ppix[npix] = pixel; pixp[client] = ppix; nump[client]++; - return(Success); + return Success; } /* Comparison functions -- passed to FindColor to determine if an @@ -1395,32 +1395,32 @@ AllComp (EntryPtr pent, xrgb *prgb) if((pent->co.local.red == prgb->red) && (pent->co.local.green == prgb->green) && (pent->co.local.blue == prgb->blue) ) - return (1); - return (0); + return 1; + return 0; } static int RedComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.red == prgb->red) - return (1); - return (0); + return 1; + return 0; } static int GreenComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.green == prgb->green) - return (1); - return (0); + return 1; + return 0; } static int BlueComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.blue == prgb->blue) - return (1); - return (0); + return 1; + return 0; } @@ -1508,7 +1508,7 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList, ClientP } } } - return (errVal); + return errVal; } static void @@ -1586,7 +1586,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, class = pmap->class; if (!(class & DynamicClass)) - return (BadAlloc); /* Shouldn't try on this type */ + return BadAlloc; /* Shouldn't try on this type */ oldcount = pmap->numPixelsRed[client]; if (pmap->class == DirectColor) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; @@ -1594,7 +1594,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, { pcr = malloc(sizeof(colorResource)); if (!pcr) - return (BadAlloc); + return BadAlloc; } if (pmap->class == DirectColor) @@ -1641,7 +1641,7 @@ AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, ok = BadAlloc; } else free(pcr); - return (ok); + return ok; } @@ -1660,7 +1660,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, class = pmap->class; if (!(class & DynamicClass)) - return (BadAlloc); /* Shouldn't try on this type */ + return BadAlloc; /* Shouldn't try on this type */ oldcount = pmap->numPixelsRed[client]; if (class == DirectColor) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; @@ -1668,7 +1668,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, { pcr = malloc(sizeof(colorResource)); if (!pcr) - return (BadAlloc); + return BadAlloc; } if (class == DirectColor) @@ -1731,7 +1731,7 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, ok = BadAlloc; } else free(pcr); - return (ok); + return ok; } static int @@ -1765,7 +1765,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont free(ppixBlue); free(ppixGreen); free(ppixRed); - return(BadAlloc); + return BadAlloc; } okR = AllocCP(pmap, pmap->red, c, r, contig, ppixRed, prmask); @@ -1805,7 +1805,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont free(ppixBlue); free(ppixGreen); free(ppixRed); - return(BadAlloc); + return BadAlloc; } *prmask <<= pmap->pVisual->offsetRed; @@ -1850,7 +1850,7 @@ AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool cont free(ppixGreen); free(ppixRed); - return (Success); + return Success; } static int @@ -1863,9 +1863,9 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, npix = c << r; if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) - return(BadAlloc); + return BadAlloc; if(!(ppixTemp = malloc(npix * sizeof(Pixel)))) - return(BadAlloc); + return BadAlloc; ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); if (ok) @@ -1879,7 +1879,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, { for (p = ppixTemp; p < ppixTemp + npix; p++) pmap->red[*p].refcnt = 0; - return (BadAlloc); + return BadAlloc; } pmap->clientPixelsRed[client] = ppix; ppix += pmap->numPixelsRed[client]; @@ -1895,7 +1895,7 @@ AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, pmap->freeRed -= npix; } free(ppixTemp); - return (ok ? Success : BadAlloc); + return ok ? Success : BadAlloc; } /* Allocates count << planes pixels from colormap pmap for client. If @@ -1941,11 +1941,11 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, ent->fShared = FALSE; } *pMask = 0; - return (TRUE); + return TRUE; } else if (planes > dplanes) { - return (FALSE); + return FALSE; } /* General case count pixels * 2 ^ planes cells to be allocated */ @@ -1992,7 +1992,7 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, } } *pMask = mask; - return (TRUE); + return TRUE; } } pixel = save + 1; @@ -2003,7 +2003,7 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, dplanes = pmap->pVisual->nplanes; if (contig || planes == 1 || dplanes < 3) - return (FALSE); + return FALSE; /* this will be very slow for large maps, need a better algorithm */ @@ -2073,10 +2073,10 @@ AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, } *pMask = mask; - return (TRUE); + return TRUE; } } - return (FALSE); + return FALSE; } /** @@ -2224,7 +2224,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) class = pmap->class; if (pmap->flags & AllAllocated) - return(BadAccess); + return BadAccess; if ((class | DynamicClass) == DirectColor) { rmask = mask & RGBMASK(pmap->pVisual); @@ -2252,7 +2252,7 @@ FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) result = BadValue; } /* XXX should worry about removing any RT_CMAPENTRY resource */ - return (result); + return result; } /** @@ -2278,7 +2278,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe int offset, numents; if (npixIn == 0) - return (errVal); + return errVal; bits = 0; zapped = 0; base = lowbit (mask); @@ -2404,7 +2404,7 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe break; } } - return (errVal); + return errVal; } @@ -2426,7 +2426,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client) class = pmap->class; if(!(class & DynamicClass) && !(pmap->flags & BeingCreated)) { - return(BadAccess); + return BadAccess; } pVisual = pmap->pVisual; @@ -2674,7 +2674,7 @@ StoreColors (ColormapPtr pmap, int count, xColorItem *defs, ClientPtr client) * count, the count of proposed entries */ if (idef != 0) ( *pmap->pScreen->StoreColors) (pmap, idef, defs); - return (errVal); + return errVal; } int @@ -2685,7 +2685,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin) pmaps = malloc(pWin->drawable.pScreen->maxInstalledCmaps*sizeof(Colormap)); if(!pmaps) - return(FALSE); + return FALSE; nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) (pWin->drawable.pScreen, pmaps); found = FALSE; @@ -2698,7 +2698,7 @@ IsMapInstalled(Colormap map, WindowPtr pWin) } } free(pmaps); - return (found); + return found; } struct colormap_lookup_data { diff --git a/dix/cursor.c b/dix/cursor.c index 67592c578..72a7609dc 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -122,7 +122,7 @@ FreeCursor(pointer value, XID cid) DeviceIntPtr pDev = NULL; /* unused anyway */ if ( --pCurs->refcnt != 0) - return(Success); + return Success; for (nscr = 0; nscr < screenInfo.numScreens; nscr++) { @@ -132,7 +132,7 @@ FreeCursor(pointer value, XID cid) FreeCursorBits(pCurs->bits); dixFiniPrivates(pCurs, PRIVATE_CURSOR); free( pCurs); - return(Success); + return Success; } diff --git a/dix/devices.c b/dix/devices.c index 8f9c8ffff..bca2caf58 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -2117,11 +2117,11 @@ ProcChangePointerControl(ClientPtr client) ctrl = mouse->ptrfeed->ctrl; if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) { client->errorValue = stuff->doAccel; - return(BadValue); + return BadValue; } if ((stuff->doThresh != xTrue) && (stuff->doThresh != xFalse)) { client->errorValue = stuff->doThresh; - return(BadValue); + return BadValue; } if (stuff->doAccel) { if (stuff->accelNum == -1) { diff --git a/dix/dispatch.c b/dix/dispatch.c index 44164f292..0e5aced1a 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -631,7 +631,7 @@ CreateConnectionBlock(void) int ProcBadRequest(ClientPtr client) { - return (BadRequest); + return BadRequest; } int @@ -1017,7 +1017,7 @@ ProcInternAtom(ClientPtr client) if ((stuff->onlyIfExists != xTrue) && (stuff->onlyIfExists != xFalse)) { client->errorValue = stuff->onlyIfExists; - return(BadValue); + return BadValue; } tchar = (char *) &stuff[1]; atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); @@ -1033,7 +1033,7 @@ ProcInternAtom(ClientPtr client) return Success; } else - return (BadAlloc); + return BadAlloc; } int @@ -1060,7 +1060,7 @@ ProcGetAtomName(ClientPtr client) else { client->errorValue = stuff->id; - return (BadAtom); + return BadAtom; } } @@ -1275,7 +1275,7 @@ ProcQueryFont(ClientPtr client) reply = calloc(1, rlength); if(!reply) { - return(BadAlloc); + return BadAlloc; } reply->type = X_Reply; @@ -1309,11 +1309,11 @@ ProcQueryTextExtents(ClientPtr client) if (stuff->oddLength) { if (length == 0) - return(BadLength); + return BadLength; length--; } if (!QueryTextExtents(pFont, length, (unsigned char *)&stuff[1], &info)) - return(BadAlloc); + return BadAlloc; reply.type = X_Reply; reply.length = 0; reply.sequenceNumber = client->sequence; @@ -1430,7 +1430,7 @@ CreatePmap: return Success; (*pDraw->pScreen->DestroyPixmap)(pMap); } - return (BadAlloc); + return BadAlloc; } int @@ -1480,7 +1480,7 @@ ProcCreateGC(ClientPtr client) if (error != Success) return error; if (!AddResource(stuff->gc, RT_GC, (pointer)pGC)) - return (BadAlloc); + return BadAlloc; return Success; } @@ -1520,7 +1520,7 @@ ProcCopyGC(ClientPtr client) if (result != Success) return result; if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) - return (BadMatch); + return BadMatch; if (stuff->mask & ~GCAllBits) { client->errorValue = stuff->mask; @@ -1574,7 +1574,7 @@ ProcSetClipRectangles(ClientPtr client) nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); if (nr & 4) - return(BadLength); + return BadLength; nr >>= 3; return SetClipRects(pGC, stuff->xOrigin, stuff->yOrigin, nr, (xRectangle *)&stuff[1], (int)stuff->ordering); @@ -1610,12 +1610,12 @@ ProcClearToBackground(ClientPtr client) if (pWin->drawable.class == InputOnly) { client->errorValue = stuff->window; - return (BadMatch); + return BadMatch; } if ((stuff->exposures != xTrue) && (stuff->exposures != xFalse)) { client->errorValue = stuff->exposures; - return(BadValue); + return BadValue; } (*pWin->drawable.pScreen->ClearToBackground)(pWin, stuff->x, stuff->y, stuff->width, stuff->height, @@ -1645,7 +1645,7 @@ ProcCopyArea(ClientPtr client) if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; - return (BadMatch); + return BadMatch; } } else @@ -1687,7 +1687,7 @@ ProcCopyPlane(ClientPtr client) if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; - return (BadMatch); + return BadMatch; } } else @@ -1698,7 +1698,7 @@ ProcCopyPlane(ClientPtr client) (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) { client->errorValue = stuff->bitPlane; - return(BadValue); + return BadValue; } pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC, stuff->srcX, stuff->srcY, @@ -1772,7 +1772,7 @@ ProcPolySegment(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq); if (nsegs & 4) - return(BadLength); + return BadLength; nsegs >>= 3; if (nsegs) (*pGC->ops->PolySegment)(pDraw, pGC, nsegs, (xSegment *) &stuff[1]); @@ -1791,7 +1791,7 @@ ProcPolyRectangle (ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq); if (nrects & 4) - return(BadLength); + return BadLength; nrects >>= 3; if (nrects) (*pGC->ops->PolyRectangle)(pDraw, pGC, @@ -1811,7 +1811,7 @@ ProcPolyArc(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); narcs = (client->req_len << 2) - sizeof(xPolyArcReq); if (narcs % sizeof(xArc)) - return(BadLength); + return BadLength; narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyArc)(pDraw, pGC, narcs, (xArc *) &stuff[1]); @@ -1861,7 +1861,7 @@ ProcPolyFillRectangle(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq); if (things & 4) - return(BadLength); + return BadLength; things >>= 3; if (things) @@ -1882,7 +1882,7 @@ ProcPolyFillArc(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess); narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq); if (narcs % sizeof(xArc)) - return(BadLength); + return BadLength; narcs /= sizeof(xArc); if (narcs) (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, (xArc *) &stuff[1]); @@ -2019,7 +2019,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, if ((format != XYPixmap) && (format != ZPixmap)) { client->errorValue = format; - return(BadValue); + return BadValue; } rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixReadAccess); if (rc != Success) @@ -2103,7 +2103,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, if (im_return) { pBuf = calloc(1, sz_xGetImageReply + length); if (!pBuf) - return (BadAlloc); + return BadAlloc; if (widthBytesLine == 0) linesPerBuf = 0; else @@ -2140,7 +2140,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, } } if(!(pBuf = calloc(1, length))) - return (BadAlloc); + return BadAlloc; WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); } @@ -2362,7 +2362,7 @@ ProcCreateColormap(ClientPtr client) if ((stuff->alloc != AllocNone) && (stuff->alloc != AllocAll)) { client->errorValue = stuff->alloc; - return(BadValue); + return BadValue; } mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); @@ -2381,7 +2381,7 @@ ProcCreateColormap(ClientPtr client) (int)stuff->alloc, client->index); } client->errorValue = stuff->visual; - return(BadMatch); + return BadMatch; } int @@ -2507,7 +2507,7 @@ ProcListInstalledColormaps(ClientPtr client) pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap)); if(!preply) - return(BadAlloc); + return BadAlloc; preply->type = X_Reply; preply->sequenceNumber = client->sequence; @@ -2595,7 +2595,7 @@ ProcAllocNamedColor (ClientPtr client) return Success; } else - return(BadName); + return BadName; } else @@ -2626,18 +2626,18 @@ ProcAllocColorCells (ClientPtr client) if (!npixels) { client->errorValue = npixels; - return (BadValue); + return BadValue; } if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) { client->errorValue = stuff->contiguous; - return (BadValue); + return BadValue; } nmasks = stuff->planes; length = ((long)npixels + (long)nmasks) * sizeof(Pixel); ppixels = malloc(length); if(!ppixels) - return(BadAlloc); + return BadAlloc; pmasks = ppixels + npixels; if( (rc = AllocColorCells(client->index, pcmp, npixels, nmasks, @@ -2690,12 +2690,12 @@ ProcAllocColorPlanes(ClientPtr client) if (!npixels) { client->errorValue = npixels; - return (BadValue); + return BadValue; } if (stuff->contiguous != xTrue && stuff->contiguous != xFalse) { client->errorValue = stuff->contiguous; - return (BadValue); + return BadValue; } acpr.type = X_Reply; acpr.sequenceNumber = client->sequence; @@ -2703,7 +2703,7 @@ ProcAllocColorPlanes(ClientPtr client) length = (long)npixels * sizeof(Pixel); ppixels = malloc(length); if(!ppixels) - return(BadAlloc); + return BadAlloc; if( (rc = AllocColorPlanes(client->index, pcmp, npixels, (int)stuff->red, (int)stuff->green, (int)stuff->blue, (Bool)stuff->contiguous, ppixels, @@ -2746,7 +2746,7 @@ ProcFreeColors(ClientPtr client) int count; if(pcmp->flags & AllAllocated) - return(BadAccess); + return BadAccess; count = bytes_to_int32((client->req_len << 2) - sizeof(xFreeColorsReq)); return FreeColors(pcmp, client->index, count, (Pixel *)&stuff[1], (Pixel)stuff->planeMask); @@ -2774,7 +2774,7 @@ ProcStoreColors (ClientPtr client) count = (client->req_len << 2) - sizeof(xStoreColorsReq); if (count % sizeof(xColorItem)) - return(BadLength); + return BadLength; count /= sizeof(xColorItem); return StoreColors(pcmp, count, (xColorItem *)&stuff[1], client); } @@ -2806,7 +2806,7 @@ ProcStoreNamedColor (ClientPtr client) def.pixel = stuff->pixel; return StoreColors(pcmp, 1, &def, client); } - return (BadName); + return BadName; } else { @@ -2834,7 +2834,7 @@ ProcQueryColors(ClientPtr client) count = bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq)); prgbs = calloc(1, count * sizeof(xrgb)); if(!prgbs && count) - return(BadAlloc); + return BadAlloc; if( (rc = QueryColors(pcmp, count, (Pixel *)&stuff[1], prgbs, client)) ) { free(prgbs); @@ -2892,7 +2892,7 @@ ProcLookupColor(ClientPtr client) WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr); return Success; } - return (BadName); + return BadName; } else { @@ -2940,24 +2940,24 @@ ProcCreateCursor (ClientPtr client) || src->drawable.height != msk->drawable.height || src->drawable.depth != 1 || msk->drawable.depth != 1) - return (BadMatch); + return BadMatch; width = src->drawable.width; height = src->drawable.height; if ( stuff->x > width || stuff->y > height ) - return (BadMatch); + return BadMatch; n = BitmapBytePad(width)*height; srcbits = calloc(1, n); if (!srcbits) - return (BadAlloc); + return BadAlloc; mskbits = malloc(n); if (!mskbits) { free(srcbits); - return (BadAlloc); + return BadAlloc; } (* src->drawable.pScreen->GetImage)( (DrawablePtr)src, 0, 0, width, height, @@ -3053,7 +3053,7 @@ ProcQueryBestSize (ClientPtr client) (stuff->class != StippleShape)) { client->errorValue = stuff->class; - return(BadValue); + return BadValue; } rc = dixLookupDrawable(&pDraw, stuff->drawable, client, M_ANY, @@ -3061,7 +3061,7 @@ ProcQueryBestSize (ClientPtr client) if (rc != Success) return rc; if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) - return (BadMatch); + return BadMatch; pScreen = pDraw->pScreen; rc = XaceHook(XACE_SCREEN_ACCESS, client, pScreen, DixGetAttrAccess); if (rc != Success) @@ -3201,7 +3201,7 @@ ProcListHosts(ClientPtr client) result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); if (result != Success) - return(result); + return result; reply.type = X_Reply; reply.sequenceNumber = client->sequence; reply.nHosts = nHosts; @@ -3276,7 +3276,7 @@ ProcKillClient(ClientPtr client) * doesn't try to touch client */ isItTimeToYield = TRUE; - return (Success); + return Success; } return Success; } @@ -3302,12 +3302,12 @@ ProcSetFontPath(ClientPtr client) while (--nfonts >= 0) { if ((total == 0) || (total < (n = (*ptr + 1)))) - return(BadLength); + return BadLength; total -= n; ptr += n; } if (total >= 4) - return(BadLength); + return BadLength; return SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]); } @@ -3356,7 +3356,7 @@ ProcChangeCloseDownMode(ClientPtr client) else { client->errorValue = stuff->mode; - return (BadValue); + return BadValue; } } @@ -3573,7 +3573,7 @@ ClientPtr NextAvailableClient(pointer ospriv) clientinfo.setup = (xConnSetup *) NULL; CallCallbacks((&ClientStateCallback), (pointer)&clientinfo); } - return(client); + return client; } int @@ -3585,7 +3585,7 @@ ProcInitialConnection(ClientPtr client) prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return (client->noClientException = -1); + return client->noClientException = -1; if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) { @@ -3626,7 +3626,7 @@ SendConnSetup(ClientPtr client, char *reason) else (void)WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); (void)WriteToClient(client, (int)csp.lengthReason, reason); - return (client->noClientException = -1); + return client->noClientException = -1; } numScreens = screenInfo.numScreens; diff --git a/dix/dixfonts.c b/dix/dixfonts.c index e32117748..6c90fb9d2 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -482,7 +482,7 @@ CloseFont(pointer value, XID fid) FontPtr pfont = (FontPtr)value; if (pfont == NullFont) - return (Success); + return Success; if (--pfont->refcnt == 0) { if (patternCache) RemoveCachedFontPattern (patternCache, pfont); @@ -504,7 +504,7 @@ CloseFont(pointer value, XID fid) (*fpe_functions[fpe->type].close_font) (fpe, pfont); FreeFPE(fpe); } - return (Success); + return Success; } diff --git a/dix/dixutils.c b/dix/dixutils.c index cb1c97c8f..470bb5dd7 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -296,17 +296,17 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, if (mode == SetModeInsert) { if (j < numnow) /* duplicate */ - return(Success); + return Success; numnow++; pTmp = (SaveSetElt *)realloc(client->saveSet, sizeof(*pTmp) * numnow); if (!pTmp) - return(BadAlloc); + return BadAlloc; client->saveSet = pTmp; client->numSaved = numnow; SaveSetAssignWindow(client->saveSet[numnow - 1], pWin); SaveSetAssignToRoot(client->saveSet[numnow - 1], toRoot); SaveSetAssignMap(client->saveSet[numnow - 1], map); - return(Success); + return Success; } else if ((mode == SetModeDelete) && (j < numnow)) { @@ -328,9 +328,9 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, client->saveSet = (SaveSetElt *)NULL; } client->numSaved = numnow; - return(Success); + return Success; } - return(Success); + return Success; } void diff --git a/dix/events.c b/dix/events.c index 2dc0e9821..ae9847c93 100644 --- a/dix/events.c +++ b/dix/events.c @@ -331,7 +331,7 @@ IsKeyboardDevice(DeviceIntPtr dev) Bool IsMaster(DeviceIntPtr dev) { - return (dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD); + return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD; } static WindowPtr XYToWindow( @@ -4083,7 +4083,7 @@ OtherClientGone(pointer value, XID id) } free(other); RecalculateDeliverableEvents(pWin); - return(Success); + return Success; } prev = other; } @@ -4488,7 +4488,7 @@ SetInputFocus( /* It is a match error to try to set the input focus to an unviewable window. */ if(!focusWin->realized) - return(BadMatch); + return BadMatch; } rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixSetFocusAccess); if (rc != Success) @@ -5005,7 +5005,7 @@ ProcQueryPointer(ClientPtr client) WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep); - return(Success); + return Success; } /** @@ -5209,8 +5209,8 @@ ProcUngrabKey(ClientPtr client) tempGrab.next = NULL; if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); + return BadAlloc; + return Success; } /** @@ -5404,8 +5404,8 @@ ProcUngrabButton(ClientPtr client) tempGrab.next = NULL; if (!DeletePassiveGrabFromList(&tempGrab)) - return(BadAlloc); - return(Success); + return BadAlloc; + return Success; } /** @@ -5619,7 +5619,7 @@ ProcRecolorCursor(ClientPtr client) ( *pscr->RecolorCursor)(PickPointer(client), pscr, pCursor, (pCursor == pSprite->current) && displayed); } - return (Success); + return Success; } /** diff --git a/dix/extension.c b/dix/extension.c index f422ea3a0..c8e921a19 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -91,10 +91,10 @@ AddExtension(char *name, int NumEvents, int NumErrors, ext = calloc(sizeof (ExtensionEntry), 1); if (!ext) - return(NULL); + return NULL; if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) { free(ext); - return(NULL); + return NULL; } ext->name = malloc(strlen(name) + 1); ext->num_aliases = 0; @@ -149,7 +149,7 @@ AddExtension(char *name, int NumEvents, int NumErrors, } RegisterExtensionNames(ext); - return(ext); + return ext; } Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) @@ -335,7 +335,7 @@ ProcListExtensions(ClientPtr client) reply.length = bytes_to_int32(total_length); buffer = bufptr = malloc(total_length); if (!buffer) - return(BadAlloc); + return BadAlloc; for (i=0; i<NumExtensions; i++) { int len; @@ -562,7 +562,7 @@ out: pGC = (GCPtr)NULL; } - return (pGC); + return pGC; } static Bool @@ -785,7 +785,7 @@ FreeGC(pointer value, XID gid) if (pGC->dash != DefaultDash) free(pGC->dash); dixFreeObjectWithPrivates(pGC, PRIVATE_GC); - return(Success); + return Success; } /* CreateScratchGC(pScreen, depth) @@ -1066,7 +1066,7 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, newct = VerifyRectOrder(nrects, prects, ordering); if (newct < 0) - return(BadMatch); + return BadMatch; size = nrects * sizeof(xRectangle); prectsNew = malloc(size); if (!prectsNew && size) diff --git a/dix/main.c b/dix/main.c index 0f499dd0f..5c46dc1dc 100644 --- a/dix/main.c +++ b/dix/main.c @@ -348,6 +348,6 @@ int main(int argc, char *argv[], char *envp[]) free(ConnectionInfo); ConnectionInfo = NULL; } - return(0); + return 0; } diff --git a/dix/property.c b/dix/property.c index 65231079a..87e5c2d18 100644 --- a/dix/property.c +++ b/dix/property.c @@ -230,12 +230,12 @@ ProcChangeProperty(ClientPtr client) if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; - return(BadAtom); + return BadAtom; } if (!ValidAtom(stuff->type)) { client->errorValue = stuff->type; - return(BadAtom); + return BadAtom; } err = dixChangeWindowProperty(client, pWin, stuff->property, stuff->type, @@ -268,15 +268,15 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, if (rc == BadMatch) /* just add to list */ { if (!pWin->optional && !MakeWindowOptional (pWin)) - return(BadAlloc); + return BadAlloc; pProp = dixAllocateObjectWithPrivates(PropertyRec, PRIVATE_PROPERTY); if (!pProp) - return(BadAlloc); + return BadAlloc; data = malloc(totalSize); if (!data && len) { dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY); - return(BadAlloc); + return BadAlloc; } memcpy(data, value, totalSize); pProp->propertyName = property; @@ -304,9 +304,9 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, "PropModeReplace" since they will be written over. */ if ((format != pProp->format) && (mode != PropModeReplace)) - return(BadMatch); + return BadMatch; if ((pProp->type != type) && (mode != PropModeReplace)) - return(BadMatch); + return BadMatch; /* save the old values for later */ savedProp = *pProp; @@ -315,7 +315,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, { data = malloc(totalSize); if (!data && len) - return(BadAlloc); + return BadAlloc; memcpy(data, value, totalSize); pProp->data = data; pProp->size = len; @@ -330,7 +330,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, { data = malloc((pProp->size + len) * sizeInBytes); if (!data) - return(BadAlloc); + return BadAlloc; memcpy(data, pProp->data, pProp->size * sizeInBytes); memcpy(data + pProp->size * sizeInBytes, value, totalSize); pProp->data = data; @@ -340,7 +340,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, { data = malloc(sizeInBytes * (len + pProp->size)); if (!data) - return(BadAlloc); + return BadAlloc; memcpy(data + totalSize, pProp->data, pProp->size * sizeInBytes); memcpy(data, value, totalSize); pProp->data = data; @@ -369,7 +369,7 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property, if (sendevent) deliverPropertyNotifyEvent(pWin, PropertyNewValue, pProp->propertyName); - return(Success); + return Success; } int @@ -477,17 +477,17 @@ ProcGetProperty(ClientPtr client) if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; - return(BadAtom); + return BadAtom; } if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) { client->errorValue = stuff->delete; - return(BadValue); + return BadValue; } if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) { client->errorValue = stuff->type; - return(BadAtom); + return BadAtom; } memset(&reply, 0, sizeof(xGetPropertyReply)); @@ -513,7 +513,7 @@ ProcGetProperty(ClientPtr client) reply.nItems = 0; reply.propertyType = pProp->type; WriteReplyToClient(client, sizeof(xGenericReply), &reply); - return(Success); + return Success; } /* @@ -635,7 +635,7 @@ ProcDeleteProperty(ClientPtr client) if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; - return (BadAtom); + return BadAtom; } return DeleteProperty(client, pWin, stuff->property); diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index cedc829d0..30e14b17e 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -494,7 +494,7 @@ CalcTracker(DeviceVelocityPtr vel, int offset, int cur_t){ + vel->tracker[index].dy * vel->tracker[index].dy); int dtime = cur_t - vel->tracker[index].time; if(dtime > 0) - return (dist / dtime); + return dist / dtime; else return 0;/* synonymous for NaN, since we're not C99 */ } diff --git a/dix/region.c b/dix/region.c index a77d17b30..5ba345773 100644 --- a/dix/region.c +++ b/dix/region.c @@ -245,7 +245,7 @@ RegionCreate(BoxPtr rect, int size) RegionInit (pReg, rect, size); - return(pReg); + return pReg; } void @@ -290,7 +290,7 @@ RegionIsValid(RegionPtr reg) (reg->extents.y1 == reg->extents.y2) && (reg->data->size || (reg->data == &RegionEmptyData))); else if (numRects == 1) - return (!reg->data); + return !reg->data; else { BoxPtr pboxP, pboxN; @@ -428,7 +428,7 @@ RegionCoalesce ( do { if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { - return (curStart); + return curStart; } pPrevBox++; pCurBox++; @@ -1655,5 +1655,5 @@ RegionClipSpans( } } } - return (pwidthNew - pwidthNewStart); + return pwidthNew - pwidthNewStart; } diff --git a/dix/resource.c b/dix/resource.c index ce025f9f0..a0fe719de 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -901,7 +901,7 @@ LegalNewID(XID id, ClientPtr client) rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, DixGetAttrAccess); - return (rc == BadValue); + return rc == BadValue; } return FALSE; } diff --git a/dix/swapreq.c b/dix/swapreq.c index 5d7d71c8f..2e34711c0 100644 --- a/dix/swapreq.c +++ b/dix/swapreq.c @@ -318,7 +318,7 @@ SProcSendEvent(ClientPtr client) /* Swap event */ proc = EventSwapVector[stuff->event.u.u.type & 0177]; if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */ - return (BadValue); + return BadValue; (*proc)(&stuff->event, &eventT); stuff->event = eventT; diff --git a/dix/window.c b/dix/window.c index 8f3ffa384..4a47dd50b 100644 --- a/dix/window.c +++ b/dix/window.c @@ -221,12 +221,12 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) WindowPtr pChild; if (!(pChild = pWin)) - return(WT_NOMATCH); + return WT_NOMATCH; while (1) { result = (* func)(pChild, data); if (result == WT_STOPWALKING) - return(WT_STOPWALKING); + return WT_STOPWALKING; if ((result == WT_WALKCHILDREN) && pChild->firstChild) { pChild = pChild->firstChild; @@ -238,7 +238,7 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) break; pChild = pChild->nextSib; } - return(WT_NOMATCH); + return WT_NOMATCH; } /***** @@ -529,9 +529,9 @@ RealChildHead(WindowPtr pWin) if (!pWin->parent && (screenIsSaved == SCREEN_SAVER_ON) && (HasSaverWindow (pWin->drawable.pScreen))) - return (pWin->firstChild); + return pWin->firstChild; else - return (NullWindow); + return NullWindow; } /***** @@ -1549,7 +1549,7 @@ MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) (*pWin->drawable.pScreen->RestackWindow)(pWin, pWin->nextSib); #endif - return( pFirstChange ); + return pFirstChange; } void @@ -1795,12 +1795,12 @@ IsSiblingAboveMe( while (pWin) { if (pWin == pSib) - return(Above); + return Above; else if (pWin == pMe) - return(Below); + return Below; pWin = pWin->nextSib; } - return(Below); + return Below; } static BoxPtr @@ -1814,7 +1814,7 @@ WindowExtents( + wBorderWidth (pWin); pBox->y2 = pWin->drawable.y + (int)pWin->drawable.height + wBorderWidth (pWin); - return(pBox); + return pBox; } #define IS_SHAPED(pWin) (wBoundingShape (pWin) != (RegionPtr) NULL) @@ -1872,10 +1872,10 @@ AnyWindowOverlapsMe( if (BOXES_OVERLAP(sbox, box) && ShapeOverlap (pWin, box, pSib, sbox) ) - return(TRUE); + return TRUE; } } - return(FALSE); + return FALSE; } static Bool @@ -1895,10 +1895,10 @@ IOverlapAnyWindow( if (BOXES_OVERLAP(sbox, box) && ShapeOverlap (pWin, box, pSib, sbox) ) - return(TRUE); + return TRUE; } } - return(FALSE); + return FALSE; } /* @@ -1955,63 +1955,63 @@ WhereDoIGoInTheStack( { case Above: if (pSib) - return(pSib); + return pSib; else if (pWin == pFirst) - return(pWin->nextSib); + return pWin->nextSib; else - return(pFirst); + return pFirst; case Below: if (pSib) if (pSib->nextSib != pWin) - return(pSib->nextSib); + return pSib->nextSib; else - return(pWin->nextSib); + return pWin->nextSib; else return NullWindow; case TopIf: if ((!pWin->mapped || (pSib && !pSib->mapped))) - return(pWin->nextSib); + return pWin->nextSib; else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Above) && (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) - return(pFirst); + return pFirst; else - return(pWin->nextSib); + return pWin->nextSib; } else if (AnyWindowOverlapsMe(pWin, pHead, &box)) - return(pFirst); + return pFirst; else - return(pWin->nextSib); + return pWin->nextSib; case BottomIf: if ((!pWin->mapped || (pSib && !pSib->mapped))) - return(pWin->nextSib); + return pWin->nextSib; else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Below) && (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return NullWindow; else - return(pWin->nextSib); + return pWin->nextSib; } else if (IOverlapAnyWindow(pWin, &box)) return NullWindow; else - return(pWin->nextSib); + return pWin->nextSib; case Opposite: if ((!pWin->mapped || (pSib && !pSib->mapped))) - return(pWin->nextSib); + return pWin->nextSib; else if (pSib) { if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT) { if (IsSiblingAboveMe(pWin, pSib) == Above) - return(pFirst); + return pFirst; else return NullWindow; } else - return(pWin->nextSib); + return pWin->nextSib; } else if (AnyWindowOverlapsMe(pWin, pHead, &box)) { @@ -2019,7 +2019,7 @@ WhereDoIGoInTheStack( * if (pWin == pWin->parent->firstChild) * return pWin->nextSib; */ - return(pFirst); + return pFirst; } else if (IOverlapAnyWindow(pWin, &box)) return NullWindow; @@ -2094,10 +2094,10 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) xEvent event; if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) - return(BadMatch); + return BadMatch; if ((mask & CWSibling) && !(mask & CWStackMode)) - return(BadMatch); + return BadMatch; pVlist = vlist; @@ -2154,9 +2154,9 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) return rc; } if (pSib->parent != pParent) - return(BadMatch); + return BadMatch; if (pSib == pWin) - return(BadMatch); + return BadMatch; break; case CWStackMode: GET_CARD8(CWStackMode, smode); @@ -2164,12 +2164,12 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) (smode != Opposite) && (smode != Above) && (smode != Below)) { client->errorValue = smode; - return(BadValue); + return BadValue; } break; default: client->errorValue = mask; - return(BadValue); + return BadValue; } } /* root really can't be reconfigured, so just return */ @@ -2217,7 +2217,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) event.u.configureRequest.parent = pParent->drawable.id; if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) - return(Success); + return Success; } if (action == RESIZE_WIN) { @@ -2268,7 +2268,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) #endif goto ActuallyDoSomething; } - return(Success); + return Success; ActuallyDoSomething: if (pWin->drawable.pScreen->ConfigNotify) @@ -2331,7 +2331,7 @@ ActuallyDoSomething: if (action != RESTACK_WIN) CheckCursorConfinement(pWin); - return(Success); + return Success; #undef RESTACK_WIN #undef MOVE_WIN #undef RESIZE_WIN @@ -2392,7 +2392,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) event.u.u.type = CirculateRequest; if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) - return(Success); + return Success; } event.u.u.type = CirculateNotify; @@ -2401,7 +2401,7 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) (direction == RaiseLowest) ? pFirst : NullWindow, VTStack); - return(Success); + return Success; } static int @@ -2412,9 +2412,9 @@ CompareWIDs( Window *wid = (Window *)value; if (pWin->drawable.id == *wid) - return(WT_STOPWALKING); + return WT_STOPWALKING; else - return(WT_WALKCHILDREN); + return WT_WALKCHILDREN; } /***** @@ -2433,9 +2433,9 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, pScreen = pWin->drawable.pScreen; if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) - return(BadMatch); + return BadMatch; if (!MakeWindowOptional(pWin)) - return(BadAlloc); + return BadAlloc; if (WasMapped) UnmapWindow(pWin, FALSE); @@ -2511,7 +2511,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, if (WasMapped) MapWindow(pWin, client); RecalculateDeliverableEvents(pWin); - return(Success); + return Success; } static void @@ -2584,7 +2584,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) WindowPtr pLayerWin; if (pWin->mapped) - return(Success); + return Success; /* general check for permission to map window */ if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW, @@ -2608,7 +2608,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) - return(Success); + return Success; } pWin->mapped = TRUE; @@ -2622,7 +2622,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) } if (!pParent->realized) - return(Success); + return Success; RealizeTree(pWin); if (pWin->viewable) { @@ -2657,7 +2657,7 @@ MapWindow(WindowPtr pWin, ClientPtr client) RegionUninit(&temp); } - return(Success); + return Success; } @@ -2813,7 +2813,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) WindowPtr pLayerWin = pWin; if ((!pWin->mapped) || (!(pParent = pWin->parent))) - return(Success); + return Success; if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) { memset(&event, 0, sizeof(xEvent)); @@ -2843,7 +2843,7 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) } if (wasRealized && !fromConfigure) WindowsRestructured (); - return(Success); + return Success; } /***** @@ -2986,15 +2986,15 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y) BoxRec box; if (!pWin->realized) - return (FALSE); + return FALSE; if (RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || RegionContainsPoint(wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) - return(TRUE); - return(FALSE); + return TRUE; + return FALSE; } @@ -3008,7 +3008,7 @@ NotClippedByChildren(WindowPtr pWin) { RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize); } - return(pReg); + return pReg; } void |