From 9b69cf132266161bbb96a705df15808f3ae3e56f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 7 May 2009 14:47:21 +0200 Subject: [PATCH] Shut up GCC 4.4.0 GCC babbles something about "type-punned" pointers. Just add an extra layer of casting to avoid the warning. Signed-off-by: Johannes Schindelin --- decorate.c | 3 ++- object.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/decorate.c b/decorate.c index 82d9e221ea..a216001dd8 100644 --- a/decorate.c +++ b/decorate.c @@ -8,7 +8,8 @@ static unsigned int hash_obj(const struct object *obj, unsigned int n) { - unsigned int hash = *(unsigned int *)obj->sha1; + const void *p = obj->sha1; + unsigned int hash = *(const unsigned int *)p; return hash % n; } diff --git a/object.c b/object.c index 7e6a92c88e..ce294241d3 100644 --- a/object.c +++ b/object.c @@ -45,7 +45,8 @@ int type_from_string(const char *str) static unsigned int hash_obj(struct object *obj, unsigned int n) { - unsigned int hash = *(unsigned int *)obj->sha1; + const void *p = obj->sha1; + unsigned int hash = *(const unsigned int *)p; return hash % n; } -- 2.11.4.GIT