* [PATCH] refs.c: remove extern keyword from function definition
@ 2014-12-19 17:24 Ramsay Jones
2014-12-29 1:41 ` Michael Haggerty
0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2014-12-19 17:24 UTC (permalink / raw)
To: Michael Haggerty; +Cc: Junio C Hamano, GIT Mailing-list
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.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
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(-)
diff --git a/refs.c b/refs.c
index 3bd686c..fdef36d 100644
--- a/refs.c
+++ b/refs.c
@@ -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;
--
2.2.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] refs.c: remove extern keyword from function definition
2014-12-19 17:24 [PATCH] refs.c: remove extern keyword from function definition Ramsay Jones
@ 2014-12-29 1:41 ` Michael Haggerty
0 siblings, 0 replies; 2+ messages in thread
From: Michael Haggerty @ 2014-12-29 1:41 UTC (permalink / raw)
To: Ramsay Jones; +Cc: Junio C Hamano, GIT Mailing-list
On 12/19/2014 06:24 PM, Ramsay Jones wrote:
>
> 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.
>
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
>
> 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
> refs.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/refs.c b/refs.c
> index 3bd686c..fdef36d 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -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;
>
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-29 1:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19 17:24 [PATCH] refs.c: remove extern keyword from function definition Ramsay Jones
2014-12-29 1:41 ` Michael Haggerty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).