Re: Improve readability by using designated initializers when possible

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Japin Li <japinli@hotmail.com>
Cc: jian he <jian.universality@gmail.com>, Jelte Fennema-Nio <postgres@jeltef.nl>, Jeff Davis <pgsql@j-davis.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-hackers@lists.postgresql.org
Date: 2024-02-27T06:25:35Z
Lists: pgsql-hackers
On Mon, Feb 26, 2024 at 05:00:13PM +0800, Japin Li wrote:
> On Mon, 26 Feb 2024 at 16:41, jian he <jian.universality@gmail.com> wrote:
>> obvious typo errors.

These would cause compilation failures.  Saying that, this is a very
nice cleanup, so I've fixed these and applied the patch after checking
that the one-one replacements were correct.

About 0002, I can't help but notice pg_enc2icu_tbl and
pg_enc2gettext_tb.  There are exceptions like MULE_INTERNAL, but is it
possible to do better?
--
Michael

Commits

  1. Remove ObjectClass type

  2. Simplify pg_enc2gettext_tbl[] with C99-designated initializer syntax

  3. Use C99-designated initializer syntax for arrays related to encodings

  4. Remove last NULL element in config_group_names[]

  5. Use C99-designated initializer syntax for more arrays

  6. Remove unnecessary array object_classes[] in dependency.c

  7. Add trailing commas to enum definitions