diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-10-05 10:27:33 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-10-05 10:27:33 +0200 |
commit | dbb4a5866fcbb121000a705e074f679445d6916b (patch) | |
tree | d6bc50e2fb02dbbe8b64f76b825d070aa527fde1 | |
parent | b95c79ab34fa782d336984030b619bfd0df5e46f (diff) | |
download | libgit2-dbb4a5866fcbb121000a705e074f679445d6916b.tar.gz |
tests: fix warning for implicit conversion of integer to pointer
GCC warns by default when implicitly converting integers to pointers or
the other way round, and commit fa48d2ea7 (vector: do not malloc
0-length vectors on dup, 2018-09-26) introduced such an implicit
conversion into our vector tests. While this is totally fine in this
test, as the pointer's value is never being used in the first place, we
can trivially avoid the warning by instead just inserting a pointer for
a variable allocated on the stack into the vector.
-rw-r--r-- | tests/core/vector.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/core/vector.c b/tests/core/vector.c index 6b8ea574d..2be7e86bd 100644 --- a/tests/core/vector.c +++ b/tests/core/vector.c @@ -412,7 +412,7 @@ void test_core_vector__dup_empty_vector(void) { git_vector v = GIT_VECTOR_INIT; git_vector dup = GIT_VECTOR_INIT; - void *dummy = 0xDEAFBEEB; + int dummy; cl_assert_equal_i(0, v.length); @@ -420,7 +420,7 @@ void test_core_vector__dup_empty_vector(void) cl_assert_equal_i(0, dup._alloc_size); cl_assert_equal_i(0, dup.length); - cl_git_pass(git_vector_insert(&dup, dummy)); + cl_git_pass(git_vector_insert(&dup, &dummy)); cl_assert_equal_i(8, dup._alloc_size); cl_assert_equal_i(1, dup.length); |