diff options
author | Tanay Abhra <tanayabh@gmail.com> | 2014-06-03 02:13:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-06 13:49:19 -0700 |
commit | acb3d22264fd3736f95f71aa38e1d6fa01f5e9e1 (patch) | |
tree | 0917dd95d20ff60df790ac5c2e53ee37838bad53 /Documentation | |
parent | Git 2.0 (diff) | |
download | tgif-acb3d22264fd3736f95f71aa38e1d6fa01f5e9e1.tar.xz |
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>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/technical/api-string-list.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 20be348834..f1add51efe 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -200,3 +200,5 @@ Represents the list itself. You should not tamper with it. . Setting the `strdup_strings` member to 1 will strdup() the strings before adding them, see above. +. The `compare_strings_fn` member is used to specify a custom compare + function, otherwise `strcmp()` is used as the default function. |