Skip to content

Commit

Permalink
Add const to parse_{commit,tag}_buffer()
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Feb 7, 2011
1 parent a2b7a3b commit cf7b1ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ int unregister_shallow(const unsigned char *sha1)
return 0;
}

int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size)
{
char *tail = buffer;
char *bufptr = buffer;
const char *tail = buffer;
const char *bufptr = buffer;
unsigned char parent[20];
struct commit_list **pptr;
struct commit_graft *graft;
Expand Down
2 changes: 1 addition & 1 deletion commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
int quiet);
struct commit *lookup_commit_reference_by_name(const char *name);

int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size);
int parse_commit(struct commit *item);

/* Find beginning and length of commit subject. */
Expand Down
2 changes: 1 addition & 1 deletion tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static unsigned long parse_tag_date(const char *buf, const char *tail)
return strtoul(dateptr, NULL, 10);
}

int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)
{
unsigned char sha1[20];
char type[20];
Expand Down
2 changes: 1 addition & 1 deletion tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct tag {
};

extern struct tag *lookup_tag(const unsigned char *sha1);
extern int parse_tag_buffer(struct tag *item, void *data, unsigned long size);
extern int parse_tag_buffer(struct tag *item, const void *data, unsigned long size);
extern int parse_tag(struct tag *item);
extern struct object *deref_tag(struct object *, const char *, int);
extern size_t parse_signature(const char *buf, unsigned long size);
Expand Down

0 comments on commit cf7b1ca

Please sign in to comment.