Initial pgindent run with pg_bsd_indent version 2.0.

Enterprise / PostgreSQL - Tom Lane [sss.pgh.pa.us] - 21 June 2017 14:39 EDT

The new indent version includes numerous fixes thanks to Piotr Stefaniak. The main changes visible in this commit are:

- Nicer formatting of function-pointer declarations.
- No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof.
- No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers.
- Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.
- Fixes bug where comments following declarations were sometimes placed with no space separating them from the code.
- Fixes some odd decisions for comments following case labels.
- Fixes some cases where comments following code were indented to less than the expected column 33.

On the less good side, it now tends to put more whitespace around typedef names that are not listed in typedefs.list. This might encourage us to put more effort into typedef name collection; it's not really a bug in indent itself.

There are more changes coming after this round, having to do with comment indentation and alignment of lines appearing within parentheses. I wanted to limit the size of the diffs to something that could be reviewed without one's eyes completely glazing over, so it seemed better to split up the changes as much as practical.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us

e3860ff Initial pgindent run with pg_bsd_indent version 2.0.
contrib/bloom/blutils.c | 2 +-
contrib/btree_gist/btree_utils_var.c | 2 +-
contrib/dblink/dblink.c | 4 +-
contrib/fuzzystrmatch/fuzzystrmatch.c | 4 +-
contrib/intarray/_int_gin.c | 2 +-
contrib/ltree/lquery_op.c | 2 +-
contrib/oid2name/oid2name.c | 14 +-
contrib/pg_stat_statements/pg_stat_statements.c | 2 +-
contrib/pg_trgm/trgm_op.c | 8 +-
contrib/pg_visibility/pg_visibility.c | 2 +-
contrib/pgcrypto/imath.c | 8 +-
contrib/pgcrypto/imath.h | 5 +-
contrib/pgcrypto/internal.c | 2 +-
contrib/pgcrypto/mbuf.h | 4 +-
contrib/pgcrypto/pgp-decrypt.c | 8 +-
contrib/pgcrypto/pgp-pgsql.c | 10 +-
contrib/pgcrypto/px-crypt.c | 4 +-
contrib/pgcrypto/px.h | 6 +-
contrib/pgcrypto/rijndael.h | 3 +-
contrib/pgcrypto/sha1.c | 10 +-
contrib/pgstattuple/pgstatapprox.c | 2 +-
contrib/pgstattuple/pgstattuple.c | 6 +-
contrib/sepgsql/hooks.c | 2 +-
contrib/sepgsql/label.c | 4 +-
contrib/sepgsql/selinux.c | 4 +-
contrib/sepgsql/sepgsql.h | 2 +-
contrib/sepgsql/uavc.c | 2 +-
contrib/spi/timetravel.c | 2 +-
contrib/uuid-ossp/uuid-ossp.c | 10 +-
contrib/vacuumlo/vacuumlo.c | 4 +-
contrib/xml2/xpath.c | 2 +-
src/backend/access/common/reloptions.c | 28 +--
src/backend/access/gin/ginarrayproc.c | 2 +-
src/backend/access/gin/gindatapage.c | 2 +-
src/backend/access/hash/hash.c | 2 +-
src/backend/access/hash/hash_xlog.c | 4 +-
src/backend/access/hash/hashovfl.c | 2 +-
src/backend/access/heap/rewriteheap.c | 10 +-
src/backend/access/heap/tuptoaster.c | 22 +-
src/backend/access/nbtree/nbtree.c | 8 +-
src/backend/access/spgist/spgdoinsert.c | 4 +-
src/backend/access/spgist/spgscan.c | 4 +-
src/backend/access/transam/parallel.c | 2 +-
src/backend/access/transam/slru.c | 2 +-
src/backend/access/transam/twophase.c | 4 +-
src/backend/access/transam/xlog.c | 8 +-
src/backend/catalog/index.c | 2 +-
src/backend/catalog/partition.c | 6 +-
src/backend/commands/copy.c | 2 +-
src/backend/commands/extension.c | 3 +-
src/backend/commands/functioncmds.c | 2 +-
src/backend/commands/publicationcmds.c | 2 +-
src/backend/commands/tablecmds.c | 56 +++--
src/backend/commands/trigger.c | 6 +-
src/backend/commands/vacuumlazy.c | 8 +-
src/backend/executor/execCurrent.c | 2 +-
src/backend/executor/functions.c | 2 +-
src/backend/executor/nodeAgg.c | 10 +-
src/backend/executor/nodeHashjoin.c | 2 +-
src/backend/executor/nodeMaterial.c | 2 +-
src/backend/executor/nodeMergejoin.c | 4 +-
src/backend/executor/nodeProjectSet.c | 2 +-
src/backend/executor/nodeSetOp.c | 4 +-
src/backend/executor/nodeWindowAgg.c | 2 +-
src/backend/lib/binaryheap.c | 2 +-
src/backend/lib/ilist.c | 2 +-
src/backend/lib/rbtree.c | 6 +-
src/backend/libpq/auth.c | 25 ++-
src/backend/libpq/be-fsstubs.c | 6 +-
src/backend/libpq/hba.c | 18 +-
src/backend/libpq/ifaddr.c | 52 ++---
src/backend/libpq/pqcomm.c | 6 +-
src/backend/nodes/nodeFuncs.c | 4 +-
src/backend/optimizer/path/costsize.c | 4 +-
src/backend/optimizer/path/joinrels.c | 2 +-
src/backend/optimizer/prep/prepjointree.c | 2 +-
src/backend/optimizer/util/predtest.c | 2 +-
src/backend/parser/parse_expr.c | 2 +-
src/backend/parser/parse_func.c | 4 +-
src/backend/port/win32/crashdump.c | 2 +-
src/backend/port/win32/socket.c | 8 +-
src/backend/port/win32/timer.c | 2 +-
src/backend/postmaster/autovacuum.c | 6 +-
src/backend/postmaster/bgworker.c | 2 +-
src/backend/postmaster/pgstat.c | 14 +-
src/backend/postmaster/postmaster.c | 23 +-
src/backend/postmaster/syslogger.c | 2 +-
src/backend/regex/regc_color.c | 84 +++----
src/backend/regex/regc_cvec.c | 10 +-
src/backend/regex/regc_lex.c | 26 +--
src/backend/regex/regc_locale.c | 16 +-
src/backend/regex/regc_nfa.c | 242 ++++++++++-----------
src/backend/regex/regcomp.c | 134 ++++++------
src/backend/regex/rege_dfa.c | 50 ++---
src/backend/regex/regerror.c | 2 +-
src/backend/regex/regexec.c | 64 +++---
src/backend/regex/regexport.c | 2 +-
src/backend/regex/regprefix.c | 6 +-
src/backend/replication/basebackup.c | 12 +-
src/backend/replication/logical/reorderbuffer.c | 3 +-
src/backend/replication/walreceiver.c | 2 +-
src/backend/replication/walsender.c | 5 +-
src/backend/rewrite/rewriteHandler.c | 2 +-
src/backend/snowball/dict_snowball.c | 2 +-
src/backend/statistics/dependencies.c | 8 +-
src/backend/statistics/extended_stats.c | 2 +-
src/backend/statistics/mvdistinct.c | 6 +-
src/backend/storage/buffer/bufmgr.c | 4 +-
src/backend/storage/buffer/freelist.c | 2 +-
src/backend/storage/ipc/dsm.c | 2 +-
src/backend/storage/ipc/shm_mq.c | 6 +-
src/backend/storage/ipc/shm_toc.c | 6 +-
src/backend/storage/ipc/shmem.c | 2 +-
src/backend/storage/lmgr/lwlock.c | 16 +-
src/backend/storage/lmgr/predicate.c | 2 +-
src/backend/storage/lmgr/proc.c | 4 +-
src/backend/storage/lmgr/s_lock.c | 8 +-
src/backend/storage/smgr/md.c | 10 +-
src/backend/storage/smgr/smgr.c | 12 +-
src/backend/tcop/fastpath.c | 10 +-
src/backend/tcop/postgres.c | 8 +-
src/backend/tcop/utility.c | 2 +-
src/backend/tsearch/regis.c | 6 +-
src/backend/tsearch/spell.c | 2 +-
src/backend/tsearch/ts_typanalyze.c | 8 +-
src/backend/tsearch/wparser_def.c | 6 +-
src/backend/utils/adt/array_typanalyze.c | 12 +-
src/backend/utils/adt/arrayfuncs.c | 2 +-
src/backend/utils/adt/arrayutils.c | 2 +-
src/backend/utils/adt/cash.c | 6 +-
src/backend/utils/adt/date.c | 18 +-
src/backend/utils/adt/datetime.c | 66 +++---
src/backend/utils/adt/dbsize.c | 4 +-
src/backend/utils/adt/encode.c | 2 +-
src/backend/utils/adt/formatting.c | 24 +-
src/backend/utils/adt/geo_ops.c | 26 +--
src/backend/utils/adt/int.c | 2 +-
src/backend/utils/adt/jsonb.c | 4 +-
src/backend/utils/adt/jsonfuncs.c | 3 +-
src/backend/utils/adt/like_match.c | 2 +-
src/backend/utils/adt/nabstime.c | 10 +-
src/backend/utils/adt/pg_locale.c | 8 +-
src/backend/utils/adt/rangetypes.c | 2 +-
src/backend/utils/adt/ruleutils.c | 20 +-
src/backend/utils/adt/selfuncs.c | 5 +-
src/backend/utils/adt/timestamp.c | 20 +-
src/backend/utils/adt/tsquery.c | 3 +-
src/backend/utils/adt/tsrank.c | 2 +-
src/backend/utils/adt/tsvector_op.c | 8 +-
src/backend/utils/adt/tsvector_parser.c | 2 +-
src/backend/utils/adt/varlena.c | 2 +-
src/backend/utils/cache/catcache.c | 2 +-
src/backend/utils/cache/inval.c | 4 +-
src/backend/utils/cache/typcache.c | 4 +-
src/backend/utils/error/elog.c | 2 +-
src/backend/utils/fmgr/dfmgr.c | 2 +-
src/backend/utils/fmgr/fmgr.c | 8 +-
src/backend/utils/hash/dynahash.c | 2 +-
src/backend/utils/mb/wchar.c | 4 +-
src/backend/utils/misc/backend_random.c | 4 +-
src/backend/utils/misc/guc.c | 86 ++++----
src/backend/utils/mmgr/aset.c | 4 +-
src/backend/utils/mmgr/slab.c | 4 +-
src/backend/utils/resowner/resowner.c | 2 +-
src/backend/utils/sort/tuplesort.c | 8 +-
src/bin/initdb/findtimezone.c | 12 +-
src/bin/initdb/initdb.c | 14 +-
src/bin/pg_dump/parallel.h | 6 +-
src/bin/pg_dump/pg_backup.h | 4 +-
src/bin/pg_dump/pg_backup_custom.c | 2 +-
src/bin/pg_dump/pg_backup_utils.c | 2 +-
src/bin/pg_dump/pg_dump_sort.c | 4 +-
src/bin/pg_upgrade/check.c | 18 +-
src/bin/pg_upgrade/version.c | 12 +-
src/bin/pgbench/pgbench.c | 18 +-
src/bin/pgevent/pgevent.c | 2 +-
src/bin/psql/conditional.h | 2 +-
src/bin/psql/copy.c | 2 +-
src/bin/psql/describe.c | 4 +-
src/bin/psql/mainloop.c | 2 +-
src/bin/psql/startup.c | 4 +-
src/bin/psql/stringutils.c | 4 +-
src/bin/psql/tab-complete.c | 2 +-
src/common/exec.c | 4 +-
src/common/ip.c | 18 +-
src/common/unicode/norm_test.c | 2 +-
src/fe_utils/mbprint.c | 10 +-
src/fe_utils/print.c | 28 +--
src/fe_utils/simple_list.c | 2 +-
src/fe_utils/string_utils.c | 3 +-
src/include/access/amapi.h | 50 ++---
src/include/access/gin_private.h | 4 +-
src/include/access/ginxlog.h | 2 +-
src/include/access/hash.h | 4 +-
src/include/access/hash_xlog.h | 2 +-
src/include/access/hio.h | 2 +-
src/include/access/itup.h | 4 +-
src/include/access/relscan.h | 10 +-
src/include/access/slru.h | 2 +-
src/include/access/tsmapi.h | 20 +-
src/include/access/tupdesc.h | 2 +-
src/include/access/tuptoaster.h | 6 +-
src/include/access/twophase_rmgr.h | 2 +-
src/include/access/xact.h | 4 +-
src/include/access/xloginsert.h | 10 +-
src/include/access/xlogreader.h | 10 +-
src/include/access/xlogrecord.h | 7 +-
src/include/c.h | 2 +-
src/include/catalog/index.h | 10 +-
src/include/catalog/namespace.h | 4 +-
src/include/catalog/objectaccess.h | 8 +-
src/include/catalog/pg_db_role_setting.h | 2 +-
src/include/catalog/pg_description.h | 4 +-
src/include/catalog/pg_extension.h | 2 +-
src/include/catalog/pg_init_privs.h | 2 +-
src/include/catalog/pg_largeobject.h | 3 +-
src/include/catalog/pg_pltemplate.h | 4 +-
src/include/catalog/pg_proc.h | 6 +-
src/include/catalog/pg_replication_origin.h | 2 +-
src/include/catalog/pg_seclabel.h | 5 +-
src/include/catalog/pg_shdescription.h | 4 +-
src/include/catalog/pg_shseclabel.h | 7 +-
src/include/catalog/pg_subscription.h | 4 +-
src/include/catalog/pg_trigger.h | 2 +-
src/include/commands/explain.h | 10 +-
src/include/commands/seclabel.h | 2 +-
src/include/commands/vacuum.h | 8 +-
src/include/common/int128.h | 2 +-
src/include/common/ip.h | 8 +-
src/include/common/unicode_norm_table.h | 3 +-
src/include/executor/executor.h | 6 +-
src/include/executor/hashjoin.h | 6 +-
src/include/executor/tablefunc.h | 6 +-
src/include/fe_utils/mbprint.h | 2 +-
src/include/fe_utils/print.h | 8 +-
src/include/fe_utils/psqlscan.h | 2 +-
src/include/fmgr.h | 10 +-
src/include/foreign/fdwapi.h | 124 +++++------
src/include/getaddrinfo.h | 6 +-
src/include/getopt_long.h | 2 +-
src/include/lib/pairingheap.h | 4 +-
src/include/lib/simplehash.h | 20 +-
src/include/libpq/ifaddr.h | 14 +-
src/include/libpq/libpq-be.h | 4 +-
src/include/mb/pg_wchar.h | 62 +++---
src/include/nodes/execnodes.h | 18 +-
src/include/nodes/extensible.h | 36 +--
src/include/nodes/memnodes.h | 2 +-
src/include/nodes/nodeFuncs.h | 20 +-
src/include/nodes/nodes.h | 1 +
src/include/nodes/params.h | 2 +-
src/include/nodes/parsenodes.h | 3 +-
src/include/nodes/primnodes.h | 13 +-
src/include/nodes/relation.h | 12 +-
src/include/optimizer/cost.h | 2 +-
src/include/optimizer/paths.h | 28 +--
src/include/optimizer/plancat.h | 6 +-
src/include/optimizer/planmain.h | 2 +-
src/include/optimizer/planner.h | 10 +-
src/include/parser/analyze.h | 2 +-
src/include/parser/parse_node.h | 4 +-
src/include/parser/parser.h | 2 +-
src/include/pg_getopt.h | 2 +-
src/include/pgstat.h | 2 +-
src/include/pgtime.h | 2 +-
src/include/port.h | 14 +-
src/include/port/win32.h | 10 +-
src/include/postgres.h | 4 +-
src/include/postmaster/bgworker.h | 4 +-
src/include/regex/regguts.h | 2 +-
src/include/replication/logical.h | 10 +-
src/include/replication/output_plugin.h | 30 +--
src/include/replication/reorderbuffer.h | 30 +--
src/include/replication/walreceiver.h | 32 +--
src/include/rewrite/rowsecurity.h | 2 +-
src/include/rusagestub.h | 2 +-
src/include/statistics/statistics.h | 1 +
src/include/storage/itemptr.h | 1 +
src/include/storage/lock.h | 2 +-
src/include/storage/lwlock.h | 2 +-
src/include/storage/pg_shmem.h | 2 +-
src/include/storage/predicate_internals.h | 8 +-
src/include/tcop/dest.h | 6 +-
src/include/tcop/utility.h | 4 +-
src/include/tsearch/ts_utils.h | 12 +-
src/include/utils/bytea.h | 2 +-
src/include/utils/datetime.h | 26 +--
src/include/utils/elog.h | 2 +-
src/include/utils/expandeddatum.h | 2 +-
src/include/utils/guc.h | 2 +-
src/include/utils/guc_tables.h | 4 +-
src/include/utils/hsearch.h | 2 +-
src/include/utils/nabstime.h | 2 +-
src/include/utils/portal.h | 2 +-
src/include/utils/rangetypes.h | 4 +-
src/include/utils/rel.h | 2 +-
src/include/utils/resowner.h | 6 +-
src/include/utils/selfuncs.h | 12 +-
src/include/utils/snapshot.h | 2 +-
src/include/utils/timestamp.h | 10 +-
src/include/utils/xml.h | 4 +-
src/interfaces/ecpg/compatlib/informix.c | 6 +-
src/interfaces/ecpg/ecpglib/connect.c | 2 +-
src/interfaces/ecpg/ecpglib/descriptor.c | 10 +-
src/interfaces/ecpg/ecpglib/execute.c | 28 +--
src/interfaces/ecpg/ecpglib/extern.h | 12 +-
src/interfaces/ecpg/ecpglib/memory.c | 2 +-
src/interfaces/ecpg/ecpglib/misc.c | 4 +-
src/interfaces/ecpg/ecpglib/prepare.c | 14 +-
src/interfaces/ecpg/ecpglib/sqlda.c | 4 +-
src/interfaces/ecpg/include/ecpg_informix.h | 2 +-
src/interfaces/ecpg/include/ecpglib.h | 2 +-
src/interfaces/ecpg/include/ecpgtype.h | 2 +-
src/interfaces/ecpg/include/pgtypes_date.h | 4 +-
src/interfaces/ecpg/include/pgtypes_interval.h | 8 +-
src/interfaces/ecpg/include/pgtypes_numeric.h | 2 +-
src/interfaces/ecpg/include/pgtypes_timestamp.h | 2 +-
src/interfaces/ecpg/include/sqlca.h | 2 +-
src/interfaces/ecpg/pgtypeslib/dt.h | 6 +-
src/interfaces/ecpg/pgtypeslib/dt_common.c | 54 ++---
src/interfaces/ecpg/pgtypeslib/interval.c | 22 +-
src/interfaces/ecpg/pgtypeslib/timestamp.c | 18 +-
src/interfaces/ecpg/preproc/extern.h | 2 +-
src/interfaces/ecpg/preproc/output.c | 4 +-
src/interfaces/ecpg/preproc/type.c | 22 +-
src/interfaces/ecpg/preproc/variable.c | 14 +-
.../test/expected/compat_informix-test_informix2.c | 2 +-
src/interfaces/ecpg/test/expected/preproc-init.c | 2 +-
.../ecpg/test/expected/preproc-outofscope.c | 2 +-
src/interfaces/ecpg/test/expected/sql-array.c | 2 +-
src/interfaces/ecpg/test/expected/sql-code100.c | 2 +-
src/interfaces/ecpg/test/expected/sql-copystdout.c | 2 +-
src/interfaces/ecpg/test/expected/sql-define.c | 2 +-
src/interfaces/ecpg/test/expected/sql-dynalloc.c | 2 +-
src/interfaces/ecpg/test/expected/sql-dynalloc2.c | 2 +-
src/interfaces/ecpg/test/expected/sql-dyntest.c | 2 +-
src/interfaces/ecpg/test/expected/sql-indicators.c | 2 +-
src/interfaces/ecpg/test/expected/sql-sqlda.c | 2 +-
src/interfaces/ecpg/test/expected/thread-alloc.c | 2 +-
.../ecpg/test/expected/thread-descriptor.c | 2 +-
src/interfaces/ecpg/test/expected/thread-prep.c | 2 +-
src/interfaces/ecpg/test/regression.h | 8 +-
src/interfaces/libpq/fe-connect.c | 22 +-
src/interfaces/libpq/fe-exec.c | 14 +-
src/interfaces/libpq/fe-print.c | 2 +-
src/interfaces/libpq/fe-secure-openssl.c | 2 +-
src/interfaces/libpq/libpq-events.h | 2 +-
src/interfaces/libpq/libpq-fe.h | 24 +-
src/interfaces/libpq/win32.c | 4 +-
src/pl/plperl/plperl.c | 2 +-
src/pl/plpgsql/src/pl_comp.c | 4 +-
src/pl/plpgsql/src/pl_exec.c | 2 +-
src/pl/plpgsql/src/pl_funcs.c | 2 +-
src/pl/plpgsql/src/plpgsql.h | 2 +-
src/pl/plpython/plpy_exec.c | 2 +-
src/pl/tcl/pltcl.c | 2 +-
src/port/crypt.c | 3 +
src/port/dirmod.c | 2 +-
src/port/getaddrinfo.c | 26 +--
src/port/getopt.c | 2 +-
src/port/getopt_long.c | 2 +-
src/port/getrusage.c | 2 +-
src/port/gettimeofday.c | 4 +-
src/port/inet_aton.c | 10 +-
src/port/mkdtemp.c | 2 +-
src/port/thread.c | 8 +-
src/port/win32error.c | 2 +-
src/port/win32setlocale.c | 2 +-
src/test/modules/worker_spi/worker_spi.c | 2 +-
src/test/regress/pg_regress.h | 6 +-
src/test/regress/regress.c | 2 +-
src/timezone/localtime.c | 28 +--
src/timezone/pgtz.h | 6 +-
src/timezone/strftime.c | 4 +-
src/timezone/zic.c | 60 ++---
src/tools/ifaddrs/test_ifaddrs.c | 4 +-
src/tools/testint128.c | 4 +-
src/tutorial/complex.c | 2 +-
src/tutorial/funcs.c | 2 +-
379 files changed, 1726 insertions(+), 1708 deletions(-)

Upstream: git.postgresql.org


  • Share