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>
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;
}