summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2025-04-03 10:39:33 +0000
committerHeikki Linnakangas2025-04-03 10:39:33 +0000
commit9370978da8ac8f0e31867859282b0f2be724fe48 (patch)
tree5da91f476e7ba9eee548ee67eeabea80f5f1ded9
parent82a46cca99fa967cc3c6c2cf55254dd44eebbcfd (diff)
Fix boilerplate comments in btree_gist
A few of these were copy-pasted wrong, like the comment "Bytea ops" in btree_numeric.c. Instead of fixing the incorrect ones, replace them all with generic comment "GiST support functions". Also tidy up the inconsistent newlines between various functions while we're at it.
-rw-r--r--contrib/btree_gist/btree_bit.c11
-rw-r--r--contrib/btree_gist/btree_bool.c9
-rw-r--r--contrib/btree_gist/btree_bytea.c15
-rw-r--r--contrib/btree_gist/btree_cash.c11
-rw-r--r--contrib/btree_gist/btree_date.c12
-rw-r--r--contrib/btree_gist/btree_enum.c8
-rw-r--r--contrib/btree_gist/btree_float4.c10
-rw-r--r--contrib/btree_gist/btree_float8.c11
-rw-r--r--contrib/btree_gist/btree_inet.c10
-rw-r--r--contrib/btree_gist/btree_int2.c11
-rw-r--r--contrib/btree_gist/btree_int4.c11
-rw-r--r--contrib/btree_gist/btree_int8.c10
-rw-r--r--contrib/btree_gist/btree_interval.c8
-rw-r--r--contrib/btree_gist/btree_macaddr.c10
-rw-r--r--contrib/btree_gist/btree_macaddr8.c13
-rw-r--r--contrib/btree_gist/btree_numeric.c15
-rw-r--r--contrib/btree_gist/btree_oid.c10
-rw-r--r--contrib/btree_gist/btree_text.c13
-rw-r--r--contrib/btree_gist/btree_time.c14
-rw-r--r--contrib/btree_gist/btree_ts.c13
-rw-r--r--contrib/btree_gist/btree_uuid.c7
21 files changed, 47 insertions, 185 deletions
diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c
index f346b956fa9..7c71daae6d7 100644
--- a/contrib/btree_gist/btree_bit.c
+++ b/contrib/btree_gist/btree_bit.c
@@ -8,10 +8,7 @@
#include "utils/fmgrprotos.h"
#include "utils/varbit.h"
-
-/*
-** Bit ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_bit_compress);
PG_FUNCTION_INFO_V1(gbt_bit_union);
PG_FUNCTION_INFO_V1(gbt_bit_picksplit);
@@ -121,7 +118,7 @@ static const gbtree_vinfo tinfo =
/**************************************************
- * Bit ops
+ * GiST support functions
**************************************************/
Datum
@@ -161,8 +158,6 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval);
}
-
-
Datum
gbt_bit_union(PG_FUNCTION_ARGS)
{
@@ -173,7 +168,6 @@ gbt_bit_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_bit_picksplit(PG_FUNCTION_ARGS)
{
@@ -196,7 +190,6 @@ gbt_bit_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_bit_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_bool.c b/contrib/btree_gist/btree_bool.c
index adb724e16ac..d2145d0d0c3 100644
--- a/contrib/btree_gist/btree_bool.c
+++ b/contrib/btree_gist/btree_bool.c
@@ -12,9 +12,7 @@ typedef struct boolkey
bool upper;
} boolKEY;
-/*
-** bool ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_bool_compress);
PG_FUNCTION_INFO_V1(gbt_bool_fetch);
PG_FUNCTION_INFO_V1(gbt_bool_union);
@@ -82,10 +80,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * bool ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_bool_compress(PG_FUNCTION_ARGS)
{
@@ -124,7 +121,6 @@ gbt_bool_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_bool_union(PG_FUNCTION_ARGS)
{
@@ -135,7 +131,6 @@ gbt_bool_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_bool_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c
index 5eacb8c59a0..751b7a2ba4f 100644
--- a/contrib/btree_gist/btree_bytea.c
+++ b/contrib/btree_gist/btree_bytea.c
@@ -7,10 +7,7 @@
#include "btree_utils_var.h"
#include "utils/fmgrprotos.h"
-
-/*
-** Bytea ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_bytea_compress);
PG_FUNCTION_INFO_V1(gbt_bytea_union);
PG_FUNCTION_INFO_V1(gbt_bytea_picksplit);
@@ -69,7 +66,6 @@ gbt_byteacmp(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
PointerGetDatum(b)));
}
-
static const gbtree_vinfo tinfo =
{
gbt_t_bytea,
@@ -86,10 +82,9 @@ static const gbtree_vinfo tinfo =
/**************************************************
- * Text ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_bytea_compress(PG_FUNCTION_ARGS)
{
@@ -98,8 +93,6 @@ gbt_bytea_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
}
-
-
Datum
gbt_bytea_consistent(PG_FUNCTION_ARGS)
{
@@ -121,8 +114,6 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval);
}
-
-
Datum
gbt_bytea_union(PG_FUNCTION_ARGS)
{
@@ -133,7 +124,6 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_bytea_picksplit(PG_FUNCTION_ARGS)
{
@@ -156,7 +146,6 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_bytea_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c
index c18c34c8b83..51bdacab8eb 100644
--- a/contrib/btree_gist/btree_cash.c
+++ b/contrib/btree_gist/btree_cash.c
@@ -14,9 +14,7 @@ typedef struct
Cash upper;
} cashKEY;
-/*
-** Cash ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_cash_compress);
PG_FUNCTION_INFO_V1(gbt_cash_fetch);
PG_FUNCTION_INFO_V1(gbt_cash_union);
@@ -111,11 +109,11 @@ cash_dist(PG_FUNCTION_ARGS)
PG_RETURN_CASH(ra);
}
+
/**************************************************
- * Cash ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_cash_compress(PG_FUNCTION_ARGS)
{
@@ -155,7 +153,6 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo));
}
-
Datum
gbt_cash_distance(PG_FUNCTION_ARGS)
{
@@ -173,7 +170,6 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_cash_union(PG_FUNCTION_ARGS)
{
@@ -184,7 +180,6 @@ gbt_cash_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_cash_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c
index 7a4a9d7a853..e87f8c03fc7 100644
--- a/contrib/btree_gist/btree_date.c
+++ b/contrib/btree_gist/btree_date.c
@@ -14,9 +14,7 @@ typedef struct
DateADT upper;
} dateKEY;
-/*
-** date ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_date_compress);
PG_FUNCTION_INFO_V1(gbt_date_fetch);
PG_FUNCTION_INFO_V1(gbt_date_union);
@@ -128,11 +126,9 @@ date_dist(PG_FUNCTION_ARGS)
/**************************************************
- * date ops
+ * GiST support functions
**************************************************/
-
-
Datum
gbt_date_compress(PG_FUNCTION_ARGS)
{
@@ -172,7 +168,6 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo));
}
-
Datum
gbt_date_distance(PG_FUNCTION_ARGS)
{
@@ -190,7 +185,6 @@ gbt_date_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_date_union(PG_FUNCTION_ARGS)
{
@@ -201,7 +195,6 @@ gbt_date_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_date_penalty(PG_FUNCTION_ARGS)
{
@@ -238,7 +231,6 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_date_picksplit(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_enum.c b/contrib/btree_gist/btree_enum.c
index 05d02e704a0..642a19e6d46 100644
--- a/contrib/btree_gist/btree_enum.c
+++ b/contrib/btree_gist/btree_enum.c
@@ -16,9 +16,7 @@ typedef struct
Oid upper;
} oidKEY;
-/*
-** enum ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_enum_compress);
PG_FUNCTION_INFO_V1(gbt_enum_fetch);
PG_FUNCTION_INFO_V1(gbt_enum_union);
@@ -99,10 +97,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * Enum ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_enum_compress(PG_FUNCTION_ARGS)
{
@@ -152,7 +149,6 @@ gbt_enum_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_enum_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c
index d138aa94bf2..673c14a8f72 100644
--- a/contrib/btree_gist/btree_float4.c
+++ b/contrib/btree_gist/btree_float4.c
@@ -13,9 +13,7 @@ typedef struct float4key
float4 upper;
} float4KEY;
-/*
-** float4 ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_float4_compress);
PG_FUNCTION_INFO_V1(gbt_float4_fetch);
PG_FUNCTION_INFO_V1(gbt_float4_union);
@@ -107,10 +105,9 @@ float4_dist(PG_FUNCTION_ARGS)
/**************************************************
- * float4 ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_float4_compress(PG_FUNCTION_ARGS)
{
@@ -150,7 +147,6 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo));
}
-
Datum
gbt_float4_distance(PG_FUNCTION_ARGS)
{
@@ -168,7 +164,6 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_float4_union(PG_FUNCTION_ARGS)
{
@@ -179,7 +174,6 @@ gbt_float4_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_float4_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c
index a74cd200529..9fb9cf024bd 100644
--- a/contrib/btree_gist/btree_float8.c
+++ b/contrib/btree_gist/btree_float8.c
@@ -13,9 +13,7 @@ typedef struct float8key
float8 upper;
} float8KEY;
-/*
-** float8 ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_float8_compress);
PG_FUNCTION_INFO_V1(gbt_float8_fetch);
PG_FUNCTION_INFO_V1(gbt_float8_union);
@@ -113,11 +111,11 @@ float8_dist(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8(fabs(r));
}
+
/**************************************************
- * float8 ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_float8_compress(PG_FUNCTION_ARGS)
{
@@ -157,7 +155,6 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
fcinfo->flinfo));
}
-
Datum
gbt_float8_distance(PG_FUNCTION_ARGS)
{
@@ -175,7 +172,6 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_float8_union(PG_FUNCTION_ARGS)
{
@@ -186,7 +182,6 @@ gbt_float8_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_float8_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c
index 4cffd349091..277fc3412d5 100644
--- a/contrib/btree_gist/btree_inet.c
+++ b/contrib/btree_gist/btree_inet.c
@@ -14,9 +14,7 @@ typedef struct inetkey
double upper;
} inetKEY;
-/*
-** inet ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_inet_compress);
PG_FUNCTION_INFO_V1(gbt_inet_union);
PG_FUNCTION_INFO_V1(gbt_inet_picksplit);
@@ -85,10 +83,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * inet ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_inet_compress(PG_FUNCTION_ARGS)
{
@@ -114,7 +111,6 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(retval);
}
-
Datum
gbt_inet_consistent(PG_FUNCTION_ARGS)
{
@@ -142,7 +138,6 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
&strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_inet_union(PG_FUNCTION_ARGS)
{
@@ -153,7 +148,6 @@ gbt_inet_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_inet_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c
index 1751a6c055d..2859fa830b3 100644
--- a/contrib/btree_gist/btree_int2.c
+++ b/contrib/btree_gist/btree_int2.c
@@ -13,9 +13,7 @@ typedef struct int16key
int16 upper;
} int16KEY;
-/*
-** int16 ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_int2_compress);
PG_FUNCTION_INFO_V1(gbt_int2_fetch);
PG_FUNCTION_INFO_V1(gbt_int2_union);
@@ -25,6 +23,7 @@ PG_FUNCTION_INFO_V1(gbt_int2_distance);
PG_FUNCTION_INFO_V1(gbt_int2_penalty);
PG_FUNCTION_INFO_V1(gbt_int2_same);
+
static bool
gbt_int2gt(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -112,10 +111,9 @@ int2_dist(PG_FUNCTION_ARGS)
/**************************************************
- * int16 ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_int2_compress(PG_FUNCTION_ARGS)
{
@@ -154,7 +152,6 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int2_distance(PG_FUNCTION_ARGS)
{
@@ -172,7 +169,6 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int2_union(PG_FUNCTION_ARGS)
{
@@ -183,7 +179,6 @@ gbt_int2_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int2_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c
index 90d183be6e8..9abda7ef009 100644
--- a/contrib/btree_gist/btree_int4.c
+++ b/contrib/btree_gist/btree_int4.c
@@ -13,9 +13,7 @@ typedef struct int32key
int32 upper;
} int32KEY;
-/*
-** int32 ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_int4_compress);
PG_FUNCTION_INFO_V1(gbt_int4_fetch);
PG_FUNCTION_INFO_V1(gbt_int4_union);
@@ -25,7 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_int4_distance);
PG_FUNCTION_INFO_V1(gbt_int4_penalty);
PG_FUNCTION_INFO_V1(gbt_int4_same);
-
static bool
gbt_int4gt(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -113,10 +110,9 @@ int4_dist(PG_FUNCTION_ARGS)
/**************************************************
- * int32 ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_int4_compress(PG_FUNCTION_ARGS)
{
@@ -155,7 +151,6 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int4_distance(PG_FUNCTION_ARGS)
{
@@ -173,7 +168,6 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int4_union(PG_FUNCTION_ARGS)
{
@@ -184,7 +178,6 @@ gbt_int4_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int4_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c
index 661cf8189fc..6e7af9a1833 100644
--- a/contrib/btree_gist/btree_int8.c
+++ b/contrib/btree_gist/btree_int8.c
@@ -13,9 +13,7 @@ typedef struct int64key
int64 upper;
} int64KEY;
-/*
-** int64 ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_int8_compress);
PG_FUNCTION_INFO_V1(gbt_int8_fetch);
PG_FUNCTION_INFO_V1(gbt_int8_union);
@@ -113,10 +111,9 @@ int8_dist(PG_FUNCTION_ARGS)
/**************************************************
- * int64 ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_int8_compress(PG_FUNCTION_ARGS)
{
@@ -155,7 +152,6 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int8_distance(PG_FUNCTION_ARGS)
{
@@ -173,7 +169,6 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int8_union(PG_FUNCTION_ARGS)
{
@@ -184,7 +179,6 @@ gbt_int8_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_int8_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c
index 8f99a416965..ac0108e6280 100644
--- a/contrib/btree_gist/btree_interval.c
+++ b/contrib/btree_gist/btree_interval.c
@@ -14,10 +14,7 @@ typedef struct
upper;
} intvKEY;
-
-/*
-** Interval ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_intv_compress);
PG_FUNCTION_INFO_V1(gbt_intv_fetch);
PG_FUNCTION_INFO_V1(gbt_intv_decompress);
@@ -137,10 +134,9 @@ interval_dist(PG_FUNCTION_ARGS)
/**************************************************
- * interval ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_intv_compress(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c
index 558cfa2172f..41e693cb2c2 100644
--- a/contrib/btree_gist/btree_macaddr.c
+++ b/contrib/btree_gist/btree_macaddr.c
@@ -15,9 +15,7 @@ typedef struct
char pad[4]; /* make struct size = sizeof(gbtreekey16) */
} macKEY;
-/*
-** OID ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_macad_compress);
PG_FUNCTION_INFO_V1(gbt_macad_fetch);
PG_FUNCTION_INFO_V1(gbt_macad_union);
@@ -88,11 +86,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * macaddr ops
+ * GiST support functions
**************************************************/
-
-
static uint64
mac_2_uint64(macaddr *m)
{
@@ -105,8 +101,6 @@ mac_2_uint64(macaddr *m)
return res;
}
-
-
Datum
gbt_macad_compress(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_macaddr8.c b/contrib/btree_gist/btree_macaddr8.c
index 5d0c5509f51..613a19e317b 100644
--- a/contrib/btree_gist/btree_macaddr8.c
+++ b/contrib/btree_gist/btree_macaddr8.c
@@ -15,9 +15,7 @@ typedef struct
/* make struct size = sizeof(gbtreekey16) */
} mac8KEY;
-/*
-** OID ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_macad8_compress);
PG_FUNCTION_INFO_V1(gbt_macad8_fetch);
PG_FUNCTION_INFO_V1(gbt_macad8_union);
@@ -26,7 +24,6 @@ PG_FUNCTION_INFO_V1(gbt_macad8_consistent);
PG_FUNCTION_INFO_V1(gbt_macad8_penalty);
PG_FUNCTION_INFO_V1(gbt_macad8_same);
-
static bool
gbt_macad8gt(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -88,11 +85,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * macaddr ops
+ * GiST support functions
**************************************************/
-
-
static uint64
mac8_2_uint64(macaddr8 *m)
{
@@ -105,8 +100,6 @@ mac8_2_uint64(macaddr8 *m)
return res;
}
-
-
Datum
gbt_macad8_compress(PG_FUNCTION_ARGS)
{
@@ -145,7 +138,6 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_macad8_union(PG_FUNCTION_ARGS)
{
@@ -156,7 +148,6 @@ gbt_macad8_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_macad8_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c
index d533648a295..f34e00818bb 100644
--- a/contrib/btree_gist/btree_numeric.c
+++ b/contrib/btree_gist/btree_numeric.c
@@ -12,9 +12,7 @@
#include "utils/numeric.h"
#include "utils/rel.h"
-/*
-** Bytea ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_numeric_compress);
PG_FUNCTION_INFO_V1(gbt_numeric_union);
PG_FUNCTION_INFO_V1(gbt_numeric_picksplit);
@@ -90,10 +88,9 @@ static const gbtree_vinfo tinfo =
/**************************************************
- * Text ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_numeric_compress(PG_FUNCTION_ARGS)
{
@@ -102,8 +99,6 @@ gbt_numeric_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
}
-
-
Datum
gbt_numeric_consistent(PG_FUNCTION_ARGS)
{
@@ -125,8 +120,6 @@ gbt_numeric_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval);
}
-
-
Datum
gbt_numeric_union(PG_FUNCTION_ARGS)
{
@@ -137,7 +130,6 @@ gbt_numeric_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_numeric_same(PG_FUNCTION_ARGS)
{
@@ -149,7 +141,6 @@ gbt_numeric_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_numeric_penalty(PG_FUNCTION_ARGS)
{
@@ -215,8 +206,6 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
-
Datum
gbt_numeric_picksplit(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c
index d1976f4f091..d9afffe7827 100644
--- a/contrib/btree_gist/btree_oid.c
+++ b/contrib/btree_gist/btree_oid.c
@@ -12,9 +12,7 @@ typedef struct
Oid upper;
} oidKEY;
-/*
-** OID ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_oid_compress);
PG_FUNCTION_INFO_V1(gbt_oid_fetch);
PG_FUNCTION_INFO_V1(gbt_oid_union);
@@ -113,10 +111,9 @@ oid_dist(PG_FUNCTION_ARGS)
/**************************************************
- * Oid ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_oid_compress(PG_FUNCTION_ARGS)
{
@@ -155,7 +152,6 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_oid_distance(PG_FUNCTION_ARGS)
{
@@ -173,7 +169,6 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_oid_union(PG_FUNCTION_ARGS)
{
@@ -184,7 +179,6 @@ gbt_oid_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_oid_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_text.c b/contrib/btree_gist/btree_text.c
index 8f80f54240f..ed706e3eaa7 100644
--- a/contrib/btree_gist/btree_text.c
+++ b/contrib/btree_gist/btree_text.c
@@ -8,9 +8,7 @@
#include "mb/pg_wchar.h"
#include "utils/fmgrprotos.h"
-/*
-** Text ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_text_compress);
PG_FUNCTION_INFO_V1(gbt_bpchar_compress);
PG_FUNCTION_INFO_V1(gbt_text_union);
@@ -163,10 +161,9 @@ static gbtree_vinfo bptinfo =
/**************************************************
- * Text ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_text_compress(PG_FUNCTION_ARGS)
{
@@ -187,8 +184,6 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS)
return gbt_text_compress(fcinfo);
}
-
-
Datum
gbt_text_consistent(PG_FUNCTION_ARGS)
{
@@ -216,7 +211,6 @@ gbt_text_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval);
}
-
Datum
gbt_bpchar_consistent(PG_FUNCTION_ARGS)
{
@@ -243,7 +237,6 @@ gbt_bpchar_consistent(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(retval);
}
-
Datum
gbt_text_union(PG_FUNCTION_ARGS)
{
@@ -254,7 +247,6 @@ gbt_text_union(PG_FUNCTION_ARGS)
&tinfo, fcinfo->flinfo));
}
-
Datum
gbt_text_picksplit(PG_FUNCTION_ARGS)
{
@@ -277,7 +269,6 @@ gbt_text_same(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_text_penalty(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c
index 2f7859340f6..79a895159b2 100644
--- a/contrib/btree_gist/btree_time.c
+++ b/contrib/btree_gist/btree_time.c
@@ -15,9 +15,7 @@ typedef struct
TimeADT upper;
} timeKEY;
-/*
-** time ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_time_compress);
PG_FUNCTION_INFO_V1(gbt_timetz_compress);
PG_FUNCTION_INFO_V1(gbt_time_fetch);
@@ -92,8 +90,6 @@ gbt_timelt(const void *a, const void *b, FmgrInfo *flinfo)
TimeADTGetDatumFast(*bb)));
}
-
-
static int
gbt_timekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -150,11 +146,9 @@ time_dist(PG_FUNCTION_ARGS)
/**************************************************
- * time ops
+ * GiST support functions
**************************************************/
-
-
Datum
gbt_time_compress(PG_FUNCTION_ARGS)
{
@@ -163,7 +157,6 @@ gbt_time_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
}
-
Datum
gbt_timetz_compress(PG_FUNCTION_ARGS)
{
@@ -262,7 +255,6 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_time_union(PG_FUNCTION_ARGS)
{
@@ -273,7 +265,6 @@ gbt_time_union(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
}
-
Datum
gbt_time_penalty(PG_FUNCTION_ARGS)
{
@@ -313,7 +304,6 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}
-
Datum
gbt_time_picksplit(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c
index 9e0d979dda9..ba3535892eb 100644
--- a/contrib/btree_gist/btree_ts.c
+++ b/contrib/btree_gist/btree_ts.c
@@ -17,9 +17,7 @@ typedef struct
Timestamp upper;
} tsKEY;
-/*
-** timestamp ops
-*/
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_ts_compress);
PG_FUNCTION_INFO_V1(gbt_tstz_compress);
PG_FUNCTION_INFO_V1(gbt_ts_fetch);
@@ -40,6 +38,8 @@ PG_FUNCTION_INFO_V1(gbt_ts_same);
#endif
+/* define for comparison */
+
static bool
gbt_tsgt(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -95,7 +95,6 @@ gbt_tslt(const void *a, const void *b, FmgrInfo *flinfo)
TimestampGetDatumFast(*bb)));
}
-
static int
gbt_tskey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
{
@@ -126,7 +125,6 @@ gbt_ts_dist(const void *a, const void *b, FmgrInfo *flinfo)
return fabs(INTERVAL_TO_SEC(i));
}
-
static const gbtree_ninfo tinfo =
{
gbt_t_ts,
@@ -190,12 +188,10 @@ tstz_dist(PG_FUNCTION_ARGS)
PG_RETURN_INTERVAL_P(abs_interval(r));
}
-
/**************************************************
- * timestamp ops
+ * GiST support functions
**************************************************/
-
static inline Timestamp
tstz_to_ts_gmt(TimestampTz ts)
{
@@ -212,7 +208,6 @@ gbt_ts_compress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(gbt_num_compress(entry, &tinfo));
}
-
Datum
gbt_tstz_compress(PG_FUNCTION_ARGS)
{
diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c
index f4c5c6e5892..02480808a4a 100644
--- a/contrib/btree_gist/btree_uuid.c
+++ b/contrib/btree_gist/btree_uuid.c
@@ -15,9 +15,7 @@ typedef struct
} uuidKEY;
-/*
- * UUID ops
- */
+/* GiST support functions */
PG_FUNCTION_INFO_V1(gbt_uuid_compress);
PG_FUNCTION_INFO_V1(gbt_uuid_fetch);
PG_FUNCTION_INFO_V1(gbt_uuid_union);
@@ -93,10 +91,9 @@ static const gbtree_ninfo tinfo =
/**************************************************
- * uuid ops
+ * GiST support functions
**************************************************/
-
Datum
gbt_uuid_compress(PG_FUNCTION_ARGS)
{