string_list: Fix argument order for string_list_append
Update the definition and callers of string_list_append to use the string_list as the first argument. This helps make the string_list API easier to use by being more consistent. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e8c8b7139c
commit
1d2f80fa79
@ -38,8 +38,8 @@ struct string_list list;
|
||||
int i;
|
||||
|
||||
memset(&list, 0, sizeof(struct string_list));
|
||||
string_list_append("foo", &list);
|
||||
string_list_append("bar", &list);
|
||||
string_list_append(&list, "foo");
|
||||
string_list_append(&list, "bar");
|
||||
for (i = 0; i < list.nr; i++)
|
||||
printf("%s\n", list.items[i].string)
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user