Skip to content

Commit dbb4a58

Browse files
committed
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 fa48d2e (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.
1 parent b95c79a commit dbb4a58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/core/vector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,15 @@ void test_core_vector__dup_empty_vector(void)
412412
{
413413
git_vector v = GIT_VECTOR_INIT;
414414
git_vector dup = GIT_VECTOR_INIT;
415-
void *dummy = 0xDEAFBEEB;
415+
int dummy;
416416

417417
cl_assert_equal_i(0, v.length);
418418

419419
cl_git_pass(git_vector_dup(&dup, &v, v._cmp));
420420
cl_assert_equal_i(0, dup._alloc_size);
421421
cl_assert_equal_i(0, dup.length);
422422

423-
cl_git_pass(git_vector_insert(&dup, dummy));
423+
cl_git_pass(git_vector_insert(&dup, &dummy));
424424
cl_assert_equal_i(8, dup._alloc_size);
425425
cl_assert_equal_i(1, dup.length);
426426

0 commit comments

Comments
 (0)