Skip to content

Commit

Permalink
[PATCH] Possible cleanups for local-pull.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Peter Hagervall authored and Junio C Hamano committed Sep 4, 2005
1 parent baeda3a commit 2ab141a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ extern int get_ack(int fd, unsigned char *result_sha1);
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);
Expand Down
10 changes: 5 additions & 5 deletions local-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void prefetch(unsigned char *sha1)

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];
Expand All @@ -30,7 +30,7 @@ void setup_index(unsigned char *sha1)
packs = new_pack;
}

int setup_indices()
static int setup_indices(void)
{
DIR *dir;
struct dirent *de;
Expand All @@ -49,7 +49,7 @@ int setup_indices()
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)) {
Expand Down Expand Up @@ -97,7 +97,7 @@ int copy_file(const char *source, const char *dest, const char *hex)
return -1;
}

int fetch_pack(unsigned char *sha1)
static int fetch_pack(const unsigned char *sha1)
{
struct packed_git *target;
char filename[PATH_MAX];
Expand Down Expand Up @@ -125,7 +125,7 @@ int fetch_pack(unsigned char *sha1)
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];
Expand Down
2 changes: 1 addition & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ struct packed_git *parse_pack_index(unsigned char *sha1)
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;
Expand Down

0 comments on commit 2ab141a

Please sign in to comment.