Skip to content

Commit 9370978

Browse files
committed
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.
1 parent 82a46cc commit 9370978

21 files changed

+47
-185
lines changed

contrib/btree_gist/btree_bit.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
#include "utils/fmgrprotos.h"
99
#include "utils/varbit.h"
1010

11-
12-
/*
13-
** Bit ops
14-
*/
11+
/* GiST support functions */
1512
PG_FUNCTION_INFO_V1(gbt_bit_compress);
1613
PG_FUNCTION_INFO_V1(gbt_bit_union);
1714
PG_FUNCTION_INFO_V1(gbt_bit_picksplit);
@@ -121,7 +118,7 @@ static const gbtree_vinfo tinfo =
121118

122119

123120
/**************************************************
124-
* Bit ops
121+
* GiST support functions
125122
**************************************************/
126123

127124
Datum
@@ -161,8 +158,6 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
161158
PG_RETURN_BOOL(retval);
162159
}
163160

164-
165-
166161
Datum
167162
gbt_bit_union(PG_FUNCTION_ARGS)
168163
{
@@ -173,7 +168,6 @@ gbt_bit_union(PG_FUNCTION_ARGS)
173168
&tinfo, fcinfo->flinfo));
174169
}
175170

176-
177171
Datum
178172
gbt_bit_picksplit(PG_FUNCTION_ARGS)
179173
{
@@ -196,7 +190,6 @@ gbt_bit_same(PG_FUNCTION_ARGS)
196190
PG_RETURN_POINTER(result);
197191
}
198192

199-
200193
Datum
201194
gbt_bit_penalty(PG_FUNCTION_ARGS)
202195
{

contrib/btree_gist/btree_bool.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ typedef struct boolkey
1212
bool upper;
1313
} boolKEY;
1414

15-
/*
16-
** bool ops
17-
*/
15+
/* GiST support functions */
1816
PG_FUNCTION_INFO_V1(gbt_bool_compress);
1917
PG_FUNCTION_INFO_V1(gbt_bool_fetch);
2018
PG_FUNCTION_INFO_V1(gbt_bool_union);
@@ -82,10 +80,9 @@ static const gbtree_ninfo tinfo =
8280

8381

8482
/**************************************************
85-
* bool ops
83+
* GiST support functions
8684
**************************************************/
8785

88-
8986
Datum
9087
gbt_bool_compress(PG_FUNCTION_ARGS)
9188
{
@@ -124,7 +121,6 @@ gbt_bool_consistent(PG_FUNCTION_ARGS)
124121
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
125122
}
126123

127-
128124
Datum
129125
gbt_bool_union(PG_FUNCTION_ARGS)
130126
{
@@ -135,7 +131,6 @@ gbt_bool_union(PG_FUNCTION_ARGS)
135131
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
136132
}
137133

138-
139134
Datum
140135
gbt_bool_penalty(PG_FUNCTION_ARGS)
141136
{

contrib/btree_gist/btree_bytea.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
#include "btree_utils_var.h"
88
#include "utils/fmgrprotos.h"
99

10-
11-
/*
12-
** Bytea ops
13-
*/
10+
/* GiST support functions */
1411
PG_FUNCTION_INFO_V1(gbt_bytea_compress);
1512
PG_FUNCTION_INFO_V1(gbt_bytea_union);
1613
PG_FUNCTION_INFO_V1(gbt_bytea_picksplit);
@@ -69,7 +66,6 @@ gbt_byteacmp(const void *a, const void *b, Oid collation, FmgrInfo *flinfo)
6966
PointerGetDatum(b)));
7067
}
7168

72-
7369
static const gbtree_vinfo tinfo =
7470
{
7571
gbt_t_bytea,
@@ -86,10 +82,9 @@ static const gbtree_vinfo tinfo =
8682

8783

8884
/**************************************************
89-
* Text ops
85+
* GiST support functions
9086
**************************************************/
9187

92-
9388
Datum
9489
gbt_bytea_compress(PG_FUNCTION_ARGS)
9590
{
@@ -98,8 +93,6 @@ gbt_bytea_compress(PG_FUNCTION_ARGS)
9893
PG_RETURN_POINTER(gbt_var_compress(entry, &tinfo));
9994
}
10095

101-
102-
10396
Datum
10497
gbt_bytea_consistent(PG_FUNCTION_ARGS)
10598
{
@@ -121,8 +114,6 @@ gbt_bytea_consistent(PG_FUNCTION_ARGS)
121114
PG_RETURN_BOOL(retval);
122115
}
123116

124-
125-
126117
Datum
127118
gbt_bytea_union(PG_FUNCTION_ARGS)
128119
{
@@ -133,7 +124,6 @@ gbt_bytea_union(PG_FUNCTION_ARGS)
133124
&tinfo, fcinfo->flinfo));
134125
}
135126

136-
137127
Datum
138128
gbt_bytea_picksplit(PG_FUNCTION_ARGS)
139129
{
@@ -156,7 +146,6 @@ gbt_bytea_same(PG_FUNCTION_ARGS)
156146
PG_RETURN_POINTER(result);
157147
}
158148

159-
160149
Datum
161150
gbt_bytea_penalty(PG_FUNCTION_ARGS)
162151
{

contrib/btree_gist/btree_cash.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ typedef struct
1414
Cash upper;
1515
} cashKEY;
1616

17-
/*
18-
** Cash ops
19-
*/
17+
/* GiST support functions */
2018
PG_FUNCTION_INFO_V1(gbt_cash_compress);
2119
PG_FUNCTION_INFO_V1(gbt_cash_fetch);
2220
PG_FUNCTION_INFO_V1(gbt_cash_union);
@@ -111,11 +109,11 @@ cash_dist(PG_FUNCTION_ARGS)
111109
PG_RETURN_CASH(ra);
112110
}
113111

112+
114113
/**************************************************
115-
* Cash ops
114+
* GiST support functions
116115
**************************************************/
117116

118-
119117
Datum
120118
gbt_cash_compress(PG_FUNCTION_ARGS)
121119
{
@@ -155,7 +153,6 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
155153
fcinfo->flinfo));
156154
}
157155

158-
159156
Datum
160157
gbt_cash_distance(PG_FUNCTION_ARGS)
161158
{
@@ -173,7 +170,6 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
173170
&tinfo, fcinfo->flinfo));
174171
}
175172

176-
177173
Datum
178174
gbt_cash_union(PG_FUNCTION_ARGS)
179175
{
@@ -184,7 +180,6 @@ gbt_cash_union(PG_FUNCTION_ARGS)
184180
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
185181
}
186182

187-
188183
Datum
189184
gbt_cash_penalty(PG_FUNCTION_ARGS)
190185
{

contrib/btree_gist/btree_date.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ typedef struct
1414
DateADT upper;
1515
} dateKEY;
1616

17-
/*
18-
** date ops
19-
*/
17+
/* GiST support functions */
2018
PG_FUNCTION_INFO_V1(gbt_date_compress);
2119
PG_FUNCTION_INFO_V1(gbt_date_fetch);
2220
PG_FUNCTION_INFO_V1(gbt_date_union);
@@ -128,11 +126,9 @@ date_dist(PG_FUNCTION_ARGS)
128126

129127

130128
/**************************************************
131-
* date ops
129+
* GiST support functions
132130
**************************************************/
133131

134-
135-
136132
Datum
137133
gbt_date_compress(PG_FUNCTION_ARGS)
138134
{
@@ -172,7 +168,6 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
172168
fcinfo->flinfo));
173169
}
174170

175-
176171
Datum
177172
gbt_date_distance(PG_FUNCTION_ARGS)
178173
{
@@ -190,7 +185,6 @@ gbt_date_distance(PG_FUNCTION_ARGS)
190185
&tinfo, fcinfo->flinfo));
191186
}
192187

193-
194188
Datum
195189
gbt_date_union(PG_FUNCTION_ARGS)
196190
{
@@ -201,7 +195,6 @@ gbt_date_union(PG_FUNCTION_ARGS)
201195
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
202196
}
203197

204-
205198
Datum
206199
gbt_date_penalty(PG_FUNCTION_ARGS)
207200
{
@@ -238,7 +231,6 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
238231
PG_RETURN_POINTER(result);
239232
}
240233

241-
242234
Datum
243235
gbt_date_picksplit(PG_FUNCTION_ARGS)
244236
{

contrib/btree_gist/btree_enum.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ typedef struct
1616
Oid upper;
1717
} oidKEY;
1818

19-
/*
20-
** enum ops
21-
*/
19+
/* GiST support functions */
2220
PG_FUNCTION_INFO_V1(gbt_enum_compress);
2321
PG_FUNCTION_INFO_V1(gbt_enum_fetch);
2422
PG_FUNCTION_INFO_V1(gbt_enum_union);
@@ -99,10 +97,9 @@ static const gbtree_ninfo tinfo =
9997

10098

10199
/**************************************************
102-
* Enum ops
100+
* GiST support functions
103101
**************************************************/
104102

105-
106103
Datum
107104
gbt_enum_compress(PG_FUNCTION_ARGS)
108105
{
@@ -152,7 +149,6 @@ gbt_enum_union(PG_FUNCTION_ARGS)
152149
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
153150
}
154151

155-
156152
Datum
157153
gbt_enum_penalty(PG_FUNCTION_ARGS)
158154
{

contrib/btree_gist/btree_float4.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ typedef struct float4key
1313
float4 upper;
1414
} float4KEY;
1515

16-
/*
17-
** float4 ops
18-
*/
16+
/* GiST support functions */
1917
PG_FUNCTION_INFO_V1(gbt_float4_compress);
2018
PG_FUNCTION_INFO_V1(gbt_float4_fetch);
2119
PG_FUNCTION_INFO_V1(gbt_float4_union);
@@ -107,10 +105,9 @@ float4_dist(PG_FUNCTION_ARGS)
107105

108106

109107
/**************************************************
110-
* float4 ops
108+
* GiST support functions
111109
**************************************************/
112110

113-
114111
Datum
115112
gbt_float4_compress(PG_FUNCTION_ARGS)
116113
{
@@ -150,7 +147,6 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
150147
fcinfo->flinfo));
151148
}
152149

153-
154150
Datum
155151
gbt_float4_distance(PG_FUNCTION_ARGS)
156152
{
@@ -168,7 +164,6 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
168164
&tinfo, fcinfo->flinfo));
169165
}
170166

171-
172167
Datum
173168
gbt_float4_union(PG_FUNCTION_ARGS)
174169
{
@@ -179,7 +174,6 @@ gbt_float4_union(PG_FUNCTION_ARGS)
179174
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
180175
}
181176

182-
183177
Datum
184178
gbt_float4_penalty(PG_FUNCTION_ARGS)
185179
{

contrib/btree_gist/btree_float8.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ typedef struct float8key
1313
float8 upper;
1414
} float8KEY;
1515

16-
/*
17-
** float8 ops
18-
*/
16+
/* GiST support functions */
1917
PG_FUNCTION_INFO_V1(gbt_float8_compress);
2018
PG_FUNCTION_INFO_V1(gbt_float8_fetch);
2119
PG_FUNCTION_INFO_V1(gbt_float8_union);
@@ -113,11 +111,11 @@ float8_dist(PG_FUNCTION_ARGS)
113111
PG_RETURN_FLOAT8(fabs(r));
114112
}
115113

114+
116115
/**************************************************
117-
* float8 ops
116+
* GiST support functions
118117
**************************************************/
119118

120-
121119
Datum
122120
gbt_float8_compress(PG_FUNCTION_ARGS)
123121
{
@@ -157,7 +155,6 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
157155
fcinfo->flinfo));
158156
}
159157

160-
161158
Datum
162159
gbt_float8_distance(PG_FUNCTION_ARGS)
163160
{
@@ -175,7 +172,6 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
175172
&tinfo, fcinfo->flinfo));
176173
}
177174

178-
179175
Datum
180176
gbt_float8_union(PG_FUNCTION_ARGS)
181177
{
@@ -186,7 +182,6 @@ gbt_float8_union(PG_FUNCTION_ARGS)
186182
PG_RETURN_POINTER(gbt_num_union(out, entryvec, &tinfo, fcinfo->flinfo));
187183
}
188184

189-
190185
Datum
191186
gbt_float8_penalty(PG_FUNCTION_ARGS)
192187
{

0 commit comments

Comments
 (0)