summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: baeda3a)
raw | patch | inline | side by side (parent: baeda3a)
author | Peter Hagervall <hager@cs.umu.se> | |
Fri, 2 Sep 2005 12:17:10 +0000 (14:17 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 4 Sep 2005 17:28:38 +0000 (10:28 -0700) |
Hi. This patch contains the following possible cleanups:
* Make some needlessly global functions in local-pull.c static
* Change 'char *' to 'const char *' where appropriate
Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make some needlessly global functions in local-pull.c static
* Change 'char *' to 'const char *' where appropriate
Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
local-pull.c | patch | blob | history | |
sha1_file.c | patch | blob | history |
index 0dcd2fe53b6aa7b19d963e130ce5fd4dea2389bc..f0c9b01aa394c0a9a356f4b661141b77a0d7c9f6 100644 (file)
--- a/cache.h
+++ b/cache.h
extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match);
extern struct packed_git *parse_pack_index(unsigned char *sha1);
-extern struct packed_git *parse_pack_index_file(unsigned char *sha1,
+extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
char *idx_path);
extern void prepare_packed_git(void);
diff --git a/local-pull.c b/local-pull.c
index 8b16f50e332888f871fd1cb38133e3b453471bd0..ca0003ba2a8584b036013a4e4d04e51a0d82fdbc 100644 (file)
--- a/local-pull.c
+++ b/local-pull.c
static struct packed_git *packs = NULL;
-void setup_index(unsigned char *sha1)
+static void setup_index(unsigned char *sha1)
{
struct packed_git *new_pack;
char filename[PATH_MAX];
packs = new_pack;
}
-int setup_indices()
+static int setup_indices(void)
{
DIR *dir;
struct dirent *de;
return 0;
}
-int copy_file(const char *source, const char *dest, const char *hex)
+static int copy_file(const char *source, const char *dest, const char *hex)
{
if (use_link) {
if (!link(source, dest)) {
return -1;
}
-int fetch_pack(unsigned char *sha1)
+static int fetch_pack(const unsigned char *sha1)
{
struct packed_git *target;
char filename[PATH_MAX];
return 0;
}
-int fetch_file(unsigned char *sha1)
+static int fetch_file(const unsigned char *sha1)
{
static int object_name_start = -1;
static char filename[PATH_MAX];
diff --git a/sha1_file.c b/sha1_file.c
index fa37f1e3ef97c7a35ec9eb4cd71ba7fda5e53055..64eac592bbf191b2c97ccf8739fdb0d4712d7788 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return parse_pack_index_file(sha1, path);
}
-struct packed_git *parse_pack_index_file(unsigned char *sha1, char *idx_path)
+struct packed_git *parse_pack_index_file(const unsigned char *sha1, char *idx_path)
{
struct packed_git *p;
unsigned long idx_size;