forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3c6f8c0
committed
Simplify the general-purpose 64-bit integer parsing APIs
pg_strtouint64() is a wrapper around strtoull/strtoul/_strtoui64, butit seems no longer necessary to have this indirection.msvc/Solution.pm claims HAVE_STRTOULL, so the "MSVC only" part seemsunnecessary. Also, we have code in c.h to substitute alternatives forstrtoull() if not found, and that would appear to cover all currentlysupported platforms, so having a further fallback in pg_strtouint64()seems unnecessary.Therefore, we could remove pg_strtouint64(), and use strtoull()directly in all call sites. However, it seems useful to keep aseparate notation for parsing exactly 64-bit integers, matching thetype definition int64/uint64. For that, add new macros strtoi64() andstrtou64() in c.h as thin wrappers around strtol()/strtoul() orstrtoll()/stroull(). This makes these functions available everywhereinstead of just in the server code, and it makes the function namingnotably different from the pg_strtointNN() functions in numutils.c,which have a different API.Discussion:https://www.postgresql.org/message-id/flat/a3df47c9-b1b4-29f2-7e91-427baf8b75a3%40enterprisedb.com1 parent9c356f4 commit3c6f8c0
File tree
7 files changed
+19
-29
lines changed- src
- backend
- nodes
- utils
- adt
- misc
- include
- utils
7 files changed
+19
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12438 | 12438 | | |
12439 | 12439 | | |
12440 | 12440 | | |
12441 | | - | |
| 12441 | + | |
12442 | 12442 | | |
12443 | 12443 | | |
12444 | 12444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
1315 | 1328 | | |
1316 | 1329 | | |
1317 | 1330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
0 commit comments
Comments
(0)