]> granicus.if.org Git - postgresql/commit
Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Sep 2017 19:21:23 +0000 (15:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Sep 2017 19:21:23 +0000 (15:21 -0400)
commit4bd1994650fddf49e717e35f1930d62208845974
tree0c6353be3e707d1ccfc7bca07ca87ca5fed1bcd8
parent3e1683d37e1d751eb2df9a5cb0507bebc6cf7d05
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
38 files changed:
contrib/btree_gist/btree_text.c
contrib/btree_gist/btree_utils_var.c
contrib/cube/cube.c
contrib/cube/cubedata.h
contrib/hstore/hstore.h
contrib/hstore/hstore_gin.c
contrib/hstore/hstore_gist.c
contrib/hstore/hstore_io.c
contrib/hstore/hstore_op.c
contrib/hstore_plperl/hstore_plperl.c
contrib/hstore_plpython/hstore_plpython.c
contrib/ltree/_ltree_gist.c
contrib/ltree/_ltree_op.c
contrib/ltree/lquery_op.c
contrib/ltree/ltree.h
contrib/ltree/ltree_gist.c
contrib/ltree/ltree_io.c
contrib/ltree/ltree_op.c
contrib/ltree/ltxtquery_io.c
contrib/ltree/ltxtquery_op.c
contrib/ltree_plpython/ltree_plpython.c
src/backend/tsearch/to_tsany.c
src/backend/tsearch/wparser.c
src/backend/utils/adt/array_expanded.c
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/jsonb.c
src/backend/utils/adt/jsonb_gin.c
src/backend/utils/adt/jsonb_op.c
src/backend/utils/adt/jsonfuncs.c
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/rangetypes_gist.c
src/backend/utils/adt/rangetypes_selfuncs.c
src/backend/utils/adt/rangetypes_spgist.c
src/backend/utils/adt/rangetypes_typanalyze.c
src/backend/utils/adt/tsgistidx.c
src/include/utils/array.h
src/include/utils/jsonb.h
src/include/utils/rangetypes.h