{"thread":{"id":"1718","subject":"[PATCH] Possible cleanups for local-pull.c","startedAt":"2005-09-02T12:17:10Z","lastAt":"2005-09-02T12:17:10Z","messageCount":1,"participants":["Peter Hagervall"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"8017","messageId":"20050902121710.GA671@peppar.cs.umu.se","threadId":"1718","inReplyTo":null,"subject":"[PATCH] Possible cleanups for local-pull.c","fromName":"Peter Hagervall","fromEmail":"hager@cs.umu.se","sentAt":"2005-09-02T12:17:10Z","receivedAt":"2005-09-02T12:17:10Z","isPatch":true,"sender":{"key":"hager@cs.umu.se","avatar":null},"body":"Hi. This patch contains the following possible cleanups:\n\n * Make some needlessly global functions in local-pull.c static\n * Change 'char *' to 'const char *' where appropriate\n\nSigned-off-by: Peter Hagervall <hager@cs.umu.se>\n\n---\n\ndiff --git a/cache.h b/cache.h\n--- a/cache.h\n+++ b/cache.h\n@@ -327,7 +327,7 @@ extern int get_ack(int fd, unsigned char\n extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match);\n \n extern struct packed_git *parse_pack_index(unsigned char *sha1);\n-extern struct packed_git *parse_pack_index_file(unsigned char *sha1, \n+extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,\n \t\t\t\t\t\tchar *idx_path);\n \n extern void prepare_packed_git(void);\ndiff --git a/local-pull.c b/local-pull.c\n--- a/local-pull.c\n+++ b/local-pull.c\n@@ -17,7 +17,7 @@ void prefetch(unsigned char *sha1)\n \n static struct packed_git *packs = NULL;\n \n-void setup_index(unsigned char *sha1)\n+static void setup_index(unsigned char *sha1)\n {\n \tstruct packed_git *new_pack;\n \tchar filename[PATH_MAX];\n@@ -30,7 +30,7 @@ void setup_index(unsigned char *sha1)\n \tpacks = new_pack;\n }\n \n-int setup_indices()\n+static int setup_indices(void)\n {\n \tDIR *dir;\n \tstruct dirent *de;\n@@ -49,7 +49,7 @@ int setup_indices()\n \treturn 0;\n }\n \n-int copy_file(const char *source, const char *dest, const char *hex)\n+static int copy_file(const char *source, const char *dest, const char *hex)\n {\n \tif (use_link) {\n \t\tif (!link(source, dest)) {\n@@ -97,7 +97,7 @@ int copy_file(const char *source, const \n \treturn -1;\n }\n \n-int fetch_pack(unsigned char *sha1)\n+static int fetch_pack(const unsigned char *sha1)\n {\n \tstruct packed_git *target;\n \tchar filename[PATH_MAX];\n@@ -125,7 +125,7 @@ int fetch_pack(unsigned char *sha1)\n \treturn 0;\n }\n \n-int fetch_file(unsigned char *sha1)\n+static int fetch_file(const unsigned char *sha1)\n {\n \tstatic int object_name_start = -1;\n \tstatic char filename[PATH_MAX];\ndiff --git a/sha1_file.c b/sha1_file.c\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -487,7 +487,7 @@ struct packed_git *parse_pack_index(unsi\n \treturn parse_pack_index_file(sha1, path);\n }\n \n-struct packed_git *parse_pack_index_file(unsigned char *sha1, char *idx_path)\n+struct packed_git *parse_pack_index_file(const unsigned char *sha1, char *idx_path)\n {\n \tstruct packed_git *p;\n \tnsigned long idx_size;\n"}]}