From: Junio C Hamano Date: Wed, 08 Dec 2010 22:50:48 GMT Subject: Re: [PATCH v2.1 3/4] describe: Store commit_names in a hash table by commit SHA1 Message-ID: <7v1v5rkhfb.fsf@alter.siamese.dyndns.org> In-Reply-To: Anders Kaseorg writes: > @@ -44,6 +47,19 @@ static const char *prio_names[] = { > "head", "lightweight", "annotated", > }; > > +static inline unsigned int hash_sha1(const unsigned char *sha1) > +{ > + return *(unsigned int *)sha1; > +} Do we know that all the archs we will be compiled on will be happy with this potentially unaligned access? hash_filespec() in diffcore-rename.c is written in a way to avoid such an issue, and I would feel safer to see this do the same.