]> git.ipfire.org Git - thirdparty/git.git/commit
t: harmonize t-reftable-merged.c with coding guidelines
authorChandra Pratap <chandrapratap3519@gmail.com>
Fri, 12 Jul 2024 05:38:58 +0000 (11:08 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jul 2024 16:55:39 +0000 (09:55 -0700)
commite8ed7d1974af3d38e7c6f2ad07fd4ea49ae29474
treef9f2fb74327cf97f439076f1f9ef4dc9ae07b08b
parent9cdfd1d7df81f911e8c4f120f3aaf1b0d981e8a1
t: harmonize t-reftable-merged.c with coding guidelines

Harmonize the newly ported test unit-tests/t-reftable-merged.c
with the following guidelines:
- Single line control flow statements like 'for' and 'if'
  must omit curly braces.
- Structs must be 0-initialized with '= { 0 }' instead of '= { NULL }'.
- Array indices should preferably be of type 'size_t', not 'int'.
- It is fine to use C99 initial declaration in 'for' loop.

While at it, use 'ARRAY_SIZE(x)' to store the number of elements
in an array instead of hardcoding them.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/t-reftable-merged.c