threads / patch / 44477

patchattr: mark a file-local symbol as static

Subject: [PATCH] attr: mark a file-local symbol as static

## tl;dr

2 messages between Nov 13, 2016 and Nov 14, 2016. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ramsay Jones· Nov 13, 2016, 16:42 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Stefan,

If you need to re-roll your 'sb/attr' branch, could you please squash this into the relevant patch.

Alternatively, since there is only a single call site for git_attr() (on line #1005), you could perhaps remove git_attr() and inline that call. (However, that does make that line exceed 80 columns).

Thanks!

ATB, Ramsay Jones

 attr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to attr.c +1 −1
diff --git a/attr.c b/attr.c
index 667ba85..84c4b08 100644
--- a/attr.c
+++ b/attr.c
@@ -169,7 +169,7 @@ static struct git_attr *git_attr_internal(const char *name, int len)
 	return a;
 }
 
-struct git_attr *git_attr(const char *name)
+static struct git_attr *git_attr(const char *name)
 {
 	return git_attr_internal(name, strlen(name));
 }
-- 
2.10.0
Stefan Beller· Nov 14, 2016, 20:00 UTC · re: Ramsay Jones · lore

Re: [PATCH] attr: mark a file-local symbol as static

On Sun, Nov 13, 2016 at 8:42 AM, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:

Show 8 quoted lines
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Stefan,
>
> If you need to re-roll your 'sb/attr' branch, could you please
> squash this into the relevant patch.
will do. I have it applied locally
>
> Alternatively, since there is only a single call site for git_attr()
> (on line #1005), you could perhaps remove git_attr() and inline that
> call. (However, that does make that line exceed 80 columns).
I'll look into that.

Thanks, Stefan

Show 24 quoted lines
>
> Thanks!
>
> ATB,
> Ramsay Jones
>
>  attr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/attr.c b/attr.c
> index 667ba85..84c4b08 100644
> --- a/attr.c
> +++ b/attr.c
> @@ -169,7 +169,7 @@ static struct git_attr *git_attr_internal(const char *name, int len)
>         return a;
>  }
>
> -struct git_attr *git_attr(const char *name)
> +static struct git_attr *git_attr(const char *name)
>  {
>         return git_attr_internal(name, strlen(name));
>  }
> --
> 2.10.0

← back to recent threads