{"thread":{"id":"45432","subject":"Subject: [PATCH 2/2] refs: remove forward declaration for files_log_ref_write()","startedAt":"2017-03-19T20:25:48Z","lastAt":"2017-03-19T20:25:48Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"314603","messageId":"78de71f0-87ce-b92e-d592-1370ec3830ac@ramsayjones.plus.com","threadId":"45432","inReplyTo":null,"subject":"Subject: [PATCH 2/2] refs: remove forward declaration for files_log_ref_write()","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2017-03-19T20:25:42Z","receivedAt":"2017-03-19T20:25:48Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 7d3989dac9 (\"files-backend: make files_log_ref_write() static\",\n18-03-2017) made the files_log_ref_write() function static by adding\nan, otherwise useless, forward declaration. This causes sparse to\nissue a warning. A much simpler solution is to simply add the static\nkeyword to the function definition.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Duy,\n\nIf you need to re-roll your 'nd/files-backend-git-dir' branch, could you please\nsquash this into the relevant patch.\n\nThanks!\n\nATB,\nRamsay Jones\n\n refs/files-backend.c | 12 ++++--------\n 1 file changed, 4 insertions(+), 8 deletions(-)\n\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 0f423be18..b4cae64ab 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -165,10 +165,6 @@ static struct ref_entry *create_dir_entry(struct files_ref_store *ref_store,\n \t\t\t\t\t  const char *dirname, size_t len,\n \t\t\t\t\t  int incomplete);\n static void add_entry_to_dir(struct ref_dir *dir, struct ref_entry *entry);\n-static int files_log_ref_write(struct files_ref_store *refs,\n-\t\t\t       const char *refname, const unsigned char *old_sha1,\n-\t\t\t       const unsigned char *new_sha1, const char *msg,\n-\t\t\t       int flags, struct strbuf *err);\n \n static struct ref_dir *get_ref_dir(struct ref_entry *entry)\n {\n@@ -2926,10 +2922,10 @@ static int log_ref_write_fd(int fd, const unsigned char *old_sha1,\n \treturn 0;\n }\n \n-int files_log_ref_write(struct files_ref_store *refs,\n-\t\t\tconst char *refname, const unsigned char *old_sha1,\n-\t\t\tconst unsigned char *new_sha1, const char *msg,\n-\t\t\tint flags, struct strbuf *err)\n+static int files_log_ref_write(struct files_ref_store *refs,\n+\t\t\t       const char *refname, const unsigned char *old_sha1,\n+\t\t\t       const unsigned char *new_sha1, const char *msg,\n+\t\t\t       int flags, struct strbuf *err)\n {\n \tint logfd, result;\n \n-- \n2.12.0\n"}]}