refs.c: remove extern keyword from function definition
PATCH 1/1 refs.c: remove extern keyword from function definition
Commit 5ed85684 ("reflog_expire(): new function in the reference API", 12-12-2014) added a new function definition which included the extern keyword.
While this is not an illegal use of the keyword, it is somewhat unusual to include it in a function definition. (It would be unique in the git codebase). Also, it triggers a warning from sparse. In order to suppress the warning, simply remove the extern keyword from reflog_expire() definition.
---
Hi Michael,
If you need to re-roll your 'mh/reflog-expire' series, could you please squash this into the relevant patch.
Thanks!
ATB,
Ramsay Jones
refs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
refs.c +6 -6
@@ -4020,12 +4020,12 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,return 0 ; } -extern int reflog_expire (const char *refname,const unsigned char *sha1, -unsigned int flags, -reflog_expiry_prepare_fn prepare_fn, -reflog_expiry_should_prune_fn should_prune_fn, -reflog_expiry_cleanup_fn cleanup_fn, -void *policy_cb_data) +int reflog_expire (const char *refname,const unsigned char *sha1, +unsigned int flags, +reflog_expiry_prepare_fn prepare_fn, +reflog_expiry_should_prune_fn should_prune_fn, +reflog_expiry_cleanup_fn cleanup_fn, +void *policy_cb_data) {static struct lock_file reflog_lock;struct expire_reflog_cb cb;
Signature · 1 line
2.2.0
Quoted 11 lines · Ramsay Jones
Commit
5ed85684("reflog_expire(): new function in the reference API", 12-12-2014) added a new function definition which included the extern keyword.While this is not an illegal use of the keyword, it is somewhat unusual to include it in a function definition. (It would be unique in the git codebase). Also, it triggers a warning from sparse. In order to suppress the warning, simply remove the extern keyword from
reflog_expire()definition.
Quoted 7 lines
Signed-off-by Ramsay Jones <[email protected]>---
Hi Michael,
If you need to re-roll your 'mh/reflog-expire' series, could you please squash this into the relevant patch.
Thanks for spotting this! It looks like Junio has already squashed this commit into place in the "pu" version of my branch. So thanks Junio, too!
Michael
Quoted 27 lines
refs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)refs.c +6
-6@@ -4020,12 +4020,12 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,return 0 ; } -extern int reflog_expire (const char *refname,const unsigned char *sha1, -unsigned int flags, -reflog_expiry_prepare_fn prepare_fn, -reflog_expiry_should_prune_fn should_prune_fn, -reflog_expiry_cleanup_fn cleanup_fn, -void *policy_cb_data) +int reflog_expire (const char *refname,const unsigned char *sha1, +unsigned int flags, +reflog_expiry_prepare_fn prepare_fn, +reflog_expiry_should_prune_fn should_prune_fn, +reflog_expiry_cleanup_fn cleanup_fn, +void *policy_cb_data) {static struct lock_file reflog_lock;struct expire_reflog_cb cb;
Signature · 3 lines
Michael Haggerty [email protected] http://softwareswirl.blogspot.com/