git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] config.c: make git_parse_long() static

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Oct 2, 2008, 10:14 UTC
Message-ID
<20081002191427.6117@nanako3.lavabit.com>
This function is not used in any other file.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
---
 cache.h  |    1 -
 config.c |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/cache.h b/cache.h
index de8c2b6..5a61f5e 100644
--- a/cache.h
+++ b/cache.h
@@ -742,7 +742,6 @@ typedef int (*config_fn_t)(const char *, const char *, void *);
 extern int git_default_config(const char *, const char *, void *);
 extern int git_config_from_file(config_fn_t fn, const char *, void *);
 extern int git_config(config_fn_t fn, void *);
-extern int git_parse_long(const char *, long *);
 extern int git_parse_ulong(const char *, unsigned long *);
 extern int git_config_int(const char *, const char *);
 extern unsigned long git_config_ulong(const char *, const char *);
diff --git a/config.c b/config.c
index 53f04a0..7d5843f 100644
--- a/config.c
+++ b/config.c
@@ -255,7 +255,7 @@ static int parse_unit_factor(const char *end, unsigned long *val)
 	return 0;
 }
 
-int git_parse_long(const char *value, long *ret)
+static int git_parse_long(const char *value, long *ret)
 {
 	if (value && *value) {
 		char *end;
@@ -291,7 +291,7 @@ static void die_bad_config(const char *name)
 
 int git_config_int(const char *name, const char *value)
 {
-	long ret;
+	long ret = 0;
 	if (!git_parse_long(value, &ret))
 		die_bad_config(name);
 	return ret;
-- 
1.6.0.2

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Message 1 of 1 in “config.c: make git_parse_long() static”
  1. config.c: make git_parse_long() staticNanako Shiraishi, Oct 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.