Re: [PATCH 1/2] ref-filter: mark a file-local symbol as static
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Mar 2, 2018, 17:56 UTC
- Message-ID
- <07197560-a6b6-91a0-3750-b17ed7dc5f69@ramsayjones.plus.com>
- In-Reply-To
- <xmqqinaecs3q.fsf@gitster-ct.c.googlers.com>
On 02/03/18 17:19, Junio C Hamano wrote:
Show 7 quoted lines
> Ramsay Jones <ramsay@ramsayjones.plus.com> writes: > >> Junio, do you want me to re-roll, or would you mind tweaking the >> commit message while queueing? > > Perfect timing ;-) I was about to get to these two patches. Here > is what is queued.
Thanks!
ATB, Ramsay Jones
Show 32 quoted lines
> commit 2d7cb07e3718d0af6547e2abb35f9cff9b10c1f5
> Author: Ramsay Jones <ramsay@ramsayjones.plus.com>
> Date: Fri Mar 2 02:54:02 2018 +0000
>
> ref-filter: mark a file-local symbol as static
>
> Commit fcfba37337 ('ref-filter: make "--contains <id>" less chatty if
> <id> is invalid', 2018-02-23) added the add_str_to_commit_list()
> function, which causes sparse to issue a "... not declared. Should it
> be static?" warning for that symbol.
>
> Indeed, the function is only used in this one compilation unit. Mark
> it static.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>
> diff --git a/ref-filter.c b/ref-filter.c
> index aa282a27f4..ed993d32d8 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -2000,7 +2000,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata)
> free(to_clear);
> }
>
> -int add_str_to_commit_list(struct string_list_item *item, void *commit_list)
> +static int add_str_to_commit_list(struct string_list_item *item, void *commit_list)
> {
> struct object_id oid;
> struct commit *commit;
>
>