Re: [PATCH] string-list: remove print_string_list, since it is not used anymore.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 11, 2010, 22:51 UTC
- Message-ID
- <7veilwb6gp.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <a4c8a6d01001111434j18b77b88j525b9acb47c7e100@mail.gmail.com>
Thiago Farina <tfransosi@gmail.com> writes:
> I can add the comment if Junio is ok with it. Something like this: > "This functions is for debugging purpose only. Please, do NOT remove > it."
Something like this should suffice, as I think "Please blah" is just superfluous.
I don't know if I like "#ifdef DEBUG" better, though. It will still let you say "call print_string_list(...)" in your debugger session, and people wouldn't muck with it even if there is no caller.
diff --git a/string-list.c b/string-list.c index 1ac536e..793e619 100644 --- a/string-list.c +++ b/string-list.c @@ -139,6 +139,7 @@ void string_list_clear_func(struct string_list *list, string_list_clear_func_t c } +#ifndef NDEBUG void print_string_list(const char *text, const struct string_list *p) { int i; @@ -147,6 +148,7 @@ void print_string_list(const char *text, const struct string_list *p) for (i = 0; i < p->nr; i++) printf("%s:%p\n", p->items[i].string, p->items[i].util); } +#endif struct string_list_item *string_list_append(const char *string, struct string_list *list) { diff --git a/string-list.h b/string-list.h index 6569cf6..8598257 100644 --- a/string-list.h +++ b/string-list.h @@ -12,7 +12,6 @@ struct string_list unsigned int strdup_strings:1; }; -void print_string_list(const char *text, const struct string_list *p); void string_list_clear(struct string_list *list, int free_util); /* Use this function to call a custom clear function on each util pointer */