From 1ed18456b30e348b83450f3e63cf3ee7480bddba Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sun, 13 Jan 2013 17:41:45 +0900 Subject: [PATCH] fix config macro name --- sprout/config/compiler.hpp | 3 +- sprout/config/compiler/has_future.hpp | 29 +++++++++++++++++++ .../{cxx11.hpp => no_cxx11_future.hpp} | 14 ++++----- sprout/config/suffix.hpp | 10 +++---- sprout/cstring/memchr.hpp | 4 +++ sprout/cstring/memcmp.hpp | 4 +++ sprout/cwchar/wmemchr.hpp | 3 ++ sprout/cwchar/wmemcmp.hpp | 3 ++ sprout/math/ceil.hpp | 2 +- sprout/math/detail/config.hpp | 6 ++-- sprout/math/floor.hpp | 2 +- sprout/math/round.hpp | 2 +- sprout/math/trunc.hpp | 2 +- 13 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 sprout/config/compiler/has_future.hpp rename sprout/config/compiler/{cxx11.hpp => no_cxx11_future.hpp} (57%) diff --git a/sprout/config/compiler.hpp b/sprout/config/compiler.hpp index ae72ef45..2f0548a2 100644 --- a/sprout/config/compiler.hpp +++ b/sprout/config/compiler.hpp @@ -47,6 +47,7 @@ # include #endif -#include +#include +#include #endif // #ifndef SPROUT_CONFIG_COMPILER_HPP diff --git a/sprout/config/compiler/has_future.hpp b/sprout/config/compiler/has_future.hpp new file mode 100644 index 00000000..fcfd30fc --- /dev/null +++ b/sprout/config/compiler/has_future.hpp @@ -0,0 +1,29 @@ +#ifndef SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP +#define SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP + +#ifndef SPROUT_NO_CONSTEXPR +# define SPROUT_HAS_CONSTEXPR +#endif +#ifndef SPROUT_NO_DEFAULTED_FUNCTIONS +# define SPROUT_HAS_DEFAULTED_FUNCTIONS +#endif +#ifndef SPROUT_NO_DELETED_FUNCTIONS +# define SPROUT_HAS_DELETED_FUNCTIONS +#endif +#ifndef SPROUT_NO_NOEXCEPT +# define SPROUT_HAS_NOEXCEPT +#endif +#ifndef SPROUT_NO_TEMPLATE_ALIASES +# define SPROUT_HAS_TEMPLATE_ALIASES +#endif +#ifndef SPROUT_NO_USER_DEFINED_LITERALS +# define SPROUT_HAS_USER_DEFINED_LITERALS +#endif +#ifndef SPROUT_NO_DELEGATING_CONSTRUCTORS +# define SPROUT_HAS_DELEGATING_CONSTRUCTORS +#endif +#ifndef SPROUT_NO_UNICODE_LITERALS +# define SPROUT_HAS_UNICODE_LITERALS +#endif + +#endif // #ifndef SPROUT_CONFIG_COMPILER_HAS_FUTURE_HPP diff --git a/sprout/config/compiler/cxx11.hpp b/sprout/config/compiler/no_cxx11_future.hpp similarity index 57% rename from sprout/config/compiler/cxx11.hpp rename to sprout/config/compiler/no_cxx11_future.hpp index cb83325d..0bba44f6 100644 --- a/sprout/config/compiler/cxx11.hpp +++ b/sprout/config/compiler/no_cxx11_future.hpp @@ -1,5 +1,5 @@ -#ifndef SPROUT_CONFIG_COMPILER_CXX11_HPP -#define SPROUT_CONFIG_COMPILER_CXX11_HPP +#ifndef SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP +#define SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP #ifdef SPROUT_NO_CONSTEXPR # define SPROUT_NO_CXX11_CONSTEXPR @@ -11,19 +11,19 @@ # define SPROUT_NO_CXX11_DELETED_FUNCTIONS #endif #ifdef SPROUT_NO_NOEXCEPT -# define SPROUT_NO_CXX11_CNOEXCEPT +# define SPROUT_NO_CXX11_NOEXCEPT #endif #ifdef SPROUT_NO_TEMPLATE_ALIASES -# define SPROUT_NO_CXX11_CTEMPLATE_ALIASES +# define SPROUT_NO_CXX11_TEMPLATE_ALIASES #endif #ifdef SPROUT_NO_USER_DEFINED_LITERALS -# define SPROUT_NO_CXX11_CUSER_DEFINED_LITERALS +# define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #endif #ifdef SPROUT_NO_DELEGATING_CONSTRUCTORS -# define SPROUT_NO_CXX11_CDELEGATING_CONSTRUCTORS +# define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #endif #ifdef SPROUT_NO_UNICODE_LITERALS # define SPROUT_NO_CXX11_UNICODE_LITERALS #endif -#endif // #ifndef SPROUT_CONFIG_COMPILER_CXX11_HPP +#endif // #ifndef SPROUT_CONFIG_COMPILER_NO_CXX11_FUTURE_HPP diff --git a/sprout/config/suffix.hpp b/sprout/config/suffix.hpp index 054bf319..81e6cf3b 100644 --- a/sprout/config/suffix.hpp +++ b/sprout/config/suffix.hpp @@ -85,11 +85,11 @@ # define SPROUT_USE_BUILTIN_BIT_OPERATION 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION -#ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW -# define SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW 1 -#else // #ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW -# define SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW 0 -#endif // #ifndef SPROUT_CONFIG_DISABLE_THROW_INT_CONVERSION_OVERFLOW +#ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING +# define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 1 +#else // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING +# define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 0 +#endif // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION # define SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION 1 diff --git a/sprout/cstring/memchr.hpp b/sprout/cstring/memchr.hpp index 902818fa..c9e5e3b5 100644 --- a/sprout/cstring/memchr.hpp +++ b/sprout/cstring/memchr.hpp @@ -23,6 +23,10 @@ namespace sprout { } // namespace detail // 7.21.5.1 memchr ֐ + // + // recursion depth: + // O(log N) + // inline SPROUT_CONSTEXPR void const* memchr(void const* s, int c, std::size_t n) { return sprout::detail::memchr_impl( diff --git a/sprout/cstring/memcmp.hpp b/sprout/cstring/memcmp.hpp index 2ad44770..9cbb4277 100644 --- a/sprout/cstring/memcmp.hpp +++ b/sprout/cstring/memcmp.hpp @@ -8,6 +8,10 @@ namespace sprout { // 7.21.4.1 memcmp ֐ + // + // recursion depth: + // O(log(N1+N2)) + // inline SPROUT_CONSTEXPR int memcmp(void const* s1, void const* s2, std::size_t n) { return sprout::tristate_lexicographical_compare( diff --git a/sprout/cwchar/wmemchr.hpp b/sprout/cwchar/wmemchr.hpp index 4d62d2eb..8a2ede3e 100644 --- a/sprout/cwchar/wmemchr.hpp +++ b/sprout/cwchar/wmemchr.hpp @@ -25,6 +25,9 @@ namespace sprout { // // wmemchr // + // recursion depth: + // O(log N) + // inline SPROUT_CONSTEXPR wchar_t const* wmemchr(wchar_t const* s, wchar_t c, size_t n) { return sprout::detail::wmemchr_impl( diff --git a/sprout/cwchar/wmemcmp.hpp b/sprout/cwchar/wmemcmp.hpp index 650555e2..edf59495 100644 --- a/sprout/cwchar/wmemcmp.hpp +++ b/sprout/cwchar/wmemcmp.hpp @@ -10,6 +10,9 @@ namespace sprout { // // wmemcmp // + // recursion depth: + // O(log(N1+N2)) + // inline SPROUT_CONSTEXPR int wmemcmp(wchar_t const* s1, wchar_t const* s2, std::size_t n) { return sprout::tristate_lexicographical_compare( diff --git a/sprout/math/ceil.hpp b/sprout/math/ceil.hpp index b76808ad..4cd9cd3d 100644 --- a/sprout/math/ceil.hpp +++ b/sprout/math/ceil.hpp @@ -29,7 +29,7 @@ namespace sprout { ceil(FloatType x) { return sprout::math::isinf(x) ? x : std::numeric_limits::max() < x || std::numeric_limits::max() < -x - ? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("ceil: Sorry, not implemented."), x) + ? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("ceil: large float rounding."), x) : x < 0 ? -static_cast(static_cast(-x)) : sprout::math::detail::ceil_impl(x, static_cast(static_cast(x))) ; diff --git a/sprout/math/detail/config.hpp b/sprout/math/detail/config.hpp index 1f2e3d29..ad6be8c1 100644 --- a/sprout/math/detail/config.hpp +++ b/sprout/math/detail/config.hpp @@ -12,10 +12,10 @@ # define NS_SPROUT_MATH_DETAIL sprout::math::detail #endif // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION -#if SPROUT_NOTHROW_INT_CONVERSION_OVERFLOW -# define SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(e, x) (x) +#if SPROUT_NOERROR_LARGE_FLOAT_ROUNDING +# define SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(e, x) (x) #else -# define SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(e, x) throw (e) +# define SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(e, x) throw (e) #endif #endif // #ifndef SPROUT_MATH_DETAIL_CONFIG_HPP diff --git a/sprout/math/floor.hpp b/sprout/math/floor.hpp index 454867af..decda316 100644 --- a/sprout/math/floor.hpp +++ b/sprout/math/floor.hpp @@ -29,7 +29,7 @@ namespace sprout { floor(FloatType x) { return sprout::math::isinf(x) ? x : std::numeric_limits::max() < x || std::numeric_limits::max() < -x - ? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("floor: Sorry, not implemented."), x) + ? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("floor: large float rounding."), x) : x < 0 ? sprout::math::detail::floor_impl(x, -static_cast(static_cast(-x))) : static_cast(static_cast(x)) ; diff --git a/sprout/math/round.hpp b/sprout/math/round.hpp index 71d1402e..f2f76630 100644 --- a/sprout/math/round.hpp +++ b/sprout/math/round.hpp @@ -35,7 +35,7 @@ namespace sprout { round(FloatType x) { return sprout::math::isinf(x) ? x : std::numeric_limits::max() < x || std::numeric_limits::max() < -x - ? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("round: Sorry, not implemented."), x) + ? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("round: large float rounding."), x) : x < 0 ? sprout::math::detail::round_impl_nagative(x, -static_cast(static_cast(-x))) : sprout::math::detail::round_impl_positive(x, static_cast(static_cast(x))) ; diff --git a/sprout/math/trunc.hpp b/sprout/math/trunc.hpp index 284fd7c2..14b1b31e 100644 --- a/sprout/math/trunc.hpp +++ b/sprout/math/trunc.hpp @@ -21,7 +21,7 @@ namespace sprout { trunc(FloatType x) { return sprout::math::isinf(x) ? x : std::numeric_limits::max() < x || std::numeric_limits::max() < -x - ? SPROUT_MATH_DETAIL_INT_CONVERSION_OVERFLOW(std::domain_error("trunc: Sorry, not implemented."), x) + ? SPROUT_MATH_THROW_LARGE_FLOAT_ROUNDING(std::domain_error("trunc: large float rounding."), x) : x < 0 ? -static_cast(static_cast(-x)) : static_cast(static_cast(x)) ;