@@ -29,41 +29,42 @@ PG_FUNCTION_INFO_V1(gbt_date_same);
29
29
static bool
30
30
gbt_dategt (const void * a , const void * b , FmgrInfo * flinfo )
31
31
{
32
- return DatumGetBool (
33
- DirectFunctionCall2 ( date_gt , DateADTGetDatum (* ((const DateADT * ) a )), DateADTGetDatum ( * (( const DateADT * ) b )))
34
- );
32
+ return DatumGetBool (DirectFunctionCall2 ( date_gt ,
33
+ DateADTGetDatum (* ((const DateADT * ) a )),
34
+ DateADTGetDatum ( * (( const DateADT * ) b ))) );
35
35
}
36
36
37
37
static bool
38
38
gbt_datege (const void * a , const void * b , FmgrInfo * flinfo )
39
39
{
40
- return DatumGetBool (
41
- DirectFunctionCall2 ( date_ge , DateADTGetDatum (* ((const DateADT * ) a )), DateADTGetDatum ( * (( const DateADT * ) b )))
42
- );
40
+ return DatumGetBool (DirectFunctionCall2 ( date_ge ,
41
+ DateADTGetDatum (* ((const DateADT * ) a )),
42
+ DateADTGetDatum ( * (( const DateADT * ) b ))) );
43
43
}
44
44
45
45
static bool
46
46
gbt_dateeq (const void * a , const void * b , FmgrInfo * flinfo )
47
47
{
48
- return DatumGetBool (
49
- DirectFunctionCall2 (date_eq , DateADTGetDatum (* ((const DateADT * ) a )), DateADTGetDatum (* ((const DateADT * ) b )))
48
+ return DatumGetBool (DirectFunctionCall2 (date_eq ,
49
+ DateADTGetDatum (* ((const DateADT * ) a )),
50
+ DateADTGetDatum (* ((const DateADT * ) b )))
50
51
);
51
52
}
52
53
53
54
static bool
54
55
gbt_datele (const void * a , const void * b , FmgrInfo * flinfo )
55
56
{
56
- return DatumGetBool (
57
- DirectFunctionCall2 ( date_le , DateADTGetDatum (* ((const DateADT * ) a )), DateADTGetDatum ( * (( const DateADT * ) b )))
58
- );
57
+ return DatumGetBool (DirectFunctionCall2 ( date_le ,
58
+ DateADTGetDatum (* ((const DateADT * ) a )),
59
+ DateADTGetDatum ( * (( const DateADT * ) b ))) );
59
60
}
60
61
61
62
static bool
62
63
gbt_datelt (const void * a , const void * b , FmgrInfo * flinfo )
63
64
{
64
- return DatumGetBool (
65
- DirectFunctionCall2 ( date_lt , DateADTGetDatum (* ((const DateADT * ) a )), DateADTGetDatum ( * (( const DateADT * ) b )))
66
- );
65
+ return DatumGetBool (DirectFunctionCall2 ( date_lt ,
66
+ DateADTGetDatum (* ((const DateADT * ) a )),
67
+ DateADTGetDatum ( * (( const DateADT * ) b ))) );
67
68
}
68
69
69
70
@@ -75,9 +76,13 @@ gbt_datekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
75
76
dateKEY * ib = (dateKEY * ) (((const Nsrt * ) b )-> t );
76
77
int res ;
77
78
78
- res = DatumGetInt32 (DirectFunctionCall2 (date_cmp , DateADTGetDatum (ia -> lower ), DateADTGetDatum (ib -> lower )));
79
+ res = DatumGetInt32 (DirectFunctionCall2 (date_cmp ,
80
+ DateADTGetDatum (ia -> lower ),
81
+ DateADTGetDatum (ib -> lower )));
79
82
if (res == 0 )
80
- return DatumGetInt32 (DirectFunctionCall2 (date_cmp , DateADTGetDatum (ia -> upper ), DateADTGetDatum (ib -> upper )));
83
+ return DatumGetInt32 (DirectFunctionCall2 (date_cmp ,
84
+ DateADTGetDatum (ia -> upper ),
85
+ DateADTGetDatum (ib -> upper )));
81
86
82
87
return res ;
83
88
}
@@ -162,9 +167,9 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
162
167
key .lower = (GBT_NUMKEY * ) & kkk -> lower ;
163
168
key .upper = (GBT_NUMKEY * ) & kkk -> upper ;
164
169
165
- PG_RETURN_BOOL (
166
- gbt_num_consistent ( & key , ( void * ) & query , & strategy , GIST_LEAF (entry ), & tinfo , fcinfo -> flinfo )
167
- );
170
+ PG_RETURN_BOOL (gbt_num_consistent ( & key , ( void * ) & query , & strategy ,
171
+ GIST_LEAF (entry ), & tinfo ,
172
+ fcinfo -> flinfo ) );
168
173
}
169
174
170
175
@@ -181,9 +186,8 @@ gbt_date_distance(PG_FUNCTION_ARGS)
181
186
key .lower = (GBT_NUMKEY * ) & kkk -> lower ;
182
187
key .upper = (GBT_NUMKEY * ) & kkk -> upper ;
183
188
184
- PG_RETURN_FLOAT8 (
185
- gbt_num_distance (& key , (void * ) & query , GIST_LEAF (entry ), & tinfo , fcinfo -> flinfo )
186
- );
189
+ PG_RETURN_FLOAT8 (gbt_num_distance (& key , (void * ) & query , GIST_LEAF (entry ),
190
+ & tinfo , fcinfo -> flinfo ));
187
191
}
188
192
189
193
@@ -207,15 +211,13 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
207
211
int32 diff ,
208
212
res ;
209
213
210
- diff = DatumGetInt32 (DirectFunctionCall2 (
211
- date_mi ,
214
+ diff = DatumGetInt32 (DirectFunctionCall2 (date_mi ,
212
215
DateADTGetDatum (newentry -> upper ),
213
216
DateADTGetDatum (origentry -> upper )));
214
217
215
218
res = Max (diff , 0 );
216
219
217
- diff = DatumGetInt32 (DirectFunctionCall2 (
218
- date_mi ,
220
+ diff = DatumGetInt32 (DirectFunctionCall2 (date_mi ,
219
221
DateADTGetDatum (origentry -> lower ),
220
222
DateADTGetDatum (newentry -> lower )));
221
223
@@ -225,8 +227,7 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
225
227
226
228
if (res > 0 )
227
229
{
228
- diff = DatumGetInt32 (DirectFunctionCall2 (
229
- date_mi ,
230
+ diff = DatumGetInt32 (DirectFunctionCall2 (date_mi ,
230
231
DateADTGetDatum (origentry -> upper ),
231
232
DateADTGetDatum (origentry -> lower )));
232
233
* result += FLT_MIN ;
@@ -241,11 +242,9 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
241
242
Datum
242
243
gbt_date_picksplit (PG_FUNCTION_ARGS )
243
244
{
244
- PG_RETURN_POINTER (gbt_num_picksplit (
245
- (GistEntryVector * ) PG_GETARG_POINTER (0 ),
245
+ PG_RETURN_POINTER (gbt_num_picksplit ((GistEntryVector * ) PG_GETARG_POINTER (0 ),
246
246
(GIST_SPLITVEC * ) PG_GETARG_POINTER (1 ),
247
- & tinfo , fcinfo -> flinfo
248
- ));
247
+ & tinfo , fcinfo -> flinfo ));
249
248
}
250
249
251
250
Datum
0 commit comments