string-list: spell all values out that are given to a string_list initializer
commitacb3d22264fd3736f95f71aa38e1d6fa01f5e9e1
authorTanay Abhra <tanayabh@gmail.com>
Tue, 3 Jun 2014 09:13:18 +0000 (3 02:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Jun 2014 20:49:19 +0000 (6 13:49 -0700)
tree0917dd95d20ff60df790ac5c2e53ee37838bad53
parente156455ea49124c140a67623f22a393db62d5d98
string-list: spell all values out that are given to a string_list initializer

STRING_LIST_INIT_{NODUP,DUP} initializers list values only
for earlier structure members, relying on the usual
convention in C that the omitted members are initailized to
0, i.e. the former is expanded to the latter:

struct string_list l = STRING_LIST_INIT_DUP;
struct string_list l = { NULL, 0, 0, 1 };

and the last member that is not mentioned (i.e. 'cmp') is
initialized to NULL.

While there is nothing wrong in this construct, spelling out
all the values where the macros are defined will serve also
as a documentation, so let's do so.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-string-list.txt
string-list.h