@matheusbsbs / matheus-bagliano / commits / c51477229e
Fork 0

sparse: Fix some "symbol not declared" warnings

In particular, sparse issues the "symbol 'a_symbol' was not declared. Should it be static?" warnings for the following symbols: attr.c:468:12: 'git_etc_gitattributes' attr.c:476:5: 'git_attr_system' vcs-svn/svndump.c:282:6: 'svndump_read' vcs-svn/svndump.c:417:5: 'svndump_init' vcs-svn/svndump.c:432:6: 'svndump_deinit' vcs-svn/svndump.c:445:6: 'svndump_reset' The symbols in attr.c only require file scope, so we add the static modifier to their declaration. The symbols in vcs-svn/svndump.c are external symbols, and they already have extern declarations in the "svndump.h" header file, so we simply include the header in svndump.c. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Apr 7, 2011 at 19:49 UTC c51477229ee4c7846d40a447860b5bf94aa1103d
2 files changed +3 -2
attr.c
+2 -2
@@ -465,7 +465,7 @@ static void drop_attr_stack(void)
465 }
466 }
467
468 -const char *git_etc_gitattributes(void)
468 +static const char *git_etc_gitattributes(void)
469 {
470 static const char *system_wide;
471 if (!system_wide)
@@ -473,7 +473,7 @@ const char *git_etc_gitattributes(void)
473 return system_wide;
474 }
475
476 -int git_attr_system(void)
476 +static int git_attr_system(void)
477 {
478 return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
479 }
vcs-svn/svndump.c
+1
@@ -13,6 +13,7 @@
13 #include "line_buffer.h"
14 #include "string_pool.h"
15 #include "strbuf.h"
16 +#include "svndump.h"
17
18 /*
19 * Compare start of string to literal of equal length;