mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Create function prototype as part of PG_FUNCTION_INFO_V1 macro
Because of gcc -Wmissing-prototypes, all functions in dynamically loadable modules must have a separate prototype declaration. This is meant to detect global functions that are not declared in header files, but in cases where the function is called via dfmgr, this is redundant. Besides filling up space with boilerplate, this is a frequent source of compiler warnings in extension modules. We can fix that by creating the function prototype as part of the PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway. That makes the code of modules cleaner, because there is one less place where the entry points have to be listed, and creates an additional check that functions have the right prototype. Remove now redundant prototypes from contrib and other modules.
This commit is contained in:
@ -19,14 +19,6 @@ PG_FUNCTION_INFO_V1(gbt_bit_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_bit_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_bit_same);
|
||||
|
||||
Datum gbt_bit_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bit_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bit_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bit_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bit_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bit_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
|
||||
/* define for comparison */
|
||||
|
||||
|
@ -18,13 +18,6 @@ PG_FUNCTION_INFO_V1(gbt_bytea_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_bytea_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_bytea_same);
|
||||
|
||||
Datum gbt_bytea_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bytea_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bytea_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bytea_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bytea_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bytea_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
/* define for comparison */
|
||||
|
||||
|
@ -24,14 +24,6 @@ PG_FUNCTION_INFO_V1(gbt_cash_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_cash_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_cash_same);
|
||||
|
||||
Datum gbt_cash_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_cash_same(PG_FUNCTION_ARGS);
|
||||
|
||||
static bool
|
||||
gbt_cashgt(const void *a, const void *b)
|
||||
{
|
||||
@ -97,7 +89,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(cash_dist);
|
||||
Datum cash_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
cash_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -24,14 +24,6 @@ PG_FUNCTION_INFO_V1(gbt_date_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_date_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_date_same);
|
||||
|
||||
Datum gbt_date_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_date_same(PG_FUNCTION_ARGS);
|
||||
|
||||
static bool
|
||||
gbt_dategt(const void *a, const void *b)
|
||||
{
|
||||
@ -115,7 +107,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(date_dist);
|
||||
Datum date_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
date_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_float4_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_float4_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_float4_same);
|
||||
|
||||
Datum gbt_float4_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float4_same(PG_FUNCTION_ARGS);
|
||||
|
||||
static bool
|
||||
gbt_float4gt(const void *a, const void *b)
|
||||
{
|
||||
@ -96,7 +88,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(float4_dist);
|
||||
Datum float4_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
float4_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_float8_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_float8_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_float8_same);
|
||||
|
||||
Datum gbt_float8_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_float8_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_float8gt(const void *a, const void *b)
|
||||
@ -104,7 +96,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(float8_dist);
|
||||
Datum float8_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
float8_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -11,8 +11,6 @@ PG_FUNCTION_INFO_V1(gbt_decompress);
|
||||
PG_FUNCTION_INFO_V1(gbtreekey_in);
|
||||
PG_FUNCTION_INFO_V1(gbtreekey_out);
|
||||
|
||||
Datum gbt_decompress(PG_FUNCTION_ARGS);
|
||||
|
||||
/**************************************************
|
||||
* In/Out for keys
|
||||
**************************************************/
|
||||
|
@ -25,13 +25,6 @@ PG_FUNCTION_INFO_V1(gbt_inet_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_inet_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_inet_same);
|
||||
|
||||
Datum gbt_inet_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_inet_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_inet_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_inet_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_inet_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_inet_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_inetgt(const void *a, const void *b)
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_int2_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_int2_same);
|
||||
|
||||
Datum gbt_int2_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int2_same(PG_FUNCTION_ARGS);
|
||||
|
||||
static bool
|
||||
gbt_int2gt(const void *a, const void *b)
|
||||
{
|
||||
@ -96,7 +88,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(int2_dist);
|
||||
Datum int2_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
int2_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_int4_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_int4_same);
|
||||
|
||||
Datum gbt_int4_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int4_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_int4gt(const void *a, const void *b)
|
||||
@ -97,7 +89,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(int4_dist);
|
||||
Datum int4_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
int4_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_int8_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_int8_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_int8_same);
|
||||
|
||||
Datum gbt_int8_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_int8_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_int8gt(const void *a, const void *b)
|
||||
@ -97,7 +89,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(int8_dist);
|
||||
Datum int8_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
int8_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -26,15 +26,6 @@ PG_FUNCTION_INFO_V1(gbt_intv_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_intv_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_intv_same);
|
||||
|
||||
Datum gbt_intv_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_decompress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_intv_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_intvgt(const void *a, const void *b)
|
||||
@ -129,7 +120,6 @@ abs_interval(Interval *a)
|
||||
}
|
||||
|
||||
PG_FUNCTION_INFO_V1(interval_dist);
|
||||
Datum interval_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
interval_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -24,13 +24,6 @@ PG_FUNCTION_INFO_V1(gbt_macad_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_macad_same);
|
||||
|
||||
Datum gbt_macad_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_macad_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_macad_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_macad_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_macad_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_macad_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_macadgt(const void *a, const void *b)
|
||||
|
@ -23,13 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_numeric_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_numeric_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_numeric_same);
|
||||
|
||||
Datum gbt_numeric_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_numeric_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_numeric_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_numeric_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_numeric_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_numeric_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
/* define for comparison */
|
||||
|
||||
|
@ -23,14 +23,6 @@ PG_FUNCTION_INFO_V1(gbt_oid_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_oid_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_oid_same);
|
||||
|
||||
Datum gbt_oid_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_oid_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
static bool
|
||||
gbt_oidgt(const void *a, const void *b)
|
||||
@ -103,7 +95,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(oid_dist);
|
||||
Datum oid_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
oid_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -19,15 +19,6 @@ PG_FUNCTION_INFO_V1(gbt_bpchar_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_text_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_text_same);
|
||||
|
||||
Datum gbt_text_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bpchar_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_text_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_text_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_text_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_bpchar_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_text_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_text_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
/* define for comparison */
|
||||
|
||||
|
@ -27,16 +27,6 @@ PG_FUNCTION_INFO_V1(gbt_timetz_consistent);
|
||||
PG_FUNCTION_INFO_V1(gbt_time_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_time_same);
|
||||
|
||||
Datum gbt_time_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_timetz_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_timetz_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_time_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
#ifdef USE_FLOAT8_BYVAL
|
||||
#define TimeADTGetDatumFast(X) TimeADTGetDatum(X)
|
||||
@ -145,7 +135,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(time_dist);
|
||||
Datum time_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
time_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -28,17 +28,6 @@ PG_FUNCTION_INFO_V1(gbt_tstz_distance);
|
||||
PG_FUNCTION_INFO_V1(gbt_ts_penalty);
|
||||
PG_FUNCTION_INFO_V1(gbt_ts_same);
|
||||
|
||||
Datum gbt_ts_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_tstz_compress(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_union(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_picksplit(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_tstz_consistent(PG_FUNCTION_ARGS);
|
||||
Datum gbt_tstz_distance(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_penalty(PG_FUNCTION_ARGS);
|
||||
Datum gbt_ts_same(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
#ifdef USE_FLOAT8_BYVAL
|
||||
#define TimestampGetDatumFast(X) TimestampGetDatum(X)
|
||||
@ -149,7 +138,6 @@ static const gbtree_ninfo tinfo =
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(ts_dist);
|
||||
Datum ts_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
ts_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
@ -178,7 +166,6 @@ ts_dist(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
PG_FUNCTION_INFO_V1(tstz_dist);
|
||||
Datum tstz_dist(PG_FUNCTION_ARGS);
|
||||
Datum
|
||||
tstz_dist(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ typedef struct
|
||||
|
||||
|
||||
PG_FUNCTION_INFO_V1(gbt_var_decompress);
|
||||
Datum gbt_var_decompress(PG_FUNCTION_ARGS);
|
||||
|
||||
|
||||
Datum
|
||||
|
Reference in New Issue
Block a user