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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2009-05-07 14:47:21 +02:00
parent d9215c962b
commit 9b69cf1322
2 changed files with 4 additions and 2 deletions

View File

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

View File

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