git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brandon Williams <bmwill@google.com>
To: Stefan Beller <sbeller@google.com>
Cc: jonathantanmy@google.com, git@vger.kernel.org
Subject: Re: [PATCH] sha1_file: make read_info_alternates static
Date: Tue, 15 Aug 2017 14:31:16 -0700	[thread overview]
Message-ID: <20170815213116.GC21874@google.com> (raw)
In-Reply-To: <20170815201319.32395-1-sbeller@google.com>

On 08/15, Stefan Beller wrote:
> read_info_alternates is not used from outside, so let's make it static.
> 
> We have to declare the function before link_alt_odb_entry instead of
> moving the code around, link_alt_odb_entry calls read_info_alternates,
> which in turn calls link_alt_odb_entry.
> 
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> 
>   This helps in a later refactoring (moving the object
>   store to the_repository struct), too.
>   
>   Thanks,
>   Stefan
> 
>  cache.h     | 1 -
>  sha1_file.c | 3 ++-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cache.h b/cache.h
> index 1c69d2a05a..4109efcf24 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -1551,7 +1551,6 @@ extern struct alternate_object_database {
>  	char path[FLEX_ARRAY];
>  } *alt_odb_list;
>  extern void prepare_alt_odb(void);
> -extern void read_info_alternates(const char * relative_base, int depth);
>  extern char *compute_alternate_path(const char *path, struct strbuf *err);
>  typedef int alt_odb_fn(struct alternate_object_database *, void *);
>  extern int foreach_alt_odb(alt_odb_fn, void*);
> diff --git a/sha1_file.c b/sha1_file.c
> index b60ae15f70..9186e2c6c7 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -347,6 +347,7 @@ static int alt_odb_usable(struct strbuf *path, const char *normalized_objdir)
>   * SHA1, an extra slash for the first level indirection, and the
>   * terminating NUL.
>   */
> +static void read_info_alternates(const char * relative_base, int depth);
>  static int link_alt_odb_entry(const char *entry, const char *relative_base,
>  	int depth, const char *normalized_objdir)
>  {
> @@ -448,7 +449,7 @@ static void link_alt_odb_entries(const char *alt, int len, int sep,
>  	strbuf_release(&objdirbuf);
>  }
>  
> -void read_info_alternates(const char * relative_base, int depth)
> +static void read_info_alternates(const char * relative_base, int depth)
>  {
>  	char *map;
>  	size_t mapsz;
> -- 
> 2.14.0.rc0.3.g6c2e499285
> 

Looks good to me.  Only nit is I would fix the style to not have a space
after the '*' ;)

-- 
Brandon Williams

  reply	other threads:[~2017-08-15 21:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 20:13 [PATCH] sha1_file: make read_info_alternates static Stefan Beller
2017-08-15 21:31 ` Brandon Williams [this message]
2017-08-15 21:34 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170815213116.GC21874@google.com \
    --to=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).