1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Remove unnecessary parentheses in return statements

The parenthesized style has only been used in a few modules.  Change
that to use the style that is predominant across the whole tree.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Reviewed-by: Ryan Murphy <ryanfmurphy@gmail.com>
This commit is contained in:
Peter Eisentraut
2017-08-17 12:39:20 -04:00
parent ba26f5cf76
commit 17273d059c
99 changed files with 469 additions and 469 deletions

View File

@ -296,7 +296,7 @@ gbt_num_consistent(const GBT_NUMKEY_R *key,
retval = false;
}
return (retval);
return retval;
}

View File

@ -159,7 +159,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
l--;
i++;
}
return (ml); /* lower == upper */
return ml; /* lower == upper */
}
@ -299,7 +299,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo)
else
retval = entry;
return (retval);
return retval;
}

View File

@ -625,7 +625,7 @@ g_cube_leaf_consistent(NDBOX *key,
default:
retval = FALSE;
}
return (retval);
return retval;
}
bool
@ -652,7 +652,7 @@ g_cube_internal_consistent(NDBOX *key,
default:
retval = FALSE;
}
return (retval);
return retval;
}
NDBOX *
@ -663,7 +663,7 @@ g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep)
retval = cube_union_v0(r1, r2);
*sizep = VARSIZE(retval);
return (retval);
return retval;
}
@ -729,7 +729,7 @@ cube_union_v0(NDBOX *a, NDBOX *b)
SET_POINT_BIT(result);
}
return (result);
return result;
}
Datum
@ -1058,7 +1058,7 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
int i;
if ((a == NULL) || (b == NULL))
return (FALSE);
return FALSE;
if (DIM(a) < DIM(b))
{
@ -1070,9 +1070,9 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
for (i = DIM(a); i < DIM(b); i++)
{
if (LL_COORD(b, i) != 0)
return (FALSE);
return FALSE;
if (UR_COORD(b, i) != 0)
return (FALSE);
return FALSE;
}
}
@ -1081,13 +1081,13 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) >
Min(LL_COORD(b, i), UR_COORD(b, i)))
return (FALSE);
return FALSE;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) <
Max(LL_COORD(b, i), UR_COORD(b, i)))
return (FALSE);
return FALSE;
}
return (TRUE);
return TRUE;
}
Datum
@ -1128,7 +1128,7 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
int i;
if ((a == NULL) || (b == NULL))
return (FALSE);
return FALSE;
/* swap the box pointers if needed */
if (DIM(a) < DIM(b))
@ -1143,21 +1143,21 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
for (i = 0; i < DIM(b); i++)
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Max(LL_COORD(b, i), UR_COORD(b, i)))
return (FALSE);
return FALSE;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Min(LL_COORD(b, i), UR_COORD(b, i)))
return (FALSE);
return FALSE;
}
/* compare to zero those dimensions in (a) absent in (b) */
for (i = DIM(b); i < DIM(a); i++)
{
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > 0)
return (FALSE);
return FALSE;
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < 0)
return (FALSE);
return FALSE;
}
return (TRUE);
return TRUE;
}
@ -1385,7 +1385,7 @@ distance_1D(double a1, double a2, double b1, double b2)
return (Min(a1, a2) - Max(b1, b2));
/* the rest are all sorts of intersections */
return (0.0);
return 0.0;
}
/* Test if a box is also a point */

View File

@ -2217,7 +2217,7 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
}
appendStringInfoChar(&buf, ')');
return (buf.data);
return buf.data;
}
static char *
@ -2254,7 +2254,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
appendStringInfoString(&buf, " IS NULL");
}
return (buf.data);
return buf.data;
}
static char *
@ -2341,7 +2341,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
appendStringInfoString(&buf, " IS NULL");
}
return (buf.data);
return buf.data;
}
/*
@ -2549,9 +2549,9 @@ getConnectionByName(const char *name)
key, HASH_FIND, NULL);
if (hentry)
return (hentry->rconn);
return hentry->rconn;
return (NULL);
return NULL;
}
static HTAB *

View File

@ -245,7 +245,7 @@ checkcondition_arr(void *checkval, ITEM *item)
{
StopMiddle = StopLow + (StopHigh - StopLow) / 2;
if (*StopMiddle == item->val)
return (true);
return true;
else if (*StopMiddle < item->val)
StopLow = StopMiddle + 1;
else
@ -274,7 +274,7 @@ execute(ITEM *curitem, void *checkval, bool calcnot,
return (*chkcond) (checkval, curitem);
else if (curitem->val == (int32) '!')
{
return (calcnot) ?
return calcnot ?
((execute(curitem - 1, checkval, calcnot, chkcond)) ? false : true)
: true;
}

View File

@ -26,7 +26,7 @@ ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void
return (*chkcond) (checkval, curitem);
else if (curitem->val == (int32) '!')
{
return (calcnot) ?
return calcnot ?
((ltree_execute(curitem + 1, checkval, calcnot, chkcond)) ? false : true)
: true;
}

View File

@ -206,18 +206,18 @@ static inline int
ascii_to_bin(char ch)
{
if (ch > 'z')
return (0);
return 0;
if (ch >= 'a')
return (ch - 'a' + 38);
if (ch > 'Z')
return (0);
return 0;
if (ch >= 'A')
return (ch - 'A' + 12);
if (ch > '9')
return (0);
return 0;
if (ch >= '.')
return (ch - '.');
return (0);
return 0;
}
static void
@ -420,7 +420,7 @@ des_setkey(const char *key)
* (which is weak and has bad parity anyway) in order to simplify the
* starting conditions.
*/
return (0);
return 0;
}
old_rawkey0 = rawkey0;
old_rawkey1 = rawkey1;
@ -479,7 +479,7 @@ des_setkey(const char *key)
| comp_maskr[6][(t1 >> 7) & 0x7f]
| comp_maskr[7][t1 & 0x7f];
}
return (0);
return 0;
}
static int
@ -500,7 +500,7 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count)
int round;
if (count == 0)
return (1);
return 1;
else if (count > 0)
{
/*
@ -613,7 +613,7 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count)
| fp_maskr[5][(r >> 16) & 0xff]
| fp_maskr[6][(r >> 8) & 0xff]
| fp_maskr[7][r & 0xff];
return (0);
return 0;
}
static int
@ -639,7 +639,7 @@ des_cipher(const char *in, char *out, long salt, int count)
retval = do_des(rawl, rawr, &l_out, &r_out, count);
if (retval)
return (retval);
return retval;
buffer[0] = htonl(l_out);
buffer[1] = htonl(r_out);
@ -647,7 +647,7 @@ des_cipher(const char *in, char *out, long salt, int count)
/* copy data to avoid assuming output is word-aligned */
memcpy(out, buffer, sizeof(buffer));
return (retval);
return retval;
}
char *
@ -680,7 +680,7 @@ px_crypt_des(const char *key, const char *setting)
key++;
}
if (des_setkey((char *) keybuf))
return (NULL);
return NULL;
#ifndef DISABLE_XDES
if (*setting == _PASSWORD_EFMT1)
@ -711,7 +711,7 @@ px_crypt_des(const char *key, const char *setting)
* Encrypt the key with itself.
*/
if (des_cipher((char *) keybuf, (char *) keybuf, 0L, 1))
return (NULL);
return NULL;
/*
* And XOR with the next 8 characters of the key.
@ -721,7 +721,7 @@ px_crypt_des(const char *key, const char *setting)
*q++ ^= *key++ << 1;
if (des_setkey((char *) keybuf))
return (NULL);
return NULL;
}
StrNCpy(output, setting, 10);
@ -767,7 +767,7 @@ px_crypt_des(const char *key, const char *setting)
* Do it.
*/
if (do_des(0L, 0L, &r0, &r1, count))
return (NULL);
return NULL;
/*
* Now encode the result...
@ -790,5 +790,5 @@ px_crypt_des(const char *key, const char *setting)
*p++ = _crypt_a64[l & 0x3f];
*p = 0;
return (output);
return output;
}

View File

@ -568,7 +568,7 @@ pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo)
tuple = heap_form_tuple(tupleDesc, values, nulls);
result = HeapTupleGetDatum(tuple);
return (result);
return result;
}
/* ------------------------------------------------------

View File

@ -528,7 +528,7 @@ gseg_binary_union(Datum r1, Datum r2, int *sizep)
retval = DirectFunctionCall2(seg_union, r1, r2);
*sizep = sizeof(SEG);
return (retval);
return retval;
}
@ -1040,7 +1040,7 @@ restore(char *result, float val, int n)
/* ... this is not done yet. */
}
return (strlen(result));
return strlen(result);
}
@ -1080,7 +1080,7 @@ significant_digits(char *s)
}
if (!n)
return (zeroes);
return zeroes;
return (n);
return n;
}

View File

@ -636,5 +636,5 @@ find_plan(char *ident, EPlan **eplan, int *nplans)
newp->splan = NULL;
(*nplans)++;
return (newp);
return newp;
}

View File

@ -517,7 +517,7 @@ findTTStatus(char *name)
AbsoluteTime
currabstime()
{
return (GetCurrentAbsoluteTime());
return GetCurrentAbsoluteTime();
}
*/
@ -549,5 +549,5 @@ find_plan(char *ident, EPlan **eplan, int *nplans)
newp->splan = NULL;
(*nplans)++;
return (newp);
return newp;
}