- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit15a79c7
committed
Use PRI*64 instead of "ll*" in format strings (minimal trial)
Old: errmsg("hello %llu", (unsigned long long) x)New: errmsg("hello %" PRIu64, x)And likewise for everything printf-like.In the past we had to use long long so localized format strings remainedarchitecture independent in message catalogs. Although long long isexpected to be 64 bit everywhere, if we hadn't also cast the int64values, we'd have generated compiler warnings on systems where int64 waslong.Now that int64 is int64_t, C99 understand how to format them using<inttypes.h> macros, the casts are not necessary, and the gettext()tools recognize the macros and defer expansion until load time. (And ifwe ever manage to get -Wformat-signedness to work for us, that'd helpwith these too, but not the type-system-clobbering casts.)This particular patch converts only pg_checksums.c to the new system,to allow testing of the translation toolchain for everyone. If thisworks okay, a later patch will convert most of the rest.Author: Thomas Munro <thomas.munro@gmail.com>Discussion:https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org1 parent00d61a0 commit15a79c7
1 file changed
+8
-8
lines changedLines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
| |
| |||
603 | 603 |
| |
604 | 604 |
| |
605 | 605 |
| |
606 |
| - | |
607 |
| - | |
| 606 | + | |
| 607 | + | |
608 | 608 |
| |
609 | 609 |
| |
610 |
| - | |
| 610 | + | |
611 | 611 |
| |
612 | 612 |
| |
613 | 613 |
| |
614 | 614 |
| |
615 | 615 |
| |
616 | 616 |
| |
617 | 617 |
| |
618 |
| - | |
619 |
| - | |
| 618 | + | |
| 619 | + | |
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
|
0 commit comments
Comments
(0)