git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
f103f95
)
api-string-list.txt: initialize the string_list the easy way
author
Michael Haggerty
<redacted>
Wed, 12 Sep 2012 14:04:47 +0000
(16:04 +0200)
committer
Junio C Hamano
<redacted>
Wed, 12 Sep 2012 18:43:25 +0000
(11:43 -0700)
In the demo code blurb, show how to initialize the string_list using
STRING_LIST_INIT_NODUP rather than memset().
Signed-off-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
Documentation/technical/api-string-list.txt
patch
|
blob
|
history
diff --git
a/Documentation/technical/api-string-list.txt
b/Documentation/technical/api-string-list.txt
index 32b35d91811aa775a13f2656966c3a49a5fea730..155ac8cb10d53053eb37bf0ea52d42623d6cb3c9 100644
(file)
--- a/
Documentation/technical/api-string-list.txt
+++ b/
Documentation/technical/api-string-list.txt
@@
-44,10
+44,9
@@
member (you need this if you add things later) and you should set the
Example:
----
-struct string_list list;
+struct string_list list
= STRING_LIST_INIT_NODUP
;
int i;
-memset(&list, 0, sizeof(struct string_list));
string_list_append(&list, "foo");
string_list_append(&list, "bar");
for (i = 0; i < list.nr; i++)
git clone https://git.99rst.org/PROJECT