Commit 14468c6be59567bf9d90ff21bd62893409ec82df

Kirill A. Shutemov 2011-07-15T14:59:37

commit: fix cast warnings /home/kas/git/public/libgit2/src/commit.c: In function ‘commit_parse_buffer’: /home/kas/git/public/libgit2/src/commit.c:186:23: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/src/commit.c:187:27: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/commit.c b/src/commit.c
index a6c19e5..7c0965c 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -183,8 +183,8 @@ cleanup:
 
 int commit_parse_buffer(git_commit *commit, const void *data, size_t len)
 {
-	const char *buffer = (char *)data;
-	const char *buffer_end = (char *)data + len;
+	const char *buffer = data;
+	const char *buffer_end = (const char *)data + len;
 
 	git_oid parent_oid;
 	int error;