Skip to content

Commit 17273d0

Browse files
committed
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 <[email protected]> Reviewed-by: Ryan Murphy <[email protected]>
1 parent ba26f5c commit 17273d0

File tree

99 files changed

+469
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+469
-469
lines changed

contrib/btree_gist/btree_utils_num.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ gbt_num_consistent(const GBT_NUMKEY_R *key,
296296
retval = false;
297297
}
298298

299-
return (retval);
299+
return retval;
300300
}
301301

302302

contrib/btree_gist/btree_utils_var.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
159159
l--;
160160
i++;
161161
}
162-
return (ml); /* lower == upper */
162+
return ml; /* lower == upper */
163163
}
164164

165165

@@ -299,7 +299,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo)
299299
else
300300
retval = entry;
301301

302-
return (retval);
302+
return retval;
303303
}
304304

305305

contrib/cube/cube.c

+17-17
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ g_cube_leaf_consistent(NDBOX *key,
625625
default:
626626
retval = FALSE;
627627
}
628-
return (retval);
628+
return retval;
629629
}
630630

631631
bool
@@ -652,7 +652,7 @@ g_cube_internal_consistent(NDBOX *key,
652652
default:
653653
retval = FALSE;
654654
}
655-
return (retval);
655+
return retval;
656656
}
657657

658658
NDBOX *
@@ -663,7 +663,7 @@ g_cube_binary_union(NDBOX *r1, NDBOX *r2, int *sizep)
663663
retval = cube_union_v0(r1, r2);
664664
*sizep = VARSIZE(retval);
665665

666-
return (retval);
666+
return retval;
667667
}
668668

669669

@@ -729,7 +729,7 @@ cube_union_v0(NDBOX *a, NDBOX *b)
729729
SET_POINT_BIT(result);
730730
}
731731

732-
return (result);
732+
return result;
733733
}
734734

735735
Datum
@@ -1058,7 +1058,7 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10581058
int i;
10591059

10601060
if ((a == NULL) || (b == NULL))
1061-
return (FALSE);
1061+
return FALSE;
10621062

10631063
if (DIM(a) < DIM(b))
10641064
{
@@ -1070,9 +1070,9 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10701070
for (i = DIM(a); i < DIM(b); i++)
10711071
{
10721072
if (LL_COORD(b, i) != 0)
1073-
return (FALSE);
1073+
return FALSE;
10741074
if (UR_COORD(b, i) != 0)
1075-
return (FALSE);
1075+
return FALSE;
10761076
}
10771077
}
10781078

@@ -1081,13 +1081,13 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10811081
{
10821082
if (Min(LL_COORD(a, i), UR_COORD(a, i)) >
10831083
Min(LL_COORD(b, i), UR_COORD(b, i)))
1084-
return (FALSE);
1084+
return FALSE;
10851085
if (Max(LL_COORD(a, i), UR_COORD(a, i)) <
10861086
Max(LL_COORD(b, i), UR_COORD(b, i)))
1087-
return (FALSE);
1087+
return FALSE;
10881088
}
10891089

1090-
return (TRUE);
1090+
return TRUE;
10911091
}
10921092

10931093
Datum
@@ -1128,7 +1128,7 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
11281128
int i;
11291129

11301130
if ((a == NULL) || (b == NULL))
1131-
return (FALSE);
1131+
return FALSE;
11321132

11331133
/* swap the box pointers if needed */
11341134
if (DIM(a) < DIM(b))
@@ -1143,21 +1143,21 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
11431143
for (i = 0; i < DIM(b); i++)
11441144
{
11451145
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Max(LL_COORD(b, i), UR_COORD(b, i)))
1146-
return (FALSE);
1146+
return FALSE;
11471147
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Min(LL_COORD(b, i), UR_COORD(b, i)))
1148-
return (FALSE);
1148+
return FALSE;
11491149
}
11501150

11511151
/* compare to zero those dimensions in (a) absent in (b) */
11521152
for (i = DIM(b); i < DIM(a); i++)
11531153
{
11541154
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > 0)
1155-
return (FALSE);
1155+
return FALSE;
11561156
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < 0)
1157-
return (FALSE);
1157+
return FALSE;
11581158
}
11591159

1160-
return (TRUE);
1160+
return TRUE;
11611161
}
11621162

11631163

@@ -1385,7 +1385,7 @@ distance_1D(double a1, double a2, double b1, double b2)
13851385
return (Min(a1, a2) - Max(b1, b2));
13861386

13871387
/* the rest are all sorts of intersections */
1388-
return (0.0);
1388+
return 0.0;
13891389
}
13901390

13911391
/* Test if a box is also a point */

contrib/dblink/dblink.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
22172217
}
22182218
appendStringInfoChar(&buf, ')');
22192219

2220-
return (buf.data);
2220+
return buf.data;
22212221
}
22222222

22232223
static char *
@@ -2254,7 +2254,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
22542254
appendStringInfoString(&buf, " IS NULL");
22552255
}
22562256

2257-
return (buf.data);
2257+
return buf.data;
22582258
}
22592259

22602260
static char *
@@ -2341,7 +2341,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
23412341
appendStringInfoString(&buf, " IS NULL");
23422342
}
23432343

2344-
return (buf.data);
2344+
return buf.data;
23452345
}
23462346

23472347
/*
@@ -2549,9 +2549,9 @@ getConnectionByName(const char *name)
25492549
key, HASH_FIND, NULL);
25502550

25512551
if (hentry)
2552-
return (hentry->rconn);
2552+
return hentry->rconn;
25532553

2554-
return (NULL);
2554+
return NULL;
25552555
}
25562556

25572557
static HTAB *

contrib/intarray/_int_bool.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ checkcondition_arr(void *checkval, ITEM *item)
245245
{
246246
StopMiddle = StopLow + (StopHigh - StopLow) / 2;
247247
if (*StopMiddle == item->val)
248-
return (true);
248+
return true;
249249
else if (*StopMiddle < item->val)
250250
StopLow = StopMiddle + 1;
251251
else
@@ -274,7 +274,7 @@ execute(ITEM *curitem, void *checkval, bool calcnot,
274274
return (*chkcond) (checkval, curitem);
275275
else if (curitem->val == (int32) '!')
276276
{
277-
return (calcnot) ?
277+
return calcnot ?
278278
((execute(curitem - 1, checkval, calcnot, chkcond)) ? false : true)
279279
: true;
280280
}

contrib/ltree/ltxtquery_op.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool (*chkcond) (void
2626
return (*chkcond) (checkval, curitem);
2727
else if (curitem->val == (int32) '!')
2828
{
29-
return (calcnot) ?
29+
return calcnot ?
3030
((ltree_execute(curitem + 1, checkval, calcnot, chkcond)) ? false : true)
3131
: true;
3232
}

contrib/pgcrypto/crypt-des.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,18 @@ static inline int
206206
ascii_to_bin(char ch)
207207
{
208208
if (ch > 'z')
209-
return (0);
209+
return 0;
210210
if (ch >= 'a')
211211
return (ch - 'a' + 38);
212212
if (ch > 'Z')
213-
return (0);
213+
return 0;
214214
if (ch >= 'A')
215215
return (ch - 'A' + 12);
216216
if (ch > '9')
217-
return (0);
217+
return 0;
218218
if (ch >= '.')
219219
return (ch - '.');
220-
return (0);
220+
return 0;
221221
}
222222

223223
static void
@@ -420,7 +420,7 @@ des_setkey(const char *key)
420420
* (which is weak and has bad parity anyway) in order to simplify the
421421
* starting conditions.
422422
*/
423-
return (0);
423+
return 0;
424424
}
425425
old_rawkey0 = rawkey0;
426426
old_rawkey1 = rawkey1;
@@ -479,7 +479,7 @@ des_setkey(const char *key)
479479
| comp_maskr[6][(t1 >> 7) & 0x7f]
480480
| comp_maskr[7][t1 & 0x7f];
481481
}
482-
return (0);
482+
return 0;
483483
}
484484

485485
static int
@@ -500,7 +500,7 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count)
500500
int round;
501501

502502
if (count == 0)
503-
return (1);
503+
return 1;
504504
else if (count > 0)
505505
{
506506
/*
@@ -613,7 +613,7 @@ do_des(uint32 l_in, uint32 r_in, uint32 *l_out, uint32 *r_out, int count)
613613
| fp_maskr[5][(r >> 16) & 0xff]
614614
| fp_maskr[6][(r >> 8) & 0xff]
615615
| fp_maskr[7][r & 0xff];
616-
return (0);
616+
return 0;
617617
}
618618

619619
static int
@@ -639,15 +639,15 @@ des_cipher(const char *in, char *out, long salt, int count)
639639

640640
retval = do_des(rawl, rawr, &l_out, &r_out, count);
641641
if (retval)
642-
return (retval);
642+
return retval;
643643

644644
buffer[0] = htonl(l_out);
645645
buffer[1] = htonl(r_out);
646646

647647
/* copy data to avoid assuming output is word-aligned */
648648
memcpy(out, buffer, sizeof(buffer));
649649

650-
return (retval);
650+
return retval;
651651
}
652652

653653
char *
@@ -680,7 +680,7 @@ px_crypt_des(const char *key, const char *setting)
680680
key++;
681681
}
682682
if (des_setkey((char *) keybuf))
683-
return (NULL);
683+
return NULL;
684684

685685
#ifndef DISABLE_XDES
686686
if (*setting == _PASSWORD_EFMT1)
@@ -711,7 +711,7 @@ px_crypt_des(const char *key, const char *setting)
711711
* Encrypt the key with itself.
712712
*/
713713
if (des_cipher((char *) keybuf, (char *) keybuf, 0L, 1))
714-
return (NULL);
714+
return NULL;
715715

716716
/*
717717
* And XOR with the next 8 characters of the key.
@@ -721,7 +721,7 @@ px_crypt_des(const char *key, const char *setting)
721721
*q++ ^= *key++ << 1;
722722

723723
if (des_setkey((char *) keybuf))
724-
return (NULL);
724+
return NULL;
725725
}
726726
StrNCpy(output, setting, 10);
727727

@@ -767,7 +767,7 @@ px_crypt_des(const char *key, const char *setting)
767767
* Do it.
768768
*/
769769
if (do_des(0L, 0L, &r0, &r1, count))
770-
return (NULL);
770+
return NULL;
771771

772772
/*
773773
* Now encode the result...
@@ -790,5 +790,5 @@ px_crypt_des(const char *key, const char *setting)
790790
*p++ = _crypt_a64[l & 0x3f];
791791
*p = 0;
792792

793-
return (output);
793+
return output;
794794
}

contrib/pgstattuple/pgstatindex.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo)
568568
tuple = heap_form_tuple(tupleDesc, values, nulls);
569569
result = HeapTupleGetDatum(tuple);
570570

571-
return (result);
571+
return result;
572572
}
573573

574574
/* ------------------------------------------------------

contrib/seg/seg.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ gseg_binary_union(Datum r1, Datum r2, int *sizep)
528528
retval = DirectFunctionCall2(seg_union, r1, r2);
529529
*sizep = sizeof(SEG);
530530

531-
return (retval);
531+
return retval;
532532
}
533533

534534

@@ -1040,7 +1040,7 @@ restore(char *result, float val, int n)
10401040

10411041
/* ... this is not done yet. */
10421042
}
1043-
return (strlen(result));
1043+
return strlen(result);
10441044
}
10451045

10461046

@@ -1080,7 +1080,7 @@ significant_digits(char *s)
10801080
}
10811081

10821082
if (!n)
1083-
return (zeroes);
1083+
return zeroes;
10841084

1085-
return (n);
1085+
return n;
10861086
}

contrib/spi/refint.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,5 +636,5 @@ find_plan(char *ident, EPlan **eplan, int *nplans)
636636
newp->splan = NULL;
637637
(*nplans)++;
638638

639-
return (newp);
639+
return newp;
640640
}

contrib/spi/timetravel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ findTTStatus(char *name)
517517
AbsoluteTime
518518
currabstime()
519519
{
520-
return (GetCurrentAbsoluteTime());
520+
return GetCurrentAbsoluteTime();
521521
}
522522
*/
523523

@@ -549,5 +549,5 @@ find_plan(char *ident, EPlan **eplan, int *nplans)
549549
newp->splan = NULL;
550550
(*nplans)++;
551551

552-
return (newp);
552+
return newp;
553553
}

0 commit comments

Comments
 (0)