@@ -29,7 +29,9 @@ static VarBit *bitsubstring(VarBit *arg, int32 s, int32 l,
29
29
static VarBit * bit_overlay (VarBit * t1 , VarBit * t2 , int sp , int sl );
30
30
31
31
32
- /* common code for bittypmodin and varbittypmodin */
32
+ /*
33
+ * common code for bittypmodin and varbittypmodin
34
+ */
33
35
static int32
34
36
anybit_typmodin (ArrayType * ta , const char * typename )
35
37
{
@@ -64,7 +66,9 @@ anybit_typmodin(ArrayType *ta, const char *typename)
64
66
return typmod ;
65
67
}
66
68
67
- /* common code for bittypmodout and varbittypmodout */
69
+ /*
70
+ * common code for bittypmodout and varbittypmodout
71
+ */
68
72
static char *
69
73
anybit_typmodout (int32 typmod )
70
74
{
@@ -233,8 +237,10 @@ bit_out(PG_FUNCTION_ARGS)
233
237
/* same as varbit output */
234
238
return varbit_out (fcinfo );
235
239
#else
236
- /* This is how one would print a hex string, in case someone wants to
237
- write a formatting function. */
240
+ /*
241
+ * This is how one would print a hex string, in case someone wants to
242
+ * write a formatting function.
243
+ */
238
244
VarBit * s = PG_GETARG_VARBIT_P (0 );
239
245
char * result ,
240
246
* r ;
@@ -330,7 +336,8 @@ bit_send(PG_FUNCTION_ARGS)
330
336
return varbit_send (fcinfo );
331
337
}
332
338
333
- /* bit()
339
+ /*
340
+ * bit()
334
341
* Converts a bit() type to a specific internal length.
335
342
* len is the bitlength specified in the column definition.
336
343
*
@@ -523,7 +530,8 @@ varbit_in(PG_FUNCTION_ARGS)
523
530
PG_RETURN_VARBIT_P (result );
524
531
}
525
532
526
- /* varbit_out -
533
+ /*
534
+ * varbit_out -
527
535
* Prints the string as bits to preserve length accurately
528
536
*/
529
537
Datum
@@ -636,7 +644,8 @@ varbit_send(PG_FUNCTION_ARGS)
636
644
PG_RETURN_BYTEA_P (pq_endtypsend (& buf ));
637
645
}
638
646
639
- /* varbit()
647
+ /*
648
+ * varbit()
640
649
* Converts a varbit() type to a specific internal length.
641
650
* len is the maximum bitlength specified in the column definition.
642
651
*
@@ -718,7 +727,8 @@ varbittypmodout(PG_FUNCTION_ARGS)
718
727
* need to be so careful.
719
728
*/
720
729
721
- /* bit_cmp
730
+ /*
731
+ * bit_cmp
722
732
*
723
733
* Compares two bitstrings and returns <0, 0, >0 depending on whether the first
724
734
* string is smaller, equal, or bigger than the second. All bits are considered
@@ -871,7 +881,8 @@ bitcmp(PG_FUNCTION_ARGS)
871
881
PG_RETURN_INT32 (result );
872
882
}
873
883
874
- /* bitcat
884
+ /*
885
+ * bitcat
875
886
* Concatenation of bit strings
876
887
*/
877
888
Datum
@@ -931,7 +942,8 @@ bit_catenate(VarBit *arg1, VarBit *arg2)
931
942
return result ;
932
943
}
933
944
934
- /* bitsubstr
945
+ /*
946
+ * bitsubstr
935
947
* retrieve a substring from the bit string.
936
948
* Note, s is 1-based.
937
949
* SQL draft 6.10 9)
@@ -1105,7 +1117,8 @@ bit_overlay(VarBit *t1, VarBit *t2, int sp, int sl)
1105
1117
return result ;
1106
1118
}
1107
1119
1108
- /* bitlength, bitoctetlength
1120
+ /*
1121
+ * bitlength, bitoctetlength
1109
1122
* Return the length of a bit string
1110
1123
*/
1111
1124
Datum
@@ -1124,11 +1137,12 @@ bitoctetlength(PG_FUNCTION_ARGS)
1124
1137
PG_RETURN_INT32 (VARBITBYTES (arg ));
1125
1138
}
1126
1139
1127
- /* bitand
1140
+ /*
1141
+ * bit_and
1128
1142
* perform a logical AND on two bit strings.
1129
1143
*/
1130
1144
Datum
1131
- bitand (PG_FUNCTION_ARGS )
1145
+ bit_and (PG_FUNCTION_ARGS )
1132
1146
{
1133
1147
VarBit * arg1 = PG_GETARG_VARBIT_P (0 );
1134
1148
VarBit * arg2 = PG_GETARG_VARBIT_P (1 );
@@ -1164,11 +1178,12 @@ bitand(PG_FUNCTION_ARGS)
1164
1178
PG_RETURN_VARBIT_P (result );
1165
1179
}
1166
1180
1167
- /* bitor
1181
+ /*
1182
+ * bit_or
1168
1183
* perform a logical OR on two bit strings.
1169
1184
*/
1170
1185
Datum
1171
- bitor (PG_FUNCTION_ARGS )
1186
+ bit_or (PG_FUNCTION_ARGS )
1172
1187
{
1173
1188
VarBit * arg1 = PG_GETARG_VARBIT_P (0 );
1174
1189
VarBit * arg2 = PG_GETARG_VARBIT_P (1 );
@@ -1210,7 +1225,8 @@ bitor(PG_FUNCTION_ARGS)
1210
1225
PG_RETURN_VARBIT_P (result );
1211
1226
}
1212
1227
1213
- /* bitxor
1228
+ /*
1229
+ * bitxor
1214
1230
* perform a logical XOR on two bit strings.
1215
1231
*/
1216
1232
Datum
@@ -1257,7 +1273,8 @@ bitxor(PG_FUNCTION_ARGS)
1257
1273
PG_RETURN_VARBIT_P (result );
1258
1274
}
1259
1275
1260
- /* bitnot
1276
+ /*
1277
+ * bitnot
1261
1278
* perform a logical NOT on a bit string.
1262
1279
*/
1263
1280
Datum
@@ -1289,7 +1306,8 @@ bitnot(PG_FUNCTION_ARGS)
1289
1306
PG_RETURN_VARBIT_P (result );
1290
1307
}
1291
1308
1292
- /* bitshiftleft
1309
+ /*
1310
+ * bitshiftleft
1293
1311
* do a left shift (i.e. towards the beginning of the string)
1294
1312
*/
1295
1313
Datum
@@ -1348,7 +1366,8 @@ bitshiftleft(PG_FUNCTION_ARGS)
1348
1366
PG_RETURN_VARBIT_P (result );
1349
1367
}
1350
1368
1351
- /* bitshiftright
1369
+ /*
1370
+ * bitshiftright
1352
1371
* do a right shift (i.e. towards the end of the string)
1353
1372
*/
1354
1373
Datum
@@ -1575,7 +1594,8 @@ bittoint8(PG_FUNCTION_ARGS)
1575
1594
}
1576
1595
1577
1596
1578
- /* Determines the position of S2 in the bitstring S1 (1-based string).
1597
+ /*
1598
+ * Determines the position of S2 in the bitstring S1 (1-based string).
1579
1599
* If S2 does not appear in S1 this function returns 0.
1580
1600
* If S2 is of length 0 this function returns 1.
1581
1601
* Compatible in usage with POSITION() functions for other data types.
0 commit comments