From cf7b1cad0e8b024538de975dff5893262cec72d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 5 Feb 2011 17:52:20 +0700 Subject: [PATCH] Add const to parse_{commit,tag}_buffer() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- commit.c | 6 +++--- commit.h | 2 +- tag.c | 2 +- tag.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commit.c b/commit.c index 74d6601880..ac337c7d7d 100644 --- a/commit.c +++ b/commit.c @@ -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; diff --git a/commit.h b/commit.h index eb6c5af1f6..659c87c3ee 100644 --- a/commit.h +++ b/commit.h @@ -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. */ diff --git a/tag.c b/tag.c index f789744cca..ecf7c1e9ce 100644 --- a/tag.c +++ b/tag.c @@ -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]; diff --git a/tag.h b/tag.h index 8522370039..5ee88e6550 100644 --- a/tag.h +++ b/tag.h @@ -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); -- 2.11.4.GIT