mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/like.c,v 1.62 2005/10/15 02:49:28 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/like.c,v 1.63 2006/01/11 08:43:12 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PostgreSQL type definitions for MAC addresses.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/mac.c,v 1.35 2005/10/15 02:49:28 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/mac.c,v 1.36 2006/01/11 08:43:12 neilc Exp $
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
@ -194,7 +194,7 @@ text_macaddr(PG_FUNCTION_ARGS)
|
||||
|
||||
result = DirectFunctionCall1(macaddr_in, CStringGetDatum(str));
|
||||
|
||||
return (result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PostgreSQL type definitions for the INET and CIDR types.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.57 2005/12/25 02:14:17 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.58 2006/01/11 08:43:12 neilc Exp $
|
||||
*
|
||||
* Jon Postel RIP 16 Oct 1998
|
||||
*/
|
||||
@ -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];
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Encoding names and routines for work with it. All
|
||||
* in this file is shared bedween FE and BE.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.26 2005/10/15 02:49:33 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.27 2006/01/11 08:43:12 neilc Exp $
|
||||
*/
|
||||
#ifdef FRONTEND
|
||||
#include "postgres_fe.h"
|
||||
@ -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;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* (currently mule internal code (mic) is used)
|
||||
* Tatsuo Ishii
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.53 2006/01/11 06:59:22 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.54 2006/01/11 08:43:12 neilc Exp $
|
||||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
@ -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
|
||||
|
Reference in New Issue
Block a user