summaryrefslogtreecommitdiff
path: root/dbe
diff options
context:
space:
mode:
authorMikhail Gusarov <dottedmag@dottedmag.net>2010-06-06 21:18:40 +0700
committerKeith Packard <keithp@keithp.com>2010-06-10 06:42:42 -0700
commit7287ef9e6cf953066e4a092cca9d0e4a279172bf (patch)
treeb67414bd69d1a1afc881e224d2f04cd495eb81d2 /dbe
parentb3a7b229e1e1f212bdd185af5443311091824005 (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 'dbe')
-rw-r--r--dbe/dbe.c60
-rw-r--r--dbe/midbe.c26
2 files changed, 43 insertions, 43 deletions
diff --git a/dbe/dbe.c b/dbe/dbe.c
index b4b746678..77b616b6a 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -199,7 +199,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* The window must be InputOutput. */
if (pWin->drawable.class != InputOutput)
{
- return(BadMatch);
+ return BadMatch;
}
/* The swap action must be valid. */
@@ -209,7 +209,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
(swapAction != XdbeUntouched ) &&
(swapAction != XdbeCopied ))
{
- return(BadValue);
+ return BadValue;
}
/* The id must be in range and not already in use. */
@@ -220,12 +220,12 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
*/
pDbeScreenPriv = DBE_SCREEN_PRIV_FROM_WINDOW(pWin);
if (!pDbeScreenPriv->GetVisualInfo)
- return(BadMatch); /* screen doesn't support double buffering */
+ return BadMatch; /* screen doesn't support double buffering */
if (!(*pDbeScreenPriv->GetVisualInfo)(pWin->drawable.pScreen, &scrVisInfo))
{
/* GetVisualInfo() failed to allocate visual info data. */
- return(BadAlloc);
+ return BadAlloc;
}
/* See if the window's visual is on the list. */
@@ -243,7 +243,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
if (!visualMatched)
{
- return(BadMatch);
+ return BadMatch;
}
if ((pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)) == NULL)
@@ -254,7 +254,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
pDbeWindowPriv = dixAllocateObjectWithPrivates(DbeWindowPrivRec, PRIVATE_DBE_WINDOW);
if (!pDbeWindowPriv)
- return(BadAlloc);
+ return BadAlloc;
/* Fill out window priv information. */
pDbeWindowPriv->pWindow = pWin;
@@ -321,7 +321,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
(pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID));
if (!pDbeWindowPriv->IDs)
{
- return(BadAlloc);
+ return BadAlloc;
}
memset(&pDbeWindowPriv->IDs[pDbeWindowPriv->nBufferIDs], 0,
(pDbeWindowPriv->maxAvailableIDs + DBE_INCR_MAX_IDS -
@@ -377,12 +377,12 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
/* Set swap action on all calls. */
pDbeWindowPriv->swapAction = stuff->swapAction;
- return(status);
+ return status;
out_free:
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, NULL);
free(pDbeWindowPriv);
- return (status);
+ return status;
} /* ProcDbeAllocateBackBufferName() */
@@ -445,12 +445,12 @@ ProcDbeDeallocateBackBufferName(ClientPtr client)
{
/* We did not find the ID in the ID list. */
client->errorValue = stuff->buffer;
- return(dbeErrorBase + DbeBadBuffer);
+ return dbeErrorBase + DbeBadBuffer;
}
FreeResource(stuff->buffer, RT_NONE);
- return(Success);
+ return Success;
} /* ProcDbeDeallocateBackBufferName() */
@@ -496,7 +496,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (nStuff == 0)
{
- return(Success);
+ return Success;
}
if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
@@ -509,7 +509,7 @@ ProcDbeSwapBuffers(ClientPtr client)
swapInfo = (DbeSwapInfoPtr)malloc(nStuff * sizeof(DbeSwapInfoRec));
if (swapInfo == NULL)
{
- return(BadAlloc);
+ return BadAlloc;
}
@@ -529,7 +529,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (DBE_WINDOW_PRIV(pWin) == NULL)
{
free(swapInfo);
- return(BadMatch);
+ return BadMatch;
}
/* Each window must only be specified once - BadMatch. */
@@ -538,7 +538,7 @@ ProcDbeSwapBuffers(ClientPtr client)
if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
{
free(swapInfo);
- return(BadMatch);
+ return BadMatch;
}
}
@@ -549,7 +549,7 @@ ProcDbeSwapBuffers(ClientPtr client)
(dbeSwapInfo[i].swapAction != XdbeCopied ))
{
free(swapInfo);
- return(BadValue);
+ return BadValue;
}
/* Everything checks out OK. Fill in the swap info array. */
@@ -579,12 +579,12 @@ ProcDbeSwapBuffers(ClientPtr client)
if (error != Success)
{
free(swapInfo);
- return(error);
+ return error;
}
}
free(swapInfo);
- return(Success);
+ return Success;
} /* ProcDbeSwapBuffers() */
@@ -626,7 +626,7 @@ ProcDbeBeginIdiom(ClientPtr client)
}
}
- return(Success);
+ return Success;
} /* ProcDbeBeginIdiom() */
@@ -673,7 +673,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
if (!(pDrawables = (DrawablePtr *)malloc(stuff->n *
sizeof(DrawablePtr))))
{
- return(BadAlloc);
+ return BadAlloc;
}
drawables = (Drawable *)&stuff[1];
@@ -695,7 +695,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
{
free(pDrawables);
- return(BadAlloc);
+ return BadAlloc;
}
length = 0;
@@ -894,7 +894,7 @@ ProcDbeDispatch(ClientPtr client)
return(ProcDbeBeginIdiom(client));
case X_DbeEndIdiom:
- return(Success);
+ return Success;
case X_DbeGetVisualInfo:
return(ProcDbeGetVisualInfo(client));
@@ -903,7 +903,7 @@ ProcDbeDispatch(ClientPtr client)
return(ProcDbeGetBackBufferAttributes(client));
default:
- return(BadRequest);
+ return BadRequest;
}
} /* ProcDbeDispatch() */
@@ -1195,7 +1195,7 @@ SProcDbeDispatch(ClientPtr client)
return(SProcDbeBeginIdiom(client));
case X_DbeEndIdiom:
- return(Success);
+ return Success;
case X_DbeGetVisualInfo:
return(SProcDbeGetVisualInfo(client));
@@ -1204,7 +1204,7 @@ SProcDbeDispatch(ClientPtr client)
return(SProcDbeGetBackBufferAttributes(client));
default:
- return (BadRequest);
+ return BadRequest;
}
} /* SProcDbeDispatch() */
@@ -1269,7 +1269,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
default:
/* pWin->backgroundState == None */
- return(FALSE);
+ return FALSE;
}
return ChangeGC(NullClient, pGC, gcmask, gcvalues) == 0;
@@ -1295,7 +1295,7 @@ DbeSetupBackgroundPainter(WindowPtr pWin, GCPtr pGC)
static int
DbeDrawableDelete(pointer pDrawable, XID id)
{
- return(Success);
+ return Success;
} /* DbeDrawableDelete() */
@@ -1335,7 +1335,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
if (i == pDbeWindowPriv->nBufferIDs)
{
/* We did not find the ID in the array. We should never get here. */
- return(BadValue);
+ return BadValue;
}
/* Remove the ID from the array. */
@@ -1402,7 +1402,7 @@ DbeWindowPrivDelete(pointer pDbeWinPriv, XID id)
dixFreeObjectWithPrivates(pDbeWindowPriv, PRIVATE_DBE_WINDOW);
}
- return(Success);
+ return Success;
} /* DbeWindowPrivDelete() */
@@ -1523,7 +1523,7 @@ DbeDestroyWindow(WindowPtr pWin)
**************************************************************************
*/
- return(ret);
+ return ret;
} /* DbeDestroyWindow() */
diff --git a/dbe/midbe.c b/dbe/midbe.c
index 03e8e2e1b..954f46e1a 100644
--- a/dbe/midbe.c
+++ b/dbe/midbe.c
@@ -96,7 +96,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo)
/* Allocate an array of XdbeVisualInfo items. */
if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo))))
{
- return(FALSE); /* memory alloc failure */
+ return FALSE; /* memory alloc failure */
}
for (i = 0, k = 0; i < pScreen->numDepths; i++)
@@ -125,7 +125,7 @@ miDbeGetVisualInfo(ScreenPtr pScreen, XdbeScreenVisualInfo *pScrVisInfo)
pScrVisInfo->count = count;
pScrVisInfo->visinfo = visInfo;
- return(TRUE); /* success */
+ return TRUE; /* success */
} /* miDbeGetVisualInfo() */
@@ -175,7 +175,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
pDbeWindowPriv->height,
pWin->drawable.depth, 0)))
{
- return(BadAlloc);
+ return BadAlloc;
}
/* Get a back pixmap. */
@@ -185,7 +185,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
pWin->drawable.depth, 0)))
{
(*pScreen->DestroyPixmap)(pDbeWindowPrivPriv->pFrontBuffer);
- return(BadAlloc);
+ return BadAlloc;
}
/* Security creation/labeling check. */
@@ -235,12 +235,12 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction)
if (!AddResource(bufId, dbeDrawableResType,
(pointer)pDbeWindowPrivPriv->pBackBuffer))
{
- return(BadAlloc);
+ return BadAlloc;
}
}
- return(Success);
+ return Success;
} /* miDbeAllocBackBufferName() */
@@ -409,7 +409,7 @@ miDbeSwapBuffers(ClientPtr client, int *pNumWindows, DbeSwapInfoPtr swapInfo)
FreeScratchGC(pGC);
- return(Success);
+ return Success;
} /* miSwapBuffers() */
@@ -571,13 +571,13 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
if (!(pDbeWindowPriv = DBE_WINDOW_PRIV(pWin)))
{
- return(ret);
+ return ret;
}
if (pDbeWindowPriv->width == pWin->drawable.width &&
pDbeWindowPriv->height == pWin->drawable.height)
{
- return(ret);
+ return ret;
}
width = pWin->drawable.width;
@@ -678,7 +678,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
}
FreeScratchGC(pGC);
- return(FALSE);
+ return FALSE;
}
else
@@ -737,7 +737,7 @@ miDbePositionWindow(WindowPtr pWin, int x, int y)
FreeScratchGC(pGC);
}
- return(ret);
+ return ret;
} /* miDbePositionWindow() */
@@ -783,7 +783,7 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
{
if (!dixRegisterPrivateKey(&miDbeWindowPrivPrivKeyRec, PRIVATE_DBE_WINDOW,
sizeof(MiDbeWindowPrivPrivRec)))
- return(FALSE);
+ return FALSE;
/* Wrap functions. */
pDbeScreenPriv->PositionWindow = pScreen->PositionWindow;
@@ -798,6 +798,6 @@ miDbeInit(ScreenPtr pScreen, DbeScreenPrivPtr pDbeScreenPriv)
pDbeScreenPriv->ResetProc = miDbeResetProc;
pDbeScreenPriv->WinPrivDelete = miDbeWinPrivDelete;
- return(TRUE);
+ return TRUE;
} /* miDbeInit() */