1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
|
$NetBSD: postgresql-7.0.3-alpha.diff,v 1.1 2001/02/13 02:39:32 jlam Exp $
This diff is derived by Berndt Josef Wulf <wulf@ping.net.au> from the patch
located at:
http://www.rkirkpat.net/software/postgresql-7.0-alpha.patch.gz
to patch cleanly into the pkgsrc PostgreSQL source tree, and fixes several
problems related to 64-bit integers. This patch will no longer be needed
for the forthcoming PostgreSQL 7.1 release.
--- backend/access/hash/hashfunc.c.orig Mon Feb 12 21:28:48 2001
+++ backend/access/hash/hashfunc.c Mon Feb 12 21:28:48 2001
@@ -22,15 +22,15 @@
#include "access/hash.h"
uint32
-hashint2(int16 key)
+hashint2(Datum key)
{
- return (uint32) ~key;
+ return (uint32) ~((int16)key);
}
uint32
-hashint4(uint32 key)
+hashint4(Datum key)
{
- return ~key;
+ return ~((uint32)key);
}
uint32
@@ -172,12 +172,12 @@
#define PRIME2 1048583
uint32
-hashchar(char key)
+hashchar(Datum key)
{
uint32 h;
/* Convert char to integer */
- h = (key - ' ');
+ h = ((char)key - ' ');
h %= PRIME2;
return h;
--- backend/access/nbtree/nbtcompare.c.orig Mon Feb 12 21:28:48 2001
+++ backend/access/nbtree/nbtcompare.c Mon Feb 12 21:28:48 2001
@@ -27,13 +27,13 @@
#include "utils/builtins.h"
int32
-btint2cmp(int16 a, int16 b)
+btint2cmp(Datum a, Datum b)
{
- return (int32) (a - b);
+ return (int32) ((int16)a - (int16)b);
}
int32
-btint4cmp(int32 a, int32 b)
+btint4cmp(Datum a, Datum b)
{
if (a > b)
return 1;
@@ -55,15 +55,15 @@
}
int32
-btint24cmp(int16 a, int32 b)
+btint24cmp(Datum a, Datum b)
{
- return ((int32) a) - b;
+ return ((int16) a) - (int32)b;
}
int32
-btint42cmp(int32 a, int16 b)
+btint42cmp(Datum a, Datum b)
{
- return a - ((int32) b);
+ return (int32)a - ((int16) b);
}
int32
@@ -118,8 +118,9 @@
int32
-btabstimecmp(AbsoluteTime a, AbsoluteTime b)
+btabstimecmp(Datum da, Datum db)
{
+ AbsoluteTime a = da, b = db;
if (AbsoluteTimeIsBefore(a, b))
return -1;
else if (AbsoluteTimeIsBefore(b, a))
@@ -129,7 +130,7 @@
}
int32
-btcharcmp(char a, char b)
+btcharcmp(Datum a, Datum b)
{
return (int32) ((uint8) a - (uint8) b);
}
--- backend/utils/adt/char.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/char.c Mon Feb 12 21:28:48 2001
@@ -35,7 +35,7 @@
* charout - converts 'x' to "x"
*/
char *
-charout(int32 ch)
+charout(Datum ch)
{
char *result = (char *) palloc(2);
@@ -70,7 +70,7 @@
* printable character...
*/
char *
-cidout(int32 c)
+cidout(Datum c)
{
char *result;
CommandId c2;
@@ -87,69 +87,69 @@
*****************************************************************************/
bool
-chareq(int8 arg1, int8 arg2)
+chareq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int8)arg1 == (int8)arg2;
}
bool
-charne(int8 arg1, int8 arg2)
+charne(Datum arg1, Datum arg2)
{
- return arg1 != arg2;
+ return (int8)arg1 != (int8)arg2;
}
bool
-charlt(int8 arg1, int8 arg2)
+charlt(Datum arg1, Datum arg2)
{
return (uint8) arg1 < (uint8) arg2;
}
bool
-charle(int8 arg1, int8 arg2)
+charle(Datum arg1, Datum arg2)
{
return (uint8) arg1 <= (uint8) arg2;
}
bool
-chargt(int8 arg1, int8 arg2)
+chargt(Datum arg1, Datum arg2)
{
return (uint8) arg1 > (uint8) arg2;
}
bool
-charge(int8 arg1, int8 arg2)
+charge(Datum arg1, Datum arg2)
{
return (uint8) arg1 >= (uint8) arg2;
}
int8
-charpl(int8 arg1, int8 arg2)
+charpl(Datum arg1, Datum arg2)
{
- return arg1 + arg2;
+ return (int8)arg1 + (int8)arg2;
}
int8
-charmi(int8 arg1, int8 arg2)
+charmi(Datum arg1, Datum arg2)
{
- return arg1 - arg2;
+ return (int8)arg1 - (int8)arg2;
}
int8
-charmul(int8 arg1, int8 arg2)
+charmul(Datum arg1, Datum arg2)
{
- return arg1 * arg2;
+ return (int8)arg1 * (int8)arg2;
}
int8
-chardiv(int8 arg1, int8 arg2)
+chardiv(Datum arg1, Datum arg2)
{
- return arg1 / arg2;
+ return (int8)arg1 / (int8)arg2;
}
bool
-cideq(int8 arg1, int8 arg2)
+cideq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int8)arg1 == (int8)arg2;
}
int8
@@ -159,13 +159,13 @@
}
text *
-char_text(int8 arg1)
+char_text(Datum arg1)
{
text *result;
result = palloc(VARHDRSZ + 1);
VARSIZE(result) = VARHDRSZ + 1;
- *(VARDATA(result)) = arg1;
+ *(VARDATA(result)) = (int8)arg1;
return result;
}
--- backend/utils/adt/float.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/float.c Mon Feb 12 21:28:48 2001
@@ -138,7 +138,7 @@
* until the distributions are updated.
* --djm 12/16/96
*/
-#if ( defined(linux) && defined(__alpha__) ) && !defined(UNSAFE_FLOATS)
+#if ( defined(linux) && defined(__alpha__) ) && !defined(UNSAFE_FLOATS) && 0
#define UNSAFE_FLOATS
#endif
@@ -864,9 +864,10 @@
* i4tod - converts an int4 number to a float8 number
*/
float64
-i4tod(int32 num)
+i4tod(Datum n)
{
float64 result;
+ int32 num = (int32) n;
result = (float64) palloc(sizeof(float64data));
@@ -879,9 +880,10 @@
* i2tod - converts an int2 number to a float8 number
*/
float64
-i2tod(int16 num)
+i2tod(Datum n)
{
float64 result;
+ int16 num = (int16) n;
result = (float64) palloc(sizeof(float64data));
@@ -932,9 +934,10 @@
* i4tof - converts an int4 number to a float8 number
*/
float32
-i4tof(int32 num)
+i4tof(Datum n)
{
float32 result;
+ int32 num = (int32) n;
result = (float32) palloc(sizeof(float32data));
@@ -947,9 +950,10 @@
* i2tof - converts an int2 number to a float8 number
*/
float32
-i2tof(int16 num)
+i2tof(Datum n)
{
float32 result;
+ int16 num = (int16) n;
result = (float32) palloc(sizeof(float32data));
--- backend/utils/adt/int.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/int.c Mon Feb 12 21:28:48 2001
@@ -62,7 +62,7 @@
* int2out - converts short to "num"
*/
char *
-int2out(int16 sh)
+int2out(Datum sh)
{
char *result;
@@ -227,12 +227,12 @@
* int4out - converts int4 to "num"
*/
char *
-int4out(int32 l)
+int4out(Datum l)
{
char *result;
result = (char *) palloc(12); /* assumes sign, 10 digits, '\0' */
- ltoa(l, result);
+ ltoa((int32)l, result);
return result;
}
@@ -244,14 +244,16 @@
*/
int32
-i2toi4(int16 arg1)
+i2toi4(Datum arg1)
{
return (int32) arg1;
}
int16
-i4toi2(int32 arg1)
+i4toi2(Datum arg)
{
+ int32 arg1 = (int32) arg;
+
if (arg1 < SHRT_MIN)
elog(ERROR, "i4toi2: '%d' causes int2 underflow", arg1);
if (arg1 > SHRT_MAX)
@@ -261,7 +263,7 @@
}
text *
-int2_text(int16 arg1)
+int2_text(Datum arg1)
{
text *result;
@@ -305,7 +307,7 @@
} /* text_int2() */
text *
-int4_text(int32 arg1)
+int4_text(Datum arg1)
{
text *result;
@@ -364,147 +366,147 @@
* intge - returns 1 iff arg1 >= arg2
*/
bool
-int4eq(int32 arg1, int32 arg2)
+int4eq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int32)arg1 == (int32)arg2;
}
bool
-int4ne(int32 arg1, int32 arg2)
+int4ne(Datum arg1, Datum arg2)
{
- return arg1 != arg2;
+ return (int32)arg1 != (int32)arg2;
}
bool
-int4lt(int32 arg1, int32 arg2)
+int4lt(Datum arg1, Datum arg2)
{
- return arg1 < arg2;
+ return (int32)arg1 < (int32)arg2;
}
bool
-int4le(int32 arg1, int32 arg2)
+int4le(Datum arg1, Datum arg2)
{
- return arg1 <= arg2;
+ return (int32)arg1 <= (int32)arg2;
}
bool
-int4gt(int32 arg1, int32 arg2)
+int4gt(Datum arg1, Datum arg2)
{
- return arg1 > arg2;
+ return (int32)arg1 > (int32)arg2;
}
bool
-int4ge(int32 arg1, int32 arg2)
+int4ge(Datum arg1, Datum arg2)
{
- return arg1 >= arg2;
+ return (int32)arg1 >= (int32)arg2;
}
bool
-int2eq(int16 arg1, int16 arg2)
+int2eq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int16)arg1 == (int16)arg2;
}
bool
-int2ne(int16 arg1, int16 arg2)
+int2ne(Datum arg1, Datum arg2)
{
- return arg1 != arg2;
+ return (int16)arg1 != (int16)arg2;
}
bool
-int2lt(int16 arg1, int16 arg2)
+int2lt(Datum arg1, Datum arg2)
{
- return arg1 < arg2;
+ return (int16)arg1 < (int16)arg2;
}
bool
-int2le(int16 arg1, int16 arg2)
+int2le(Datum arg1, Datum arg2)
{
- return arg1 <= arg2;
+ return (int16)arg1 <= (int16)arg2;
}
bool
-int2gt(int16 arg1, int16 arg2)
+int2gt(Datum arg1, Datum arg2)
{
- return arg1 > arg2;
+ return (int16)arg1 > (int16)arg2;
}
bool
-int2ge(int16 arg1, int16 arg2)
+int2ge(Datum arg1, Datum arg2)
{
- return arg1 >= arg2;
+ return (int16)arg1 >= (int16)arg2;
}
bool
-int24eq(int32 arg1, int32 arg2)
+int24eq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int32)arg1 == (int32)arg2;
}
bool
-int24ne(int32 arg1, int32 arg2)
+int24ne(Datum arg1, Datum arg2)
{
- return arg1 != arg2;
+ return (int32)arg1 != (int32)arg2;
}
bool
-int24lt(int32 arg1, int32 arg2)
+int24lt(Datum arg1, Datum arg2)
{
- return arg1 < arg2;
+ return (int32)arg1 < (int32)arg2;
}
bool
-int24le(int32 arg1, int32 arg2)
+int24le(Datum arg1, Datum arg2)
{
- return arg1 <= arg2;
+ return (int32)arg1 <= (int32)arg2;
}
bool
-int24gt(int32 arg1, int32 arg2)
+int24gt(Datum arg1, Datum arg2)
{
- return arg1 > arg2;
+ return (int32)arg1 > (int32)arg2;
}
bool
-int24ge(int32 arg1, int32 arg2)
+int24ge(Datum arg1, Datum arg2)
{
- return arg1 >= arg2;
+ return (int32)arg1 >= (int32)arg2;
}
bool
-int42eq(int32 arg1, int32 arg2)
+int42eq(Datum arg1, Datum arg2)
{
- return arg1 == arg2;
+ return (int32)arg1 == (int32)arg2;
}
bool
-int42ne(int32 arg1, int32 arg2)
+int42ne(Datum arg1, Datum arg2)
{
- return arg1 != arg2;
+ return (int32)arg1 != (int32)arg2;
}
bool
-int42lt(int32 arg1, int32 arg2)
+int42lt(Datum arg1, Datum arg2)
{
- return arg1 < arg2;
+ return (int32)arg1 < (int32)arg2;
}
bool
-int42le(int32 arg1, int32 arg2)
+int42le(Datum arg1, Datum arg2)
{
- return arg1 <= arg2;
+ return (int32)arg1 <= (int32)arg2;
}
bool
-int42gt(int32 arg1, int32 arg2)
+int42gt(Datum arg1, Datum arg2)
{
- return arg1 > arg2;
+ return (int32)arg1 > (int32)arg2;
}
bool
-int42ge(int32 arg1, int32 arg2)
+int42ge(Datum arg1, Datum arg2)
{
- return arg1 >= arg2;
+ return (int32)arg1 >= (int32)arg2;
}
/*
@@ -514,159 +516,160 @@
* int[24]div - returns arg1 / arg2
*/
int32
-int4um(int32 arg)
+int4um(Datum arg)
{
- return -arg;
+ return (int32)-arg;
}
int32
-int4pl(int32 arg1, int32 arg2)
+int4pl(Datum arg1, Datum arg2)
{
- return arg1 + arg2;
+ return (int32)arg1 + (int32)arg2;
}
int32
-int4mi(int32 arg1, int32 arg2)
+int4mi(Datum arg1, Datum arg2)
{
- return arg1 - arg2;
+ return (int32)arg1 - (int32)arg2;
}
int32
-int4mul(int32 arg1, int32 arg2)
+int4mul(Datum arg1, Datum arg2)
{
- return arg1 * arg2;
+ return (int32)arg1 * (int32)arg2;
}
int32
-int4div(int32 arg1, int32 arg2)
+int4div(Datum arg1, Datum arg2)
{
- return arg1 / arg2;
+ return (int32)arg1 / (int32)arg2;
}
int32
-int4inc(int32 arg)
+int4inc(Datum arg)
{
- return arg + (int32) 1;
+ return (int32)++arg;
}
int16
-int2um(int16 arg)
+int2um(Datum arg)
{
- return -arg;
+ return (int16)-arg;
}
int16
-int2pl(int16 arg1, int16 arg2)
+int2pl(Datum arg1, Datum arg2)
{
- return arg1 + arg2;
+ return (int16)arg1 + (int16)arg2;
}
int16
-int2mi(int16 arg1, int16 arg2)
+int2mi(Datum arg1, Datum arg2)
{
- return arg1 - arg2;
+ return (int16)arg1 - (int16)arg2;
}
int16
-int2mul(int16 arg1, int16 arg2)
+int2mul(Datum arg1, Datum arg2)
{
- return arg1 * arg2;
+ return (int16)arg1 * (int16)arg2;
}
int16
-int2div(int16 arg1, int16 arg2)
+int2div(Datum arg1, Datum arg2)
{
- return arg1 / arg2;
+ return (int16)arg1 / (int16)arg2;
}
int16
-int2inc(int16 arg)
+int2inc(Datum arg)
{
- return arg + (int16) 1;
+ return (int16)++arg;
}
int32
-int24pl(int32 arg1, int32 arg2)
+int24pl(Datum arg1, Datum arg2)
{
- return arg1 + arg2;
+ return (int32)arg1 + (int32)arg2;
}
int32
-int24mi(int32 arg1, int32 arg2)
+int24mi(Datum arg1, Datum arg2)
{
- return arg1 - arg2;
+ return (int32)arg1 - (int32)arg2;
}
int32
-int24mul(int32 arg1, int32 arg2)
+int24mul(Datum arg1, Datum arg2)
{
- return arg1 * arg2;
+ return (int32)arg1 * (int32)arg2;
}
int32
-int24div(int32 arg1, int32 arg2)
+int24div(Datum arg1, Datum arg2)
{
- return arg1 / arg2;
+ return (int32)arg1 / (int32)arg2;
}
int32
-int42pl(int32 arg1, int32 arg2)
+int42pl(Datum arg1, Datum arg2)
{
- return arg1 + arg2;
+ return (int32)arg1 + (int32)arg2;
}
int32
-int42mi(int32 arg1, int32 arg2)
+int42mi(Datum arg1, Datum arg2)
{
- return arg1 - arg2;
+ return (int32)arg1 - (int32)arg2;
}
int32
-int42mul(int32 arg1, int32 arg2)
+int42mul(Datum arg1, Datum arg2)
{
- return arg1 * arg2;
+ return (int32)arg1 * (int32)arg2;
}
int32
-int42div(int32 arg1, int32 arg2)
+int42div(Datum arg1, Datum arg2)
{
- return arg1 / arg2;
+ return (int32)arg1 / (int32)arg2;
}
/*
* int[24]mod - returns arg1 mod arg2
*/
int32
-int4mod(int32 arg1, int32 arg2)
+int4mod(Datum arg1, Datum arg2)
{
- return arg1 % arg2;
+ return (int32)arg1 % (int32)arg2;
}
int32
-int2mod(int16 arg1, int16 arg2)
+int2mod(Datum arg1, Datum arg2)
{
- return arg1 % arg2;
+ return (int16)arg1 % (int16)arg2;
}
int32
-int24mod(int32 arg1, int32 arg2)
+int24mod(Datum arg1, Datum arg2)
{
- return arg1 % arg2;
+ return (int32)arg1 % (int32)arg2;
}
int32
-int42mod(int32 arg1, int32 arg2)
+int42mod(Datum arg1, Datum arg2)
{
- return arg1 % arg2;
+ return (int32)arg1 % (int32)arg2;
}
/* int[24]fac()
* Factorial
*/
int32
-int4fac(int32 arg1)
+int4fac(Datum arg)
{
int32 result;
+ int32 arg1 = (int32) arg;
if (arg1 < 1)
result = 0;
@@ -677,9 +680,10 @@
}
int32
-int2fac(int16 arg1)
+int2fac(Datum arg)
{
int32 result;
+ int16 arg1 = (int16) arg;
if (arg1 < 1)
result = 0;
@@ -693,37 +697,37 @@
* Absolute value
*/
int32
-int4abs(int32 arg1)
+int4abs(Datum arg1)
{
- return ((arg1 < 0) ? -arg1 : arg1);
+ return ((arg1 < 0) ? -arg1: arg1);
}
int16
-int2abs(int16 arg1)
+int2abs(Datum arg1)
{
- return ((arg1 < 0) ? -arg1 : arg1);
+ return ((arg1 < 0) ? -arg1: arg1);
}
int16
-int2larger(int16 arg1, int16 arg2)
+int2larger(Datum arg1, Datum arg2)
{
- return (arg1 > arg2) ? arg1 : arg2;
+ return ((int16)arg1 > (int16)arg2) ? (int16)arg1 : (int16)arg2;
}
int16
-int2smaller(int16 arg1, int16 arg2)
+int2smaller(Datum arg1, Datum arg2)
{
- return (arg1 < arg2) ? arg1 : arg2;
+ return ((int16)arg1 < (int16)arg2) ? (int16)arg1 : (int16)arg2;
}
int32
-int4larger(int32 arg1, int32 arg2)
+int4larger(Datum arg1, Datum arg2)
{
- return (arg1 > arg2) ? arg1 : arg2;
+ return ((int32)arg1 > (int32)arg2) ? (int32)arg1 : (int32)arg2;
}
int32
-int4smaller(int32 arg1, int32 arg2)
+int4smaller(Datum arg1, Datum arg2)
{
- return (arg1 < arg2) ? arg1 : arg2;
+ return ((int32)arg1 < (int32)arg2) ? (int32)arg1 : (int32)arg2;
}
--- backend/utils/adt/int8.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/int8.c Mon Feb 12 21:28:48 2001
@@ -176,57 +176,57 @@
* Is 64-bit val1 relop 32-bit val2?
*/
bool
-int84eq(int64 *val1, int32 val2)
+int84eq(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 == val2;
+ return *val1 == (int32)val2;
} /* int84eq() */
bool
-int84ne(int64 *val1, int32 val2)
+int84ne(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 != val2;
+ return *val1 != (int32)val2;
} /* int84ne() */
bool
-int84lt(int64 *val1, int32 val2)
+int84lt(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 < val2;
+ return *val1 < (int32)val2;
} /* int84lt() */
bool
-int84gt(int64 *val1, int32 val2)
+int84gt(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 > val2;
+ return *val1 > (int32)val2;
} /* int84gt() */
bool
-int84le(int64 *val1, int32 val2)
+int84le(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 <= val2;
+ return *val1 <= (int32)val2;
} /* int84le() */
bool
-int84ge(int64 *val1, int32 val2)
+int84ge(int64 *val1, Datum val2)
{
if (!val1)
return 0;
- return *val1 >= val2;
+ return *val1 >= (int32)val2;
} /* int84ge() */
@@ -234,57 +234,57 @@
* Is 32-bit val1 relop 64-bit val2?
*/
bool
-int48eq(int32 val1, int64 *val2)
+int48eq(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 == *val2;
+ return (int32)val1 == *val2;
} /* int48eq() */
bool
-int48ne(int32 val1, int64 *val2)
+int48ne(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 != *val2;
+ return (int32)val1 != *val2;
} /* int48ne() */
bool
-int48lt(int32 val1, int64 *val2)
+int48lt(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 < *val2;
+ return (int32)val1 < *val2;
} /* int48lt() */
bool
-int48gt(int32 val1, int64 *val2)
+int48gt(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 > *val2;
+ return (int32)val1 > *val2;
} /* int48gt() */
bool
-int48le(int32 val1, int64 *val2)
+int48le(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 <= *val2;
+ return (int32)val1 <= *val2;
} /* int48le() */
bool
-int48ge(int32 val1, int64 *val2)
+int48ge(Datum val1, int64 *val2)
{
if (!val2)
return 0;
- return val1 >= *val2;
+ return (int32)val1 >= *val2;
} /* int48ge() */
@@ -444,106 +444,106 @@
int64 *
-int84pl(int64 *val1, int32 val2)
+int84pl(int64 *val1, Datum val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val1))
return NULL;
- *result = *val1 + (int64) val2;
+ *result = *val1 + (int32) val2;
return result;
} /* int84pl() */
int64 *
-int84mi(int64 *val1, int32 val2)
+int84mi(int64 *val1, Datum val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val1))
return NULL;
- *result = *val1 - (int64) val2;
+ *result = *val1 - (int32) val2;
return result;
} /* int84mi() */
int64 *
-int84mul(int64 *val1, int32 val2)
+int84mul(int64 *val1, Datum val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val1))
return NULL;
- *result = *val1 * (int64) val2;
+ *result = *val1 * (int32) val2;
return result;
} /* int84mul() */
int64 *
-int84div(int64 *val1, int32 val2)
+int84div(int64 *val1, Datum val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val1))
return NULL;
- *result = *val1 / (int64) val2;
+ *result = *val1 / (int32) val2;
return result;
} /* int84div() */
int64 *
-int48pl(int32 val1, int64 *val2)
+int48pl(Datum val1, int64 *val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val2))
return NULL;
- *result = (int64) val1 + *val2;
+ *result = (int32) val1 + *val2;
return result;
} /* int48pl() */
int64 *
-int48mi(int32 val1, int64 *val2)
+int48mi(Datum val1, int64 *val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val2))
return NULL;
- *result = (int64) val1 - *val2;
+ *result = (int32) val1 - *val2;
return result;
} /* int48mi() */
int64 *
-int48mul(int32 val1, int64 *val2)
+int48mul(Datum val1, int64 *val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val2))
return NULL;
- *result = (int64) val1 **val2;
+ *result = (int32) val1 **val2;
return result;
} /* int48mul() */
int64 *
-int48div(int32 val1, int64 *val2)
+int48div(Datum val1, int64 *val2)
{
int64 *result = palloc(sizeof(int64));
if (!PointerIsValid(val2))
return NULL;
- *result = (int64) val1 / *val2;
+ *result = (int32) val1 / *val2;
return result;
} /* int48div() */
@@ -554,11 +554,11 @@
*---------------------------------------------------------*/
int64 *
-int48(int32 val)
+int48(Datum val)
{
int64 *result = palloc(sizeof(int64));
- *result = val;
+ *result = (int32)val;
return result;
} /* int48() */
--- backend/utils/adt/nabstime.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/nabstime.c Mon Feb 12 21:28:48 2001
@@ -209,11 +209,11 @@
void
-abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
+abstime2tm(Datum time, int *tzp, struct tm * tm, char *tzn)
{
#ifdef USE_POSIX_TIME
struct tm *tx;
-
+ time_t t = (time_t) time;
#else /* ! USE_POSIX_TIME */
struct timeb tb; /* the old V7-ism */
@@ -222,10 +222,10 @@
#ifdef USE_POSIX_TIME
if (tzp != NULL)
- tx = localtime((time_t *) &time);
+ tx = localtime( &t );
else
{
- tx = gmtime((time_t *) &time);
+ tx = gmtime( &t );
};
#endif
@@ -304,8 +304,8 @@
static AbsoluteTime
tm2abstime(struct tm * tm, int tz)
{
- int day,
- sec;
+ int day;
+ AbsoluteTime sec;
/* validate, before going out of range on some members */
if (tm->tm_year < 1901 || tm->tm_year > 2038
@@ -407,8 +407,9 @@
* Given an AbsoluteTime return the English text version of the date
*/
char *
-nabstimeout(AbsoluteTime time)
+nabstimeout(Datum t)
{
+ AbsoluteTime time = (AbsoluteTime) t;
char *result;
int tz;
double fsec = 0;
@@ -453,8 +454,10 @@
* AbsoluteTimeIsBefore -- true iff time1 is after time2.
*/
bool
-AbsoluteTimeIsBefore(AbsoluteTime time1, AbsoluteTime time2)
+AbsoluteTimeIsBefore(Datum t1, Datum t2)
{
+ AbsoluteTime time1 = t1, time2 = t2;
+
Assert(AbsoluteTimeIsValid(time1));
Assert(AbsoluteTimeIsValid(time2));
@@ -469,8 +472,10 @@
#ifdef NOT_USED
bool
-AbsoluteTimeIsAfter(AbsoluteTime time1, AbsoluteTime time2)
+AbsoluteTimeIsAfter(Datum t1, Datum t2)
{
+ AbsoluteTime time1 = t1, time2 = t2;
+
Assert(AbsoluteTimeIsValid(time1));
Assert(AbsoluteTimeIsValid(time2));
@@ -488,8 +493,10 @@
/* abstime_finite()
*/
bool
-abstime_finite(AbsoluteTime abstime)
+abstime_finite(Datum d)
{
+ AbsoluteTime abstime = (AbsoluteTime) d;
+
return ((abstime != INVALID_ABSTIME)
&& (abstime != NOSTART_ABSTIME) && (abstime != NOEND_ABSTIME));
} /* abstime_finite() */
@@ -504,8 +511,10 @@
* abstimege - returns 1, iff t1 greater than or equal to t2
*/
bool
-abstimeeq(AbsoluteTime t1, AbsoluteTime t2)
+abstimeeq(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -517,8 +526,10 @@
}
bool
-abstimene(AbsoluteTime t1, AbsoluteTime t2)
+abstimene(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -530,8 +541,10 @@
}
bool
-abstimelt(AbsoluteTime t1, AbsoluteTime t2)
+abstimelt(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -543,8 +556,10 @@
}
bool
-abstimegt(AbsoluteTime t1, AbsoluteTime t2)
+abstimegt(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -556,8 +571,10 @@
}
bool
-abstimele(AbsoluteTime t1, AbsoluteTime t2)
+abstimele(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -569,8 +586,10 @@
}
bool
-abstimege(AbsoluteTime t1, AbsoluteTime t2)
+abstimege(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == INVALID_ABSTIME || t2 == INVALID_ABSTIME)
return FALSE;
if (t1 == CURRENT_ABSTIME)
@@ -640,8 +659,9 @@
* Convert abstime to timestamp.
*/
Timestamp *
-abstime_timestamp(AbsoluteTime abstime)
+abstime_timestamp(Datum d)
{
+ AbsoluteTime abstime = (AbsoluteTime)d;
Timestamp *result;
if (!PointerIsValid(result = palloc(sizeof(Timestamp))))
@@ -729,8 +749,9 @@
* reltimeout - converts the internal format to a reltime string
*/
char *
-reltimeout(RelativeTime time)
+reltimeout(Datum t)
{
+ RelativeTime time = (RelativeTime) t;
char *result;
struct tm tt,
*tm = &tt;
@@ -755,8 +776,10 @@
static void
-reltime2tm(RelativeTime time, struct tm * tm)
+reltime2tm(RelativeTime t, struct tm * tm)
{
+ RelativeTime time = (RelativeTime) t;
+
TMODULO(time, tm->tm_year, 31536000);
TMODULO(time, tm->tm_mon, 2592000);
TMODULO(time, tm->tm_mday, 86400);
@@ -916,8 +939,9 @@
Interval *
-reltime_interval(RelativeTime reltime)
+reltime_interval(Datum d)
{
+ RelativeTime reltime = d;
Interval *result;
int year,
month;
@@ -947,8 +971,9 @@
* mktinterval - creates a time interval with endpoints t1 and t2
*/
TimeInterval
-mktinterval(AbsoluteTime t1, AbsoluteTime t2)
+mktinterval(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
AbsoluteTime tstart = ABSTIMEMIN(t1, t2),
tend = ABSTIMEMAX(t1, t2);
TimeInterval interval;
@@ -977,8 +1002,10 @@
* timepl - returns the value of (abstime t1 + relime t2)
*/
AbsoluteTime
-timepl(AbsoluteTime t1, RelativeTime t2)
+timepl(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1;
+ RelativeTime t2 = d2;
if (t1 == CURRENT_ABSTIME)
t1 = GetCurrentTransactionStartTime();
@@ -996,8 +1023,11 @@
* timemi - returns the value of (abstime t1 - reltime t2)
*/
AbsoluteTime
-timemi(AbsoluteTime t1, RelativeTime t2)
+timemi(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1;
+ RelativeTime t2 = d2;
+
if (t1 == CURRENT_ABSTIME)
t1 = GetCurrentTransactionStartTime();
@@ -1015,8 +1045,10 @@
* abstimemi - returns the value of (abstime t1 - abstime t2)
*/
static RelativeTime
-abstimemi(AbsoluteTime t1, AbsoluteTime t2)
+abstimemi(Datum d1, Datum d2)
{
+ AbsoluteTime t1 = d1, t2 = d2;
+
if (t1 == CURRENT_ABSTIME)
t1 = GetCurrentTransactionStartTime();
if (t2 == CURRENT_ABSTIME)
@@ -1034,7 +1066,7 @@
* intinterval - returns 1, iff absolute date is in the interval
*/
int
-intinterval(AbsoluteTime t, TimeInterval interval)
+intinterval(Datum t, TimeInterval interval)
{
if (interval->status == T_INTERVAL_VALID && t != INVALID_ABSTIME)
return (abstimege(t, interval->data[0]) &&
@@ -1048,6 +1080,7 @@
RelativeTime
tintervalrel(TimeInterval interval)
{
+
if (interval->status == T_INTERVAL_VALID)
return abstimemi(interval->data[1], interval->data[0]);
else
@@ -1078,51 +1111,57 @@
* reltimege - returns 1, iff t1 greater than or equal to t2
*/
bool
-reltimeeq(RelativeTime t1, RelativeTime t2)
+reltimeeq(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 == t2;
+ return (RelativeTime)t1 == (RelativeTime)t2;
}
bool
-reltimene(RelativeTime t1, RelativeTime t2)
+reltimene(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 != t2;
+ return (RelativeTime)t1 != (RelativeTime)t2;
}
bool
-reltimelt(RelativeTime t1, RelativeTime t2)
+reltimelt(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 < t2;
+ return (RelativeTime)t1 < (RelativeTime)t2;
}
bool
-reltimegt(RelativeTime t1, RelativeTime t2)
+reltimegt(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 > t2;
+ return (RelativeTime)t1 > (RelativeTime)t2;
}
bool
-reltimele(RelativeTime t1, RelativeTime t2)
+reltimele(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 <= t2;
+ return (RelativeTime)t1 <= (RelativeTime)t2;
}
bool
-reltimege(RelativeTime t1, RelativeTime t2)
+reltimege(Datum t1, Datum t2)
{
- if (t1 == INVALID_RELTIME || t2 == INVALID_RELTIME)
+ if ((RelativeTime)t1 == INVALID_RELTIME
+ || (RelativeTime)t2 == INVALID_RELTIME)
return 0;
- return t1 >= t2;
+ return (RelativeTime)t1 >= (RelativeTime)t2;
}
@@ -1362,8 +1401,9 @@
* reltime t
*/
bool
-tintervalleneq(TimeInterval i, RelativeTime t)
+tintervalleneq(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
@@ -1377,8 +1417,9 @@
* to reltime t
*/
bool
-tintervallenne(TimeInterval i, RelativeTime t)
+tintervallenne(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
@@ -1392,8 +1433,9 @@
* reltime t
*/
bool
-tintervallenlt(TimeInterval i, RelativeTime t)
+tintervallenlt(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
@@ -1407,8 +1449,9 @@
* reltime t
*/
bool
-tintervallengt(TimeInterval i, RelativeTime t)
+tintervallengt(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
@@ -1422,8 +1465,9 @@
* than reltime t
*/
bool
-tintervallenle(TimeInterval i, RelativeTime t)
+tintervallenle(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
@@ -1437,8 +1481,9 @@
* equal than reltime t
*/
bool
-tintervallenge(TimeInterval i, RelativeTime t)
+tintervallenge(TimeInterval i, Datum d)
{
+ RelativeTime t = d;
RelativeTime rt;
if ((i->status == T_INTERVAL_INVAL) || (t == INVALID_RELTIME))
--- backend/utils/adt/numeric.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/numeric.c Mon Feb 12 21:28:48 2001
@@ -187,7 +187,7 @@
* ----------
*/
Numeric
-numeric_in(char *str, int dummy, int32 typmod)
+numeric_in(char *str, int dummy, Datum typmod)
{
NumericVar value;
Numeric res;
@@ -217,7 +217,7 @@
init_var(&value);
set_var_from_str(str, &value);
- apply_typmod(&value, typmod);
+ apply_typmod(&value, (int32)typmod);
res = make_result(&value);
free_var(&value);
@@ -1706,8 +1706,9 @@
Numeric
-int4_numeric(int32 val)
+int4_numeric(Datum v)
{
+ int32 val = v;
Numeric res;
NumericVar result;
char *tmp;
--- backend/utils/adt/oid.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/oid.c Mon Feb 12 21:28:48 2001
@@ -185,17 +185,17 @@
}
bool
-oideqint4(Oid arg1, int32 arg2)
+oideqint4(Oid arg1, Datum arg2)
{
/* oid is unsigned, but int4 is signed */
- return arg2 >= 0 && arg1 == arg2;
+ return (int32)arg2 >= 0 && arg1 == (int32)arg2;
}
bool
-int4eqoid(int32 arg1, Oid arg2)
+int4eqoid(Datum arg1, Oid arg2)
{
/* oid is unsigned, but int4 is signed */
- return arg1 >= 0 && arg1 == arg2;
+ return (int32)arg1 >= 0 && (int32)arg1 == arg2;
}
text *
--- backend/utils/adt/varchar.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/varchar.c Mon Feb 12 21:28:48 2001
@@ -62,8 +62,9 @@
* because we pass typelem as the second argument for array_in.)
*/
char *
-bpcharin(char *s, int dummy, int32 atttypmod)
+bpcharin(char *s, Datum dummy, Datum a)
{
+ int32 atttypmod = a;
char *result,
*r;
int len;
@@ -147,8 +148,9 @@
* len is the length specified in () plus VARHDRSZ bytes.
*/
char *
-bpchar(char *s, int32 len)
+bpchar(char *s, Datum l)
{
+ int32 len = l;
char *result,
*r;
int rlen,
@@ -219,9 +221,9 @@
* len is the length specified in () plus VARHDRSZ bytes.
*/
ArrayType *
-_bpchar(ArrayType *v, int32 len)
+_bpchar(ArrayType *v, Datum len)
{
- return array_map(v, BPCHAROID, bpchar, BPCHAROID, 1, len);
+ return array_map(v, BPCHAROID, bpchar, BPCHAROID, 1, (int32)len);
}
@@ -238,7 +240,7 @@
* Convert char to bpchar(1).
*/
char *
-char_bpchar(int32 c)
+char_bpchar(Datum c)
{
char *result;
@@ -330,8 +332,9 @@
* because we pass typelem as the second argument for array_in.)
*/
char *
-varcharin(char *s, int dummy, int32 atttypmod)
+varcharin(char *s, int dummy, Datum a)
{
+ int32 atttypmod = a;
char *result;
int len;
@@ -392,8 +395,9 @@
* slen is the length specified in () plus VARHDRSZ bytes.
*/
char *
-varchar(char *s, int32 slen)
+varchar(char *s, Datum ds)
{
+ int32 slen = ds;
char *result;
int len;
@@ -430,9 +434,9 @@
* len is the length specified in () plus VARHDRSZ bytes.
*/
ArrayType *
-_varchar(ArrayType *v, int32 len)
+_varchar(ArrayType *v, Datum len)
{
- return array_map(v, VARCHAROID, varchar, VARCHAROID, 1, len);
+ return array_map(v, VARCHAROID, varchar, VARCHAROID, 1, (int32)len);
}
--- backend/utils/adt/varlena.c.orig Mon Feb 12 21:28:48 2001
+++ backend/utils/adt/varlena.c Mon Feb 12 21:28:48 2001
@@ -324,8 +324,9 @@
* - Thomas Lockhart 1998-12-10
*/
text *
-text_substr(text *string, int32 m, int32 n)
+text_substr(text *string, Datum dm, Datum dn)
{
+ int32 m = dm, n = dn;
text *ret;
int len;
--- include/access/hash.h.orig Mon Feb 12 21:28:43 2001
+++ include/access/hash.h Mon Feb 12 21:28:43 2001
@@ -263,15 +263,15 @@
extern void hashdelete(Relation rel, ItemPointer tid);
/* hashfunc.c */
-extern uint32 hashint2(int16 key);
-extern uint32 hashint4(uint32 key);
+extern uint32 hashint2(Datum key);
+extern uint32 hashint4(Datum key);
extern uint32 hashint8(int64 *key);
extern uint32 hashfloat4(float32 keyp);
extern uint32 hashfloat8(float64 keyp);
extern uint32 hashoid(Oid key);
extern uint32 hashoidvector(Oid *key);
extern uint32 hashint2vector(int16 *key);
-extern uint32 hashchar(char key);
+extern uint32 hashchar(Datum key);
extern uint32 hashtext(struct varlena * key);
extern uint32 hashname(NameData *n);
--- include/utils/builtins.h.orig Mon Feb 12 21:28:43 2001
+++ include/utils/builtins.h Mon Feb 12 21:28:43 2001
@@ -55,95 +55,95 @@
/* char.c */
extern int32 charin(char *ch);
-extern char *charout(int32 ch);
+extern char *charout(Datum ch);
extern int32 cidin(char *s);
-extern char *cidout(int32 c);
-extern bool chareq(int8 arg1, int8 arg2);
-extern bool charne(int8 arg1, int8 arg2);
-extern bool charlt(int8 arg1, int8 arg2);
-extern bool charle(int8 arg1, int8 arg2);
-extern bool chargt(int8 arg1, int8 arg2);
-extern bool charge(int8 arg1, int8 arg2);
-extern int8 charpl(int8 arg1, int8 arg2);
-extern int8 charmi(int8 arg1, int8 arg2);
-extern int8 charmul(int8 arg1, int8 arg2);
-extern int8 chardiv(int8 arg1, int8 arg2);
-extern bool cideq(int8 arg1, int8 arg2);
+extern char *cidout(Datum c);
+extern bool chareq(Datum arg1, Datum arg2);
+extern bool charne(Datum arg1, Datum arg2);
+extern bool charlt(Datum arg1, Datum arg2);
+extern bool charle(Datum arg1, Datum arg2);
+extern bool chargt(Datum arg1, Datum arg2);
+extern bool charge(Datum arg1, Datum arg2);
+extern int8 charpl(Datum arg1, Datum arg2);
+extern int8 charmi(Datum arg1, Datum arg2);
+extern int8 charmul(Datum arg1, Datum arg2);
+extern int8 chardiv(Datum arg1, Datum arg2);
+extern bool cideq(Datum arg1, Datum arg2);
extern int8 text_char(text *arg1);
-extern text *char_text(int8 arg1);
+extern text *char_text(Datum arg1);
/* int.c */
extern int32 int2in(char *num);
-extern char *int2out(int16 sh);
+extern char *int2out(Datum sh);
extern int16 *int2vectorin(char *shs);
extern char *int2vectorout(int16 *shs);
extern bool int2vectoreq(int16 *arg1, int16 *arg2);
extern int32 *int44in(char *input_string);
extern char *int44out(int32 *an_array);
extern int32 int4in(char *num);
-extern char *int4out(int32 l);
-extern int32 i2toi4(int16 arg1);
-extern int16 i4toi2(int32 arg1);
-extern text *int2_text(int16 arg1);
+extern char *int4out(Datum l);
+extern int32 i2toi4(Datum arg1);
+extern int16 i4toi2(Datum arg1);
+extern text *int2_text(Datum arg1);
extern int16 text_int2(text *arg1);
-extern text *int4_text(int32 arg1);
+extern text *int4_text(Datum arg1);
extern int32 text_int4(text *arg1);
-extern bool int4eq(int32 arg1, int32 arg2);
-extern bool int4ne(int32 arg1, int32 arg2);
-extern bool int4lt(int32 arg1, int32 arg2);
-extern bool int4le(int32 arg1, int32 arg2);
-extern bool int4gt(int32 arg1, int32 arg2);
-extern bool int4ge(int32 arg1, int32 arg2);
-extern bool int2eq(int16 arg1, int16 arg2);
-extern bool int2ne(int16 arg1, int16 arg2);
-extern bool int2lt(int16 arg1, int16 arg2);
-extern bool int2le(int16 arg1, int16 arg2);
-extern bool int2gt(int16 arg1, int16 arg2);
-extern bool int2ge(int16 arg1, int16 arg2);
-extern bool int24eq(int32 arg1, int32 arg2);
-extern bool int24ne(int32 arg1, int32 arg2);
-extern bool int24lt(int32 arg1, int32 arg2);
-extern bool int24le(int32 arg1, int32 arg2);
-extern bool int24gt(int32 arg1, int32 arg2);
-extern bool int24ge(int32 arg1, int32 arg2);
-extern bool int42eq(int32 arg1, int32 arg2);
-extern bool int42ne(int32 arg1, int32 arg2);
-extern bool int42lt(int32 arg1, int32 arg2);
-extern bool int42le(int32 arg1, int32 arg2);
-extern bool int42gt(int32 arg1, int32 arg2);
-extern bool int42ge(int32 arg1, int32 arg2);
-extern int32 int4um(int32 arg);
-extern int32 int4pl(int32 arg1, int32 arg2);
-extern int32 int4mi(int32 arg1, int32 arg2);
-extern int32 int4mul(int32 arg1, int32 arg2);
-extern int32 int4div(int32 arg1, int32 arg2);
-extern int32 int4abs(int32 arg);
-extern int32 int4inc(int32 arg);
-extern int16 int2um(int16 arg);
-extern int16 int2pl(int16 arg1, int16 arg2);
-extern int16 int2mi(int16 arg1, int16 arg2);
-extern int16 int2mul(int16 arg1, int16 arg2);
-extern int16 int2div(int16 arg1, int16 arg2);
-extern int16 int2abs(int16 arg);
-extern int16 int2inc(int16 arg);
-extern int32 int24pl(int32 arg1, int32 arg2);
-extern int32 int24mi(int32 arg1, int32 arg2);
-extern int32 int24mul(int32 arg1, int32 arg2);
-extern int32 int24div(int32 arg1, int32 arg2);
-extern int32 int42pl(int32 arg1, int32 arg2);
-extern int32 int42mi(int32 arg1, int32 arg2);
-extern int32 int42mul(int32 arg1, int32 arg2);
-extern int32 int42div(int32 arg1, int32 arg2);
-extern int32 int4mod(int32 arg1, int32 arg2);
-extern int32 int2mod(int16 arg1, int16 arg2);
-extern int32 int24mod(int32 arg1, int32 arg2);
-extern int32 int42mod(int32 arg1, int32 arg2);
-extern int32 int4fac(int32 arg1);
-extern int32 int2fac(int16 arg1);
-extern int16 int2larger(int16 arg1, int16 arg2);
-extern int16 int2smaller(int16 arg1, int16 arg2);
-extern int32 int4larger(int32 arg1, int32 arg2);
-extern int32 int4smaller(int32 arg1, int32 arg2);
+extern bool int4eq(Datum arg1, Datum arg2);
+extern bool int4ne(Datum arg1, Datum arg2);
+extern bool int4lt(Datum arg1, Datum arg2);
+extern bool int4le(Datum arg1, Datum arg2);
+extern bool int4gt(Datum arg1, Datum arg2);
+extern bool int4ge(Datum arg1, Datum arg2);
+extern bool int2eq(Datum arg1, Datum arg2);
+extern bool int2ne(Datum arg1, Datum arg2);
+extern bool int2lt(Datum arg1, Datum arg2);
+extern bool int2le(Datum arg1, Datum arg2);
+extern bool int2gt(Datum arg1, Datum arg2);
+extern bool int2ge(Datum arg1, Datum arg2);
+extern bool int24eq(Datum arg1, Datum arg2);
+extern bool int24ne(Datum arg1, Datum arg2);
+extern bool int24lt(Datum arg1, Datum arg2);
+extern bool int24le(Datum arg1, Datum arg2);
+extern bool int24gt(Datum arg1, Datum arg2);
+extern bool int24ge(Datum arg1, Datum arg2);
+extern bool int42eq(Datum arg1, Datum arg2);
+extern bool int42ne(Datum arg1, Datum arg2);
+extern bool int42lt(Datum arg1, Datum arg2);
+extern bool int42le(Datum arg1, Datum arg2);
+extern bool int42gt(Datum arg1, Datum arg2);
+extern bool int42ge(Datum arg1, Datum arg2);
+extern int32 int4um(Datum arg);
+extern int32 int4pl(Datum arg1, Datum arg2);
+extern int32 int4mi(Datum arg1, Datum arg2);
+extern int32 int4mul(Datum arg1, Datum arg2);
+extern int32 int4div(Datum arg1, Datum arg2);
+extern int32 int4abs(Datum arg);
+extern int32 int4inc(Datum arg);
+extern int16 int2um(Datum arg);
+extern int16 int2pl(Datum arg1, Datum arg2);
+extern int16 int2mi(Datum arg1, Datum arg2);
+extern int16 int2mul(Datum arg1, Datum arg2);
+extern int16 int2div(Datum arg1, Datum arg2);
+extern int16 int2abs(Datum arg);
+extern int16 int2inc(Datum arg);
+extern int32 int24pl(Datum arg1, Datum arg2);
+extern int32 int24mi(Datum arg1, Datum arg2);
+extern int32 int24mul(Datum arg1, Datum arg2);
+extern int32 int24div(Datum arg1, Datum arg2);
+extern int32 int42pl(Datum arg1, Datum arg2);
+extern int32 int42mi(Datum arg1, Datum arg2);
+extern int32 int42mul(Datum arg1, Datum arg2);
+extern int32 int42div(Datum arg1, Datum arg2);
+extern int32 int4mod(Datum arg1, Datum arg2);
+extern int32 int2mod(Datum arg1, Datum arg2);
+extern int32 int24mod(Datum arg1, Datum arg2);
+extern int32 int42mod(Datum arg1, Datum arg2);
+extern int32 int4fac(Datum arg1);
+extern int32 int2fac(Datum arg1);
+extern int16 int2larger(Datum arg1, Datum arg2);
+extern int16 int2smaller(Datum arg1, Datum arg2);
+extern int32 int4larger(Datum arg1, Datum arg2);
+extern int32 int4smaller(Datum arg1, Datum arg2);
/* name.c */
extern NameData *namein(const char *s);
@@ -177,17 +177,17 @@
* Per-opclass comparison functions for new btrees. These are
* stored in pg_amproc and defined in nbtree/
*/
-extern int32 btint2cmp(int16 a, int16 b);
-extern int32 btint4cmp(int32 a, int32 b);
+extern int32 btint2cmp(Datum a, Datum b);
+extern int32 btint4cmp(Datum a, Datum b);
extern int32 btint8cmp(int64 *a, int64 *b);
-extern int32 btint24cmp(int16 a, int32 b);
-extern int32 btint42cmp(int32 a, int16 b);
+extern int32 btint24cmp(Datum a, Datum b);
+extern int32 btint42cmp(Datum a, Datum b);
extern int32 btfloat4cmp(float32 a, float32 b);
extern int32 btfloat8cmp(float64 a, float64 b);
extern int32 btoidcmp(Oid a, Oid b);
extern int32 btoidvectorcmp(Oid *a, Oid *b);
-extern int32 btabstimecmp(AbsoluteTime a, AbsoluteTime b);
-extern int32 btcharcmp(char a, char b);
+extern int32 btabstimecmp(Datum a, Datum b);
+extern int32 btcharcmp(Datum a, Datum b);
extern int32 btnamecmp(NameData *a, NameData *b);
extern int32 bttextcmp(struct varlena * a, struct varlena * b);
extern int32 btboolcmp(bool a, bool b);
@@ -252,13 +252,13 @@
extern bool float8gt(float64 arg1, float64 arg2);
extern bool float8ge(float64 arg1, float64 arg2);
extern float64 ftod(float32 num);
-extern float64 i4tod(int32 num);
-extern float64 i2tod(int16 num);
+extern float64 i4tod(Datum num);
+extern float64 i2tod(Datum num);
extern float32 dtof(float64 num);
extern int32 dtoi4(float64 num);
extern int16 dtoi2(float64 num);
-extern float32 i4tof(int32 num);
-extern float32 i2tof(int16 num);
+extern float32 i4tof(Datum num);
+extern float32 i2tof(Datum num);
extern int32 ftoi4(float32 num);
extern int16 ftoi2(float32 num);
extern float64 text_float8(text *str);
@@ -337,8 +337,8 @@
extern bool oidvectorle(Oid *arg1, Oid *arg2);
extern bool oidvectorge(Oid *arg1, Oid *arg2);
extern bool oidvectorgt(Oid *arg1, Oid *arg2);
-extern bool oideqint4(Oid arg1, int32 arg2);
-extern bool int4eqoid(int32 arg1, Oid arg2);
+extern bool oideqint4(Oid arg1, Datum arg2);
+extern bool int4eqoid(Datum arg1, Oid arg2);
extern text *oid_text(Oid arg1);
extern Oid text_oid(text *arg1);
@@ -461,11 +461,11 @@
extern ItemPointer currtid_byrelname(const text *relName, ItemPointer);
/* varchar.c */
-extern char *bpcharin(char *s, int dummy, int32 atttypmod);
+extern char *bpcharin(char *s, Datum dummy, Datum atttypmod);
extern char *bpcharout(char *s);
-extern char *bpchar(char *s, int32 slen);
-extern ArrayType *_bpchar(ArrayType *v, int32 slen);
-extern char *char_bpchar(int32 c);
+extern char *bpchar(char *s, Datum slen);
+extern ArrayType *_bpchar(ArrayType *v, Datum slen);
+extern char *char_bpchar(Datum c);
extern int32 bpchar_char(char *s);
extern char *name_bpchar(NameData *s);
extern NameData *bpchar_name(char *s);
@@ -480,10 +480,10 @@
extern int32 bpcharoctetlen(char *arg);
extern uint32 hashbpchar(struct varlena * key);
-extern char *varcharin(char *s, int dummy, int32 atttypmod);
+extern char *varcharin(char *s, int dummy, Datum atttypmod);
extern char *varcharout(char *s);
-extern char *varchar(char *s, int32 slen);
-extern ArrayType *_varchar(ArrayType *v, int32 slen);
+extern char *varchar(char *s, Datum slen);
+extern ArrayType *_varchar(ArrayType *v, Datum slen);
extern bool varchareq(char *arg1, char *arg2);
extern bool varcharne(char *arg1, char *arg2);
extern bool varcharlt(char *arg1, char *arg2);
@@ -511,7 +511,7 @@
extern int32 textlen(text *arg);
extern int32 textoctetlen(text *arg);
extern int32 textpos(text *arg1, text *arg2);
-extern text *text_substr(text *string, int32 m, int32 n);
+extern text *text_substr(text *string, Datum m, Datum n);
extern text *name_text(NameData *s);
extern NameData *text_name(text *s);
@@ -590,7 +590,7 @@
extern text *macaddr_manuf(macaddr *addr);
/* numeric.c */
-extern Numeric numeric_in(char *str, int dummy, int32 typmod);
+extern Numeric numeric_in(char *str, int dummy, Datum typmod);
extern char *numeric_out(Numeric num);
extern Numeric numeric(Numeric num, int32 typmod);
extern Numeric numeric_abs(Numeric num);
@@ -621,7 +621,7 @@
extern Numeric numeric_ln(Numeric num);
extern Numeric numeric_log(Numeric num1, Numeric num2);
extern Numeric numeric_power(Numeric num1, Numeric num2);
-extern Numeric int4_numeric(int32 val);
+extern Numeric int4_numeric(Datum val);
extern int32 numeric_int4(Numeric num);
extern Numeric int8_numeric(int64 *val);
extern int64 *numeric_int8(Numeric num);
--- include/utils/int8.h.orig Mon Feb 12 21:28:43 2001
+++ include/utils/int8.h Mon Feb 12 21:28:43 2001
@@ -57,19 +57,19 @@
extern bool int8le(int64 *val1, int64 *val2);
extern bool int8ge(int64 *val1, int64 *val2);
-extern bool int84eq(int64 *val1, int32 val2);
-extern bool int84ne(int64 *val1, int32 val2);
-extern bool int84lt(int64 *val1, int32 val2);
-extern bool int84gt(int64 *val1, int32 val2);
-extern bool int84le(int64 *val1, int32 val2);
-extern bool int84ge(int64 *val1, int32 val2);
+extern bool int84eq(int64 *val1, Datum val2);
+extern bool int84ne(int64 *val1, Datum val2);
+extern bool int84lt(int64 *val1, Datum val2);
+extern bool int84gt(int64 *val1, Datum val2);
+extern bool int84le(int64 *val1, Datum val2);
+extern bool int84ge(int64 *val1, Datum val2);
-extern bool int48eq(int32 val1, int64 *val2);
-extern bool int48ne(int32 val1, int64 *val2);
-extern bool int48lt(int32 val1, int64 *val2);
-extern bool int48gt(int32 val1, int64 *val2);
-extern bool int48le(int32 val1, int64 *val2);
-extern bool int48ge(int32 val1, int64 *val2);
+extern bool int48eq(Datum val1, int64 *val2);
+extern bool int48ne(Datum val1, int64 *val2);
+extern bool int48lt(Datum val1, int64 *val2);
+extern bool int48gt(Datum val1, int64 *val2);
+extern bool int48le(Datum val1, int64 *val2);
+extern bool int48ge(Datum val1, int64 *val2);
extern int64 *int8um(int64 *val);
extern int64 *int8pl(int64 *val1, int64 *val2);
@@ -82,17 +82,17 @@
extern int64 *int8larger(int64 *val1, int64 *val2);
extern int64 *int8smaller(int64 *val1, int64 *val2);
-extern int64 *int84pl(int64 *val1, int32 val2);
-extern int64 *int84mi(int64 *val1, int32 val2);
-extern int64 *int84mul(int64 *val1, int32 val2);
-extern int64 *int84div(int64 *val1, int32 val2);
+extern int64 *int84pl(int64 *val1, Datum val2);
+extern int64 *int84mi(int64 *val1, Datum val2);
+extern int64 *int84mul(int64 *val1, Datum val2);
+extern int64 *int84div(int64 *val1, Datum val2);
-extern int64 *int48pl(int32 val1, int64 *val2);
-extern int64 *int48mi(int32 val1, int64 *val2);
-extern int64 *int48mul(int32 val1, int64 *val2);
-extern int64 *int48div(int32 val1, int64 *val2);
+extern int64 *int48pl(Datum val1, int64 *val2);
+extern int64 *int48mi(Datum val1, int64 *val2);
+extern int64 *int48mul(Datum val1, int64 *val2);
+extern int64 *int48div(Datum val1, int64 *val2);
-extern int64 *int48(int32 val);
+extern int64 *int48(Datum val);
extern int32 int84(int64 *val);
#ifdef NOT_USED
--- include/utils/nabstime.h.orig Mon Feb 12 21:28:43 2001
+++ include/utils/nabstime.h Mon Feb 12 21:28:43 2001
@@ -105,43 +105,43 @@
* nabstime.c prototypes
*/
extern AbsoluteTime nabstimein(char *timestr);
-extern char *nabstimeout(AbsoluteTime time);
+extern char *nabstimeout(Datum time);
-extern bool abstimeeq(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstimene(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstimelt(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstimegt(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstimele(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstimege(AbsoluteTime t1, AbsoluteTime t2);
-extern bool abstime_finite(AbsoluteTime time);
+extern bool abstimeeq(Datum t1, Datum t2);
+extern bool abstimene(Datum t1, Datum t2);
+extern bool abstimelt(Datum t1, Datum t2);
+extern bool abstimegt(Datum t1, Datum t2);
+extern bool abstimele(Datum t1, Datum t2);
+extern bool abstimege(Datum t1, Datum t2);
+extern bool abstime_finite(Datum time);
extern AbsoluteTime timestamp_abstime(Timestamp *timestamp);
-extern Timestamp *abstime_timestamp(AbsoluteTime abstime);
+extern Timestamp *abstime_timestamp(Datum abstime);
-extern bool AbsoluteTimeIsBefore(AbsoluteTime time1, AbsoluteTime time2);
+extern bool AbsoluteTimeIsBefore(Datum time1, Datum time2);
-extern void abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn);
+extern void abstime2tm(Datum time, int *tzp, struct tm * tm, char *tzn);
extern RelativeTime reltimein(char *timestring);
-extern char *reltimeout(RelativeTime timevalue);
+extern char *reltimeout(Datum timevalue);
extern TimeInterval tintervalin(char *intervalstr);
extern char *tintervalout(TimeInterval interval);
extern RelativeTime interval_reltime(Interval *interval);
-extern Interval *reltime_interval(RelativeTime reltime);
-extern TimeInterval mktinterval(AbsoluteTime t1, AbsoluteTime t2);
-extern AbsoluteTime timepl(AbsoluteTime t1, RelativeTime t2);
-extern AbsoluteTime timemi(AbsoluteTime t1, RelativeTime t2);
+extern Interval *reltime_interval(Datum reltime);
+extern TimeInterval mktinterval(Datum t1, Datum t2);
+extern AbsoluteTime timepl(Datum t1, Datum t2);
+extern AbsoluteTime timemi(Datum t1, Datum t2);
/* extern RelativeTime abstimemi(AbsoluteTime t1, AbsoluteTime t2); static*/
-extern int intinterval(AbsoluteTime t, TimeInterval interval);
+extern int intinterval(Datum t, TimeInterval interval);
extern RelativeTime tintervalrel(TimeInterval interval);
extern AbsoluteTime timenow(void);
-extern bool reltimeeq(RelativeTime t1, RelativeTime t2);
-extern bool reltimene(RelativeTime t1, RelativeTime t2);
-extern bool reltimelt(RelativeTime t1, RelativeTime t2);
-extern bool reltimegt(RelativeTime t1, RelativeTime t2);
-extern bool reltimele(RelativeTime t1, RelativeTime t2);
-extern bool reltimege(RelativeTime t1, RelativeTime t2);
+extern bool reltimeeq(Datum t1, Datum t2);
+extern bool reltimene(Datum t1, Datum t2);
+extern bool reltimelt(Datum t1, Datum t2);
+extern bool reltimegt(Datum t1, Datum t2);
+extern bool reltimele(Datum t1, Datum t2);
+extern bool reltimege(Datum t1, Datum t2);
extern bool tintervalsame(TimeInterval i1, TimeInterval i2);
extern bool tintervaleq(TimeInterval i1, TimeInterval i2);
extern bool tintervalne(TimeInterval i1, TimeInterval i2);
@@ -149,12 +149,12 @@
extern bool tintervalgt(TimeInterval i1, TimeInterval i2);
extern bool tintervalle(TimeInterval i1, TimeInterval i2);
extern bool tintervalge(TimeInterval i1, TimeInterval i2);
-extern bool tintervalleneq(TimeInterval i, RelativeTime t);
-extern bool tintervallenne(TimeInterval i, RelativeTime t);
-extern bool tintervallenlt(TimeInterval i, RelativeTime t);
-extern bool tintervallengt(TimeInterval i, RelativeTime t);
-extern bool tintervallenle(TimeInterval i, RelativeTime t);
-extern bool tintervallenge(TimeInterval i, RelativeTime t);
+extern bool tintervalleneq(TimeInterval i, Datum t);
+extern bool tintervallenne(TimeInterval i, Datum t);
+extern bool tintervallenlt(TimeInterval i, Datum t);
+extern bool tintervallengt(TimeInterval i, Datum t);
+extern bool tintervallenle(TimeInterval i, Datum t);
+extern bool tintervallenge(TimeInterval i, Datum t);
extern bool tintervalct(TimeInterval i1, TimeInterval i2);
extern bool tintervalov(TimeInterval i1, TimeInterval i2);
extern AbsoluteTime tintervalstart(TimeInterval i);
|