提交 488201c8 编写于 作者: R Ramsay Jones 提交者: Junio C Hamano

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: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 650af7ae
......@@ -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;
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册