summaryrefslogtreecommitdiff
path: root/boost/random/detail
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/random/detail
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/random/detail')
-rw-r--r--boost/random/detail/auto_link.hpp2
-rw-r--r--boost/random/detail/config.hpp2
-rw-r--r--boost/random/detail/const_mod.hpp2
-rw-r--r--boost/random/detail/disable_warnings.hpp7
-rw-r--r--boost/random/detail/enable_warnings.hpp6
-rw-r--r--boost/random/detail/generator_bits.hpp2
-rw-r--r--boost/random/detail/generator_seed_seq.hpp2
-rw-r--r--boost/random/detail/integer_log2.hpp8
-rw-r--r--boost/random/detail/large_arithmetic.hpp10
-rw-r--r--boost/random/detail/operators.hpp2
-rw-r--r--boost/random/detail/ptr_helper.hpp29
-rw-r--r--boost/random/detail/seed.hpp2
-rw-r--r--boost/random/detail/seed_impl.hpp11
-rw-r--r--boost/random/detail/uniform_int_float.hpp2
-rw-r--r--boost/random/detail/vector_io.hpp2
15 files changed, 36 insertions, 53 deletions
diff --git a/boost/random/detail/auto_link.hpp b/boost/random/detail/auto_link.hpp
index 1f30fd56d9..6b180cc71e 100644
--- a/boost/random/detail/auto_link.hpp
+++ b/boost/random/detail/auto_link.hpp
@@ -5,7 +5,7 @@
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
- * $Id: auto_link.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_AUTO_LINK_HPP
diff --git a/boost/random/detail/config.hpp b/boost/random/detail/config.hpp
index d6bc0ccd07..724ab19452 100644
--- a/boost/random/detail/config.hpp
+++ b/boost/random/detail/config.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: config.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $
+ * $Id$
*/
#include <boost/config.hpp>
diff --git a/boost/random/detail/const_mod.hpp b/boost/random/detail/const_mod.hpp
index 9778f55179..07f4ea7d84 100644
--- a/boost/random/detail/const_mod.hpp
+++ b/boost/random/detail/const_mod.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: const_mod.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*
* Revision history
* 2001-02-18 moved to individual header files
diff --git a/boost/random/detail/disable_warnings.hpp b/boost/random/detail/disable_warnings.hpp
index f3ade5ec8d..d875004c44 100644
--- a/boost/random/detail/disable_warnings.hpp
+++ b/boost/random/detail/disable_warnings.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: disable_warnings.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
+ * $Id$
*
*/
@@ -21,3 +21,8 @@
#pragma warning(disable:4127)
#pragma warning(disable:4724)
#endif
+
+#if defined(BOOST_GCC) && BOOST_GCC >= 40600
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlogical-op"
+#endif
diff --git a/boost/random/detail/enable_warnings.hpp b/boost/random/detail/enable_warnings.hpp
index 26184ea55b..24f3bb3f58 100644
--- a/boost/random/detail/enable_warnings.hpp
+++ b/boost/random/detail/enable_warnings.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: enable_warnings.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $
+ * $Id$
*
*/
@@ -16,3 +16,7 @@
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
+
+#if defined(BOOST_GCC) && BOOST_GCC >= 40600
+#pragma GCC diagnostic pop
+#endif
diff --git a/boost/random/detail/generator_bits.hpp b/boost/random/detail/generator_bits.hpp
index 44b4248b2f..05276142cb 100644
--- a/boost/random/detail/generator_bits.hpp
+++ b/boost/random/detail/generator_bits.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: generator_bits.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $
+ * $Id$
*
*/
diff --git a/boost/random/detail/generator_seed_seq.hpp b/boost/random/detail/generator_seed_seq.hpp
index 6aaf98f577..7e13483464 100644
--- a/boost/random/detail/generator_seed_seq.hpp
+++ b/boost/random/detail/generator_seed_seq.hpp
@@ -8,7 +8,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: generator_seed_seq.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*
*/
diff --git a/boost/random/detail/integer_log2.hpp b/boost/random/detail/integer_log2.hpp
index baee426f7a..248243a4b2 100644
--- a/boost/random/detail/integer_log2.hpp
+++ b/boost/random/detail/integer_log2.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: integer_log2.hpp 76145 2011-12-24 19:05:17Z danieljames $
+ * $Id$
*
*/
@@ -22,12 +22,12 @@ namespace boost {
namespace random {
namespace detail {
-#if !defined(BOOST_NO_CONSTEXPR)
+#if !defined(BOOST_NO_CXX11_CONSTEXPR)
#define BOOST_RANDOM_DETAIL_CONSTEXPR constexpr
#elif defined(BOOST_MSVC)
#define BOOST_RANDOM_DETAIL_CONSTEXPR __forceinline
#elif defined(__GNUC__) && __GNUC__ >= 4
-#define BOOST_RANDOM_DETAIL_CONSTEXPR __attribute__((const)) __attribute__((always_inline))
+#define BOOST_RANDOM_DETAIL_CONSTEXPR inline __attribute__((__const__)) __attribute__((__always_inline__))
#else
#define BOOST_RANDOM_DETAIL_CONSTEXPR inline
#endif
@@ -35,7 +35,7 @@ namespace detail {
template<int Shift>
struct integer_log2_impl
{
-#if defined(BOOST_NO_CONSTEXPR)
+#if defined(BOOST_NO_CXX11_CONSTEXPR)
template<class T>
BOOST_RANDOM_DETAIL_CONSTEXPR static int apply(T t, int accum)
{
diff --git a/boost/random/detail/large_arithmetic.hpp b/boost/random/detail/large_arithmetic.hpp
index 24177dcdda..66f6b4e615 100644
--- a/boost/random/detail/large_arithmetic.hpp
+++ b/boost/random/detail/large_arithmetic.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: large_arithmetic.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_LARGE_ARITHMETIC_HPP
@@ -31,9 +31,9 @@ struct div_t {
inline div_t muldivmod(boost::uintmax_t a, boost::uintmax_t b, boost::uintmax_t m)
{
- static const int bits =
+ const int bits =
::std::numeric_limits< ::boost::uintmax_t>::digits / 2;
- static const ::boost::uintmax_t mask = (::boost::uintmax_t(1) << bits) - 1;
+ const ::boost::uintmax_t mask = (::boost::uintmax_t(1) << bits) - 1;
typedef ::boost::uint_t<bits>::fast digit_t;
int shift = std::numeric_limits< ::boost::uintmax_t>::digits - 1
@@ -96,8 +96,8 @@ inline div_t muldivmod(boost::uintmax_t a, boost::uintmax_t b, boost::uintmax_t
quotient[i - 2] = q;
product[i] = 0;
- product[i-1] = (rem >> bits) & mask;
- product[i-2] = rem & mask;
+ product[i-1] = static_cast<digit_t>((rem >> bits) & mask);
+ product[i-2] = static_cast<digit_t>(rem & mask);
}
div_t result = {
diff --git a/boost/random/detail/operators.hpp b/boost/random/detail/operators.hpp
index f27839a961..597343c907 100644
--- a/boost/random/detail/operators.hpp
+++ b/boost/random/detail/operators.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: operators.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_OPERATORS_HPP
diff --git a/boost/random/detail/ptr_helper.hpp b/boost/random/detail/ptr_helper.hpp
index 3f3fbdd564..f1b983d936 100644
--- a/boost/random/detail/ptr_helper.hpp
+++ b/boost/random/detail/ptr_helper.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: ptr_helper.hpp 24096 2004-07-27 03:43:34Z dgregor $
+ * $Id$
*
*/
@@ -32,7 +32,6 @@ struct ptr_helper
static const T& ref(const T& r) { return r; }
};
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class T>
struct ptr_helper<T&>
{
@@ -52,7 +51,6 @@ struct ptr_helper<T*>
static reference_type ref(T * p) { return *p; }
static const T& ref(const T * p) { return *p; }
};
-#endif
} // namespace detail
} // namespace random
@@ -64,31 +62,6 @@ struct ptr_helper<T*>
// Helper macro for broken compilers defines specializations of
// ptr_helper.
//
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-# define BOOST_RANDOM_PTR_HELPER_SPEC(T) \
-namespace boost { namespace random { namespace detail { \
-template<> \
-struct ptr_helper<T&> \
-{ \
- typedef T value_type; \
- typedef T& reference_type; \
- typedef T& rvalue_type; \
- static reference_type ref(T& r) { return r; } \
- static const T& ref(const T& r) { return r; } \
-}; \
- \
-template<> \
-struct ptr_helper<T*> \
-{ \
- typedef T value_type; \
- typedef T& reference_type; \
- typedef T* rvalue_type; \
- static reference_type ref(T * p) { return *p; } \
- static const T& ref(const T * p) { return *p; } \
-}; \
-}}}
-#else
# define BOOST_RANDOM_PTR_HELPER_SPEC(T)
-#endif
#endif // BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
diff --git a/boost/random/detail/seed.hpp b/boost/random/detail/seed.hpp
index 979db297af..55b2fa667d 100644
--- a/boost/random/detail/seed.hpp
+++ b/boost/random/detail/seed.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: seed.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_SEED_HPP
diff --git a/boost/random/detail/seed_impl.hpp b/boost/random/detail/seed_impl.hpp
index e044d45d38..f88cab299c 100644
--- a/boost/random/detail/seed_impl.hpp
+++ b/boost/random/detail/seed_impl.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: seed_impl.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_SEED_IMPL_HPP
@@ -15,6 +15,7 @@
#include <stdexcept>
#include <boost/cstdint.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/integer/integer_mask.hpp>
#include <boost/integer/static_log2.hpp>
@@ -253,7 +254,7 @@ IntType get_one_int(Iter& first, Iter last)
IntType s = 0;
for(int j = 0; j < k; ++j) {
if(first == last) {
- throw ::std::invalid_argument("Not enough elements in call to seed.");
+ boost::throw_exception(::std::invalid_argument("Not enough elements in call to seed."));
}
IntType digit = const_mod<IntType, m>::apply(IntType(*first++));
IntType mult = IntType(1) << 32*j;
@@ -303,7 +304,7 @@ void fill_array_int_impl(Iter& first, Iter last, UIntType (&x)[n])
UIntType val = 0;
for(std::size_t k = 0; k < (w+31)/32; ++k) {
if(first == last) {
- throw std::invalid_argument("Not enough elements in call to seed.");
+ boost::throw_exception(std::invalid_argument("Not enough elements in call to seed."));
}
val += static_cast<UIntType>(*first++) << 32*k;
}
@@ -373,12 +374,12 @@ void fill_array_real(Iter& first, Iter last, RealType (&x)[n])
RealType val = RealType(0);
RealType mult = divisor;
for(int k = 0; k < w/32; ++k, ++first) {
- if(first == last) throw std::invalid_argument("Not enough elements in call to seed.");
+ if(first == last) boost::throw_exception(std::invalid_argument("Not enough elements in call to seed."));
val += *first * mult;
mult *= two32;
}
if(mask != 0) {
- if(first == last) throw std::invalid_argument("Not enough elements in call to seed.");
+ if(first == last) boost::throw_exception(std::invalid_argument("Not enough elements in call to seed."));
val += (*first & mask) * mult;
++first;
}
diff --git a/boost/random/detail/uniform_int_float.hpp b/boost/random/detail/uniform_int_float.hpp
index ef209157b6..393c455bcd 100644
--- a/boost/random/detail/uniform_int_float.hpp
+++ b/boost/random/detail/uniform_int_float.hpp
@@ -8,7 +8,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: uniform_int_float.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $
+ * $Id$
*
*/
diff --git a/boost/random/detail/vector_io.hpp b/boost/random/detail/vector_io.hpp
index 0bb261c3ae..24508c210e 100644
--- a/boost/random/detail/vector_io.hpp
+++ b/boost/random/detail/vector_io.hpp
@@ -7,7 +7,7 @@
*
* See http://www.boost.org for most recent version including documentation.
*
- * $Id: vector_io.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
*/
#ifndef BOOST_RANDOM_DETAIL_VECTOR_IO_HPP