Re: [PATCH v6 02/27] files-backend: make files_log_ref_write() static
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Mar 19, 2017, 20:35 UTC
- Message-ID
- <dda96cdb-ec10-cb46-96e9-576062d90841@ramsayjones.plus.com>
- In-Reply-To
- <a949cc96-34a4-fb5d-06c6-e124f6c025aa@alum.mit.edu>
On 19/03/17 19:10, Michael Haggerty wrote:
Show 43 quoted lines
> On 03/18/2017 03:03 AM, Nguyễn Thái Ngọc Duy wrote:
>> Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
>> but probably never used outside refs-internal.c
>>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>> refs/files-backend.c | 3 +++
>> refs/refs-internal.h | 4 ----
>> 2 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/refs/files-backend.c b/refs/files-backend.c
>> index 50188e92f9..0a6d2bf6bc 100644
>> --- a/refs/files-backend.c
>> +++ b/refs/files-backend.c
>> @@ -165,6 +165,9 @@ static struct ref_entry *create_dir_entry(struct files_ref_store *ref_store,
>> const char *dirname, size_t len,
>> int incomplete);
>> static void add_entry_to_dir(struct ref_dir *dir, struct ref_entry *entry);
>> +static int files_log_ref_write(const char *refname, const unsigned char *old_sha1,
>> + const unsigned char *new_sha1, const char *msg,
>> + int flags, struct strbuf *err);
>>
>> static struct ref_dir *get_ref_dir(struct ref_entry *entry)
>> {
>> diff --git a/refs/refs-internal.h b/refs/refs-internal.h
>> index fa93c9a32e..f732473e1d 100644
>> --- a/refs/refs-internal.h
>> +++ b/refs/refs-internal.h
>> @@ -228,10 +228,6 @@ struct ref_transaction {
>> enum ref_transaction_state state;
>> };
>>
>> -int files_log_ref_write(const char *refname, const unsigned char *old_sha1,
>> - const unsigned char *new_sha1, const char *msg,
>> - int flags, struct strbuf *err);
>> -
>> /*
>> * Check for entries in extras that are within the specified
>> * directory, where dirname is a reference directory name including
>>
>
> You changed the declaration, but the definition still makes the function
> non-static.Actually, this is a static symbol, since it's 'static-ness' derives from the above forward declaration.
However, as I said in a previous email, this tickles sparse to issue a warning. In addition, simply adding 'static' to the definition (ie simply _don't_ do the forward declaration) is less work! :-D
ATB, Ramsay Jones