Skip to content

Commit cf7b1ca

Browse files
pcloudsgitster
authored andcommitted
Add const to parse_{commit,tag}_buffer()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2b7a3b commit cf7b1ca

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

commit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ int unregister_shallow(const unsigned char *sha1)
245245
return 0;
246246
}
247247

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)
249249
{
250-
char *tail = buffer;
251-
char *bufptr = buffer;
250+
const char *tail = buffer;
251+
const char *bufptr = buffer;
252252
unsigned char parent[20];
253253
struct commit_list **pptr;
254254
struct commit_graft *graft;

commit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct commit *lookup_commit_reference_gently(const unsigned char *sha1,
3838
int quiet);
3939
struct commit *lookup_commit_reference_by_name(const char *name);
4040

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);
4242
int parse_commit(struct commit *item);
4343

4444
/* Find beginning and length of commit subject. */

tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static unsigned long parse_tag_date(const char *buf, const char *tail)
5656
return strtoul(dateptr, NULL, 10);
5757
}
5858

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)
6060
{
6161
unsigned char sha1[20];
6262
char type[20];

tag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct tag {
1313
};
1414

1515
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);
1717
extern int parse_tag(struct tag *item);
1818
extern struct object *deref_tag(struct object *, const char *, int);
1919
extern size_t parse_signature(const char *buf, unsigned long size);

0 commit comments

Comments
 (0)