Skip to content

Commit

Permalink
setup.c: Fix some "symbol not declared" sparse warnings
Browse files Browse the repository at this point in the history
In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warnings for the following symbols:

    setup.c:159:3: 'pathspec_magic'
    setup.c:176:12: 'prefix_pathspec'

These symbols only require file scope, so we add the static modifier
to their declarations.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and gitster committed May 18, 2011
1 parent 650af7a commit 488201c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void verify_non_filename(const char *prefix, const char *arg)
*/
#define PATHSPEC_FROMTOP (1<<0)

struct pathspec_magic {
static struct pathspec_magic {
unsigned bit;
char mnemonic; /* this cannot be ':'! */
const char *name;
Expand All @@ -173,7 +173,7 @@ struct pathspec_magic {
* the prefix part must always match literally, and a single stupid
* string cannot express such a case.
*/
const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)
static const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)
{
unsigned magic = 0;
const char *copyfrom = elt;
Expand Down

0 comments on commit 488201c

Please sign in to comment.