summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway2006-01-11 08:43:13 +0000
committerNeil Conway2006-01-11 08:43:13 +0000
commit7e0a5dd6d74c6b70ed7e7c1d28c33e3d5d793e17 (patch)
treebe505fd852087224c84d2a7c93b6959e2bbc809f
parent882af70dac5a6fbd644a048b6a93cccea8e0f949 (diff)
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.
-rw-r--r--src/backend/access/heap/heapam.c6
-rw-r--r--src/backend/access/heap/tuptoaster.c4
-rw-r--r--src/backend/access/nbtree/nbtinsert.c2
-rw-r--r--src/backend/access/transam/xlog.c8
-rw-r--r--src/backend/access/transam/xlogutils.c10
-rw-r--r--src/backend/executor/execMain.c6
-rw-r--r--src/backend/libpq/be-secure.c2
-rw-r--r--src/backend/utils/adt/like.c10
-rw-r--r--src/backend/utils/adt/mac.c2
-rw-r--r--src/backend/utils/adt/network.c2
-rw-r--r--src/backend/utils/mb/encnames.c2
-rw-r--r--src/backend/utils/mb/mbutils.c18
-rw-r--r--src/bin/psql/tab-complete.c2
-rw-r--r--src/interfaces/libpq/fe-connect.c2
-rw-r--r--src/interfaces/libpq/fe-exec.c8
-rw-r--r--src/interfaces/libpq/fe-misc.c6
-rw-r--r--src/interfaces/libpq/fe-protocol2.c4
-rw-r--r--src/interfaces/libpq/fe-protocol3.c4
-rw-r--r--src/tutorial/funcs.c2
19 files changed, 50 insertions, 50 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 29080fe240..32b6b39dfe 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -2796,7 +2796,7 @@ log_heap_clean(Relation reln, Buffer buffer, OffsetNumber *unused, int uncnt)
recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_CLEAN, rdata);
- return (recptr);
+ return recptr;
}
static XLogRecPtr
@@ -2884,14 +2884,14 @@ log_heap_update(Relation reln, Buffer oldbuf, ItemPointerData from,
recptr = XLogInsert(RM_HEAP_ID, info, rdata);
- return (recptr);
+ return recptr;
}
XLogRecPtr
log_heap_move(Relation reln, Buffer oldbuf, ItemPointerData from,
Buffer newbuf, HeapTuple newtup)
{
- return (log_heap_update(reln, oldbuf, from, newbuf, newtup, true));
+ return log_heap_update(reln, oldbuf, from, newbuf, newtup, true);
}
static void
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
index cfb59d91f0..1866af5e34 100644
--- a/src/backend/access/heap/tuptoaster.c
+++ b/src/backend/access/heap/tuptoaster.c
@@ -182,7 +182,7 @@ heap_tuple_untoast_attr_slice(varattrib *attr, int32 sliceoffset, int32 slicelen
if (VARATT_IS_EXTERNAL(attr))
{
/* fast path */
- return (toast_fetch_datum_slice(attr, sliceoffset, slicelength));
+ return toast_fetch_datum_slice(attr, sliceoffset, slicelength);
}
else
preslice = attr;
@@ -1338,7 +1338,7 @@ toast_fetch_datum_slice(varattrib *attr, int32 sliceoffset, int32 length)
VARATT_SIZEP(result) |= VARATT_FLAG_COMPRESSED;
if (length == 0)
- return (result); /* Can save a lot of work at this point! */
+ return result; /* Can save a lot of work at this point! */
startchunk = sliceoffset / TOAST_MAX_CHUNK_SIZE;
endchunk = (sliceoffset + length - 1) / TOAST_MAX_CHUNK_SIZE;
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index e00a50d45a..9bb3b150c5 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -1498,7 +1498,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
/* write and let go of metapage buffer */
_bt_wrtbuf(rel, metabuf);
- return (rootbuf);
+ return rootbuf;
}
/*
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f45e079db0..c07d7ca1f6 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -561,7 +561,7 @@ XLogInsert(RmgrId rmid, uint8 info, XLogRecData *rdata)
{
RecPtr.xlogid = 0;
RecPtr.xrecoff = SizeOfXLogLongPHD; /* start of 1st chkpt record */
- return (RecPtr);
+ return RecPtr;
}
/*
@@ -953,7 +953,7 @@ begin:;
END_CRIT_SECTION();
- return (RecPtr);
+ return RecPtr;
}
/*
@@ -1742,7 +1742,7 @@ XLogFileInit(uint32 log, uint32 seg,
path, log, seg)));
}
else
- return (fd);
+ return fd;
}
/*
@@ -1834,7 +1834,7 @@ XLogFileInit(uint32 log, uint32 seg,
errmsg("could not open file \"%s\" (log file %u, segment %u): %m",
path, log, seg)));
- return (fd);
+ return fd;
}
/*
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index bab1c9ddc6..8fbf43e6a8 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -51,13 +51,13 @@ XLogReadBuffer(bool extend, Relation reln, BlockNumber blkno)
}
if (buffer != InvalidBuffer)
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
- return (buffer);
+ return buffer;
}
buffer = ReadBuffer(reln, blkno);
if (buffer != InvalidBuffer)
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
- return (buffer);
+ return buffer;
}
@@ -141,7 +141,7 @@ _xl_new_reldesc(void)
if (_xlast < _xlcnt)
{
_xlrelarr[_xlast].reldata.rd_rel = &(_xlpgcarr[_xlast]);
- return (&(_xlrelarr[_xlast]));
+ return &(_xlrelarr[_xlast]);
}
/* reuse */
@@ -150,7 +150,7 @@ _xl_new_reldesc(void)
_xl_remove_hash_entry(res);
_xlast--;
- return (res);
+ return res;
}
@@ -249,7 +249,7 @@ XLogOpenRelation(RelFileNode rnode)
_xlrelarr[0].lessRecently = res;
res->lessRecently->moreRecently = res;
- return (&(res->reldata));
+ return &(res->reldata);
}
/*
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 101014a7f6..47c11248c1 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -1231,7 +1231,7 @@ lnext: ;
default:
elog(ERROR, "unrecognized heap_lock_tuple status: %u",
test);
- return (NULL);
+ return NULL;
}
}
}
@@ -2109,7 +2109,7 @@ lpqnext:;
epq->rti = 0;
estate->es_useEvalPlan = false;
/* and continue Query execution */
- return (NULL);
+ return NULL;
}
Assert(oldepq->rti != 0);
/* push current PQ to freePQ stack */
@@ -2119,7 +2119,7 @@ lpqnext:;
goto lpqnext;
}
- return (slot);
+ return slot;
}
static void
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c
index 8539e9a97a..ab408a5d2d 100644
--- a/src/backend/libpq/be-secure.c
+++ b/src/backend/libpq/be-secure.c
@@ -486,7 +486,7 @@ my_SSL_set_fd(SSL *s, int fd)
SSL_set_bio(s, bio, bio);
ret = 1;
err:
- return (ret);
+ return ret;
}
/*
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index 3fc2fca7f1..408623b457 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -49,19 +49,19 @@ wchareq(char *p1, char *p2)
/* Optimization: quickly compare the first byte. */
if (*p1 != *p2)
- return (0);
+ return 0;
p1_len = pg_mblen(p1);
if (pg_mblen(p2) != p1_len)
- return (0);
+ return 0;
/* They are the same length */
while (p1_len--)
{
if (*p1++ != *p2++)
- return (0);
+ return 0;
}
- return (1);
+ return 1;
}
/*--------------------
@@ -91,7 +91,7 @@ iwchareq(char *p1, char *p2)
* different characters
*/
else if ((unsigned char) *p1 < CHARMAX || (unsigned char) *p2 < CHARMAX)
- return (0);
+ return 0;
/*
* ok, p1 and p2 are both > CHARMAX, then they must be multibyte
diff --git a/src/backend/utils/adt/mac.c b/src/backend/utils/adt/mac.c
index e993e2dbd7..8b1638efab 100644
--- a/src/backend/utils/adt/mac.c
+++ b/src/backend/utils/adt/mac.c
@@ -194,7 +194,7 @@ text_macaddr(PG_FUNCTION_ARGS)
result = DirectFunctionCall1(macaddr_in, CStringGetDatum(str));
- return (result);
+ return result;
}
/*
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c
index 564a4aaa1e..f08621b2ff 100644
--- a/src/backend/utils/adt/network.c
+++ b/src/backend/utils/adt/network.c
@@ -898,7 +898,7 @@ bitncmp(void *l, void *r, int n)
b = n / 8;
x = memcmp(l, r, b);
if (x)
- return (x);
+ return x;
lb = ((const u_char *) l)[b];
rb = ((const u_char *) r)[b];
diff --git a/src/backend/utils/mb/encnames.c b/src/backend/utils/mb/encnames.c
index a4baddd4a6..efec8c6f5b 100644
--- a/src/backend/utils/mb/encnames.c
+++ b/src/backend/utils/mb/encnames.c
@@ -490,7 +490,7 @@ pg_char_to_encoding(const char *s)
pg_encname *p = NULL;
if (!s)
- return (-1);
+ return -1;
p = pg_char_to_encname_struct(s);
return p ? p->encoding : -1;
diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c
index a1c745b6b3..77ba388c21 100644
--- a/src/backend/utils/mb/mbutils.c
+++ b/src/backend/utils/mb/mbutils.c
@@ -64,7 +64,7 @@ SetClientEncoding(int encoding, bool doit)
MemoryContext oldcontext;
if (!PG_VALID_FE_ENCODING(encoding))
- return (-1);
+ return -1;
/* Can't do anything during startup, per notes above */
if (!backend_startup_complete)
@@ -196,7 +196,7 @@ int
pg_get_client_encoding(void)
{
Assert(ClientEncoding);
- return (ClientEncoding->encoding);
+ return ClientEncoding->encoding;
}
/*
@@ -206,7 +206,7 @@ const char *
pg_get_client_encoding_name(void)
{
Assert(ClientEncoding);
- return (ClientEncoding->name);
+ return ClientEncoding->name;
}
/*
@@ -483,7 +483,7 @@ pg_mbstrlen(const char *mbstr)
mbstr += pg_mblen(mbstr);
len++;
}
- return (len);
+ return len;
}
/* returns the length (counted in wchars) of a multibyte string
@@ -506,7 +506,7 @@ pg_mbstrlen_with_len(const char *mbstr, int limit)
mbstr += l;
len++;
}
- return (len);
+ return len;
}
/*
@@ -536,7 +536,7 @@ pg_mbcliplen(const char *mbstr, int len, int limit)
len -= l;
mbstr += l;
}
- return (clen);
+ return clen;
}
/*
@@ -563,7 +563,7 @@ pg_mbcharcliplen(const char *mbstr, int len, int limit)
len -= l;
mbstr += l;
}
- return (clen);
+ return clen;
}
void
@@ -586,14 +586,14 @@ int
GetDatabaseEncoding(void)
{
Assert(DatabaseEncoding);
- return (DatabaseEncoding->encoding);
+ return DatabaseEncoding->encoding;
}
const char *
GetDatabaseEncodingName(void)
{
Assert(DatabaseEncoding);
- return (DatabaseEncoding->name);
+ return DatabaseEncoding->name;
}
Datum
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index ee57dc8ee2..ba119cc571 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2169,7 +2169,7 @@ complete_from_list(const char *text, int state)
casesensitive = false;
list_index = 0;
state++;
- return (complete_from_list(text, state));
+ return complete_from_list(text, state);
}
/* If no more matches, return null. */
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index fd1df8b7d3..931b24723d 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -2936,7 +2936,7 @@ PQsetClientEncoding(PGconn *conn, const char *encoding)
status = 0; /* everything is ok */
}
PQclear(res);
- return (status);
+ return status;
}
PGVerbosity
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index eb4cd4dce7..d8081e9bb4 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -2271,7 +2271,7 @@ PQsetnonblocking(PGconn *conn, int arg)
/* early out if the socket is already in the state requested */
if (barg == conn->nonblocking)
- return (0);
+ return 0;
/*
* to guarantee constancy for flushing/query/result-polling behavior we
@@ -2281,11 +2281,11 @@ PQsetnonblocking(PGconn *conn, int arg)
*/
/* if we are going from blocking to non-blocking flush here */
if (pqFlush(conn))
- return (-1);
+ return -1;
conn->nonblocking = barg;
- return (0);
+ return 0;
}
/*
@@ -2295,7 +2295,7 @@ PQsetnonblocking(PGconn *conn, int arg)
int
PQisnonblocking(const PGconn *conn)
{
- return (pqIsnonblocking(conn));
+ return pqIsnonblocking(conn);
}
/* try to force data out, really only useful for non-blocking users */
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index ced8e9ad04..7094ff809b 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -1090,7 +1090,7 @@ pqSocketPoll(int sock, int forRead, int forWrite, time_t end_time)
int
PQmblen(const char *s, int encoding)
{
- return (pg_encoding_mblen(encoding, s));
+ return pg_encoding_mblen(encoding, s);
}
/*
@@ -1100,7 +1100,7 @@ PQmblen(const char *s, int encoding)
int
PQdsplen(const char *s, int encoding)
{
- return (pg_encoding_dsplen(encoding, s));
+ return pg_encoding_dsplen(encoding, s);
}
/*
@@ -1115,7 +1115,7 @@ PQenv2encoding(void)
str = getenv("PGCLIENTENCODING");
if (str && *str != '\0')
encoding = pg_char_to_encoding(str);
- return (encoding);
+ return encoding;
}
diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c
index 048c727422..5678ccb594 100644
--- a/src/interfaces/libpq/fe-protocol2.c
+++ b/src/interfaces/libpq/fe-protocol2.c
@@ -1180,11 +1180,11 @@ pqEndcopy2(PGconn *conn)
* and the flush fails
*/
if (pqFlush(conn) && pqIsnonblocking(conn))
- return (1);
+ return 1;
/* non blocking connections may have to abort at this point. */
if (pqIsnonblocking(conn) && PQisBusy(conn))
- return (1);
+ return 1;
/* Return to active duty */
conn->asyncStatus = PGASYNC_BUSY;
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index 42df353582..82443d606b 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -1158,7 +1158,7 @@ pqEndcopy3(PGconn *conn)
* and the flush fails
*/
if (pqFlush(conn) && pqIsnonblocking(conn))
- return (1);
+ return 1;
/* Return to active duty */
conn->asyncStatus = PGASYNC_BUSY;
@@ -1172,7 +1172,7 @@ pqEndcopy3(PGconn *conn)
* with the CopyDone; are there corner cases where that doesn't happen?)
*/
if (pqIsnonblocking(conn) && PQisBusy(conn))
- return (1);
+ return 1;
/* Wait for the completion response */
result = PQgetResult(conn);
diff --git a/src/tutorial/funcs.c b/src/tutorial/funcs.c
index 5e8ad6ee70..a988ad431b 100644
--- a/src/tutorial/funcs.c
+++ b/src/tutorial/funcs.c
@@ -102,6 +102,6 @@ c_overpaid(HeapTupleHeader t, /* the current instance of EMP */
salary = DatumGetInt32(GetAttributeByName(t, "salary", &isnull));
if (isnull)
- return (false);
+ return false;
return salary > limit;
}