Skip to content

Commit 6511987

Browse files
Ramsay Jonesgitster
authored andcommitted
test-string-list.c: Fix some sparse warnings
In particular, sparse complains as follows: SP test-string-list.c test-string-list.c:10:6: warning: symbol 'parse_string_list' was not \ declared. Should it be static? test-string-list.c:18:6: warning: symbol 'write_list' was not \ declared. Should it be static? test-string-list.c:25:6: warning: symbol 'write_list_compact' was not \ declared. Should it be static? test-string-list.c:38:5: warning: symbol 'prefix_cb' was not \ declared. Should it be static? In order to suppress the warnings, since the above symbols do not need more than file scope, we simply include the static modifier in their declaration. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5f0fc64 commit 6511987

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test-string-list.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
* list (as opposed to "", which indicates a string list containing a
88
* single empty string). list->strdup_strings must be set.
99
*/
10-
void parse_string_list(struct string_list *list, const char *arg)
10+
static void parse_string_list(struct string_list *list, const char *arg)
1111
{
1212
if (!strcmp(arg, "-"))
1313
return;
1414

1515
(void)string_list_split(list, arg, ':', -1);
1616
}
1717

18-
void write_list(const struct string_list *list)
18+
static void write_list(const struct string_list *list)
1919
{
2020
int i;
2121
for (i = 0; i < list->nr; i++)
2222
printf("[%d]: \"%s\"\n", i, list->items[i].string);
2323
}
2424

25-
void write_list_compact(const struct string_list *list)
25+
static void write_list_compact(const struct string_list *list)
2626
{
2727
int i;
2828
if (!list->nr)
@@ -35,7 +35,7 @@ void write_list_compact(const struct string_list *list)
3535
}
3636
}
3737

38-
int prefix_cb(struct string_list_item *item, void *cb_data)
38+
static int prefix_cb(struct string_list_item *item, void *cb_data)
3939
{
4040
const char *prefix = (const char *)cb_data;
4141
return !prefixcmp(item->string, prefix);

0 commit comments

Comments
 (0)