From 277917ec6a5bf1e9552972a3a21d2de69471b293 Mon Sep 17 00:00:00 2001 From: Jakob Petsovits Date: Thu, 16 Jul 2015 01:37:25 -0400 Subject: [PATCH] Avoid more warnings when building tests. --- test/test_packet_buffer.cpp | 4 ++-- test/test_string.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_packet_buffer.cpp b/test/test_packet_buffer.cpp index eacd5ee52..64535bcb7 100644 --- a/test/test_packet_buffer.cpp +++ b/test/test_packet_buffer.cpp @@ -86,14 +86,14 @@ TORRENT_TEST(insert) for (int i = 0; i < 0xff; ++i) { int index = (i + 0xfff0) & 0xffff; - pb.insert(index, (void*)(index + 1)); + pb.insert(index, reinterpret_cast(index + 1)); fprintf(stderr, "insert: %u (mask: %x)\n", index, int(pb.capacity() - 1)); TEST_EQUAL(pb.capacity(), 512); if (i >= 14) { index = (index - 14) & 0xffff; fprintf(stderr, "remove: %u\n", index); - TEST_CHECK(pb.remove(index) == (void*)(index + 1)); + TEST_CHECK(pb.remove(index) == reinterpret_cast(index + 1)); TEST_EQUAL(pb.size(), 14); } } diff --git a/test/test_string.cpp b/test/test_string.cpp index d7d4e06a3..605a1276c 100644 --- a/test/test_string.cpp +++ b/test/test_string.cpp @@ -294,7 +294,7 @@ TORRENT_TEST(string) TEST_EQUAL(ptr, std::string("f")); ptr = string_tokenize(next, ' ', &next); - TEST_EQUAL(ptr, NULL); + TEST_EQUAL(ptr, static_cast(0)); TEST_EQUAL(std::string("foobar"), convert_from_native(convert_to_native("foobar"))); TEST_EQUAL(std::string("foobar")