Some ereport calls have excess sets of parentheses. patch 0001 removes the ones I found in a very quick grep.
0002 removes newlines immediately following parens. These were previously useful because pgindent would move arguments further to the left so that the line would fit under 80 chars. However, pgindent no longer does that, so the newlines are pointless and ugly. These being cosmetic cleanups, they're not intended for backpatch, though an argument could be made that doing that would save some future backpatching pain. If ther are sufficient votes for that, I'm open to doing it. (Of course, 0002 would not be backpatched further back than pg10, the first release that uses the "new" pgindent rules.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>From dc31967fd68053e3c03ac70f5be231c3d0720be6 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvhe...@alvh.no-ip.org> Date: Wed, 29 Jan 2020 15:45:47 -0300 Subject: [PATCH 1/2] Remove excess parens in ereport() calls Cosmetic cleanup, not worth backpatching. --- contrib/adminpack/adminpack.c | 12 ++++++------ contrib/hstore_plperl/hstore_plperl.c | 2 +- contrib/jsonb_plperl/jsonb_plperl.c | 6 +++--- contrib/jsonb_plpython/jsonb_plpython.c | 8 ++++---- contrib/pageinspect/brinfuncs.c | 8 ++++---- contrib/pageinspect/btreefuncs.c | 8 ++++---- contrib/pageinspect/fsmfuncs.c | 2 +- contrib/pageinspect/ginfuncs.c | 6 +++--- contrib/pageinspect/hashfuncs.c | 10 +++++----- contrib/pageinspect/heapfuncs.c | 2 +- contrib/pageinspect/rawpage.c | 6 +++--- contrib/pg_prewarm/pg_prewarm.c | 4 ++-- contrib/pgstattuple/pgstatapprox.c | 2 +- contrib/pgstattuple/pgstatindex.c | 10 +++++----- contrib/pgstattuple/pgstattuple.c | 4 ++-- src/backend/access/transam/xlogfuncs.c | 4 ++-- src/backend/commands/alter.c | 8 ++++---- src/backend/commands/collationcmds.c | 2 +- src/backend/commands/createas.c | 2 +- src/backend/commands/functioncmds.c | 4 ++-- src/backend/commands/publicationcmds.c | 2 +- src/backend/commands/subscriptioncmds.c | 2 +- src/backend/commands/user.c | 4 ++-- src/backend/libpq/auth-scram.c | 8 ++++---- src/backend/libpq/be-secure-openssl.c | 6 +++--- src/backend/postmaster/syslogger.c | 4 ++-- src/backend/replication/logical/logical.c | 6 +++--- src/backend/replication/logical/logicalfuncs.c | 2 +- src/backend/replication/repl_gram.y | 4 ++-- src/backend/replication/slot.c | 2 +- src/backend/replication/slotfuncs.c | 4 ++-- src/backend/replication/walsender.c | 6 +++--- src/backend/storage/ipc/procarray.c | 4 ++-- src/backend/storage/ipc/signalfuncs.c | 14 +++++++------- src/backend/utils/adt/genfile.c | 12 ++++++------ src/backend/utils/adt/pg_upgrade_support.c | 2 +- src/backend/utils/misc/guc.c | 2 +- 37 files changed, 97 insertions(+), 97 deletions(-) diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c index 7b5a531e08..29b46aea3e 100644 --- a/contrib/adminpack/adminpack.c +++ b/contrib/adminpack/adminpack.c @@ -93,7 +93,7 @@ convert_and_check_filename(text *arg, bool logAllowed) if (path_contains_parent_reference(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("reference to parent directory (\"..\") not allowed")))); + errmsg("reference to parent directory (\"..\") not allowed"))); /* * Allow absolute paths if within DataDir or Log_directory, even @@ -104,12 +104,12 @@ convert_and_check_filename(text *arg, bool logAllowed) !path_is_prefix_of_path(Log_directory, filename))) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("absolute path not allowed")))); + errmsg("absolute path not allowed"))); } else if (!path_is_relative_and_below_cwd(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("path must be in or below the current directory")))); + errmsg("path must be in or below the current directory"))); return filename; } @@ -124,7 +124,7 @@ requireSuperuser(void) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("only superuser may access generic file functions")))); + errmsg("only superuser may access generic file functions"))); } @@ -485,7 +485,7 @@ pg_logdir_ls(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("only superuser can list the log directory")))); + errmsg("only superuser can list the log directory"))); return (pg_logdir_ls_internal(fcinfo)); } @@ -515,7 +515,7 @@ pg_logdir_ls_internal(FunctionCallInfo fcinfo) if (strcmp(Log_filename, "postgresql-%Y-%m-%d_%H%M%S.log") != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'")))); + errmsg("the log_filename parameter must equal 'postgresql-%%Y-%%m-%%d_%%H%%M%%S.log'"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/hstore_plperl/hstore_plperl.c b/contrib/hstore_plperl/hstore_plperl.c index 1316b0500b..417b721cff 100644 --- a/contrib/hstore_plperl/hstore_plperl.c +++ b/contrib/hstore_plperl/hstore_plperl.c @@ -116,7 +116,7 @@ plperl_to_hstore(PG_FUNCTION_ARGS) if (SvTYPE(in) != SVt_PVHV) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("cannot transform non-hash Perl value to hstore")))); + errmsg("cannot transform non-hash Perl value to hstore"))); hv = (HV *) in; pcount = hv_iterinit(hv); diff --git a/contrib/jsonb_plperl/jsonb_plperl.c b/contrib/jsonb_plperl/jsonb_plperl.c index 4ae13532d1..ed361efbe2 100644 --- a/contrib/jsonb_plperl/jsonb_plperl.c +++ b/contrib/jsonb_plperl/jsonb_plperl.c @@ -235,11 +235,11 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem) if (isinf(nval)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert infinity to jsonb")))); + errmsg("cannot convert infinity to jsonb"))); if (isnan(nval)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert NaN to jsonb")))); + errmsg("cannot convert NaN to jsonb"))); out.type = jbvNumeric; out.val.numeric = @@ -260,7 +260,7 @@ SV_to_JsonbValue(SV *in, JsonbParseState **jsonb_state, bool is_elem) */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("cannot transform this Perl type to jsonb")))); + errmsg("cannot transform this Perl type to jsonb"))); return NULL; } } diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index b41c738ad6..b06ad9f929 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -380,7 +380,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) { ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), - (errmsg("could not convert value \"%s\" to jsonb", str)))); + errmsg("could not convert value \"%s\" to jsonb", str))); } PG_END_TRY(); @@ -394,7 +394,7 @@ PLyNumber_ToJsonbValue(PyObject *obj, JsonbValue *jbvNum) if (numeric_is_nan(num)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - (errmsg("cannot convert NaN to jsonb")))); + errmsg("cannot convert NaN to jsonb"))); jbvNum->type = jbvNumeric; jbvNum->val.numeric = num; @@ -446,8 +446,8 @@ PLyObject_ToJsonbValue(PyObject *obj, JsonbParseState **jsonb_state, bool is_ele else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("Python type \"%s\" cannot be transformed to jsonb", - PLyObject_AsString((PyObject *) obj->ob_type))))); + errmsg("Python type \"%s\" cannot be transformed to jsonb", + PLyObject_AsString((PyObject *) obj->ob_type)))); /* Push result into 'jsonb_state' unless it is raw scalar value. */ return (*jsonb_state ? diff --git a/contrib/pageinspect/brinfuncs.c b/contrib/pageinspect/brinfuncs.c index b1901cb03c..fb32d74a66 100644 --- a/contrib/pageinspect/brinfuncs.c +++ b/contrib/pageinspect/brinfuncs.c @@ -52,7 +52,7 @@ brin_page_type(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; @@ -141,7 +141,7 @@ brin_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); /* check to see if caller supports us returning a tuplestore */ if (rsinfo == NULL || !IsA(rsinfo, ReturnSetInfo)) @@ -336,7 +336,7 @@ brin_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_brin_page(raw_page, BRIN_PAGETYPE_META, "metapage"); @@ -374,7 +374,7 @@ brin_revmap_data(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c index 78cdc69ec7..564c818558 100644 --- a/contrib/pageinspect/btreefuncs.c +++ b/contrib/pageinspect/btreefuncs.c @@ -174,7 +174,7 @@ bt_page_stats(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -318,7 +318,7 @@ bt_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); if (SRF_IS_FIRSTCALL()) { @@ -428,7 +428,7 @@ bt_page_items_bytea(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { @@ -518,7 +518,7 @@ bt_metap(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pageinspect functions")))); + errmsg("must be superuser to use pageinspect functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); diff --git a/contrib/pageinspect/fsmfuncs.c b/contrib/pageinspect/fsmfuncs.c index e830be8060..099acbb2fe 100644 --- a/contrib/pageinspect/fsmfuncs.c +++ b/contrib/pageinspect/fsmfuncs.c @@ -42,7 +42,7 @@ fsm_page_contents(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); fsmpage = (FSMPage) PageGetContents(VARDATA(raw_page)); diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c index 4b623fbf51..9b1d41c510 100644 --- a/contrib/pageinspect/ginfuncs.c +++ b/contrib/pageinspect/ginfuncs.c @@ -45,7 +45,7 @@ gin_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = get_page_from_raw(raw_page); @@ -103,7 +103,7 @@ gin_page_opaque_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = get_page_from_raw(raw_page); @@ -169,7 +169,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c index 5bbd230742..effc80fbd3 100644 --- a/contrib/pageinspect/hashfuncs.c +++ b/contrib/pageinspect/hashfuncs.c @@ -195,7 +195,7 @@ hash_page_type(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, 0); @@ -243,7 +243,7 @@ hash_page_stats(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE); @@ -310,7 +310,7 @@ hash_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); if (SRF_IS_FIRSTCALL()) { @@ -415,7 +415,7 @@ hash_bitmap_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); indexRel = index_open(indexRelid, AccessShareLock); @@ -526,7 +526,7 @@ hash_metapage_info(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); page = verify_hash_page(raw_page, LH_META_PAGE); diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index aa7e4b9fef..61fe4359a0 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -135,7 +135,7 @@ heap_page_items(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index a7b0d177d2..c0181506a5 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -102,7 +102,7 @@ get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -233,7 +233,7 @@ page_header(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; @@ -305,7 +305,7 @@ page_checksum(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use raw page functions")))); + errmsg("must be superuser to use raw page functions"))); raw_page_size = VARSIZE(raw_page) - VARHDRSZ; diff --git a/contrib/pg_prewarm/pg_prewarm.c b/contrib/pg_prewarm/pg_prewarm.c index b5ebac8f97..33e2d28b27 100644 --- a/contrib/pg_prewarm/pg_prewarm.c +++ b/contrib/pg_prewarm/pg_prewarm.c @@ -77,7 +77,7 @@ pg_prewarm(PG_FUNCTION_ARGS) if (PG_ARGISNULL(1)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("prewarm type cannot be null")))); + errmsg("prewarm type cannot be null"))); type = PG_GETARG_TEXT_PP(1); ttype = text_to_cstring(type); if (strcmp(ttype, "prefetch") == 0) @@ -97,7 +97,7 @@ pg_prewarm(PG_FUNCTION_ARGS) if (PG_ARGISNULL(2)) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - (errmsg("relation fork cannot be null")))); + errmsg("relation fork cannot be null"))); forkName = PG_GETARG_TEXT_PP(2); forkString = text_to_cstring(forkName); forkNumber = forkname_to_number(forkString); diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c index 672dbf2bb7..96d837485f 100644 --- a/contrib/pgstattuple/pgstatapprox.c +++ b/contrib/pgstattuple/pgstatapprox.c @@ -228,7 +228,7 @@ pgstattuple_approx(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); PG_RETURN_DATUM(pgstattuple_approx_internal(relid, fcinfo)); } diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c index 4bae176e09..b1ce0d77d7 100644 --- a/contrib/pgstattuple/pgstatindex.c +++ b/contrib/pgstattuple/pgstatindex.c @@ -151,7 +151,7 @@ pgstatindex(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -193,7 +193,7 @@ pgstatindexbyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); rel = relation_open(relid, AccessShareLock); @@ -386,7 +386,7 @@ pg_relpages(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); rel = relation_openrv(relrv, AccessShareLock); @@ -438,7 +438,7 @@ pg_relpagesbyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); rel = relation_open(relid, AccessShareLock); @@ -492,7 +492,7 @@ pgstatginindex(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); PG_RETURN_DATUM(pgstatginindex_internal(relid, fcinfo)); } diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index 70af43ebd5..69179d4104 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -173,7 +173,7 @@ pgstattuple(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); /* open relation */ relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname)); @@ -213,7 +213,7 @@ pgstattuplebyid(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to use pgstattuple functions")))); + errmsg("must be superuser to use pgstattuple functions"))); /* open relation */ rel = relation_open(relid, AccessShareLock); diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index d4e21f90a8..20316539b6 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -298,8 +298,8 @@ pg_create_restore_point(PG_FUNCTION_ARGS) if (RecoveryInProgress()) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - (errmsg("recovery is in progress"), - errhint("WAL control functions cannot be executed during recovery.")))); + errmsg("recovery is in progress"), + errhint("WAL control functions cannot be executed during recovery."))); if (!XLogIsNeeded()) ereport(ERROR, diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c index 4dda38fa30..fca85ba2c1 100644 --- a/src/backend/commands/alter.c +++ b/src/backend/commands/alter.c @@ -212,8 +212,8 @@ AlterObjectRename_internal(Relation rel, Oid objectId, const char *new_name) if (Anum_owner <= 0) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to rename %s", - getObjectDescriptionOids(classId, objectId))))); + errmsg("must be superuser to rename %s", + getObjectDescriptionOids(classId, objectId)))); /* Otherwise, must be owner of the existing object */ datum = heap_getattr(oldtup, Anum_owner, @@ -715,8 +715,8 @@ AlterObjectNamespace_internal(Relation rel, Oid objid, Oid nspOid) if (Anum_owner <= 0) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to set schema of %s", - getObjectDescriptionOids(classId, objid))))); + errmsg("must be superuser to set schema of %s", + getObjectDescriptionOids(classId, objid)))); /* Otherwise, must be owner of the existing object */ owner = heap_getattr(tup, Anum_owner, RelationGetDescr(rel), &isnull); diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index 34c75e8b56..85f726ae06 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -527,7 +527,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to import system collations")))); + errmsg("must be superuser to import system collations"))); /* Load collations known to libc, using "locale -a" to enumerate them */ #ifdef READ_LOCALE_A_OUTPUT diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c index 9f387b5f5f..cc02cf824e 100644 --- a/src/backend/commands/createas.c +++ b/src/backend/commands/createas.c @@ -537,7 +537,7 @@ intorel_startup(DestReceiver *self, int operation, TupleDesc typeinfo) if (check_enable_rls(intoRelationAddr.objectId, InvalidOid, false) == RLS_ENABLED) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("policies not yet implemented for this command")))); + errmsg("policies not yet implemented for this command"))); /* * Tentatively mark the target as populated, if it's a matview and we're diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index c31c57e5e9..3b44b0f895 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -285,8 +285,8 @@ interpret_function_parameter_list(ParseState *pstate, if (fp->mode == FUNC_PARAM_OUT) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("procedures cannot have OUT arguments"), - errhint("INOUT arguments are permitted.")))); + errmsg("procedures cannot have OUT arguments"), + errhint("INOUT arguments are permitted."))); } /* handle input parameters */ diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index f96cb42adc..eb4d22cc2a 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -158,7 +158,7 @@ CreatePublication(CreatePublicationStmt *stmt) if (stmt->for_all_tables && !superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to create FOR ALL TABLES publication")))); + errmsg("must be superuser to create FOR ALL TABLES publication"))); rel = table_open(PublicationRelationId, RowExclusiveLock); diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c index 9bfe142ada..119a9ce76f 100644 --- a/src/backend/commands/subscriptioncmds.c +++ b/src/backend/commands/subscriptioncmds.c @@ -347,7 +347,7 @@ CreateSubscription(CreateSubscriptionStmt *stmt, bool isTopLevel) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to create subscriptions")))); + errmsg("must be superuser to create subscriptions"))); /* * If built with appropriate switch, whine when regression-testing diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index f370659842..c47fdfc9e5 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -1523,8 +1523,8 @@ AddRoleMems(const char *rolename, Oid roleid, if (is_member_of_role_nosuper(roleid, memberid)) ereport(ERROR, (errcode(ERRCODE_INVALID_GRANT_OPERATION), - (errmsg("role \"%s\" is a member of role \"%s\"", - rolename, get_rolespec_name(memberRole))))); + errmsg("role \"%s\" is a member of role \"%s\"", + rolename, get_rolespec_name(memberRole)))); /* * Check if entry for this role/member already exists; if so, give diff --git a/src/backend/libpq/auth-scram.c b/src/backend/libpq/auth-scram.c index d2e94d76c5..5e5119e8ea 100644 --- a/src/backend/libpq/auth-scram.c +++ b/src/backend/libpq/auth-scram.c @@ -997,8 +997,8 @@ read_client_first_message(scram_state *state, const char *input) if (strcmp(channel_binding_type, "tls-server-end-point") != 0) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), - (errmsg("unsupported SCRAM channel-binding type \"%s\"", - sanitize_str(channel_binding_type))))); + errmsg("unsupported SCRAM channel-binding type \"%s\"", + sanitize_str(channel_binding_type)))); break; default: ereport(ERROR, @@ -1282,7 +1282,7 @@ read_client_final_message(scram_state *state, const char *input) if (strcmp(channel_binding, b64_message) != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION), - (errmsg("SCRAM channel binding check failed")))); + errmsg("SCRAM channel binding check failed"))); #else /* shouldn't happen, because we checked this earlier already */ elog(ERROR, "channel binding not supported by this build"); @@ -1300,7 +1300,7 @@ read_client_final_message(scram_state *state, const char *input) !(strcmp(channel_binding, "eSws") == 0 && state->cbind_flag == 'y')) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), - (errmsg("unexpected SCRAM channel-binding attribute in client-final-message")))); + errmsg("unexpected SCRAM channel-binding attribute in client-final-message"))); } state->client_final_nonce = read_attr_value(&p, 'r'); diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 987ab660cb..18d3fff068 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -999,7 +999,7 @@ initialize_dh(SSL_CTX *context, bool isServerStart) { ereport(isServerStart ? FATAL : LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), - (errmsg("DH: could not load DH parameters")))); + errmsg("DH: could not load DH parameters"))); return false; } @@ -1007,8 +1007,8 @@ initialize_dh(SSL_CTX *context, bool isServerStart) { ereport(isServerStart ? FATAL : LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), - (errmsg("DH: could not set DH parameters: %s", - SSLerrmessage(ERR_get_error()))))); + errmsg("DH: could not set DH parameters: %s", + SSLerrmessage(ERR_get_error())))); DH_free(dh); return false; } diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index cc4c7b5b75..b2b69a7207 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -569,7 +569,7 @@ SysLogger_Start(void) if (pipe(syslogPipe) < 0) ereport(FATAL, (errcode_for_socket_access(), - (errmsg("could not create pipe for syslog: %m")))); + errmsg("could not create pipe for syslog: %m"))); } #else if (!syslogPipe[0]) @@ -583,7 +583,7 @@ SysLogger_Start(void) if (!CreatePipe(&syslogPipe[0], &syslogPipe[1], &sa, 32768)) ereport(FATAL, (errcode_for_file_access(), - (errmsg("could not create pipe for syslog: %m")))); + errmsg("could not create pipe for syslog: %m"))); } #endif diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index cf93200618..e3da7d3625 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -390,13 +390,13 @@ CreateDecodingContext(XLogRecPtr start_lsn, if (SlotIsPhysical(slot)) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - (errmsg("cannot use physical replication slot for logical decoding")))); + errmsg("cannot use physical replication slot for logical decoding"))); if (slot->data.database != MyDatabaseId) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - (errmsg("replication slot \"%s\" was not created in this database", - NameStr(slot->data.name))))); + errmsg("replication slot \"%s\" was not created in this database", + NameStr(slot->data.name)))); if (start_lsn == InvalidXLogRecPtr) { diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c index 25b89e5616..8095ae4cb1 100644 --- a/src/backend/replication/logical/logicalfuncs.c +++ b/src/backend/replication/logical/logicalfuncs.c @@ -103,7 +103,7 @@ check_permissions(void) if (!superuser() && !has_rolreplication(GetUserId())) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser or replication role to use replication slots")))); + errmsg("must be superuser or replication role to use replication slots"))); } int diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y index 2d96567409..14fcd53221 100644 --- a/src/backend/replication/repl_gram.y +++ b/src/backend/replication/repl_gram.y @@ -333,7 +333,7 @@ timeline_history: if ($2 <= 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - (errmsg("invalid timeline %u", $2)))); + errmsg("invalid timeline %u", $2))); cmd = makeNode(TimeLineHistoryCmd); cmd->timeline = $2; @@ -365,7 +365,7 @@ opt_timeline: if ($2 <= 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - (errmsg("invalid timeline %u", $2)))); + errmsg("invalid timeline %u", $2))); $$ = $2; } | /* EMPTY */ { $$ = 0; } diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index 976f6479a9..1cec53d748 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -979,7 +979,7 @@ CheckSlotRequirements(void) if (max_replication_slots == 0) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - (errmsg("replication slots can only be used if max_replication_slots > 0")))); + errmsg("replication slots can only be used if max_replication_slots > 0"))); if (wal_level < WAL_LEVEL_REPLICA) ereport(ERROR, diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index 7c89694611..526ccad902 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -31,7 +31,7 @@ check_permissions(void) if (!superuser() && !has_rolreplication(GetUserId())) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser or replication role to use replication slots")))); + errmsg("must be superuser or replication role to use replication slots"))); } /* @@ -670,7 +670,7 @@ copy_replication_slot(FunctionCallInfo fcinfo, bool logical_slot) Assert(!logical_slot); ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - (errmsg("cannot copy a replication slot that doesn't reserve WAL")))); + errmsg("cannot copy a replication slot that doesn't reserve WAL"))); } /* Overwrite params from optional arguments */ diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 0c65f1660b..abb533b9d0 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -563,7 +563,7 @@ StartReplication(StartReplicationCmd *cmd) if (SlotIsLogical(MyReplicationSlot)) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), - (errmsg("cannot use a logical replication slot for physical replication")))); + errmsg("cannot use a logical replication slot for physical replication"))); } /* @@ -1499,8 +1499,8 @@ exec_replication_command(const char *cmd_string) if (parse_rc != 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), - (errmsg_internal("replication command parser returned %d", - parse_rc)))); + errmsg_internal("replication command parser returned %d", + parse_rc))); cmd_node = replication_parse_result; diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index c3adb2e6c0..4a5b26c23d 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -3046,14 +3046,14 @@ TerminateOtherDBBackends(Oid databaseId) if (superuser_arg(proc->roleId) && !superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a superuser to terminate superuser process")))); + errmsg("must be a superuser to terminate superuser process"))); /* Users can signal backends they have role membership in. */ if (!has_privs_of_role(GetUserId(), proc->roleId) && !has_privs_of_role(GetUserId(), DEFAULT_ROLE_SIGNAL_BACKENDID)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a member of the role whose process is being terminated or member of pg_signal_backend")))); + errmsg("must be a member of the role whose process is being terminated or member of pg_signal_backend"))); } } diff --git a/src/backend/storage/ipc/signalfuncs.c b/src/backend/storage/ipc/signalfuncs.c index 7fb6ced14b..9dd5a27204 100644 --- a/src/backend/storage/ipc/signalfuncs.c +++ b/src/backend/storage/ipc/signalfuncs.c @@ -115,12 +115,12 @@ pg_cancel_backend(PG_FUNCTION_ARGS) if (r == SIGNAL_BACKEND_NOSUPERUSER) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a superuser to cancel superuser query")))); + errmsg("must be a superuser to cancel superuser query"))); if (r == SIGNAL_BACKEND_NOPERMISSION) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a member of the role whose query is being canceled or member of pg_signal_backend")))); + errmsg("must be a member of the role whose query is being canceled or member of pg_signal_backend"))); PG_RETURN_BOOL(r == SIGNAL_BACKEND_SUCCESS); } @@ -139,12 +139,12 @@ pg_terminate_backend(PG_FUNCTION_ARGS) if (r == SIGNAL_BACKEND_NOSUPERUSER) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a superuser to terminate superuser process")))); + errmsg("must be a superuser to terminate superuser process"))); if (r == SIGNAL_BACKEND_NOPERMISSION) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be a member of the role whose process is being terminated or member of pg_signal_backend")))); + errmsg("must be a member of the role whose process is being terminated or member of pg_signal_backend"))); PG_RETURN_BOOL(r == SIGNAL_BACKEND_SUCCESS); } @@ -180,10 +180,10 @@ pg_rotate_logfile(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to rotate log files with adminpack 1.0"), + errmsg("must be superuser to rotate log files with adminpack 1.0"), /* translator: %s is a SQL function name */ - errhint("Consider using %s, which is part of core, instead.", - "pg_logfile_rotate()")))); + errhint("Consider using %s, which is part of core, instead.", + "pg_logfile_rotate()"))); if (!Logging_collector) { diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c index 0d75928e7f..3741b87486 100644 --- a/src/backend/utils/adt/genfile.c +++ b/src/backend/utils/adt/genfile.c @@ -78,7 +78,7 @@ convert_and_check_filename(text *arg) if (path_contains_parent_reference(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("reference to parent directory (\"..\") not allowed")))); + errmsg("reference to parent directory (\"..\") not allowed"))); /* * Allow absolute paths if within DataDir or Log_directory, even @@ -89,12 +89,12 @@ convert_and_check_filename(text *arg) !path_is_prefix_of_path(Log_directory, filename))) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("absolute path not allowed")))); + errmsg("absolute path not allowed"))); } else if (!path_is_relative_and_below_cwd(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("path must be in or below the current directory")))); + errmsg("path must be in or below the current directory"))); return filename; } @@ -218,10 +218,10 @@ pg_read_file(PG_FUNCTION_ARGS) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to read files with adminpack 1.0"), + errmsg("must be superuser to read files with adminpack 1.0"), /* translator: %s is a SQL function name */ - errhint("Consider using %s, which is part of core, instead.", - "pg_file_read()")))); + errhint("Consider using %s, which is part of core, instead.", + "pg_file_read()"))); /* handle optional arguments */ if (PG_NARGS() >= 3) diff --git a/src/backend/utils/adt/pg_upgrade_support.c b/src/backend/utils/adt/pg_upgrade_support.c index 8b26e1a93d..0d9e55cdcf 100644 --- a/src/backend/utils/adt/pg_upgrade_support.c +++ b/src/backend/utils/adt/pg_upgrade_support.c @@ -26,7 +26,7 @@ do { \ if (!IsBinaryUpgrade) \ ereport(ERROR, \ (errcode(ERRCODE_CANT_CHANGE_RUNTIME_PARAM), \ - (errmsg("function can only be called when server is in binary upgrade mode")))); \ + errmsg("function can only be called when server is in binary upgrade mode"))); \ } while (0) Datum diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index cacbe904db..a16fe8cd5b 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -7993,7 +7993,7 @@ AlterSystemSetConfigFile(AlterSystemStmt *altersysstmt) if (!superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("must be superuser to execute ALTER SYSTEM command")))); + errmsg("must be superuser to execute ALTER SYSTEM command"))); /* * Extract statement arguments -- 2.20.1
>From 85e63a38feb83b6172913a31bcbd2067a4a11453 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvhe...@alvh.no-ip.org> Date: Wed, 29 Jan 2020 16:54:43 -0300 Subject: [PATCH 2/2] fix useless newlines after parens --- contrib/btree_gin/btree_gin.c | 6 +- contrib/btree_gist/btree_cash.c | 17 +++-- contrib/btree_gist/btree_date.c | 63 +++++++++---------- contrib/btree_gist/btree_enum.c | 48 +++++++------- contrib/btree_gist/btree_float4.c | 17 +++-- contrib/btree_gist/btree_float8.c | 17 +++-- contrib/btree_gist/btree_inet.c | 6 +- contrib/btree_gist/btree_int2.c | 16 ++--- contrib/btree_gist/btree_int4.c | 16 ++--- contrib/btree_gist/btree_int8.c | 16 ++--- contrib/btree_gist/btree_interval.c | 16 ++--- contrib/btree_gist/btree_macaddr.c | 11 ++-- contrib/btree_gist/btree_macaddr8.c | 11 ++-- contrib/btree_gist/btree_numeric.c | 24 +++---- contrib/btree_gist/btree_oid.c | 16 ++--- contrib/btree_gist/btree_time.c | 30 ++++----- contrib/btree_gist/btree_ts.c | 26 +++----- contrib/btree_gist/btree_utils_var.c | 7 +-- contrib/btree_gist/btree_uuid.c | 13 ++-- contrib/cube/cube.c | 24 +++---- contrib/dblink/dblink.c | 6 +- contrib/fuzzystrmatch/dmetaphone.c | 18 ++---- contrib/hstore/hstore_op.c | 6 +- contrib/intarray/_int_op.c | 8 +-- contrib/ltree/_ltree_gist.c | 6 +- contrib/ltree/lquery_op.c | 13 +--- contrib/ltree/ltree_gist.c | 18 ++---- contrib/ltree/ltxtquery_op.c | 13 ++-- contrib/oid2name/oid2name.c | 3 +- contrib/pageinspect/heapfuncs.c | 3 +- contrib/pg_trgm/trgm_gist.c | 12 ++-- contrib/pg_trgm/trgm_op.c | 6 +- contrib/seg/seg.c | 30 +++++---- contrib/test_decoding/test_decoding.c | 4 +- src/backend/access/gin/ginlogic.c | 6 +- src/backend/access/gist/gistproc.c | 12 ++-- src/backend/access/heap/heapam.c | 3 +- src/backend/access/rmgrdesc/xactdesc.c | 11 ++-- src/backend/access/spgist/spgscan.c | 3 +- src/backend/access/transam/xact.c | 12 ++-- src/backend/catalog/heap.c | 3 +- src/backend/commands/event_trigger.c | 6 +- src/backend/commands/tablecmds.c | 3 +- src/backend/executor/execExprInterp.c | 6 +- src/backend/executor/nodeAgg.c | 6 +- src/backend/libpq/auth.c | 6 +- src/backend/optimizer/path/joinpath.c | 3 +- src/backend/optimizer/plan/createplan.c | 6 +- src/backend/postmaster/pgstat.c | 12 ++-- .../replication/logical/logicalfuncs.c | 3 +- .../replication/logical/reorderbuffer.c | 3 +- src/backend/tcop/utility.c | 3 +- src/backend/tsearch/dict_thesaurus.c | 8 +-- src/backend/tsearch/to_tsany.c | 3 +- src/backend/tsearch/ts_parse.c | 12 ++-- src/backend/utils/adt/formatting.c | 3 +- src/backend/utils/adt/pgstatfuncs.c | 6 +- src/backend/utils/adt/rangetypes_spgist.c | 3 +- src/backend/utils/adt/rangetypes_typanalyze.c | 9 +-- src/backend/utils/adt/ruleutils.c | 3 +- src/backend/utils/adt/timestamp.c | 6 +- src/backend/utils/adt/tsgistidx.c | 12 ++-- src/backend/utils/adt/tsquery_op.c | 11 +--- src/backend/utils/adt/tsvector_op.c | 22 +++---- src/backend/utils/misc/pg_controldata.c | 3 +- src/bin/pg_upgrade/tablespace.c | 7 +-- src/bin/psql/help.c | 6 +- src/interfaces/libpq/fe-connect.c | 45 +++++++------ src/interfaces/libpq/fe-misc.c | 3 +- src/interfaces/libpq/fe-protocol2.c | 8 +-- src/interfaces/libpq/fe-protocol3.c | 6 +- src/interfaces/libpq/fe-secure-openssl.c | 12 ++-- src/interfaces/libpq/fe-secure.c | 6 +- src/interfaces/libpq/win32.c | 9 +-- src/pl/plperl/plperl.c | 7 +-- src/pl/plpython/plpy_elog.c | 6 +- src/pl/tcl/pltcl.c | 8 +-- src/port/gettimeofday.c | 3 +- src/timezone/zic.c | 6 +- 79 files changed, 344 insertions(+), 542 deletions(-) diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c index 0ed3d580df..e05b5c60ca 100644 --- a/contrib/btree_gin/btree_gin.c +++ b/contrib/btree_gin/btree_gin.c @@ -114,8 +114,7 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo) int32 res, cmp; - cmp = DatumGetInt32(CallerFInfoFunctionCall2( - data->typecmp, + cmp = DatumGetInt32(CallerFInfoFunctionCall2(data->typecmp, fcinfo->flinfo, PG_GET_COLLATION(), (data->strategy == BTLessStrategyNumber || @@ -463,8 +462,7 @@ gin_enum_cmp(PG_FUNCTION_ARGS) } else { - res = DatumGetInt32(CallerFInfoFunctionCall2( - enum_cmp, + res = DatumGetInt32(CallerFInfoFunctionCall2(enum_cmp, fcinfo->flinfo, PG_GET_COLLATION(), ObjectIdGetDatum(a), diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c index 894d0a2665..dfa23224b6 100644 --- a/contrib/btree_gist/btree_cash.c +++ b/contrib/btree_gist/btree_cash.c @@ -150,9 +150,9 @@ gbt_cash_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } @@ -169,9 +169,8 @@ gbt_cash_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -202,11 +201,9 @@ gbt_cash_penalty(PG_FUNCTION_ARGS) Datum gbt_cash_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index 992ce57507..455a265a49 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -29,41 +29,42 @@ PG_FUNCTION_INFO_V1(gbt_date_same); static bool gbt_dategt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_gt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_gt, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_datege(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_ge, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_ge, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_dateeq(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_eq, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) + return DatumGetBool(DirectFunctionCall2(date_eq, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b))) ); } static bool gbt_datele(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_le, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_le, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } static bool gbt_datelt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - DirectFunctionCall2(date_lt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b))) - ); + return DatumGetBool(DirectFunctionCall2(date_lt, + DateADTGetDatum(*((const DateADT *) a)), + DateADTGetDatum(*((const DateADT *) b)))); } @@ -75,9 +76,13 @@ gbt_datekey_cmp(const void *a, const void *b, FmgrInfo *flinfo) dateKEY *ib = (dateKEY *) (((const Nsrt *) b)->t); int res; - res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower))); + res = DatumGetInt32(DirectFunctionCall2(date_cmp, + DateADTGetDatum(ia->lower), + DateADTGetDatum(ib->lower))); if (res == 0) - return DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->upper), DateADTGetDatum(ib->upper))); + return DatumGetInt32(DirectFunctionCall2(date_cmp, + DateADTGetDatum(ia->upper), + DateADTGetDatum(ib->upper))); return res; } @@ -162,9 +167,9 @@ gbt_date_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } @@ -181,9 +186,8 @@ gbt_date_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -207,15 +211,13 @@ gbt_date_penalty(PG_FUNCTION_ARGS) int32 diff, res; - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(newentry->upper), DateADTGetDatum(origentry->upper))); res = Max(diff, 0); - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(origentry->lower), DateADTGetDatum(newentry->lower))); @@ -225,8 +227,7 @@ gbt_date_penalty(PG_FUNCTION_ARGS) if (res > 0) { - diff = DatumGetInt32(DirectFunctionCall2( - date_mi, + diff = DatumGetInt32(DirectFunctionCall2(date_mi, DateADTGetDatum(origentry->upper), DateADTGetDatum(origentry->lower))); *result += FLT_MIN; @@ -241,11 +242,9 @@ gbt_date_penalty(PG_FUNCTION_ARGS) Datum gbt_date_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c index b56301270f..d4dc38a38e 100644 --- a/contrib/btree_gist/btree_enum.c +++ b/contrib/btree_gist/btree_enum.c @@ -31,16 +31,16 @@ PG_FUNCTION_INFO_V1(gbt_enum_same); static bool gbt_enumgt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) - ); + return DatumGetBool(CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, + ObjectIdGetDatum(*((const Oid *) a)), + ObjectIdGetDatum(*((const Oid *) b)))); } static bool gbt_enumge(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) - ); + return DatumGetBool(CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, + ObjectIdGetDatum(*((const Oid *) a)), + ObjectIdGetDatum(*((const Oid *) b)))); } static bool gbt_enumeq(const void *a, const void *b, FmgrInfo *flinfo) @@ -50,16 +50,16 @@ gbt_enumeq(const void *a, const void *b, FmgrInfo *flinfo) static bool gbt_enumle(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - CallerFInfoFunctionCall2(enum_le, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) - ); + return DatumGetBool(CallerFInfoFunctionCall2(enum_le, flinfo, InvalidOid, + ObjectIdGetDatum(*((const Oid *) a)), + ObjectIdGetDatum(*((const Oid *) b)))); } static bool gbt_enumlt(const void *a, const void *b, FmgrInfo *flinfo) { - return DatumGetBool( - CallerFInfoFunctionCall2(enum_lt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b))) - ); + return DatumGetBool(CallerFInfoFunctionCall2(enum_lt, flinfo, InvalidOid, + ObjectIdGetDatum(*((const Oid *) a)), + ObjectIdGetDatum(*((const Oid *) b)))); } static int @@ -73,14 +73,14 @@ gbt_enumkey_cmp(const void *a, const void *b, FmgrInfo *flinfo) if (ia->upper == ib->upper) return 0; - return DatumGetInt32( - CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper)) - ); + return DatumGetInt32(CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, + ObjectIdGetDatum(ia->upper), + ObjectIdGetDatum(ib->upper))); } - return DatumGetInt32( - CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower)) - ); + return DatumGetInt32(CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, + ObjectIdGetDatum(ia->lower), + ObjectIdGetDatum(ib->lower))); } static const gbtree_ninfo tinfo = @@ -137,9 +137,9 @@ gbt_enum_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } Datum @@ -168,11 +168,9 @@ gbt_enum_penalty(PG_FUNCTION_ARGS) Datum gbt_enum_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c index 6b20f44a48..3604c73313 100644 --- a/contrib/btree_gist/btree_float4.c +++ b/contrib/btree_gist/btree_float4.c @@ -143,9 +143,9 @@ gbt_float4_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } @@ -162,9 +162,8 @@ gbt_float4_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -195,11 +194,9 @@ gbt_float4_penalty(PG_FUNCTION_ARGS) Datum gbt_float4_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c index ee114cbe42..10a5262aaa 100644 --- a/contrib/btree_gist/btree_float8.c +++ b/contrib/btree_gist/btree_float8.c @@ -150,9 +150,9 @@ gbt_float8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } @@ -169,9 +169,8 @@ gbt_float8_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -202,11 +201,9 @@ gbt_float8_penalty(PG_FUNCTION_ARGS) Datum gbt_float8_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index a3b4301c49..e4b3a946b2 100644 --- a/contrib/btree_gist/btree_inet.c +++ b/contrib/btree_gist/btree_inet.c @@ -171,11 +171,9 @@ gbt_inet_penalty(PG_FUNCTION_ARGS) Datum gbt_inet_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c index 7674e2d292..a91b95ff39 100644 --- a/contrib/btree_gist/btree_int2.c +++ b/contrib/btree_gist/btree_int2.c @@ -150,9 +150,8 @@ gbt_int2_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -169,9 +168,8 @@ gbt_int2_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -201,11 +199,9 @@ gbt_int2_penalty(PG_FUNCTION_ARGS) Datum gbt_int2_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c index 80005ab65d..7ea98c478c 100644 --- a/contrib/btree_gist/btree_int4.c +++ b/contrib/btree_gist/btree_int4.c @@ -151,9 +151,8 @@ gbt_int4_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -170,9 +169,8 @@ gbt_int4_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -202,11 +200,9 @@ gbt_int4_penalty(PG_FUNCTION_ARGS) Datum gbt_int4_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c index b0fd3e1277..df2b0d174b 100644 --- a/contrib/btree_gist/btree_int8.c +++ b/contrib/btree_gist/btree_int8.c @@ -151,9 +151,8 @@ gbt_int8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -170,9 +169,8 @@ gbt_int8_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -202,11 +200,9 @@ gbt_int8_penalty(PG_FUNCTION_ARGS) Datum gbt_int8_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index 3a527a75fa..a4b3b2b1e6 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -225,9 +225,8 @@ gbt_intv_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -244,9 +243,8 @@ gbt_intv_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -284,11 +282,9 @@ gbt_intv_penalty(PG_FUNCTION_ARGS) Datum gbt_intv_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c index 0486c35730..7f0e9e9c91 100644 --- a/contrib/btree_gist/btree_macaddr.c +++ b/contrib/btree_gist/btree_macaddr.c @@ -141,9 +141,8 @@ gbt_macad_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,11 +180,9 @@ gbt_macad_penalty(PG_FUNCTION_ARGS) Datum gbt_macad_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_macaddr8.c b/contrib/btree_gist/btree_macaddr8.c index 30a1391d73..ab4bca5d50 100644 --- a/contrib/btree_gist/btree_macaddr8.c +++ b/contrib/btree_gist/btree_macaddr8.c @@ -141,9 +141,8 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -181,11 +180,9 @@ gbt_macad8_penalty(PG_FUNCTION_ARGS) Datum gbt_macad8_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c index d43612a873..d66901680e 100644 --- a/contrib/btree_gist/btree_numeric.c +++ b/contrib/btree_gist/btree_numeric.c @@ -174,23 +174,17 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS) ok = gbt_var_key_readable(org); uk = gbt_var_key_readable((GBT_VARKEY *) DatumGetPointer(uni)); - us = DatumGetNumeric(DirectFunctionCall2( - numeric_sub, + us = DatumGetNumeric(DirectFunctionCall2(numeric_sub, PointerGetDatum(uk.upper), - PointerGetDatum(uk.lower) - )); + PointerGetDatum(uk.lower))); - os = DatumGetNumeric(DirectFunctionCall2( - numeric_sub, + os = DatumGetNumeric(DirectFunctionCall2(numeric_sub, PointerGetDatum(ok.upper), - PointerGetDatum(ok.lower) - )); + PointerGetDatum(ok.lower))); - ds = DatumGetNumeric(DirectFunctionCall2( - numeric_sub, + ds = DatumGetNumeric(DirectFunctionCall2(numeric_sub, NumericGetDatum(us), - NumericGetDatum(os) - )); + NumericGetDatum(os))); if (numeric_is_nan(us)) { @@ -208,11 +202,9 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS) if (DirectFunctionCall2(numeric_gt, NumericGetDatum(ds), NumericGetDatum(nul))) { *result += FLT_MIN; - os = DatumGetNumeric(DirectFunctionCall2( - numeric_div, + os = DatumGetNumeric(DirectFunctionCall2(numeric_div, NumericGetDatum(ds), - NumericGetDatum(us) - )); + NumericGetDatum(us))); *result += (float4) DatumGetFloat8(DirectFunctionCall1(numeric_float8_no_overflow, NumericGetDatum(os))); } } diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index 00e701903f..3cc7d4245d 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -151,9 +151,8 @@ gbt_oid_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -170,9 +169,8 @@ gbt_oid_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -202,11 +200,9 @@ gbt_oid_penalty(PG_FUNCTION_ARGS) Datum gbt_oid_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index 90cf6554ea..fd8774a2f0 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -216,9 +216,8 @@ gbt_time_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } Datum @@ -234,9 +233,8 @@ gbt_time_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } Datum @@ -260,9 +258,8 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } @@ -287,15 +284,13 @@ gbt_time_penalty(PG_FUNCTION_ARGS) double res; double res2; - intr = DatumGetIntervalP(DirectFunctionCall2( - time_mi_time, + intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time, TimeADTGetDatumFast(newentry->upper), TimeADTGetDatumFast(origentry->upper))); res = INTERVAL_TO_SEC(intr); res = Max(res, 0); - intr = DatumGetIntervalP(DirectFunctionCall2( - time_mi_time, + intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time, TimeADTGetDatumFast(origentry->lower), TimeADTGetDatumFast(newentry->lower))); res2 = INTERVAL_TO_SEC(intr); @@ -307,8 +302,7 @@ gbt_time_penalty(PG_FUNCTION_ARGS) if (res > 0) { - intr = DatumGetIntervalP(DirectFunctionCall2( - time_mi_time, + intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time, TimeADTGetDatumFast(origentry->upper), TimeADTGetDatumFast(origentry->lower))); *result += FLT_MIN; @@ -323,11 +317,9 @@ gbt_time_penalty(PG_FUNCTION_ARGS) Datum gbt_time_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index 49d1849d88..3b07969dee 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -265,9 +265,8 @@ gbt_ts_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } Datum @@ -283,9 +282,8 @@ gbt_ts_distance(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } Datum @@ -308,9 +306,8 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)]; qqq = tstz_to_ts_gmt(query); - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy, + GIST_LEAF(entry), &tinfo, fcinfo->flinfo)); } Datum @@ -328,9 +325,8 @@ gbt_tstz_distance(PG_FUNCTION_ARGS) key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)]; qqq = tstz_to_ts_gmt(query); - PG_RETURN_FLOAT8( - gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), + &tinfo, fcinfo->flinfo)); } @@ -387,11 +383,9 @@ gbt_ts_penalty(PG_FUNCTION_ARGS) Datum gbt_ts_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c index 452241f697..2886c08b85 100644 --- a/contrib/btree_gist/btree_utils_var.c +++ b/contrib/btree_gist/btree_utils_var.c @@ -190,10 +190,9 @@ gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinf static bool gbt_var_node_pf_match(const GBT_VARKEY_R *node, const bytea *query, const gbtree_vinfo *tinfo) { - return (tinfo->trnc && ( - gbt_bytea_pf_match(node->lower, query, tinfo) || - gbt_bytea_pf_match(node->upper, query, tinfo) - )); + return (tinfo->trnc && + (gbt_bytea_pf_match(node->lower, query, tinfo) || + gbt_bytea_pf_match(node->upper, query, tinfo))); } diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index 0b3e52fbff..b81875979a 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -148,10 +148,9 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS) key.lower = (GBT_NUMKEY *) &kkk->lower; key.upper = (GBT_NUMKEY *) &kkk->upper; - PG_RETURN_BOOL( - gbt_num_consistent(&key, (void *) query, &strategy, - GIST_LEAF(entry), &tinfo, fcinfo->flinfo) - ); + PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy, + GIST_LEAF(entry), &tinfo, + fcinfo->flinfo)); } Datum @@ -219,11 +218,9 @@ gbt_uuid_penalty(PG_FUNCTION_ARGS) Datum gbt_uuid_picksplit(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(gbt_num_picksplit( - (GistEntryVector *) PG_GETARG_POINTER(0), + PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0), (GIST_SPLITVEC *) PG_GETARG_POINTER(1), - &tinfo, fcinfo->flinfo - )); + &tinfo, fcinfo->flinfo)); } Datum diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index b98118e367..6f810b26c5 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -717,14 +717,10 @@ cube_union_v0(NDBOX *a, NDBOX *b) /* First compute the union of the dimensions present in both args */ for (i = 0; i < DIM(b); i++) { - result->x[i] = Min( - Min(LL_COORD(a, i), UR_COORD(a, i)), - Min(LL_COORD(b, i), UR_COORD(b, i)) - ); - result->x[i + DIM(a)] = Max( - Max(LL_COORD(a, i), UR_COORD(a, i)), - Max(LL_COORD(b, i), UR_COORD(b, i)) - ); + result->x[i] = Min(Min(LL_COORD(a, i), UR_COORD(a, i)), + Min(LL_COORD(b, i), UR_COORD(b, i))); + result->x[i + DIM(a)] = Max(Max(LL_COORD(a, i), UR_COORD(a, i)), + Max(LL_COORD(b, i), UR_COORD(b, i))); } /* continue on the higher dimensions only present in 'a' */ for (; i < DIM(a); i++) @@ -796,14 +792,10 @@ cube_inter(PG_FUNCTION_ARGS) /* First compute intersection of the dimensions present in both args */ for (i = 0; i < DIM(b); i++) { - result->x[i] = Max( - Min(LL_COORD(a, i), UR_COORD(a, i)), - Min(LL_COORD(b, i), UR_COORD(b, i)) - ); - result->x[i + DIM(a)] = Min( - Max(LL_COORD(a, i), UR_COORD(a, i)), - Max(LL_COORD(b, i), UR_COORD(b, i)) - ); + result->x[i] = Max(Min(LL_COORD(a, i), UR_COORD(a, i)), + Min(LL_COORD(b, i), UR_COORD(b, i))); + result->x[i + DIM(a)] = Min(Max(LL_COORD(a, i), UR_COORD(a, i)), + Max(LL_COORD(b, i), UR_COORD(b, i))); } /* continue on the higher dimensions only present in 'a' */ for (; i < DIM(a); i++) diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 1dddf02779..c1155e3911 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -905,8 +905,7 @@ materializeResult(FunctionCallInfo fcinfo, PGconn *conn, PGresult *res) if (!is_sql_cmd) nestlevel = applyRemoteGucs(conn); - oldcontext = MemoryContextSwitchTo( - rsinfo->econtext->ecxt_per_query_memory); + oldcontext = MemoryContextSwitchTo(rsinfo->econtext->ecxt_per_query_memory); tupstore = tuplestore_begin_heap(true, false, work_mem); rsinfo->setResult = tupstore; rsinfo->setDesc = tupdesc; @@ -1027,8 +1026,7 @@ materializeQueryResult(FunctionCallInfo fcinfo, TEXTOID, -1, 0); attinmeta = TupleDescGetAttInMetadata(tupdesc); - oldcontext = MemoryContextSwitchTo( - rsinfo->econtext->ecxt_per_query_memory); + oldcontext = MemoryContextSwitchTo(rsinfo->econtext->ecxt_per_query_memory); tupstore = tuplestore_begin_heap(true, false, work_mem); rsinfo->setResult = tupstore; rsinfo->setDesc = tupdesc; diff --git a/contrib/fuzzystrmatch/dmetaphone.c b/contrib/fuzzystrmatch/dmetaphone.c index f2f16bc883..6f4d2b730e 100644 --- a/contrib/fuzzystrmatch/dmetaphone.c +++ b/contrib/fuzzystrmatch/dmetaphone.c @@ -531,8 +531,7 @@ DoubleMetaphone(char *str, char **codes) } /* germanic, greek, or otherwise 'ch' for 'kh' sound */ - if ( - (StringAt(original, 0, 4, "VAN ", "VON ", "") + if ((StringAt(original, 0, 4, "VAN ", "VON ", "") || StringAt(original, 0, 3, "SCH", "")) /* 'architect but not 'arch', 'orchestra', 'orchid' */ || StringAt(original, (current - 2), 6, "ORCHES", @@ -606,8 +605,7 @@ DoubleMetaphone(char *str, char **codes) && !StringAt(original, (current + 2), 2, "HU", "")) { /* 'accident', 'accede' 'succeed' */ - if ( - ((current == 1) + if (((current == 1) && (GetAt(original, current - 1) == 'A')) || StringAt(original, (current - 1), 5, "UCCEE", "UCCES", "")) @@ -754,8 +752,7 @@ DoubleMetaphone(char *str, char **codes) * Parker's rule (with some further refinements) - e.g., * 'hugh' */ - if ( - ((current > 1) + if (((current > 1) && StringAt(original, (current - 2), 1, "B", "H", "D", "")) /* e.g., 'bough' */ @@ -848,14 +845,12 @@ DoubleMetaphone(char *str, char **codes) } /* -ger-, -gy- */ - if ( - (StringAt(original, (current + 1), 2, "ER", "") + if ((StringAt(original, (current + 1), 2, "ER", "") || (GetAt(original, current + 1) == 'Y')) && !StringAt(original, 0, 6, "DANGER", "RANGER", "MANGER", "") && !StringAt(original, (current - 1), 1, "E", "I", "") - && !StringAt(original, (current - 1), 3, "RGY", "OGY", - "")) + && !StringAt(original, (current - 1), 3, "RGY", "OGY", "")) { MetaphAdd(primary, "K"); MetaphAdd(secondary, "J"); @@ -869,8 +864,7 @@ DoubleMetaphone(char *str, char **codes) "AGGI", "OGGI", "")) { /* obvious germanic */ - if ( - (StringAt(original, 0, 4, "VAN ", "VON ", "") + if ((StringAt(original, 0, 4, "VAN ", "VON ", "") || StringAt(original, 0, 3, "SCH", "")) || StringAt(original, (current + 1), 2, "ET", "")) { diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c index c54071b1a8..01e59beaa3 100644 --- a/contrib/hstore/hstore_op.c +++ b/contrib/hstore/hstore_op.c @@ -612,9 +612,9 @@ hstore_slice_to_array(PG_FUNCTION_ARGS) } else { - out_datums[i] = PointerGetDatum( - cstring_to_text_with_len(HSTORE_VAL(entries, ptr, idx), - HSTORE_VALLEN(entries, idx))); + out_datums[i] = + PointerGetDatum(cstring_to_text_with_len(HSTORE_VAL(entries, ptr, idx), + HSTORE_VALLEN(entries, idx))); out_nulls[i] = false; } } diff --git a/contrib/intarray/_int_op.c b/contrib/intarray/_int_op.c index 0e3dcb467f..5b164f6788 100644 --- a/contrib/intarray/_int_op.c +++ b/contrib/intarray/_int_op.c @@ -45,13 +45,9 @@ _int_contains(PG_FUNCTION_ARGS) Datum _int_different(PG_FUNCTION_ARGS) { - PG_RETURN_BOOL(!DatumGetBool( - DirectFunctionCall2( - _int_same, + PG_RETURN_BOOL(!DatumGetBool(DirectFunctionCall2(_int_same, PointerGetDatum(PG_GETARG_POINTER(0)), - PointerGetDatum(PG_GETARG_POINTER(1)) - ) - )); + PointerGetDatum(PG_GETARG_POINTER(1))))); } Datum diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index 6b14ed5150..50f54f2eec 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -446,11 +446,9 @@ gist_qtxt(ltree_gist *key, ltxtquery *query) if (LTG_ISALLTRUE(key)) return true; - return ltree_execute( - GETQUERY(query), + return ltree_execute(GETQUERY(query), (void *) LTG_SIGN(key), false, - checkcondition_bit - ); + checkcondition_bit); } static bool diff --git a/contrib/ltree/lquery_op.c b/contrib/ltree/lquery_op.c index fa47710439..bfbcee6db4 100644 --- a/contrib/ltree/lquery_op.c +++ b/contrib/ltree/lquery_op.c @@ -65,11 +65,7 @@ compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, isok = false; while ((tn = getlexeme(tn, endt, &lent)) != NULL) { - if ( - ( - lent == lenq || - (lent > lenq && anyend) - ) && + if ((lent == lenq || (lent > lenq && anyend)) && (*cmpptr) (qn, tn, lenq) == 0) { @@ -118,11 +114,8 @@ checkLevel(lquery_level *curq, ltree_level *curt) if (compare_subnode(curt, curvar->name, curvar->len, cmpptr, (curvar->flag & LVAR_ANYEND))) return true; } - else if ( - ( - curvar->len == curt->len || - (curt->len > curvar->len && (curvar->flag & LVAR_ANYEND)) - ) && + else if ((curvar->len == curt->len || + (curt->len > curvar->len && (curvar->flag & LVAR_ANYEND))) && (*cmpptr) (curvar->name, curt->name, curvar->len) == 0) { diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 12aa8fff20..6ff4c3548b 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -258,10 +258,8 @@ typedef struct rix static int treekey_cmp(const void *a, const void *b) { - return ltree_compare( - ((const RIX *) a)->r, - ((const RIX *) b)->r - ); + return ltree_compare(((const RIX *) a)->r, + ((const RIX *) b)->r); } @@ -571,11 +569,9 @@ gist_qtxt(ltree_gist *key, ltxtquery *query) if (LTG_ISALLTRUE(key)) return true; - return ltree_execute( - GETQUERY(query), + return ltree_execute(GETQUERY(query), (void *) LTG_SIGN(key), false, - checkcondition_bit - ); + checkcondition_bit); } static bool @@ -636,11 +632,9 @@ ltree_consistent(PG_FUNCTION_ARGS) if (GIST_LEAF(entry)) res = (ltree_compare((ltree *) query, LTG_NODE(key)) == 0); else - res = ( - ltree_compare((ltree *) query, LTG_GETLNODE(key)) >= 0 + res = (ltree_compare((ltree *) query, LTG_GETLNODE(key)) >= 0 && - ltree_compare((ltree *) query, LTG_GETRNODE(key)) <= 0 - ); + ltree_compare((ltree *) query, LTG_GETRNODE(key)) <= 0); break; case BTGreaterEqualStrategyNumber: query = PG_GETARG_LTREE_P(1); diff --git a/contrib/ltree/ltxtquery_op.c b/contrib/ltree/ltxtquery_op.c index dc0ee82bb6..002102c9c7 100644 --- a/contrib/ltree/ltxtquery_op.c +++ b/contrib/ltree/ltxtquery_op.c @@ -68,11 +68,8 @@ checkcondition_str(void *checkval, ITEM *val) if (compare_subnode(level, op, val->length, cmpptr, (val->flag & LVAR_ANYEND))) return true; } - else if ( - ( - val->length == level->len || - (level->len > val->length && (val->flag & LVAR_ANYEND)) - ) && + else if ((val->length == level->len || + (level->len > val->length && (val->flag & LVAR_ANYEND))) && (*cmpptr) (op, level->name, val->length) == 0) return true; @@ -94,12 +91,10 @@ ltxtq_exec(PG_FUNCTION_ARGS) chkval.node = val; chkval.operand = GETOPERAND(query); - result = ltree_execute( - GETQUERY(query), + result = ltree_execute(GETQUERY(query), &chkval, true, - checkcondition_str - ); + checkcondition_str); PG_FREE_IF_COPY(val, 0); PG_FREE_IF_COPY(query, 1); diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c index 9a3eac2ae6..2b53dac64a 100644 --- a/contrib/oid2name/oid2name.c +++ b/contrib/oid2name/oid2name.c @@ -545,8 +545,7 @@ sql_exec_searchtables(PGconn *conn, struct options *opts) free(comma_filenodes); /* now build the query */ - todo = psprintf( - "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n" + todo = psprintf("SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n" "FROM pg_catalog.pg_class c\n" " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n" " LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),\n" diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index 61fe4359a0..20b4d32429 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -250,8 +250,7 @@ heap_page_items(PG_FUNCTION_ARGS) bits_len = BITMAPLEN(HeapTupleHeaderGetNatts(tuphdr)) * BITS_PER_BYTE; - values[11] = CStringGetTextDatum( - bits_to_text(tuphdr->t_bits, bits_len)); + values[11] = CStringGetTextDatum(bits_to_text(tuphdr->t_bits, bits_len)); } else nulls[11] = true; diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index e022d0b799..35a75c6066 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -878,9 +878,9 @@ gtrgm_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_l) && cache[j].allistrue) size_alpha = 0; else - size_alpha = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_l) : GETSIGN(cache[j].sign) - ); + size_alpha = SIGLENBIT - + sizebitvec((cache[j].allistrue) ? GETSIGN(datum_l) : + GETSIGN(cache[j].sign)); } else size_alpha = hemdistsign(cache[j].sign, GETSIGN(datum_l)); @@ -890,9 +890,9 @@ gtrgm_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_r) && cache[j].allistrue) size_beta = 0; else - size_beta = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_r) : GETSIGN(cache[j].sign) - ); + size_beta = SIGLENBIT - + sizebitvec((cache[j].allistrue) ? GETSIGN(datum_r) : + GETSIGN(cache[j].sign)); } else size_beta = hemdistsign(cache[j].sign, GETSIGN(datum_r)); diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c index c9c8cbc734..0670095c20 100644 --- a/contrib/pg_trgm/trgm_op.c +++ b/contrib/pg_trgm/trgm_op.c @@ -975,14 +975,12 @@ show_trgm(PG_FUNCTION_ARGS) d[i] = PointerGetDatum(item); } - a = construct_array( - d, + a = construct_array(d, ARRNELEM(trg), TEXTOID, -1, false, - 'i' - ); + 'i'); for (i = 0; i < ARRNELEM(trg); i++) pfree(DatumGetPointer(d[i])); diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index 4ff6694193..4a8e2be329 100644 --- a/contrib/seg/seg.c +++ b/contrib/seg/seg.c @@ -557,8 +557,9 @@ seg_contained(PG_FUNCTION_ARGS) Datum seg_same(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp == 0); } @@ -845,8 +846,9 @@ seg_cmp(PG_FUNCTION_ARGS) Datum seg_lt(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp < 0); } @@ -854,8 +856,9 @@ seg_lt(PG_FUNCTION_ARGS) Datum seg_le(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp <= 0); } @@ -863,8 +866,9 @@ seg_le(PG_FUNCTION_ARGS) Datum seg_gt(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp > 0); } @@ -872,8 +876,9 @@ seg_gt(PG_FUNCTION_ARGS) Datum seg_ge(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp >= 0); } @@ -882,8 +887,9 @@ seg_ge(PG_FUNCTION_ARGS) Datum seg_different(PG_FUNCTION_ARGS) { - int cmp = DatumGetInt32( - DirectFunctionCall2(seg_cmp, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))); + int cmp = DatumGetInt32(DirectFunctionCall2(seg_cmp, + PG_GETARG_DATUM(0), + PG_GETARG_DATUM(1))); PG_RETURN_BOOL(cmp != 0); } diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index cd105d91e0..93c948856e 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -419,9 +419,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, appendStringInfoString(ctx->out, "table "); appendStringInfoString(ctx->out, - quote_qualified_identifier( - get_namespace_name( - get_rel_namespace(RelationGetRelid(relation))), + quote_qualified_identifier(get_namespace_name(get_rel_namespace(RelationGetRelid(relation))), class_form->relrewrite ? get_rel_name(class_form->relrewrite) : NameStr(class_form->relname))); diff --git a/src/backend/access/gin/ginlogic.c b/src/backend/access/gin/ginlogic.c index 64bc2415bb..bcbc26efdb 100644 --- a/src/backend/access/gin/ginlogic.c +++ b/src/backend/access/gin/ginlogic.c @@ -94,8 +94,7 @@ directBoolConsistentFn(GinScanKey key) static GinTernaryValue directTriConsistentFn(GinScanKey key) { - return DatumGetGinTernaryValue(FunctionCall7Coll( - key->triConsistentFmgrInfo, + return DatumGetGinTernaryValue(FunctionCall7Coll(key->triConsistentFmgrInfo, key->collation, PointerGetDatum(key->entryRes), UInt16GetDatum(key->strategy), @@ -116,8 +115,7 @@ shimBoolConsistentFn(GinScanKey key) { GinTernaryValue result; - result = DatumGetGinTernaryValue(FunctionCall7Coll( - key->triConsistentFmgrInfo, + result = DatumGetGinTernaryValue(FunctionCall7Coll(key->triConsistentFmgrInfo, key->collation, PointerGetDatum(key->entryRes), UInt16GetDatum(key->strategy), diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index 6ba5619644..9ace64c3c4 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -1377,8 +1377,7 @@ gist_point_consistent(PG_FUNCTION_ARGS) { POLYGON *query = PG_GETARG_POLYGON_P(1); - result = DatumGetBool(DirectFunctionCall5( - gist_poly_consistent, + result = DatumGetBool(DirectFunctionCall5(gist_poly_consistent, PointerGetDatum(entry), PolygonPGetDatum(query), Int16GetDatum(RTOverlapStrategyNumber), @@ -1394,8 +1393,7 @@ gist_point_consistent(PG_FUNCTION_ARGS) Assert(box->high.x == box->low.x && box->high.y == box->low.y); - result = DatumGetBool(DirectFunctionCall2( - poly_contain_pt, + result = DatumGetBool(DirectFunctionCall2(poly_contain_pt, PolygonPGetDatum(query), PointPGetDatum(&box->high))); *recheck = false; @@ -1406,8 +1404,7 @@ gist_point_consistent(PG_FUNCTION_ARGS) { CIRCLE *query = PG_GETARG_CIRCLE_P(1); - result = DatumGetBool(DirectFunctionCall5( - gist_circle_consistent, + result = DatumGetBool(DirectFunctionCall5(gist_circle_consistent, PointerGetDatum(entry), CirclePGetDatum(query), Int16GetDatum(RTOverlapStrategyNumber), @@ -1423,8 +1420,7 @@ gist_point_consistent(PG_FUNCTION_ARGS) Assert(box->high.x == box->low.x && box->high.y == box->low.y); - result = DatumGetBool(DirectFunctionCall2( - circle_contain_pt, + result = DatumGetBool(DirectFunctionCall2(circle_contain_pt, CirclePGetDatum(query), PointPGetDatum(&box->high))); *recheck = false; diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 854136e9fa..db6fad76bc 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -4282,8 +4282,7 @@ l3: /* if the xmax changed in the meantime, start over */ if (xmax_infomask_changed(tuple->t_data->t_infomask, infomask) || - !TransactionIdEquals( - HeapTupleHeaderGetRawXmax(tuple->t_data), + !TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple->t_data), xwait)) goto l3; /* otherwise, we're good */ diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c index e388cc714a..fbc5942578 100644 --- a/src/backend/access/rmgrdesc/xactdesc.c +++ b/src/backend/access/rmgrdesc/xactdesc.c @@ -295,9 +295,9 @@ xact_desc_commit(StringInfo buf, uint8 info, xl_xact_commit *xlrec, RepOriginId xact_desc_relations(buf, "rels", parsed.nrels, parsed.xnodes); xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts); - standby_desc_invalidations( - buf, parsed.nmsgs, parsed.msgs, parsed.dbId, parsed.tsId, - XactCompletionRelcacheInitFileInval(parsed.xinfo)); + standby_desc_invalidations(buf, parsed.nmsgs, parsed.msgs, parsed.dbId, + parsed.tsId, + XactCompletionRelcacheInitFileInval(parsed.xinfo)); if (XactCompletionForceSyncCommit(parsed.xinfo)) appendStringInfoString(buf, "; sync"); @@ -344,9 +344,8 @@ xact_desc_prepare(StringInfo buf, uint8 info, xl_xact_prepare *xlrec) parsed.abortnodes); xact_desc_subxacts(buf, parsed.nsubxacts, parsed.subxacts); - standby_desc_invalidations( - buf, parsed.nmsgs, parsed.msgs, parsed.dbId, parsed.tsId, - xlrec->initfileinval); + standby_desc_invalidations(buf, parsed.nmsgs, parsed.msgs, parsed.dbId, + parsed.tsId, xlrec->initfileinval); } static void diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c index c264aef7ea..4d506bfb9a 100644 --- a/src/backend/access/spgist/spgscan.c +++ b/src/backend/access/spgist/spgscan.c @@ -650,8 +650,7 @@ spgInnerTest(SpGistScanOpaque so, SpGistSearchItem *item, { /* collect node pointers */ SpGistNodeTuple node; - SpGistNodeTuple *nodes = (SpGistNodeTuple *) palloc( - sizeof(SpGistNodeTuple) * nNodes); + SpGistNodeTuple *nodes = (SpGistNodeTuple *) palloc(sizeof(SpGistNodeTuple) * nNodes); SGITITERATE(innerTuple, i, node) { diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 017f03b6d8..e3c60f23cd 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -5779,22 +5779,19 @@ xact_redo_commit(xl_xact_parsed_commit *parsed, * bits set on changes made by transactions that haven't yet * recovered. It's unlikely but it's good to be safe. */ - TransactionIdAsyncCommitTree( - xid, parsed->nsubxacts, parsed->subxacts, lsn); + TransactionIdAsyncCommitTree(xid, parsed->nsubxacts, parsed->subxacts, lsn); /* * We must mark clog before we update the ProcArray. */ - ExpireTreeKnownAssignedTransactionIds( - xid, parsed->nsubxacts, parsed->subxacts, max_xid); + ExpireTreeKnownAssignedTransactionIds(xid, parsed->nsubxacts, parsed->subxacts, max_xid); /* * Send any cache invalidations attached to the commit. We must * maintain the same order of invalidation then release locks as * occurs in CommitTransaction(). */ - ProcessCommittedInvalidationMessages( - parsed->msgs, parsed->nmsgs, + ProcessCommittedInvalidationMessages(parsed->msgs, parsed->nmsgs, XactCompletionRelcacheInitFileInval(parsed->xinfo), parsed->dbId, parsed->tsId); @@ -5908,8 +5905,7 @@ xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid) /* * We must update the ProcArray after we have marked clog. */ - ExpireTreeKnownAssignedTransactionIds( - xid, parsed->nsubxacts, parsed->subxacts, max_xid); + ExpireTreeKnownAssignedTransactionIds(xid, parsed->nsubxacts, parsed->subxacts, max_xid); /* * There are no invalidation messages to send or undo. diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c index 0fdff2918f..709df9035f 100644 --- a/src/backend/catalog/heap.c +++ b/src/backend/catalog/heap.c @@ -2256,8 +2256,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, else { /* otherwise make a one-element array of the value */ - missingval = PointerGetDatum( - construct_array(&missingval, + missingval = PointerGetDatum(construct_array(&missingval, 1, defAttStruct->atttypid, defAttStruct->attlen, diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index 6d4154af50..71911d4067 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -2163,8 +2163,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS) /* command tag */ values[i++] = CStringGetTextDatum(CreateCommandTag(cmd->parsetree)); /* object_type */ - values[i++] = CStringGetTextDatum(stringify_adefprivs_objtype( - cmd->d.defprivs.objtype)); + values[i++] = CStringGetTextDatum(stringify_adefprivs_objtype(cmd->d.defprivs.objtype)); /* schema */ nulls[i++] = true; /* identity */ @@ -2186,8 +2185,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS) values[i++] = CStringGetTextDatum(cmd->d.grant.istmt->is_grant ? "GRANT" : "REVOKE"); /* object_type */ - values[i++] = CStringGetTextDatum(stringify_grant_objtype( - cmd->d.grant.istmt->objtype)); + values[i++] = CStringGetTextDatum(stringify_grant_objtype(cmd->d.grant.istmt->objtype)); /* schema */ nulls[i++] = true; /* identity */ diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 70589dd1dc..f0c4831d22 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -11464,8 +11464,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, attTup->attbyval, attTup->attalign, &isNull); - missingval = PointerGetDatum( - construct_array(&missingval, + missingval = PointerGetDatum(construct_array(&missingval, 1, targettype, tform->typlen, diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index f901baf1ed..061752ea9c 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -3816,8 +3816,7 @@ ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op) return; value = argvalue[0]; - *op->resvalue = PointerGetDatum( - xmltotext_with_xmloption(DatumGetXmlP(value), + *op->resvalue = PointerGetDatum(xmltotext_with_xmloption(DatumGetXmlP(value), xexpr->xmloption)); *op->resnull = false; } @@ -4174,8 +4173,7 @@ ExecAggInitGroup(AggState *aggstate, AggStatePerTrans pertrans, AggStatePerGroup * that the agg's input type is binary-compatible with its transtype, so * straight copy here is OK.) */ - oldContext = MemoryContextSwitchTo( - aggstate->curaggcontext->ecxt_per_tuple_memory); + oldContext = MemoryContextSwitchTo(aggstate->curaggcontext->ecxt_per_tuple_memory); pergroup->transValue = datumCopy(fcinfo->args[1].value, pertrans->transtypeByVal, pertrans->transtypeLen); diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 7b8cb91f04..9073395eac 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -475,8 +475,7 @@ initialize_aggregate(AggState *aggstate, AggStatePerTrans pertrans, { MemoryContext oldContext; - oldContext = MemoryContextSwitchTo( - aggstate->curaggcontext->ecxt_per_tuple_memory); + oldContext = MemoryContextSwitchTo(aggstate->curaggcontext->ecxt_per_tuple_memory); pergroupstate->transValue = datumCopy(pertrans->initValue, pertrans->transtypeByVal, pertrans->transtypeLen); @@ -582,8 +581,7 @@ advance_transition_function(AggState *aggstate, * We must copy the datum into aggcontext if it is pass-by-ref. We * do not need to pfree the old transValue, since it's NULL. */ - oldContext = MemoryContextSwitchTo( - aggstate->curaggcontext->ecxt_per_tuple_memory); + oldContext = MemoryContextSwitchTo(aggstate->curaggcontext->ecxt_per_tuple_memory); pergroupstate->transValue = datumCopy(fcinfo->args[1].value, pertrans->transtypeByVal, pertrans->transtypeLen); diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c index bd8c7f5811..c4f5a553ac 100644 --- a/src/backend/libpq/auth.c +++ b/src/backend/libpq/auth.c @@ -188,8 +188,7 @@ static int pg_GSS_recvauth(Port *port); */ #ifdef ENABLE_SSPI typedef SECURITY_STATUS - (WINAPI * QUERY_SECURITY_CONTEXT_TOKEN_FN) ( - PCtxtHandle, void **); + (WINAPI * QUERY_SECURITY_CONTEXT_TOKEN_FN) (PCtxtHandle, void **); static int pg_SSPI_recvauth(Port *port); static int pg_SSPI_make_upn(char *accountname, size_t accountnamesize, @@ -1147,8 +1146,7 @@ pg_GSS_recvauth(Port *port) elog(DEBUG4, "processing received GSS token of length %u", (unsigned int) gbuf.length); - maj_stat = gss_accept_sec_context( - &min_stat, + maj_stat = gss_accept_sec_context(&min_stat, &port->gss->ctx, port->gss->cred, &gbuf, diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index 7d2756e234..db54a6ba2e 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -1538,8 +1538,7 @@ match_unsorted_outer(PlannerInfo *root, if (save_jointype == JOIN_UNIQUE_INNER) return; - inner_cheapest_total = get_cheapest_parallel_safe_total_inner( - innerrel->pathlist); + inner_cheapest_total = get_cheapest_parallel_safe_total_inner(innerrel->pathlist); } if (inner_cheapest_total) diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index dff826a828..e048d200bb 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -5110,13 +5110,11 @@ static void bitmap_subplan_mark_shared(Plan *plan) { if (IsA(plan, BitmapAnd)) - bitmap_subplan_mark_shared( - linitial(((BitmapAnd *) plan)->bitmapplans)); + bitmap_subplan_mark_shared(linitial(((BitmapAnd *) plan)->bitmapplans)); else if (IsA(plan, BitmapOr)) { ((BitmapOr *) plan)->isshared = true; - bitmap_subplan_mark_shared( - linitial(((BitmapOr *) plan)->bitmapplans)); + bitmap_subplan_mark_shared(linitial(((BitmapOr *) plan)->bitmapplans)); } else if (IsA(plan, BitmapIndexScan)) ((BitmapIndexScan *) plan)->isshared = true; diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c index 51c486bebd..7169509a79 100644 --- a/src/backend/postmaster/pgstat.c +++ b/src/backend/postmaster/pgstat.c @@ -4571,14 +4571,12 @@ PgstatCollectorMain(int argc, char *argv[]) break; case PGSTAT_MTYPE_RESETSHAREDCOUNTER: - pgstat_recv_resetsharedcounter( - &msg.msg_resetsharedcounter, + pgstat_recv_resetsharedcounter(&msg.msg_resetsharedcounter, len); break; case PGSTAT_MTYPE_RESETSINGLECOUNTER: - pgstat_recv_resetsinglecounter( - &msg.msg_resetsinglecounter, + pgstat_recv_resetsinglecounter(&msg.msg_resetsinglecounter, len); break; @@ -4611,8 +4609,7 @@ PgstatCollectorMain(int argc, char *argv[]) break; case PGSTAT_MTYPE_RECOVERYCONFLICT: - pgstat_recv_recoveryconflict( - &msg.msg_recoveryconflict, + pgstat_recv_recoveryconflict(&msg.msg_recoveryconflict, len); break; @@ -4625,8 +4622,7 @@ PgstatCollectorMain(int argc, char *argv[]) break; case PGSTAT_MTYPE_CHECKSUMFAILURE: - pgstat_recv_checksum_failure( - &msg.msg_checksumfailure, + pgstat_recv_checksum_failure(&msg.msg_checksumfailure, len); break; diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c index 8095ae4cb1..2bba2b4f24 100644 --- a/src/backend/replication/logical/logicalfuncs.c +++ b/src/backend/replication/logical/logicalfuncs.c @@ -90,8 +90,7 @@ LogicalOutputWrite(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xi false)); /* ick, but cstring_to_text_with_len works for bytea perfectly fine */ - values[2] = PointerGetDatum( - cstring_to_text_with_len(ctx->out->data, ctx->out->len)); + values[2] = PointerGetDatum(cstring_to_text_with_len(ctx->out->data, ctx->out->len)); tuplestore_putvalues(p->tupstore, p->tupdesc, values, nulls); p->returned_rows++; diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index 73ca4f7884..aeebbf243a 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -3415,8 +3415,7 @@ ReorderBufferToastReplace(ReorderBuffer *rb, ReorderBufferTXN *txn, cchange = dlist_container(ReorderBufferChange, node, it.cur); ctup = cchange->data.tp.newtuple; - chunk = DatumGetPointer( - fastgetattr(&ctup->tuple, 3, toast_desc, &isnull)); + chunk = DatumGetPointer(fastgetattr(&ctup->tuple, 3, toast_desc, &isnull)); Assert(!isnull); Assert(!VARATT_IS_EXTERNAL(chunk)); diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 51925af6a0..bb85b5e52a 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -2558,8 +2558,7 @@ CreateCommandTag(Node *parsetree) * When the column is renamed, the command tag is created from its * relation type */ - tag = AlterObjectTypeCommandTag( - ((RenameStmt *) parsetree)->renameType == OBJECT_COLUMN ? + tag = AlterObjectTypeCommandTag(((RenameStmt *) parsetree)->renameType == OBJECT_COLUMN ? ((RenameStmt *) parsetree)->relationType : ((RenameStmt *) parsetree)->renameType); break; diff --git a/src/backend/tsearch/dict_thesaurus.c b/src/backend/tsearch/dict_thesaurus.c index fb91a34b02..cb0835982d 100644 --- a/src/backend/tsearch/dict_thesaurus.c +++ b/src/backend/tsearch/dict_thesaurus.c @@ -533,15 +533,11 @@ compileTheSubstitute(DictThesaurus *d) } else { - lexized = (TSLexeme *) DatumGetPointer( - FunctionCall4( - &(d->subdict->lexize), + lexized = (TSLexeme *) DatumGetPointer(FunctionCall4(&(d->subdict->lexize), PointerGetDatum(d->subdict->dictData), PointerGetDatum(inptr->lexeme), Int32GetDatum(strlen(inptr->lexeme)), - PointerGetDatum(NULL) - ) - ); + PointerGetDatum(NULL))); } if (lexized && lexized->lexeme) diff --git a/src/backend/tsearch/to_tsany.c b/src/backend/tsearch/to_tsany.c index 1fe67c4c99..e7cd6264db 100644 --- a/src/backend/tsearch/to_tsany.c +++ b/src/backend/tsearch/to_tsany.c @@ -49,8 +49,7 @@ compareWORD(const void *a, const void *b) { int res; - res = tsCompareString( - ((const ParsedWord *) a)->word, ((const ParsedWord *) a)->len, + res = tsCompareString(((const ParsedWord *) a)->word, ((const ParsedWord *) a)->len, ((const ParsedWord *) b)->word, ((const ParsedWord *) b)->len, false); diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c index 1681621657..1c0f94e797 100644 --- a/src/backend/tsearch/ts_parse.c +++ b/src/backend/tsearch/ts_parse.c @@ -204,13 +204,11 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem) ld->dictState.isend = ld->dictState.getnext = false; ld->dictState.private_state = NULL; - res = (TSLexeme *) DatumGetPointer(FunctionCall4( - &(dict->lexize), + res = (TSLexeme *) DatumGetPointer(FunctionCall4(&(dict->lexize), PointerGetDatum(dict->dictData), PointerGetDatum(curValLemm), Int32GetDatum(curValLenLemm), - PointerGetDatum(&ld->dictState) - )); + PointerGetDatum(&ld->dictState))); if (ld->dictState.getnext) { @@ -293,13 +291,11 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem) ld->dictState.isend = (curVal->type == 0) ? true : false; ld->dictState.getnext = false; - res = (TSLexeme *) DatumGetPointer(FunctionCall4( - &(dict->lexize), + res = (TSLexeme *) DatumGetPointer(FunctionCall4(&(dict->lexize), PointerGetDatum(dict->dictData), PointerGetDatum(curVal->lemm), Int32GetDatum(curVal->lenlemm), - PointerGetDatum(&ld->dictState) - )); + PointerGetDatum(&ld->dictState))); if (ld->dictState.getnext) { diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 792f9ca4fa..f58331de75 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -6217,8 +6217,7 @@ int8_to_char(PG_FUNCTION_ARGS) if (IS_ROMAN(&Num)) { /* Currently don't support int8 conversion to roman... */ - numstr = orgnum = int_to_roman(DatumGetInt32( - DirectFunctionCall1(int84, Int64GetDatum(value)))); + numstr = orgnum = int_to_roman(DatumGetInt32(DirectFunctionCall1(int84, Int64GetDatum(value)))); } else if (IS_EEEE(&Num)) { diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index 74f899f24d..7b2da2b36f 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -1501,8 +1501,7 @@ pg_stat_get_db_conflict_all(PG_FUNCTION_ARGS) if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) result = 0; else - result = (int64) ( - dbentry->n_conflict_tablespace + + result = (int64) (dbentry->n_conflict_tablespace + dbentry->n_conflict_lock + dbentry->n_conflict_snapshot + dbentry->n_conflict_bufferpin + @@ -1973,6 +1972,5 @@ pg_stat_get_archiver(PG_FUNCTION_ARGS) values[6] = TimestampTzGetDatum(archiver_stats->stat_reset_timestamp); /* Returns the record as Datum */ - PG_RETURN_DATUM(HeapTupleGetDatum( - heap_form_tuple(tupdesc, values, nulls))); + PG_RETURN_DATUM(HeapTupleGetDatum(heap_form_tuple(tupdesc, values, nulls))); } diff --git a/src/backend/utils/adt/rangetypes_spgist.c b/src/backend/utils/adt/rangetypes_spgist.c index 6fbd523bbb..dd2bc742aa 100644 --- a/src/backend/utils/adt/rangetypes_spgist.c +++ b/src/backend/utils/adt/rangetypes_spgist.c @@ -346,8 +346,7 @@ spg_range_quad_inner_consistent(PG_FUNCTION_ARGS) * is RANGESTRAT_CONTAINS_ELEM. */ if (strategy != RANGESTRAT_CONTAINS_ELEM) - empty = RangeIsEmpty( - DatumGetRangeTypeP(in->scankeys[i].sk_argument)); + empty = RangeIsEmpty(DatumGetRangeTypeP(in->scankeys[i].sk_argument)); else empty = false; diff --git a/src/backend/utils/adt/rangetypes_typanalyze.c b/src/backend/utils/adt/rangetypes_typanalyze.c index fe6a75a0ca..57413b0720 100644 --- a/src/backend/utils/adt/rangetypes_typanalyze.c +++ b/src/backend/utils/adt/rangetypes_typanalyze.c @@ -165,8 +165,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, * For an ordinary range, use subdiff function between upper * and lower bound values. */ - length = DatumGetFloat8(FunctionCall2Coll( - &typcache->rng_subdiff_finfo, + length = DatumGetFloat8(FunctionCall2Coll(&typcache->rng_subdiff_finfo, typcache->rng_collation, upper.val, lower.val)); } @@ -246,8 +245,10 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, for (i = 0; i < num_hist; i++) { - bound_hist_values[i] = PointerGetDatum(range_serialize( - typcache, &lowers[pos], &uppers[pos], false)); + bound_hist_values[i] = PointerGetDatum(range_serialize(typcache, + &lowers[pos], + &uppers[pos], + false)); pos += delta; posfrac += deltafrac; if (posfrac >= (num_hist - 1)) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 116e00bce4..158784474d 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -6453,8 +6453,7 @@ get_update_query_targetlist_def(Query *query, List *targetList, { cur_ma_sublink = (SubLink *) lfirst(next_ma_cell); next_ma_cell = lnext(ma_sublinks, next_ma_cell); - remaining_ma_columns = count_nonjunk_tlist_entries( - ((Query *) cur_ma_sublink->subselect)->targetList); + remaining_ma_columns = count_nonjunk_tlist_entries(((Query *) cur_ma_sublink->subselect)->targetList); Assert(((Param *) expr)->paramid == ((cur_ma_sublink->subLinkId << 16) | 1)); appendStringInfoChar(buf, '('); diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index ef99365b87..0b6c9d5ea8 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -5459,8 +5459,7 @@ generate_series_timestamp(PG_FUNCTION_ARGS) timestamp_cmp_internal(result, fctx->finish) >= 0) { /* increment current in preparation for next iteration */ - fctx->current = DatumGetTimestamp( - DirectFunctionCall2(timestamp_pl_interval, + fctx->current = DatumGetTimestamp(DirectFunctionCall2(timestamp_pl_interval, TimestampGetDatum(fctx->current), PointerGetDatum(&fctx->step))); @@ -5540,8 +5539,7 @@ generate_series_timestamptz(PG_FUNCTION_ARGS) timestamp_cmp_internal(result, fctx->finish) >= 0) { /* increment current in preparation for next iteration */ - fctx->current = DatumGetTimestampTz( - DirectFunctionCall2(timestamptz_pl_interval, + fctx->current = DatumGetTimestampTz(DirectFunctionCall2(timestamptz_pl_interval, TimestampTzGetDatum(fctx->current), PointerGetDatum(&fctx->step))); diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index 7fd32bcceb..8320dcda80 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -704,9 +704,9 @@ gtsvector_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_l) && cache[j].allistrue) size_alpha = 0; else - size_alpha = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_l) : GETSIGN(cache[j].sign) - ); + size_alpha = SIGLENBIT - sizebitvec((cache[j].allistrue) ? + GETSIGN(datum_l) : + GETSIGN(cache[j].sign)); } else size_alpha = hemdistsign(cache[j].sign, GETSIGN(datum_l)); @@ -716,9 +716,9 @@ gtsvector_picksplit(PG_FUNCTION_ARGS) if (ISALLTRUE(datum_r) && cache[j].allistrue) size_beta = 0; else - size_beta = SIGLENBIT - sizebitvec( - (cache[j].allistrue) ? GETSIGN(datum_r) : GETSIGN(cache[j].sign) - ); + size_beta = SIGLENBIT - sizebitvec((cache[j].allistrue) ? + GETSIGN(datum_r) : + GETSIGN(cache[j].sign)); } else size_beta = hemdistsign(cache[j].sign, GETSIGN(datum_r)); diff --git a/src/backend/utils/adt/tsquery_op.c b/src/backend/utils/adt/tsquery_op.c index 663b434b6a..ea40804110 100644 --- a/src/backend/utils/adt/tsquery_op.c +++ b/src/backend/utils/adt/tsquery_op.c @@ -148,8 +148,7 @@ tsquery_phrase_distance(PG_FUNCTION_ARGS) Datum tsquery_phrase(PG_FUNCTION_ARGS) { - PG_RETURN_POINTER(DirectFunctionCall3( - tsquery_phrase_distance, + PG_RETURN_POINTER(DirectFunctionCall3(tsquery_phrase_distance, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1), Int32GetDatum(1))); @@ -353,11 +352,7 @@ tsq_mcontains(PG_FUNCTION_ARGS) Datum tsq_mcontained(PG_FUNCTION_ARGS) { - PG_RETURN_DATUM( - DirectFunctionCall2( - tsq_mcontains, + PG_RETURN_DATUM(DirectFunctionCall2(tsq_mcontains, PG_GETARG_DATUM(1), - PG_GETARG_DATUM(0) - ) - ); + PG_GETARG_DATUM(0))); } diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index e33ca5abe7..cab6874e70 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -666,9 +666,7 @@ tsvector_unnest(PG_FUNCTION_ARGS) bool nulls[] = {false, false, false}; Datum values[3]; - values[0] = PointerGetDatum( - cstring_to_text_with_len(data + arrin[i].pos, arrin[i].len) - ); + values[0] = PointerGetDatum(cstring_to_text_with_len(data + arrin[i].pos, arrin[i].len)); if (arrin[i].haspos) { @@ -689,15 +687,14 @@ tsvector_unnest(PG_FUNCTION_ARGS) { positions[j] = Int16GetDatum(WEP_GETPOS(posv->pos[j])); weight = 'D' - WEP_GETWEIGHT(posv->pos[j]); - weights[j] = PointerGetDatum( - cstring_to_text_with_len(&weight, 1) - ); + weights[j] = PointerGetDatum(cstring_to_text_with_len(&weight, + 1)); } - values[1] = PointerGetDatum( - construct_array(positions, posv->npos, INT2OID, 2, true, 's')); - values[2] = PointerGetDatum( - construct_array(weights, posv->npos, TEXTOID, -1, false, 'i')); + values[1] = PointerGetDatum(construct_array(positions, posv->npos, + INT2OID, 2, true, 's')); + values[2] = PointerGetDatum(construct_array(weights, posv->npos, + TEXTOID, -1, false, 'i')); } else { @@ -730,9 +727,8 @@ tsvector_to_array(PG_FUNCTION_ARGS) for (i = 0; i < tsin->size; i++) { - elements[i] = PointerGetDatum( - cstring_to_text_with_len(STRPTR(tsin) + arrin[i].pos, arrin[i].len) - ); + elements[i] = PointerGetDatum(cstring_to_text_with_len(STRPTR(tsin) + arrin[i].pos, + arrin[i].len)); } array = construct_array(elements, tsin->size, TEXTOID, -1, false, 'i'); diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index f2b4997392..419b58330f 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -199,8 +199,7 @@ pg_control_checkpoint(PG_FUNCTION_ARGS) values[16] = TransactionIdGetDatum(ControlFile->checkPointCopy.newestCommitTsXid); nulls[16] = false; - values[17] = TimestampTzGetDatum( - time_t_to_timestamptz(ControlFile->checkPointCopy.time)); + values[17] = TimestampTzGetDatum(time_t_to_timestamptz(ControlFile->checkPointCopy.time)); nulls[17] = false; htup = heap_form_tuple(tupdesc, values, nulls); diff --git a/src/bin/pg_upgrade/tablespace.c b/src/bin/pg_upgrade/tablespace.c index eba4d835d3..11a2429738 100644 --- a/src/bin/pg_upgrade/tablespace.c +++ b/src/bin/pg_upgrade/tablespace.c @@ -57,8 +57,8 @@ get_tablespace_paths(void) res = executeQueryOrDie(conn, "%s", query); if ((os_info.num_old_tablespaces = PQntuples(res)) != 0) - os_info.old_tablespaces = (char **) pg_malloc( - os_info.num_old_tablespaces * sizeof(char *)); + os_info.old_tablespaces = + (char **) pg_malloc(os_info.num_old_tablespaces * sizeof(char *)); else os_info.old_tablespaces = NULL; @@ -68,8 +68,7 @@ get_tablespace_paths(void) { struct stat statBuf; - os_info.old_tablespaces[tblnum] = pg_strdup( - PQgetvalue(res, tblnum, i_spclocation)); + os_info.old_tablespaces[tblnum] = pg_strdup(PQgetvalue(res, tblnum, i_spclocation)); /* * Check that the tablespace path exists and is a directory. diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index f2cbbf2023..66b47d98cb 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -663,8 +663,7 @@ helpSQL(const char *topic, unsigned short int pager) void print_copyright(void) { - puts( - "PostgreSQL Database Management System\n" + puts("PostgreSQL Database Management System\n" "(formerly known as Postgres, then as Postgres95)\n\n" "Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group\n\n" "Portions Copyright (c) 1994, The Regents of the University of California\n\n" @@ -681,6 +680,5 @@ print_copyright(void) "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n" "AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS\n" "ON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO\n" - "PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n" - ); + "PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n"); } diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index c57dee4e27..2e2d217352 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -2301,10 +2301,7 @@ PQconnectPoll(PGconn *conn) default: appendPQExpBufferStr(&conn->errorMessage, - libpq_gettext( - "invalid connection state, " - "probably indicative of memory corruption\n" - )); + libpq_gettext("invalid connection state, probably indicative of memory corruption\n")); goto error_return; } @@ -3217,9 +3214,7 @@ keep_going: /* We will come back to here until there is if (!(beresp == 'R' || beresp == 'E')) { appendPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "expected authentication request from " - "server, but received %c\n"), + libpq_gettext("expected authentication request from server, but received %c\n"), beresp); goto error_return; } @@ -3250,9 +3245,7 @@ keep_going: /* We will come back to here until there is if (beresp == 'R' && (msgLength < 8 || msgLength > 2000)) { appendPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "expected authentication request from " - "server, but received %c\n"), + libpq_gettext("expected authentication request from server, but received %c\n"), beresp); goto error_return; } @@ -4637,8 +4630,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, p = strchr(url + strlen(LDAP_URL), '/'); if (p == NULL || *(p + 1) == '\0' || *(p + 1) == '?') { - printfPQExpBuffer(errorMessage, libpq_gettext( - "invalid LDAP URL \"%s\": missing distinguished name\n"), purl); + printfPQExpBuffer(errorMessage, + libpq_gettext("invalid LDAP URL \"%s\": missing distinguished name\n"), + purl); free(url); return 3; } @@ -4648,8 +4642,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, /* attribute */ if ((p = strchr(dn, '?')) == NULL || *(p + 1) == '\0' || *(p + 1) == '?') { - printfPQExpBuffer(errorMessage, libpq_gettext( - "invalid LDAP URL \"%s\": must have exactly one attribute\n"), purl); + printfPQExpBuffer(errorMessage, + libpq_gettext("invalid LDAP URL \"%s\": must have exactly one attribute\n"), + purl); free(url); return 3; } @@ -4690,8 +4685,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, lport = strtol(portstr, &endptr, 10); if (*portstr == '\0' || *endptr != '\0' || errno || lport < 0 || lport > 65535) { - printfPQExpBuffer(errorMessage, libpq_gettext( - "invalid LDAP URL \"%s\": invalid port number\n"), purl); + printfPQExpBuffer(errorMessage, + libpq_gettext("invalid LDAP URL \"%s\": invalid port number\n"), + purl); free(url); return 3; } @@ -4701,8 +4697,9 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, /* Allow only one attribute */ if (strchr(attrs[0], ',') != NULL) { - printfPQExpBuffer(errorMessage, libpq_gettext( - "invalid LDAP URL \"%s\": must have exactly one attribute\n"), purl); + printfPQExpBuffer(errorMessage, + libpq_gettext("invalid LDAP URL \"%s\": must have exactly one attribute\n"), + purl); free(url); return 3; } @@ -4900,8 +4897,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, } else if (ld_is_nl_cr(*p)) { - printfPQExpBuffer(errorMessage, libpq_gettext( - "missing \"=\" after \"%s\" in connection info string\n"), + printfPQExpBuffer(errorMessage, + libpq_gettext("missing \"=\" after \"%s\" in connection info string\n"), optname); free(result); return 3; @@ -4919,8 +4916,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, } else if (!ld_is_sp_tab(*p)) { - printfPQExpBuffer(errorMessage, libpq_gettext( - "missing \"=\" after \"%s\" in connection info string\n"), + printfPQExpBuffer(errorMessage, + libpq_gettext("missing \"=\" after \"%s\" in connection info string\n"), optname); free(result); return 3; @@ -5008,8 +5005,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options, if (state == 5 || state == 6) { - printfPQExpBuffer(errorMessage, libpq_gettext( - "unterminated quoted string in connection info string\n")); + printfPQExpBuffer(errorMessage, + libpq_gettext("unterminated quoted string in connection info string\n")); return 3; } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index a9074d2f29..19729f9631 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -802,8 +802,7 @@ retry4: */ definitelyEOF: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "server closed the connection unexpectedly\n" + libpq_gettext("server closed the connection unexpectedly\n" "\tThis probably means the server terminated abnormally\n" "\tbefore or while processing the request.\n")); diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c index 275ecc5a0a..9360c541be 100644 --- a/src/interfaces/libpq/fe-protocol2.c +++ b/src/interfaces/libpq/fe-protocol2.c @@ -84,10 +84,7 @@ pqSetenvPoll(PGconn *conn) default: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "invalid setenv state %c, " - "probably indicative of memory corruption\n" - ), + libpq_gettext("invalid setenv state %c, probably indicative of memory corruption\n"), conn->setenv_state); goto error_return; } @@ -626,8 +623,7 @@ pqParseInput2(PGconn *conn) */ default: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "unexpected response from server; first received character was \"%c\"\n"), + libpq_gettext("unexpected response from server; first received character was \"%c\"\n"), id); /* build an error result holding the error message */ pqSaveErrorResult(conn); diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index 850bf84c96..1696525475 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -405,8 +405,7 @@ pqParseInput3(PGconn *conn) break; default: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "unexpected response from server; first received character was \"%c\"\n"), + libpq_gettext("unexpected response from server; first received character was \"%c\"\n"), id); /* build an error result holding the error message */ pqSaveErrorResult(conn); @@ -447,8 +446,7 @@ static void handleSyncLoss(PGconn *conn, char id, int msgLength) { printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "lost synchronization with server: got message type \"%c\", length %d\n"), + libpq_gettext("lost synchronization with server: got message type \"%c\", length %d\n"), id, msgLength); /* build an error result holding the error message */ pqSaveErrorResult(conn); diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c index 026b14fa72..cf142fbaa4 100644 --- a/src/interfaces/libpq/fe-secure-openssl.c +++ b/src/interfaces/libpq/fe-secure-openssl.c @@ -206,8 +206,7 @@ rloop: if (result_errno == EPIPE || result_errno == ECONNRESET) printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "server closed the connection unexpectedly\n" + libpq_gettext("server closed the connection unexpectedly\n" "\tThis probably means the server terminated abnormally\n" "\tbefore or while processing the request.\n")); else @@ -314,8 +313,7 @@ pgtls_write(PGconn *conn, const void *ptr, size_t len) result_errno = SOCK_ERRNO; if (result_errno == EPIPE || result_errno == ECONNRESET) printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "server closed the connection unexpectedly\n" + libpq_gettext("server closed the connection unexpectedly\n" "\tThis probably means the server terminated abnormally\n" "\tbefore or while processing the request.\n")); else @@ -578,10 +576,8 @@ pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn, if (cn_index >= 0) { (*names_examined)++; - rc = openssl_verify_peer_name_matches_certificate_name( - conn, - X509_NAME_ENTRY_get_data( - X509_NAME_get_entry(subject_name, cn_index)), + rc = openssl_verify_peer_name_matches_certificate_name(conn, + X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subject_name, cn_index)), first_name); } } diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c index 52f6e8790e..b455b45e96 100644 --- a/src/interfaces/libpq/fe-secure.c +++ b/src/interfaces/libpq/fe-secure.c @@ -264,8 +264,7 @@ pqsecure_raw_read(PGconn *conn, void *ptr, size_t len) #ifdef ECONNRESET case ECONNRESET: printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "server closed the connection unexpectedly\n" + libpq_gettext("server closed the connection unexpectedly\n" "\tThis probably means the server terminated abnormally\n" "\tbefore or while processing the request.\n")); break; @@ -381,8 +380,7 @@ retry_masked: case ECONNRESET: #endif printfPQExpBuffer(&conn->errorMessage, - libpq_gettext( - "server closed the connection unexpectedly\n" + libpq_gettext("server closed the connection unexpectedly\n" "\tThis probably means the server terminated abnormally\n" "\tbefore or while processing the request.\n")); break; diff --git a/src/interfaces/libpq/win32.c b/src/interfaces/libpq/win32.c index 25ca38754f..cd19ec9252 100644 --- a/src/interfaces/libpq/win32.c +++ b/src/interfaces/libpq/win32.c @@ -291,8 +291,7 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen) if (!dlls[i].loaded) { dlls[i].loaded = 1; /* Only load once */ - dlls[i].handle = (void *) LoadLibraryEx( - dlls[i].dll_name, + dlls[i].handle = (void *) LoadLibraryEx(dlls[i].dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); } @@ -304,13 +303,11 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen) | FORMAT_MESSAGE_IGNORE_INSERTS | (dlls[i].handle ? FORMAT_MESSAGE_FROM_HMODULE : 0); - success = 0 != FormatMessage( - flags, + success = 0 != FormatMessage(flags, dlls[i].handle, err, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), strerrbuf, buflen - 64, - 0 - ); + 0); } if (!success) diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index c78891868a..f5de2332d5 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -1631,11 +1631,8 @@ plperl_trigger_build_args(FunctionCallInfo fcinfo) tdata = (TriggerData *) fcinfo->context; tupdesc = tdata->tg_relation->rd_att; - relid = DatumGetCString( - DirectFunctionCall1(oidout, - ObjectIdGetDatum(tdata->tg_relation->rd_id) - ) - ); + relid = DatumGetCString(DirectFunctionCall1(oidout, + ObjectIdGetDatum(tdata->tg_relation->rd_id))); hv_store_string(hv, "name", cstr2sv(tdata->tg_trigger->tgname)); hv_store_string(hv, "relid", cstr2sv(relid)); diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c index 71b433ef26..ae0b97c85d 100644 --- a/src/pl/plpython/plpy_elog.c +++ b/src/pl/plpython/plpy_elog.c @@ -297,12 +297,10 @@ PLy_traceback(PyObject *e, PyObject *v, PyObject *tb, plain_lineno = PyInt_AsLong(lineno); if (proname == NULL) - appendStringInfo( - &tbstr, "\n PL/Python anonymous code block, line %ld, in %s", + appendStringInfo(&tbstr, "\n PL/Python anonymous code block, line %ld, in %s", plain_lineno - 1, fname); else - appendStringInfo( - &tbstr, "\n PL/Python function \"%s\", line %ld, in %s", + appendStringInfo(&tbstr, "\n PL/Python function \"%s\", line %ld, in %s", proname, plain_lineno - 1, fname); /* diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index e7640008fd..f0d170bec7 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -2746,8 +2746,7 @@ pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp *interp, if (strlen(nulls) != qdesc->nargs) { Tcl_SetObjResult(interp, - Tcl_NewStringObj( - "length of nulls string doesn't match number of arguments", + Tcl_NewStringObj("length of nulls string doesn't match number of arguments", -1)); return TCL_ERROR; } @@ -2762,9 +2761,8 @@ pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp *interp, if (i >= objc) { Tcl_SetObjResult(interp, - Tcl_NewStringObj( - "argument list length doesn't match number of arguments for query" - ,-1)); + Tcl_NewStringObj("argument list length doesn't match number of arguments for query", + -1)); return TCL_ERROR; } diff --git a/src/port/gettimeofday.c b/src/port/gettimeofday.c index e11f068052..ee8fe82337 100644 --- a/src/port/gettimeofday.c +++ b/src/port/gettimeofday.c @@ -74,8 +74,7 @@ init_gettimeofday(LPFILETIME lpSystemTimeAsFileTime) * and determining the windows version is its self somewhat Windows * version and development SDK specific... */ - pg_get_system_time = (PgGetSystemTimeFn) GetProcAddress( - GetModuleHandle(TEXT("kernel32.dll")), + pg_get_system_time = (PgGetSystemTimeFn) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetSystemTimePreciseAsFileTime"); if (pg_get_system_time == NULL) { diff --git a/src/timezone/zic.c b/src/timezone/zic.c index c27fb456d0..af15bcad96 100644 --- a/src/timezone/zic.c +++ b/src/timezone/zic.c @@ -1498,15 +1498,13 @@ inzone(char **fields, int nfields) } if (lcltime != NULL && strcmp(fields[ZF_NAME], tzdefault) == 0) { - error( - _("\"Zone %s\" line and -l option are mutually exclusive"), + error(_("\"Zone %s\" line and -l option are mutually exclusive"), tzdefault); return false; } if (strcmp(fields[ZF_NAME], TZDEFRULES) == 0 && psxrules != NULL) { - error( - _("\"Zone %s\" line and -p option are mutually exclusive"), + error(_("\"Zone %s\" line and -p option are mutually exclusive"), TZDEFRULES); return false; } -- 2.20.1