git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Initialise hash variable to prevent compiler warnings
@ 2014-10-13 14:37 Felipe Franciosi
  2014-10-13 20:12 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Franciosi @ 2014-10-13 14:37 UTC (permalink / raw)
  To: git; +Cc: Felipe Franciosi

The 'hash' variable in test-hashmap.c is not initialised properly
which causes some 'gcc' versions to complain during compilation.

Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
---
 test-hashmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test-hashmap.c b/test-hashmap.c
index 07aa7ec..cc2891d 100644
--- a/test-hashmap.c
+++ b/test-hashmap.c
@@ -47,7 +47,7 @@ static struct test_entry *alloc_test_entry(int hash, char *key, int klen,
 
 static unsigned int hash(unsigned int method, unsigned int i, const char *key)
 {
-	unsigned int hash;
+	unsigned int hash = 0;
 	switch (method & 3)
 	{
 	case HASH_METHOD_FNV:
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-14 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13 14:37 [PATCH] Initialise hash variable to prevent compiler warnings Felipe Franciosi
2014-10-13 20:12 ` Junio C Hamano
     [not found]   ` <CANxchRS1mGapb77hc9Ywqj_-8UeexSAWK4UK9y9M76pvoN-Yeg@mail.gmail.com>
2014-10-13 21:55     ` Felipe Franciosi
2014-10-14  1:13     ` Junio C Hamano
2014-10-14 11:44       ` Felipe Franciosi
2014-10-14 16:41         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).