From 225c11b505c5eb028aeae87febc847e2fde9e811 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Thu, 15 Nov 2012 18:36:55 +0900 Subject: [PATCH] erase warnings for clang3.2 --- sprout/array/tuple.hpp | 7 ++++++ sprout/bitset/bitset.hpp | 9 ++++---- sprout/config/compiler.hpp | 28 ++++++++++++------------ sprout/pit/tuple.hpp | 7 ++++++ sprout/random/inversive_congruential.hpp | 10 ++++++++- sprout/random/linear_congruential.hpp | 13 ++++++++--- sprout/string/tuple.hpp | 7 ++++++ sprout/sub_array/tuple.hpp | 7 ++++++ sprout/tuple/tuple/tuple.hpp | 7 ++++++ sprout/type/integral_array.hpp | 7 ++++++ sprout/type/string/string.hpp | 7 ++++++ sprout/type/type_tuple.hpp | 7 ++++++ sprout/utility/pair/tuple.hpp | 7 ++++++ sprout/variant/tuple.hpp | 7 ++++++ 14 files changed, 108 insertions(+), 22 deletions(-) diff --git a/sprout/array/tuple.hpp b/sprout/array/tuple.hpp index 42e0c15a..652f48f9 100644 --- a/sprout/array/tuple.hpp +++ b/sprout/array/tuple.hpp @@ -33,6 +33,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -50,6 +54,9 @@ namespace std { static_assert(I < N, "tuple_element<>: index out of range"); typedef T type; }; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_ARRAY_TUPLE_HPP diff --git a/sprout/bitset/bitset.hpp b/sprout/bitset/bitset.hpp index 15e4614a..0e4bacff 100644 --- a/sprout/bitset/bitset.hpp +++ b/sprout/bitset/bitset.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_NUMERIC_SSCRISK_CEL_OR_SPROUT #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT @@ -129,7 +130,7 @@ namespace sprout { { return base_bitset( sprout::detail::base_bitset_from_words_construct_tag(), - (static_cast(Indexes) > wshift + (sprout::math::greater(Indexes, wshift) ? (w_[Indexes - wshift] << offset) | (w_[Indexes - wshift - 1] >> sub_offset) : Indexes == wshift ? w_[0] << offset : static_cast(0) @@ -145,7 +146,7 @@ namespace sprout { { return base_bitset( sprout::detail::base_bitset_from_words_construct_tag(), - (static_cast(Indexes) >= wshift ? w_[Indexes - wshift] + (sprout::math::greater_equal(Indexes, wshift) ? w_[Indexes - wshift] : static_cast(0) )... ); @@ -172,7 +173,7 @@ namespace sprout { { return base_bitset( sprout::detail::base_bitset_from_words_construct_tag(), - (static_cast(Indexes) < limit + (sprout::math::less(Indexes, limit) ? (w_[Indexes + wshift] >> offset) | (w_[Indexes + wshift + 1] << sub_offset) : Indexes == limit ? w_[N-1] >> offset : static_cast(0) @@ -188,7 +189,7 @@ namespace sprout { { return base_bitset( sprout::detail::base_bitset_from_words_construct_tag(), - (static_cast(Indexes) <= limit ? w_[Indexes + wshift] + (sprout::math::less_equal(Indexes, limit) ? w_[Indexes + wshift] : static_cast(0) )... ) diff --git a/sprout/config/compiler.hpp b/sprout/config/compiler.hpp index ddb20121..462e861d 100644 --- a/sprout/config/compiler.hpp +++ b/sprout/config/compiler.hpp @@ -5,37 +5,37 @@ # include #elif defined(_CRAYC) # include -#elif defined __CUDACC__ +#elif defined(__CUDACC__) # include -#elif defined __COMO__ +#elif defined(__COMO__) # include #elif defined(__PATHSCALE__) && (__PATHCC__ >= 4) # include -#elif defined __clang__ +#elif defined(__clang__) # include -#elif defined __DMC__ +#elif defined(__DMC__) # include #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) # include -# elif defined __GNUC__ +# elif defined(__GNUC__) # include -#elif defined __KCC +#elif defined(__KCC) # include -#elif defined __sgi +#elif defined(__sgi) # include -#elif defined __DECCXX +#elif defined(__DECCXX) # include -#elif defined __ghs +#elif defined(__ghs) # include -#elif defined __CODEGEARC__ +#elif defined(__CODEGEARC__) # include -#elif defined __BORLANDC__ +#elif defined(__BORLANDC__) # include -#elif defined __MWERKS__ +#elif defined( __MWERKS__) # include -#elif defined __SUNPRO_CC +#elif defined( __SUNPRO_CC) # include -#elif defined __HP_aCC +#elif defined(__HP_aCC) # include #elif defined(__MRC__) || defined(__SC__) # include diff --git a/sprout/pit/tuple.hpp b/sprout/pit/tuple.hpp index 963f68f7..921b9e8b 100644 --- a/sprout/pit/tuple.hpp +++ b/sprout/pit/tuple.hpp @@ -34,6 +34,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -49,6 +53,9 @@ namespace std { struct tuple_element > : public std::tuple_element {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_PIT_TUPLE_HPP diff --git a/sprout/random/inversive_congruential.hpp b/sprout/random/inversive_congruential.hpp index 3ed34490..1e34ebb0 100644 --- a/sprout/random/inversive_congruential.hpp +++ b/sprout/random/inversive_congruential.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,14 @@ namespace sprout { static SPROUT_CONSTEXPR result_type static_max() { return modulus - 1; } - static SPROUT_CONSTEXPR bool arg_check_nothrow(IntType const& x0) { + template + static SPROUT_CONSTEXPR typename std::enable_if::value, bool>::type + arg_check_nothrow(T const& x0) { + return x0 <= static_max(); + } + template + static SPROUT_CONSTEXPR typename std::enable_if::value), bool>::type + arg_check_nothrow(T const& x0) { return x0 >= static_min() && x0 <= static_max(); } static SPROUT_CONSTEXPR IntType arg_check(IntType const& x0) { diff --git a/sprout/random/linear_congruential.hpp b/sprout/random/linear_congruential.hpp index ad7ea1e6..063d93f5 100644 --- a/sprout/random/linear_congruential.hpp +++ b/sprout/random/linear_congruential.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -36,12 +37,18 @@ namespace sprout { static SPROUT_CONSTEXPR result_type static_max() { return modulus - 1; } - static SPROUT_CONSTEXPR bool arg_check_nothrow(IntType const& x0) { + template + static SPROUT_CONSTEXPR typename std::enable_if::value, bool>::type + arg_check_nothrow(T const& x0) { + return x0 <= static_max(); + } + template + static SPROUT_CONSTEXPR typename std::enable_if::value), bool>::type + arg_check_nothrow(T const& x0) { return x0 >= static_min() && x0 <= static_max(); } static SPROUT_CONSTEXPR IntType arg_check(IntType const& x0) { - return arg_check_nothrow(x0) - ? x0 + return arg_check_nothrow(x0) ? x0 : throw std::invalid_argument("linear_congruential_engine<>: invalid argument (x0 >= static_min() && x0 <= static_max())") ; } diff --git a/sprout/string/tuple.hpp b/sprout/string/tuple.hpp index 81b3278e..c0581e4f 100644 --- a/sprout/string/tuple.hpp +++ b/sprout/string/tuple.hpp @@ -33,6 +33,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -50,6 +54,9 @@ namespace std { static_assert(I < N, "tuple_element<>: index out of range"); typedef T type; }; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_STRING_TUPLE_HPP diff --git a/sprout/sub_array/tuple.hpp b/sprout/sub_array/tuple.hpp index 181e3752..dd28f0d0 100644 --- a/sprout/sub_array/tuple.hpp +++ b/sprout/sub_array/tuple.hpp @@ -43,6 +43,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -58,6 +62,9 @@ namespace std { struct tuple_element > : public std::tuple_element::type> {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_SUB_ARRAY_TUPLE_HPP diff --git a/sprout/tuple/tuple/tuple.hpp b/sprout/tuple/tuple/tuple.hpp index 2b003497..5017295c 100644 --- a/sprout/tuple/tuple/tuple.hpp +++ b/sprout/tuple/tuple/tuple.hpp @@ -339,6 +339,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -354,6 +358,9 @@ namespace std { struct tuple_element > : public sprout::tuples::detail::tuple_element_impl > {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_TUPLE_TUPLE_TUPLE_HPP diff --git a/sprout/type/integral_array.hpp b/sprout/type/integral_array.hpp index 3da3e910..779d6824 100644 --- a/sprout/type/integral_array.hpp +++ b/sprout/type/integral_array.hpp @@ -24,6 +24,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -39,6 +43,9 @@ namespace std { struct tuple_element > : public std::tuple_element...> > {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_TYPE_INTEGRAL_ARRAY_HPP diff --git a/sprout/type/string/string.hpp b/sprout/type/string/string.hpp index 7b8ac5d6..fd7aea59 100644 --- a/sprout/type/string/string.hpp +++ b/sprout/type/string/string.hpp @@ -20,6 +20,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -35,6 +39,9 @@ namespace std { struct tuple_element > : public std::tuple_element > {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_TYPE_STRING_STRING_HPP diff --git a/sprout/type/type_tuple.hpp b/sprout/type/type_tuple.hpp index 2cddb8d1..a065ccc4 100644 --- a/sprout/type/type_tuple.hpp +++ b/sprout/type/type_tuple.hpp @@ -55,6 +55,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -70,6 +74,9 @@ namespace std { struct tuple_element > : public sprout::types::detail::tuple_element_impl > {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_TYPE_TYPE_TUPLE_HPP diff --git a/sprout/utility/pair/tuple.hpp b/sprout/utility/pair/tuple.hpp index ff100dd8..035e0890 100644 --- a/sprout/utility/pair/tuple.hpp +++ b/sprout/utility/pair/tuple.hpp @@ -50,6 +50,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -65,6 +69,9 @@ namespace std { struct tuple_element > : public sprout::tuples::detail::tuple_element_impl > {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std namespace sprout { diff --git a/sprout/variant/tuple.hpp b/sprout/variant/tuple.hpp index 46b8e286..e856a4e7 100644 --- a/sprout/variant/tuple.hpp +++ b/sprout/variant/tuple.hpp @@ -39,6 +39,10 @@ namespace sprout { } // namespace sprout namespace std { +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmismatched-tags" +#endif // // tuple_size // @@ -54,6 +58,9 @@ namespace std { struct tuple_element > : public std::tuple_element::tuple_type> {}; +#if defined(__clang__) +# pragma clang diagnostic pop +#endif } // namespace std #endif // #ifndef SPROUT_VARIANT_TUPLE_HPP