From b647aba2cdbb28a5b1ac5cd09586e46c8eb6a357 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 21 Nov 2009 19:40:54 +0000 Subject: [PATCH] Fix some hash /W4 warnings. Fixes #3648 [SVN r57839] --- hash/examples/books.cpp | 1 + hash/test/hash_complex_test.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hash/examples/books.cpp b/hash/examples/books.cpp index d54b353..40feae3 100644 --- a/hash/examples/books.cpp +++ b/hash/examples/books.cpp @@ -20,6 +20,7 @@ int main() boost::hash book_hasher; std::size_t knife_hash_value = book_hasher(knife); + (void)knife_hash_value; // suppress unused variable warning // If std::unordered_set was available: // diff --git a/hash/test/hash_complex_test.cpp b/hash/test/hash_complex_test.cpp index 80b8974..7adffd9 100644 --- a/hash/test/hash_complex_test.cpp +++ b/hash/test/hash_complex_test.cpp @@ -19,19 +19,17 @@ int main() {} #include -#include -#include -#include - #if defined(BOOST_MSVC) -#pragma warning(push) #pragma warning(disable:4244) // conversion from 'unsigned long' to 'unsigned short', possible loss of data +#pragma warning(disable:4245) // conversion from 'int' to 'const unsigned short', signed/unsigned mismatch +#pragma warning(disable:4305) // truncation from 'double' to 'const std::complex::_Ty' +#pragma warning(disable:4309) // truncation of constant value #pragma warning(disable:4512) // assignment operator could not be generated #endif -#if defined(BOOST_MSVC) -#pragma warning(pop) -#endif +#include +#include +#include template void generic_complex_tests(std::complex v)