forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit595a0ea
committed
Rationalize snprintf.c's handling of "ll" formats.
Although all known platforms define "long long" as 64 bits, it still feelsa bit shaky to be using "va_arg(args, int64)" to pull out an argument thatthe caller thought was declared "long long". The reason it was coded likethis, way back in commit3311c76, was to work around the possibility thatthe compiler had no type named "long long" --- and, at the time, that itmaybe didn't have 64-bit ints at all. Now that we're requiring compilersto support C99, those concerns are moot. Let's make the code clearer andmore bulletproof by writing "long long" where we mean "long long".This does introduce a hazard that we'd inefficiently use 128-bit arithmeticto convert plain old integers. The way to tackle that would be to providetwo versions of fmtint(), one for "long long" and one for narrower types.Since, as of today, no platforms require that, we won't bother with theextra code for now.Discussion:https://postgr.es/m/1680.1538587115@sss.pgh.pa.us1 parent6d842be commit595a0ea
1 file changed
+10
-10
lines changedLines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
157 | 157 |
| |
158 | 158 |
| |
159 | 159 |
| |
160 |
| - | |
| 160 | + | |
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
| |||
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
322 |
| - | |
| 322 | + | |
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
| |||
390 | 390 |
| |
391 | 391 |
| |
392 | 392 |
| |
393 |
| - | |
| 393 | + | |
394 | 394 |
| |
395 | 395 |
| |
396 | 396 |
| |
| |||
603 | 603 |
| |
604 | 604 |
| |
605 | 605 |
| |
606 |
| - | |
| 606 | + | |
607 | 607 |
| |
608 | 608 |
| |
609 | 609 |
| |
| |||
626 | 626 |
| |
627 | 627 |
| |
628 | 628 |
| |
629 |
| - | |
| 629 | + | |
630 | 630 |
| |
631 | 631 |
| |
632 | 632 |
| |
| |||
635 | 635 |
| |
636 | 636 |
| |
637 | 637 |
| |
638 |
| - | |
| 638 | + | |
639 | 639 |
| |
640 | 640 |
| |
641 | 641 |
| |
| |||
944 | 944 |
| |
945 | 945 |
| |
946 | 946 |
| |
947 |
| - | |
| 947 | + | |
948 | 948 |
| |
949 | 949 |
| |
950 | 950 |
| |
| |||
1002 | 1002 |
| |
1003 | 1003 |
| |
1004 | 1004 |
| |
1005 |
| - | |
| 1005 | + | |
1006 | 1006 |
| |
1007 | 1007 |
| |
1008 | 1008 |
| |
1009 |
| - | |
| 1009 | + | |
1010 | 1010 |
| |
1011 | 1011 |
| |
1012 | 1012 |
| |
| |||
1056 | 1056 |
| |
1057 | 1057 |
| |
1058 | 1058 |
| |
1059 |
| - | |
| 1059 | + | |
1060 | 1060 |
| |
1061 | 1061 |
| |
1062 | 1062 |
| |
|
0 commit comments
Comments
(0)