Add const to parse_{commit,tag}_buffer()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Feb 5, 2011 at 17:52 UTC
cf7b1cad0e8b024538de975dff5893262cec72d7
4 files changed
+6
-6
commit.c
+3
-3
@@ -245,10 +245,10 @@ int unregister_shallow(const unsigned char *sha1)
245
return 0;
246
}
247
248
-int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
248
+int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size)
249
{
250
- char *tail = buffer;
251
- char *bufptr = buffer;
250
+ const char *tail = buffer;
251
+ const char *bufptr = buffer;
252
unsigned char parent[20];
253
struct commit_list **pptr;
254
struct commit_graft *graft;
commit.h
+1
-1
@@ -38,7 +38,7 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
38
int quiet);
39
struct commit *lookup_commit_reference_by_name(const char *name);
40
41
-int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size);
41
+int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long size);
42
int parse_commit(struct commit *item);
43
44
/* Find beginning and length of commit subject. */
tag.c
+1
-1
@@ -56,7 +56,7 @@ static unsigned long parse_tag_date(const char *buf, const char *tail)
56
return strtoul(dateptr, NULL, 10);
57
}
58
59
-int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
59
+int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)
60
{
61
unsigned char sha1[20];
62
char type[20];
tag.h
+1
-1
@@ -13,7 +13,7 @@ struct tag {
13
};
14
15
extern struct tag *lookup_tag(const unsigned char *sha1);
16
-extern int parse_tag_buffer(struct tag *item, void *data, unsigned long size);
16
+extern int parse_tag_buffer(struct tag *item, const void *data, unsigned long size);
17
extern int parse_tag(struct tag *item);
18
extern struct object *deref_tag(struct object *, const char *, int);
19
extern size_t parse_signature(const char *buf, unsigned long size);