]> git.ipfire.org Git - thirdparty/git.git/commitdiff
alloc: make allocate_alloc_state and clear_alloc_state more consistent
authorElijah Newren <newren@gmail.com>
Wed, 15 Aug 2018 17:54:06 +0000 (10:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Aug 2018 18:52:09 +0000 (11:52 -0700)
Since both functions are using the same data type, they should either both
refer to it as void *, or both use the real type (struct alloc_state *).
Opt for the latter.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
alloc.c
alloc.h

diff --git a/alloc.c b/alloc.c
index c2fc5d68886bf3f74a1f013a3a36c7b5dcad2258..e7aa81b7aa48c14f2a98894eb6e8c2e28998945e 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -36,7 +36,7 @@ struct alloc_state {
        int slab_nr, slab_alloc;
 };
 
-void *allocate_alloc_state(void)
+struct alloc_state *allocate_alloc_state(void)
 {
        return xcalloc(1, sizeof(struct alloc_state));
 }
diff --git a/alloc.h b/alloc.h
index 7a41bb9eb338c78fee221220b94f91387ac04503..ba356ed8478d13f05f49efd5bacccaac3e69dfd7 100644 (file)
--- a/alloc.h
+++ b/alloc.h
@@ -15,7 +15,7 @@ void *alloc_object_node(struct repository *r);
 void alloc_report(struct repository *r);
 unsigned int alloc_commit_index(struct repository *r);
 
-void *allocate_alloc_state(void);
+struct alloc_state *allocate_alloc_state(void);
 void clear_alloc_state(struct alloc_state *s);
 
 #endif