From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more co
Date: Mon, 18 Sep 2017 19:21:35 +0000
Message-ID: <E1du1br-0006Lv-In@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent.
By project convention, these names should include "P" when dealing with a
pointer type; that is, if the result of a GETARG macro is of type FOO *,
it should be called PG_GETARG_FOO_P not just PG_GETARG_FOO. Some newer
types such as JSONB and ranges had not followed the convention, and a
number of contrib modules hadn't gotten that memo either. Rename the
offending macros to improve consistency.
In passing, fix a few places that thought PG_DETOAST_DATUM() returns
a Datum; it does not, it returns "struct varlena *". Applying
DatumGetPointer to that happens not to cause any bad effects today,
but it's formally wrong. Also, adjust an ltree macro that was designed
without any thought for what pgindent would do with it.
This is all cosmetic and shouldn't have any impact on generated code.
Mark Dilger, some further tweaks by me
Discussion: https://postgr.es/m/EA5676F4-766F-4F38-8348-ECC7DB427C6A@gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/4bd1994650fddf49e717e35f1930d62208845974
Modified Files
--------------
contrib/btree_gist/btree_text.c | 2 +-
contrib/btree_gist/btree_utils_var.c | 6 +-
contrib/cube/cube.c | 151 +++++++++++++-------------
contrib/cube/cubedata.h | 6 +-
contrib/hstore/hstore.h | 2 +-
contrib/hstore/hstore_gin.c | 4 +-
contrib/hstore/hstore_gist.c | 2 +-
contrib/hstore/hstore_io.c | 14 +--
contrib/hstore/hstore_op.c | 50 ++++-----
contrib/hstore_plperl/hstore_plperl.c | 2 +-
contrib/hstore_plpython/hstore_plpython.c | 2 +-
contrib/ltree/_ltree_gist.c | 2 +-
contrib/ltree/_ltree_op.c | 16 +--
contrib/ltree/lquery_op.c | 6 +-
contrib/ltree/ltree.h | 21 +++-
contrib/ltree/ltree_gist.c | 26 ++---
contrib/ltree/ltree_io.c | 4 +-
contrib/ltree/ltree_op.c | 68 ++++++------
contrib/ltree/ltxtquery_io.c | 2 +-
contrib/ltree/ltxtquery_op.c | 4 +-
contrib/ltree_plpython/ltree_plpython.c | 2 +-
src/backend/tsearch/to_tsany.c | 6 +-
src/backend/tsearch/wparser.c | 4 +-
src/backend/utils/adt/array_expanded.c | 4 +-
src/backend/utils/adt/arrayfuncs.c | 46 ++++----
src/backend/utils/adt/jsonb.c | 8 +-
src/backend/utils/adt/jsonb_gin.c | 12 +-
src/backend/utils/adt/jsonb_op.c | 48 ++++----
src/backend/utils/adt/jsonfuncs.c | 94 ++++++++--------
src/backend/utils/adt/rangetypes.c | 134 +++++++++++------------
src/backend/utils/adt/rangetypes_gist.c | 96 ++++++++--------
src/backend/utils/adt/rangetypes_selfuncs.c | 4 +-
src/backend/utils/adt/rangetypes_spgist.c | 54 ++++-----
src/backend/utils/adt/rangetypes_typanalyze.c | 2 +-
src/backend/utils/adt/tsgistidx.c | 4 +-
src/include/utils/array.h | 4 +-
src/include/utils/jsonb.h | 8 +-
src/include/utils/rangetypes.h | 12 +-
38 files changed, 471 insertions(+), 461 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more co
In-Reply-To: <E1du1br-0006Lv-In@gemulon.postgresql.org>
References: <E1du1br-0006Lv-In@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox