Skip to content

Commit 488201c

Browse files
Ramsay Jonesgitster
authored andcommitted
setup.c: Fix some "symbol not declared" sparse warnings
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>
1 parent 650af7a commit 488201c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void verify_non_filename(const char *prefix, const char *arg)
152152
*/
153153
#define PATHSPEC_FROMTOP (1<<0)
154154

155-
struct pathspec_magic {
155+
static struct pathspec_magic {
156156
unsigned bit;
157157
char mnemonic; /* this cannot be ':'! */
158158
const char *name;
@@ -173,7 +173,7 @@ struct pathspec_magic {
173173
* the prefix part must always match literally, and a single stupid
174174
* string cannot express such a case.
175175
*/
176-
const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)
176+
static const char *prefix_pathspec(const char *prefix, int prefixlen, const char *elt)
177177
{
178178
unsigned magic = 0;
179179
const char *copyfrom = elt;

0 commit comments

Comments
 (0)