Commit 803ca5cb92035f6d06c55b41e2863ae629aa877c

Kirill A. Shutemov 2011-07-15T15:31:17

revwalk: fix cast warning /home/kas/git/public/libgit2/src/revwalk.c: In function ‘object_table_hash’: /home/kas/git/public/libgit2/src/revwalk.c:120:7: 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/revwalk.c b/src/revwalk.c
index e0b6cbe..f7a56cc 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -115,9 +115,8 @@ static int commit_time_cmp(void *a, void *b)
 static uint32_t object_table_hash(const void *key, int hash_id)
 {
 	uint32_t r;
-	git_oid *id;
+	const git_oid *id = key;
 
-	id = (git_oid *)key;
 	memcpy(&r, id->id + (hash_id * sizeof(uint32_t)), sizeof(r));
 	return r;
 }