Commit 3ecc8b5ed984c49e464224133093250bdd5c9c1c

Vicent Marti 2011-02-18T00:08:34

Fix refcounting initialization Signed-off-by: Vicent Marti <tanoku@gmail.com>

diff --git a/src/thread-utils.h b/src/thread-utils.h
index 588c919..0029e4b 100644
--- a/src/thread-utils.h
+++ b/src/thread-utils.h
@@ -34,9 +34,9 @@
 #		define gitrc_free(a)	(void)0
 #	elif defined(GIT_WIN32)
 		typedef long git_refcnt;
-#		define gitrc_init(a, v)	*a = v
-#		define gitrc_inc(a)		InterlockedIncrement(a)
-#		define gitrc_dec(a)		!InterlockedDecrement(a)
+#		define gitrc_init(a, v)	(*a = v)
+#		define gitrc_inc(a)		(InterlockedIncrement(a))
+#		define gitrc_dec(a)		(!InterlockedDecrement(a))
 #		define gitrc_free(a)	(void)0
 #	else
 		typedef struct { git_lck lock; int counter; } git_refcnt;
@@ -98,7 +98,7 @@
 #	define gitlck_free(a)   (void)0
 
 	typedef struct { int counter; } git_refcnt;
-#	define gitrc_init(a)   ((a)->counter = 0)
+#	define gitrc_init(a,v) ((a)->counter = v)
 #	define gitrc_inc(a)    ((a)->counter++)
 #	define gitrc_dec(a)    (--(a)->counter == 0)
 #	define gitrc_free(a)   (void)0