public inbox for [email protected]help / color / mirror / Atom feed
pgsql: Use C99-designated initializer syntax for more arrays 2+ messages / 1 participants [nested] [flat]
* pgsql: Use C99-designated initializer syntax for more arrays @ 2024-02-27 23:42 Michael Paquier <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2024-02-27 23:42 UTC (permalink / raw) To: [email protected] Use C99-designated initializer syntax for more arrays This is in the same spirit as ef5e2e90859a, updating this time some arrays in parser.c, relpath.c, guc_tables.c and pg_dump_sort.c so as the order of their elements has no need to match the enum structures they are based on anymore. Author: Jelte Fennema-Nio Reviewed-by: Jian He, Japin Li Discussion: https://postgr.es/m/CAGECzQT3caUbcCcszNewCCmMbCuyP7XNAm60J3ybd6PN5kH2Dw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/afd8ef39094b0dff9d1f2bfecb1d9fa056b85e19 Modified Files -------------- src/backend/parser/parser.c | 12 +-- src/backend/utils/misc/guc_tables.c | 187 ++++++++++++++---------------------- src/bin/pg_dump/pg_dump_sort.c | 94 +++++++++--------- src/common/relpath.c | 8 +- 4 files changed, 128 insertions(+), 173 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Use C99-designated initializer syntax for arrays related to enco @ 2024-02-29 00:56 Michael Paquier <[email protected]> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2024-02-29 00:56 UTC (permalink / raw) To: [email protected] Use C99-designated initializer syntax for arrays related to encodings This updates the following lookup arrays to use C99-designated initializer syntax, indexed based on the enum pg_enc: pg_enc2icu_tbl[] pg_enc2name_tbl[] pg_wchar_table[] This is more readable, and removes problems with ordering mistakes as this removes dependencies between the arrays and their lookup index in the enum pg_enc. So, adding new encodings becomes easier, even if this does not happen often. Author: Jelte Fennema-Nio Reviewed-by: Jian He, Japin Li Discussion: https://postgr.es/m/CAGECzQT3caUbcCcszNewCCmMbCuyP7XNAm60J3ybd6PN5kH2Dw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ada87a4d95fc39dfb1214edf6653390314b6f0df Modified Files -------------- src/common/encnames.c | 155 +++++++++++++++++++++++----------------------- src/common/wchar.c | 85 +++++++++++++------------ src/include/mb/pg_wchar.h | 8 +-- 3 files changed, 122 insertions(+), 126 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-02-29 00:56 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-02-27 23:42 pgsql: Use C99-designated initializer syntax for more arrays Michael Paquier <[email protected]> 2024-02-29 00:56 pgsql: Use C99-designated initializer syntax for arrays related to enco Michael Paquier <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox