forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit69036aa
committed
Simplify jsonfuncs.c code by using strtoint() not strtol().
Explicitly testing for INT_MIN and INT_MAX isn't particularly goodstyle; it's tedious and may draw useless compiler warnings onmachines where int and long are the same width. We inventedstrtoint() precisely for this usage, so use that instead.While here, remove gratuitous variations in the way the tests fordid-strtoint-succeed were spelled. Also, avoid attempting tonegate INT_MIN; that would probably work given that the resultis implicitly cast to uint32, but I think it's nominally undefinedbehavior.Per gripe from Ranier Vilela, though this isn't his proposed patch.Discussion:https://postgr.es/m/CAEudQAqge3QfzoBRhe59QrB_5g+NmQUj2QpzqZ9Nc7QepXGAEw@mail.gmail.com1 parentd4c7465 commit69036aa
1 file changed
+15
-20
lines changedLines changed: 15 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
| |||
1026 | 1027 |
| |
1027 | 1028 |
| |
1028 | 1029 |
| |
1029 |
| - | |
| 1030 | + | |
1030 | 1031 |
| |
1031 | 1032 |
| |
1032 | 1033 |
| |
1033 |
| - | |
1034 |
| - | |
1035 |
| - | |
1036 |
| - | |
| 1034 | + | |
| 1035 | + | |
1037 | 1036 |
| |
| 1037 | + | |
| 1038 | + | |
1038 | 1039 |
| |
1039 | 1040 |
| |
1040 | 1041 |
| |
| |||
1533 | 1534 |
| |
1534 | 1535 |
| |
1535 | 1536 |
| |
1536 |
| - | |
| 1537 | + | |
1537 | 1538 |
| |
1538 | 1539 |
| |
1539 | 1540 |
| |
1540 | 1541 |
| |
1541 | 1542 |
| |
1542 |
| - | |
1543 |
| - | |
1544 |
| - | |
| 1543 | + | |
| 1544 | + | |
1545 | 1545 |
| |
1546 | 1546 |
| |
1547 | 1547 |
| |
| |||
1562 | 1562 |
| |
1563 | 1563 |
| |
1564 | 1564 |
| |
1565 |
| - | |
| 1565 | + | |
1566 | 1566 |
| |
1567 | 1567 |
| |
1568 | 1568 |
| |
| |||
1675 | 1675 |
| |
1676 | 1676 |
| |
1677 | 1677 |
| |
1678 |
| - | |
1679 | 1678 |
| |
1680 | 1679 |
| |
1681 | 1680 |
| |
| |||
1687 | 1686 |
| |
1688 | 1687 |
| |
1689 | 1688 |
| |
| 1689 | + | |
1690 | 1690 |
| |
1691 | 1691 |
| |
1692 | 1692 |
| |
| |||
1697 | 1697 |
| |
1698 | 1698 |
| |
1699 | 1699 |
| |
1700 |
| - | |
1701 |
| - | |
1702 |
| - | |
| 1700 | + | |
| 1701 | + | |
1703 | 1702 |
| |
1704 | 1703 |
| |
1705 | 1704 |
| |
| |||
1720 | 1719 |
| |
1721 | 1720 |
| |
1722 | 1721 |
| |
1723 |
| - | |
1724 | 1722 |
| |
1725 | 1723 |
| |
1726 | 1724 |
| |
| |||
5138 | 5136 |
| |
5139 | 5137 |
| |
5140 | 5138 |
| |
5141 |
| - | |
5142 | 5139 |
| |
5143 | 5140 |
| |
5144 | 5141 |
| |
5145 |
| - | |
5146 |
| - | |
5147 |
| - | |
| 5142 | + | |
| 5143 | + | |
5148 | 5144 |
| |
5149 | 5145 |
| |
5150 | 5146 |
| |
5151 | 5147 |
| |
5152 |
| - | |
5153 | 5148 |
| |
5154 | 5149 |
| |
5155 | 5150 |
| |
|
0 commit comments
Comments
(0)