summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-10-05 10:27:33 +0200
committerPatrick Steinhardt <ps@pks.im>2018-10-26 14:58:52 +0200
commit0952278f5097c5a49fae7ef36d3b291279bce789 (patch)
tree9212136b5cf3990254b04477fed2680ac8cc5af9
parent2e7d53ac21b58875ea5b8722ed1c29bca1637ee9 (diff)
downloadlibgit2-0952278f5097c5a49fae7ef36d3b291279bce789.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. (cherry picked from commit dbb4a5866fcbb121000a705e074f679445d6916b)
-rw-r--r--tests/core/vector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/core/vector.c b/tests/core/vector.c
index 371c68160..91452404c 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);