aboutsummaryrefslogtreecommitdiff
path: root/contrib/btree_gist/btree_utils_var.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-09-18 15:21:23 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-09-18 15:21:23 -0400
commit4bd1994650fddf49e717e35f1930d62208845974 (patch)
tree0c6353be3e707d1ccfc7bca07ca87ca5fed1bcd8 /contrib/btree_gist/btree_utils_var.c
parent3e1683d37e1d751eb2df9a5cb0507bebc6cf7d05 (diff)
downloadpostgresql-4bd1994650fddf49e717e35f1930d62208845974.tar.gz
postgresql-4bd1994650fddf49e717e35f1930d62208845974.zip
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
Diffstat (limited to 'contrib/btree_gist/btree_utils_var.c')
-rw-r--r--contrib/btree_gist/btree_utils_var.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c
index 586de63a4d3..a43d81a1651 100644
--- a/contrib/btree_gist/btree_utils_var.c
+++ b/contrib/btree_gist/btree_utils_var.c
@@ -37,7 +37,7 @@ Datum
gbt_var_decompress(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
- GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(PG_DETOAST_DATUM(entry->key));
+ GBT_VARKEY *key = (GBT_VARKEY *) PG_DETOAST_DATUM(entry->key);
if (key != (GBT_VARKEY *) DatumGetPointer(entry->key))
{
@@ -159,7 +159,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
l--;
i++;
}
- return ml; /* lower == upper */
+ return ml; /* lower == upper */
}
@@ -307,7 +307,7 @@ Datum
gbt_var_fetch(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
- GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(PG_DETOAST_DATUM(entry->key));
+ GBT_VARKEY *key = (GBT_VARKEY *) PG_DETOAST_DATUM(entry->key);
GBT_VARKEY_R r = gbt_var_key_readable(key);
GISTENTRY *retval;