Skip to content

Commit fb627b7

Browse files
author
Neil Conway
committed
Cosmetic code cleanup: fix a bunch of places that used "return (expr);"
rather than "return expr;" -- the latter style is used in most of the tree. I kept the parentheses when they were necessary or useful because the return expression was complex.
1 parent 762bcbd commit fb627b7

File tree

19 files changed

+68
-68
lines changed

19 files changed

+68
-68
lines changed

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.205 2005/11/26 05:03:06 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.206 2006/01/11 08:43:11 neilc Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -2796,7 +2796,7 @@ log_heap_clean(Relation reln, Buffer buffer, OffsetNumber *unused, int uncnt)
27962796

27972797
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_CLEAN, rdata);
27982798

2799-
return (recptr);
2799+
return recptr;
28002800
}
28012801

28022802
static XLogRecPtr
@@ -2884,14 +2884,14 @@ log_heap_update(Relation reln, Buffer oldbuf, ItemPointerData from,
28842884

28852885
recptr = XLogInsert(RM_HEAP_ID, info, rdata);
28862886

2887-
return (recptr);
2887+
return recptr;
28882888
}
28892889

28902890
XLogRecPtr
28912891
log_heap_move(Relation reln, Buffer oldbuf, ItemPointerData from,
28922892
Buffer newbuf, HeapTuple newtup)
28932893
{
2894-
return (log_heap_update(reln, oldbuf, from, newbuf, newtup, true));
2894+
return log_heap_update(reln, oldbuf, from, newbuf, newtup, true);
28952895
}
28962896

28972897
static void

src/backend/access/heap/tuptoaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.57 2005/12/03 05:50:59 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.58 2006/01/11 08:43:11 neilc Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -182,7 +182,7 @@ heap_tuple_untoast_attr_slice(varattrib *attr, int32 sliceoffset, int32 slicelen
182182
if (VARATT_IS_EXTERNAL(attr))
183183
{
184184
/* fast path */
185-
return (toast_fetch_datum_slice(attr, sliceoffset, slicelength));
185+
return toast_fetch_datum_slice(attr, sliceoffset, slicelength);
186186
}
187187
else
188188
preslice = attr;
@@ -1338,7 +1338,7 @@ toast_fetch_datum_slice(varattrib *attr, int32 sliceoffset, int32 length)
13381338
VARATT_SIZEP(result) |= VARATT_FLAG_COMPRESSED;
13391339

13401340
if (length == 0)
1341-
return (result); /* Can save a lot of work at this point! */
1341+
return result; /* Can save a lot of work at this point! */
13421342

13431343
startchunk = sliceoffset / TOAST_MAX_CHUNK_SIZE;
13441344
endchunk = (sliceoffset + length - 1) / TOAST_MAX_CHUNK_SIZE;

src/backend/access/nbtree/nbtinsert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.129 2005/11/22 18:17:06 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.130 2006/01/11 08:43:11 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1498,7 +1498,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
14981498
/* write and let go of metapage buffer */
14991499
_bt_wrtbuf(rel, metabuf);
15001500

1501-
return (rootbuf);
1501+
return rootbuf;
15021502
}
15031503

15041504
/*

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.225 2005/12/29 18:08:05 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.226 2006/01/11 08:43:12 neilc Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -561,7 +561,7 @@ XLogInsert(RmgrId rmid, uint8 info, XLogRecData *rdata)
561561
{
562562
RecPtr.xlogid = 0;
563563
RecPtr.xrecoff = SizeOfXLogLongPHD; /* start of 1st chkpt record */
564-
return (RecPtr);
564+
return RecPtr;
565565
}
566566

567567
/*
@@ -953,7 +953,7 @@ begin:;
953953

954954
END_CRIT_SECTION();
955955

956-
return (RecPtr);
956+
return RecPtr;
957957
}
958958

959959
/*
@@ -1742,7 +1742,7 @@ XLogFileInit(uint32 log, uint32 seg,
17421742
path, log, seg)));
17431743
}
17441744
else
1745-
return (fd);
1745+
return fd;
17461746
}
17471747

17481748
/*
@@ -1834,7 +1834,7 @@ XLogFileInit(uint32 log, uint32 seg,
18341834
errmsg("could not open file \"%s\" (log file %u, segment %u): %m",
18351835
path, log, seg)));
18361836

1837-
return (fd);
1837+
return fd;
18381838
}
18391839

18401840
/*

src/backend/access/transam/xlogutils.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.39 2005/10/15 02:49:11 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.40 2006/01/11 08:43:12 neilc Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -51,13 +51,13 @@ XLogReadBuffer(bool extend, Relation reln, BlockNumber blkno)
5151
}
5252
if (buffer != InvalidBuffer)
5353
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
54-
return (buffer);
54+
return buffer;
5555
}
5656

5757
buffer = ReadBuffer(reln, blkno);
5858
if (buffer != InvalidBuffer)
5959
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
60-
return (buffer);
60+
return buffer;
6161
}
6262

6363

@@ -141,7 +141,7 @@ _xl_new_reldesc(void)
141141
if (_xlast < _xlcnt)
142142
{
143143
_xlrelarr[_xlast].reldata.rd_rel = &(_xlpgcarr[_xlast]);
144-
return (&(_xlrelarr[_xlast]));
144+
return &(_xlrelarr[_xlast]);
145145
}
146146

147147
/* reuse */
@@ -150,7 +150,7 @@ _xl_new_reldesc(void)
150150
_xl_remove_hash_entry(res);
151151

152152
_xlast--;
153-
return (res);
153+
return res;
154154
}
155155

156156

@@ -249,7 +249,7 @@ XLogOpenRelation(RelFileNode rnode)
249249
_xlrelarr[0].lessRecently = res;
250250
res->lessRecently->moreRecently = res;
251251

252-
return (&(res->reldata));
252+
return &(res->reldata);
253253
}
254254

255255
/*

src/backend/executor/execMain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.263 2006/01/07 22:30:43 tgl Exp $
29+
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.264 2006/01/11 08:43:12 neilc Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -1231,7 +1231,7 @@ lnext: ;
12311231
default:
12321232
elog(ERROR, "unrecognized heap_lock_tuple status: %u",
12331233
test);
1234-
return (NULL);
1234+
return NULL;
12351235
}
12361236
}
12371237
}
@@ -2109,7 +2109,7 @@ lpqnext:;
21092109
epq->rti = 0;
21102110
estate->es_useEvalPlan = false;
21112111
/* and continue Query execution */
2112-
return (NULL);
2112+
return NULL;
21132113
}
21142114
Assert(oldepq->rti != 0);
21152115
/* push current PQ to freePQ stack */
@@ -2119,7 +2119,7 @@ lpqnext:;
21192119
goto lpqnext;
21202120
}
21212121

2122-
return (slot);
2122+
return slot;
21232123
}
21242124

21252125
static void

src/backend/libpq/be-secure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.60 2005/11/22 18:17:11 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.61 2006/01/11 08:43:12 neilc Exp $
1515
*
1616
* Since the server static private key ($DataDir/server.key)
1717
* will normally be stored unencrypted so that the database
@@ -486,7 +486,7 @@ my_SSL_set_fd(SSL *s, int fd)
486486
SSL_set_bio(s, bio, bio);
487487
ret = 1;
488488
err:
489-
return (ret);
489+
return ret;
490490
}
491491

492492
/*

src/backend/utils/adt/like.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/utils/adt/like.c,v 1.62 2005/10/15 02:49:28 momjian Exp $
14+
* $PostgreSQL: pgsql/src/backend/utils/adt/like.c,v 1.63 2006/01/11 08:43:12 neilc Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -49,19 +49,19 @@ wchareq(char *p1, char *p2)
4949

5050
/* Optimization: quickly compare the first byte. */
5151
if (*p1 != *p2)
52-
return (0);
52+
return 0;
5353

5454
p1_len = pg_mblen(p1);
5555
if (pg_mblen(p2) != p1_len)
56-
return (0);
56+
return 0;
5757

5858
/* They are the same length */
5959
while (p1_len--)
6060
{
6161
if (*p1++ != *p2++)
62-
return (0);
62+
return 0;
6363
}
64-
return (1);
64+
return 1;
6565
}
6666

6767
/*--------------------
@@ -91,7 +91,7 @@ iwchareq(char *p1, char *p2)
9191
* different characters
9292
*/
9393
else if ((unsigned char) *p1 < CHARMAX || (unsigned char) *p2 < CHARMAX)
94-
return (0);
94+
return 0;
9595

9696
/*
9797
* ok, p1 and p2 are both > CHARMAX, then they must be multibyte

src/backend/utils/adt/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* PostgreSQL type definitions for MAC addresses.
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/mac.c,v 1.35 2005/10/15 02:49:28 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/mac.c,v 1.36 2006/01/11 08:43:12 neilc Exp $
55
*/
66

77
#include "postgres.h"
@@ -194,7 +194,7 @@ text_macaddr(PG_FUNCTION_ARGS)
194194

195195
result = DirectFunctionCall1(macaddr_in, CStringGetDatum(str));
196196

197-
return (result);
197+
return result;
198198
}
199199

200200
/*

src/backend/utils/adt/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* PostgreSQL type definitions for the INET and CIDR types.
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.57 2005/12/25 02:14:17 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.58 2006/01/11 08:43:12 neilc Exp $
55
*
66
* Jon Postel RIP 16 Oct 1998
77
*/
@@ -898,7 +898,7 @@ bitncmp(void *l, void *r, int n)
898898
b = n / 8;
899899
x = memcmp(l, r, b);
900900
if (x)
901-
return (x);
901+
return x;
902902

903903
lb = ((const u_char *) l)[b];
904904
rb = ((const u_char *) r)[b];

src/backend/utils/mb/encnames.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Encoding names and routines for work with it. All
33
* in this file is shared bedween FE and BE.
44
*
5-
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.26 2005/10/15 02:49:33 momjian Exp $
5+
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.27 2006/01/11 08:43:12 neilc Exp $
66
*/
77
#ifdef FRONTEND
88
#include "postgres_fe.h"
@@ -490,7 +490,7 @@ pg_char_to_encoding(const char *s)
490490
pg_encname *p = NULL;
491491

492492
if (!s)
493-
return (-1);
493+
return -1;
494494

495495
p = pg_char_to_encname_struct(s);
496496
return p ? p->encoding : -1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy