From 896f2a7654ffbc1b98f75663deeaccb22227f36e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 12 Jan 2010 18:51:40 +0000 Subject: [PATCH 01/19] Disable warnings when defining INT#_C macros for gcc. [SVN r58948] --- include/boost/cstdint.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 47e6a16..9f5e071 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -390,6 +390,16 @@ INT#_C macros if they're not already defined (John Maddock). # define UINTMAX_C(value) value##ui64 # else +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// From 6293af825a90a986dce1689d2ed8c6524894b2d2 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 25 Jan 2010 10:55:50 +0000 Subject: [PATCH 02/19] Commit alternative warning suppression code. [SVN r59264] --- include/boost/cstdint.hpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 9f5e071..ac8c834 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -390,16 +390,6 @@ INT#_C macros if they're not already defined (John Maddock). # define UINTMAX_C(value) value##ui64 # else -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. - -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif - // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// @@ -431,7 +421,7 @@ INT#_C macros if they're not already defined (John Maddock). # if defined(BOOST_HAS_LONG_LONG) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) -# if defined(__hpux) +# if defined(__hpux) || defined(__APPLE__) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL From 2f13159023cf2ddb00e4a55b4413d45a6aaf505f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 2 Feb 2010 18:35:33 +0000 Subject: [PATCH 03/19] Change code to check individually for the INT#_C macros before defining them - this correctly handles cases where they are partially defined by other other headers (for example ICU). Also declare this a gcc system header - seems to be the only way to really suppress the warnings - fixes #3889. [SVN r59430] --- include/boost/cstdint.hpp | 45 ++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ac8c834..ee55e69 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -366,62 +366,91 @@ INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ + (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) +// +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif + #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // // Borland/Intel/Microsoft compilers have width specific suffixes: // +#ifndef INT8_C # define INT8_C(value) value##i8 +#endif +#ifndef INT16_C # define INT16_C(value) value##i16 +#endif +#ifndef INT32_C # define INT32_C(value) value##i32 +#endif +#ifndef INT64_C # define INT64_C(value) value##i64 +#endif # ifdef __BORLANDC__ // Borland bug: appending ui8 makes the type a signed char # define UINT8_C(value) static_cast(value##u) # else # define UINT8_C(value) value##ui8 # endif +#ifndef UINT16_C # define UINT16_C(value) value##ui16 +#endif +#ifndef UINT32_C # define UINT32_C(value) value##ui32 +#endif +#ifndef UINT64_C # define UINT64_C(value) value##ui64 +#endif +#ifndef INTMAX_C # define INTMAX_C(value) value##i64 # define UINTMAX_C(value) value##ui64 +#endif # else // do it the old fashioned way: // 8-bit types ------------------------------------------------------------// -# if UCHAR_MAX == 0xff +# if (UCHAR_MAX == 0xff) && !defined(INT8_C) # define INT8_C(value) static_cast(value) # define UINT8_C(value) static_cast(value##u) # endif // 16-bit types -----------------------------------------------------------// -# if USHRT_MAX == 0xffff +# if (USHRT_MAX == 0xffff) && !defined(INT16_C) # define INT16_C(value) static_cast(value) # define UINT16_C(value) static_cast(value##u) # endif // 32-bit types -----------------------------------------------------------// - -# if UINT_MAX == 0xffffffff +#ifndef INT32_C +# if (UINT_MAX == 0xffffffff) # define INT32_C(value) value # define UINT32_C(value) value##u # elif ULONG_MAX == 0xffffffff # define INT32_C(value) value##L # define UINT32_C(value) value##uL # endif +#endif // 64-bit types + intmax_t and uintmax_t ----------------------------------// - +#ifndef INT64_C # if defined(BOOST_HAS_LONG_LONG) && \ (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) -# if defined(__hpux) || defined(__APPLE__) +# if defined(__hpux) // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions # define INT64_C(value) value##LL # define UINT64_C(value) value##uLL @@ -462,7 +491,7 @@ INT#_C macros if they're not already defined (John Maddock). # define INTMAX_C(value) INT64_C(value) # define UINTMAX_C(value) UINT64_C(value) # endif - +#endif # endif // Borland/Microsoft specific width suffixes #endif // INT#_C macros. From a5356bb2540bc2e19d2b2db4b391978b9cc026e1 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 4 Feb 2010 11:15:54 +0000 Subject: [PATCH 04/19] Change integer code to still work when BOOST_HAS_MS_INT64 is defined but BOOST_HAS_LONG_LONG is not. Update VC++ config to define BOOST_HAS_LONG_LONG for MSVC-8 in ANSI mode. Fixes #3657. [SVN r59468] --- include/boost/integer.hpp | 4 ++++ include/boost/integer_fwd.hpp | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index 3393c81..fc0b398 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -57,6 +57,8 @@ namespace boost // no specializations for 0 and 5: requests for a type > long are in error #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; +#elif defined(BOOST_HAS_MS_INT64) + template<> struct int_least_helper<1> { typedef __int64 least; }; #endif template<> struct int_least_helper<2> { typedef long least; }; template<> struct int_least_helper<3> { typedef int least; }; @@ -64,6 +66,8 @@ namespace boost template<> struct int_least_helper<5> { typedef signed char least; }; #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; +#elif defined(BOOST_HAS_MS_INT64) + template<> struct int_least_helper<6> { typedef unsigned __int64 least; }; #endif template<> struct int_least_helper<7> { typedef unsigned long least; }; template<> struct int_least_helper<8> { typedef unsigned int least; }; diff --git a/include/boost/integer_fwd.hpp b/include/boost/integer_fwd.hpp index 01b0a08..e6045ca 100644 --- a/include/boost/integer_fwd.hpp +++ b/include/boost/integer_fwd.hpp @@ -77,12 +77,18 @@ template < > template < > class integer_traits< unsigned long >; -#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG) template < > - class integer_traits< ::boost::long_long_type>; +class integer_traits< ::boost::long_long_type>; template < > - class integer_traits< ::boost::ulong_long_type >; +class integer_traits< ::boost::ulong_long_type >; +#elif !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_MS_INT64) +template < > +class integer_traits<__int64>; + +template < > +class integer_traits; #endif From 8a1d11f36913f04c72b5817cb92519927ebec0d8 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 14 Feb 2010 13:09:24 +0000 Subject: [PATCH 05/19] Fix link to integer header. [SVN r59676] --- doc/integer.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/integer.qbk b/doc/integer.qbk index c5d6e70..8b505dc 100644 --- a/doc/integer.qbk +++ b/doc/integer.qbk @@ -43,7 +43,7 @@ compile-time value; and computing min and max of constant expressions. ] [ [[link boost_integer.integer Integer Type Selection].] - [[^[@../../../../boost/hpp ]]] + [[^[@../../../../boost/integer.hpp ]]] [Templates for integer type selection based on properties such as maximum value or number of bits: Use to select the type of an integer when some property such as maximum value or number of bits is known. Useful for generic programming. ] From 84c8a5208597241e8d38d812b5200cc18648301f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 5 Apr 2010 07:27:25 +0000 Subject: [PATCH 06/19] Rebuild the integer documentation. [SVN r61058] --- doc/html/boost_integer/cstdint.html | 60 +++--- doc/html/boost_integer/history.html | 20 +- doc/html/boost_integer/integer.html | 304 ++++++++++++++-------------- doc/html/boost_integer/log2.html | 20 +- doc/html/boost_integer/mask.html | 225 ++++++++++---------- doc/html/boost_integer/minmax.html | 16 +- doc/html/boost_integer/traits.html | 86 ++++---- doc/html/index.html | 182 ++++++++--------- 8 files changed, 459 insertions(+), 454 deletions(-) diff --git a/doc/html/boost_integer/cstdint.html b/doc/html/boost_integer/cstdint.html index d233f43..b709cfc 100644 --- a/doc/html/boost_integer/cstdint.html +++ b/doc/html/boost_integer/cstdint.html @@ -3,7 +3,7 @@ Standard Integer Types - + @@ -22,7 +22,7 @@
PrevUpHomeNext
-
+ -
+
@@ -62,7 +62,7 @@ a test program.

-
+
@@ -82,7 +82,7 @@ conventions rather than C++ Standard Library header naming conventions.

-
+
@@ -99,7 +99,7 @@ Use the respective names in namespace boost instead.

-
+

Exact-width integer types @@ -119,7 +119,7 @@ The absence of int64_t and uint64_t is indicated by the macro BOOST_NO_INT64_T.

-
+

Minimum-width integer types @@ -137,27 +137,27 @@

The following minimum-width integer types are provided for all platforms:

-
    -
  • int_least8_t
  • -
  • int_least16_t
  • -
  • int_least32_t
  • -
  • uint_least8_t
  • -
  • uint_least16_t
  • -
  • uint_least32_t
  • +
      +
    • int_least8_t
    • +
    • int_least16_t
    • +
    • int_least32_t
    • +
    • uint_least8_t
    • +
    • uint_least16_t
    • +
    • uint_least32_t

    The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

    -
      -
    • int_least64_t
    • -
    • uint_least64_t
    • +
        +
      • int_least64_t
      • +
      • uint_least64_t

      All other minimum-width integer types are optional.

    -
    +

    Fastest minimum-width integer types @@ -175,27 +175,27 @@

    The following fastest minimum-width integer types are provided for all platforms:

    -
      -
    • int_fast8_t
    • -
    • int_fast16_t
    • -
    • int_fast32_t
    • -
    • uint_fast8_t
    • -
    • uint_fast16_t
    • -
    • uint_fast32_t
    • +
        +
      • int_fast8_t
      • +
      • int_fast16_t
      • +
      • int_fast32_t
      • +
      • uint_fast8_t
      • +
      • uint_fast16_t
      • +
      • uint_fast32_t

      The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

      -
        -
      • int_fast64_t
      • -
      • uint_fast64_t
      • +
          +
        • int_fast64_t
        • +
        • uint_fast64_t

        All other fastest minimum-width integer types are optional.

      -
      +

      Greatest-width integer types @@ -212,7 +212,7 @@ These types are provided for all platforms.

      -
      +

      Integer Constant Macros diff --git a/doc/html/boost_integer/history.html b/doc/html/boost_integer/history.html index b92217e..3d6cb39 100644 --- a/doc/html/boost_integer/history.html +++ b/doc/html/boost_integer/history.html @@ -3,7 +3,7 @@ History - + @@ -21,19 +21,19 @@
      PrevUpHome
      -
      +
      - + 1.42.0
      -
        -
      • +
          +
        • Reverted Trunk to release branch state (i.e. a "known good state").
        • -
        • +
        • Fixed issues: 653, 3084, 3177, @@ -42,12 +42,12 @@ 3657, 2134.
        • -
        • +
        • Added long long support to boost::static_log2, boost::static_signed_min, boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, when available.
        • -
        • +
        • The argument type and the result type of boost::static_signed_min etc are now typedef'd. Formerly, they were hardcoded as unsigned long and int respectively. Please, use the provided @@ -55,10 +55,10 @@
        - + 1.32.0
        -
        • +
          • The argument type and the result type of boost::static_log2 are now typedef'd. Formerly, they were hardcoded as unsigned long and int respectively. Please, use the provided typedefs diff --git a/doc/html/boost_integer/integer.html b/doc/html/boost_integer/integer.html index 8c022fa..4078a26 100644 --- a/doc/html/boost_integer/integer.html +++ b/doc/html/boost_integer/integer.html @@ -3,7 +3,7 @@ Integer Type Selection - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -44,7 +44,7 @@ characteristics such as number of bits or maximum value. This facility is particularly useful for solving generic programming problems.

            -
            +
            @@ -102,7 +102,7 @@ } // namespace boost
            -
            +

            Easiest-to-Manipulate Types @@ -126,7 +126,7 @@ the input type.

            -
            +
            @@ -139,7 +139,7 @@ fast. The following table describes each template's criteria.

            -

            Table 1. Criteria for the Sized Type Class Templates

            +

            Table 1. Criteria for the Sized Type Class Templates

            @@ -147,199 +147,201 @@ +

            + Class Template +

            + +

            + Template Parameter Mapping +

            + +

            + boost::int_t<N>::least +

            + +

            + The smallest, built-in, signed integral type with at least N + bits, including the sign bit. The parameter should be a positive + number. A compile-time error results if the parameter is larger + than the number of bits in the largest integer type. +

            + +

            + boost::int_t<N>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type with + at least N bits, including the sign bit. The + parameter should be a positive number. A compile-time error results + if the parameter is larger than the number of bits in the largest + integer type. +

            + +

            + boost::int_t<N>::exact +

            + +

            + A built-in, signed integral type with exactly N + bits, including the sign bit. The parameter should be a positive + number. Note that the member exact is defined + only if there exists a type with + exactly N bits. +

            + +

            + boost::uint_t<N>::least +

            + +

            + The smallest, built-in, unsigned integral type with at least N + bits. The parameter should be a positive number. A compile-time + error results if the parameter is larger than the number of bits + in the largest integer type. +

            + +

            + boost::uint_t<N>::fast +

            + +

            + The easiest-to-manipulate, built-in, unsigned integral type with + at least N bits. The parameter should be a + positive number. A compile-time error results if the parameter + is larger than the number of bits in the largest integer type. +

            + +

            + boost::uint_t<N>::exact +

            + +

            + A built-in, unsigned integral type with exactly N + bits. The parameter should be a positive number. A compile-time + error results if the parameter is larger than the number of bits + in the largest integer type. Note that the member exact + is defined only if there exists + a type with exactly N bits. +

            + +

            + boost::int_max_value_t<V>::last +

            + +

            + The smallest, built-in, signed integral type that can hold all + the values in the inclusive range 0 - V. The + parameter should be a positive number. +

            + +

            + boost::int_max_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type that + can hold all the values in the inclusive range 0 - V. + The parameter should be a positive number. +

            + +

            + boost::int_min_value_t<V>::least +

            + +

            + The smallest, built-in, signed integral type that can hold all + the values in the inclusive range V - 0. The + parameter should be a negative number. +

            + +

            + boost::int_min_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, signed integral type that + can hold all the values in the inclusive range V - 0. + The parameter should be a negative number. +

            + +

            + boost::uint_value_t<V>::least +

            + +

            + The smallest, built-in, unsigned integral type that can hold all + positive values up to and including V. The + parameter should be a positive number. +

            + +

            + boost::uint_value_t<V>::fast +

            + +

            + The easiest-to-manipulate, built-in, unsigned integral type that + can hold all positive values up to and including V. + The parameter should be a positive number. +

            +
            -

            - Class Template -

            -
            -

            - Template Parameter Mapping -

            -
            -

            - boost::int_t<N>::least -

            -
            -

            - The smallest, built-in, signed integral type with at least N - bits, including the sign bit. The parameter should be a positive number. - A compile-time error results if the parameter is larger than the number - of bits in the largest integer type. -

            -
            -

            - boost::int_t<N>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type with at least - N bits, including the sign bit. The parameter - should be a positive number. A compile-time error results if the parameter - is larger than the number of bits in the largest integer type. -

            -
            -

            - boost::int_t<N>::exact -

            -
            -

            - A built-in, signed integral type with exactly N - bits, including the sign bit. The parameter should be a positive number. - Note that the member exact is defined only if there exists a type with exactly N - bits. -

            -
            -

            - boost::uint_t<N>::least -

            -
            -

            - The smallest, built-in, unsigned integral type with at least N - bits. The parameter should be a positive number. A compile-time error - results if the parameter is larger than the number of bits in the largest - integer type. -

            -
            -

            - boost::uint_t<N>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, unsigned integral type with at - least N bits. The parameter should be a positive - number. A compile-time error results if the parameter is larger than - the number of bits in the largest integer type. -

            -
            -

            - boost::uint_t<N>::exact -

            -
            -

            - A built-in, unsigned integral type with exactly N - bits. The parameter should be a positive number. A compile-time error - results if the parameter is larger than the number of bits in the largest - integer type. Note that the member exact is defined - only if there exists a type with exactly - N bits. -

            -
            -

            - boost::int_max_value_t<V>::last -

            -
            -

            - The smallest, built-in, signed integral type that can hold all the - values in the inclusive range 0 - V. The parameter - should be a positive number. -

            -
            -

            - boost::int_max_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type that can - hold all the values in the inclusive range 0 - V. - The parameter should be a positive number. -

            -
            -

            - boost::int_min_value_t<V>::least -

            -
            -

            - The smallest, built-in, signed integral type that can hold all the - values in the inclusive range V - 0. The parameter - should be a negative number. -

            -
            -

            - boost::int_min_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, signed integral type that can - hold all the values in the inclusive range V - 0. - The parameter should be a negative number. -

            -
            -

            - boost::uint_value_t<V>::least -

            -
            -

            - The smallest, built-in, unsigned integral type that can hold all positive - values up to and including V. The parameter should - be a positive number. -

            -
            -

            - boost::uint_value_t<V>::fast -

            -
            -

            - The easiest-to-manipulate, built-in, unsigned integral type that can - hold all positive values up to and including V. - The parameter should be a positive number. -

            -

            -
            +
            @@ -361,7 +363,7 @@ }
            -
            +

            Demonstration Program @@ -372,27 +374,27 @@ of the sized type class templates.

            -
            +

            The rationale for the design of the templates in this header includes:

            -
              -
            • +
                +
              • Avoid recursion because of concern about C++'s limited guaranteed recursion depth (17).
              • -
              • +
              • Avoid macros on general principles.
              • -
              • +
              • Try to keep the design as simple as possible.
            -
            +
            @@ -401,7 +403,7 @@ to use the types supplied in <boost/cstdint.hpp>.

            -
            +
            diff --git a/doc/html/boost_integer/log2.html b/doc/html/boost_integer/log2.html index cb234bd..44669ae 100644 --- a/doc/html/boost_integer/log2.html +++ b/doc/html/boost_integer/log2.html @@ -3,7 +3,7 @@ Compile Time log2 Calculation - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -39,7 +39,7 @@ determines the position of the highest bit in a given value. This facility is useful for solving generic programming problems.

            -
            +
            @@ -66,7 +66,7 @@ } // namespace boost
            -
            +
            @@ -85,18 +85,18 @@

            Note:

            -
              -
            • +
                +
              • static_log2_argument_type is an unsigned integer type (C++ standard, 3.9.1p3).
              • -
              • +
              • static_log2_result_type is an integer type (C++ standard, 3.9.1p7).
            -
            +

            Demonstration Program @@ -107,7 +107,7 @@ of the binary logarithm class template.

            -
            +
            @@ -120,7 +120,7 @@ to be available statically (i.e. at compile-time).

            -
            +
            diff --git a/doc/html/boost_integer/mask.html b/doc/html/boost_integer/mask.html index f7bfc12..ff9972f 100644 --- a/doc/html/boost_integer/mask.html +++ b/doc/html/boost_integer/mask.html @@ -3,7 +3,7 @@ Integer Masks - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -41,7 +41,7 @@
            Rationale
            Credits
            -
            +
            @@ -52,7 +52,7 @@ type selection templates header.

            -
            +
            @@ -90,7 +90,7 @@ } // namespace boost
            -
            +

            Single Bit-Mask Class Template @@ -105,7 +105,7 @@ of high_bit_mask_t.

            -

            Table 2. Members of the `boost::high_bit_mask_t` Class Template

            +

            Table 2. Members of the `boost::high_bit_mask_t` Class Template

            @@ -113,84 +113,85 @@ +

            + Member +

            + +

            + Meaning +

            + +

            + least +

            + +

            + The smallest, unsigned, built-in type that supports the given bit + position. +

            + +

            + fast +

            + +

            + The easiest-to-manipulate analog of least. +

            + +

            + high_bit +

            + +

            + A least constant of the value 2Bit. +

            + +

            + high_bit_fast +

            + +

            + A fast analog of high_bit. +

            + +

            + bit_position +

            + +

            + The value of the template parameter, in case its needed from a + renamed instantiation of the class template. +

            +
            -

            - Member -

            -
            -

            - Meaning -

            -
            -

            - least -

            -
            -

            - The smallest, unsigned, built-in type that supports the given bit position. -

            -
            -

            - fast -

            -
            -

            - The easiest-to-manipulate analog of least. -

            -
            -

            - high_bit -

            -
            -

            - A least constant of the value 2Bit. -

            -
            -

            - high_bit_fast -

            -
            -

            - A fast analog of high_bit. -

            -
            -

            - bit_position -

            -
            -

            - The value of the template parameter, in case its needed from a renamed - instantiation of the class template. -

            -

            -
            +

            Group Bit-Mask Class Template @@ -204,7 +205,7 @@ type. The following table describes the members of low_bits_mask_t.

            -

            Table 3. Members of the [^boost::low_bits_mask_t] Class Template

            +

            Table 3. Members of the [^boost::low_bits_mask_t] Class Template

            @@ -212,84 +213,86 @@ +

            + Member +

            + +

            + Meaning +

            + +

            + least +

            + +

            + The smallest, unsigned built-in type that supports the given bit + count. +

            + +

            + fast +

            + +

            + The easiest-to-manipulate analog of least. +

            + +

            + sig_bits +

            + +

            + A least constant of the desired bit-masking + value. +

            + +

            + sig_bits_fast +

            + +

            + A fast analog of sig_bits. +

            + +

            + bit_count +

            + +

            + The value of the template parameter, in case its needed from a + renamed instantiation of the class template. +

            +
            -

            - Member -

            -
            -

            - Meaning -

            -
            -

            - least -

            -
            -

            - The smallest, unsigned built-in type that supports the given bit count. -

            -
            -

            - fast -

            -
            -

            - The easiest-to-manipulate analog of least. -

            -
            -

            - sig_bits -

            -
            -

            - A least constant of the desired bit-masking value. -

            -
            -

            - sig_bits_fast -

            -
            -

            - A fast analog of sig_bits. -

            -
            -

            - bit_count -

            -
            -

            - The value of the template parameter, in case its needed from a renamed - instantiation of the class template. -

            -

            -
            +

            Implementation Notes @@ -301,7 +304,7 @@ bit counts.

            -
            +
            @@ -325,7 +328,7 @@ }
            -
            +

            Demonstration Program @@ -336,7 +339,7 @@ of the bit mask class templates.

            -
            +
            @@ -348,7 +351,7 @@ bits. This prevents contamination of values by the higher, unused bits.

            -
            +
            diff --git a/doc/html/boost_integer/minmax.html b/doc/html/boost_integer/minmax.html index 7b1fea0..7e8d396 100644 --- a/doc/html/boost_integer/minmax.html +++ b/doc/html/boost_integer/minmax.html @@ -3,7 +3,7 @@ Compile time min/max calculation - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            +
            @@ -40,7 +40,7 @@ provide a compile-time evaluation of the minimum or maximum of two integers. These facilities are useful for generic programming problems.

            -
            +
            @@ -65,7 +65,7 @@ }
            -
            +
            @@ -77,7 +77,7 @@ which is set to the respective minimum or maximum of the template's parameters.

            -
            +
            @@ -112,7 +112,7 @@ }
            -
            +

            Demonstration Program @@ -123,7 +123,7 @@ extrema class templates.

            -
            +
            @@ -133,7 +133,7 @@ another class template.

            -
            +
            diff --git a/doc/html/boost_integer/traits.html b/doc/html/boost_integer/traits.html index 7c197d7..d60fef3 100644 --- a/doc/html/boost_integer/traits.html +++ b/doc/html/boost_integer/traits.html @@ -3,7 +3,7 @@ Integer Traits - + @@ -22,7 +22,7 @@
            PrevUpHomeNext
            -
            + -
            +
            @@ -62,7 +62,7 @@ The template class integer_traits addresses this problem.

            -
            +
            @@ -82,7 +82,7 @@ }
            -
            +
            @@ -102,71 +102,71 @@ -

            - member -

            +

            + member +

            -

            - type -

            +

            + type +

            -

            - value -

            +

            + value +

            -

            - is_integral -

            +

            + is_integral +

            -

            - bool -

            +

            + bool +

            -

            - true -

            +

            + true +

            -

            - const_min -

            +

            + const_min +

            -

            - T -

            +

            + T +

            -

            - equivalent to std::numeric_limits<T>::min() -

            +

            + equivalent to std::numeric_limits<T>::min() +

            -

            - const_max -

            +

            + const_max +

            -

            - T -

            +

            + T +

            -

            - equivalent to std::numeric_limits<T>::max() -

            +

            + equivalent to std::numeric_limits<T>::max() +

            @@ -179,7 +179,7 @@ unless boost::integer_traits is also specialized.

            -
            +
            @@ -188,7 +188,7 @@ exercises the integer_traits class.

            -
            +
            diff --git a/doc/html/index.html b/doc/html/index.html index 97bf531..1e4d3da 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Boost.Integer - + @@ -18,7 +18,7 @@
            Next
            -
            +

            @@ -39,8 +39,8 @@

            -
            -

            +

            +

            Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

            @@ -61,7 +61,7 @@
            History
            -
            +
            @@ -84,152 +84,152 @@ -

            - Component -

            +

            + Component +

            -

            - Header -

            +

            + Header +

            -

            - Purpose -

            +

            + Purpose +

            -

            - Forward Declarations. -

            +

            + Forward Declarations. +

            -

            - <boost/integer_fwd.hpp> -

            +

            + <boost/integer_fwd.hpp> +

            -

            - Forward declarations of classes and class templates - for use when - just the name of a class is needed. -

            +

            + Forward declarations of classes and class templates - for use when + just the name of a class is needed. +

            -

            - Standard Integer Types. -

            +

            + Standard Integer Types. +

            -

            - <boost/cstdint.hpp> -

            +

            + <boost/cstdint.hpp> +

            -

            - Provides typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. This - implementation may #include the compiler supplied <stdint.h>, - if present. -

            +

            + Provides typedef's based on the 1999 C Standard header <stdint.h>, wrapped in namespace boost. + This implementation may #include the compiler supplied <stdint.h>, if present. +

            -

            - Integer Traits. -

            +

            + Integer Traits. +

            -

            - <boost/integer_traits.hpp> -

            +

            + <boost/integer_traits.hpp> +

            -

            - Class template boost::integer_traits, derives from - std::numeric_limits and adds const_min - and const_max members. -

            +

            + Class template boost::integer_traits, derives + from std::numeric_limits and adds const_min + and const_max members. +

            -

            - Integer Type Selection. -

            +

            + Integer Type Selection. +

            -

            - <boost/integer.hpp> -

            +

            + <boost/integer.hpp> +

            -

            - Templates for integer type selection based on properties such as maximum - value or number of bits: Use to select the type of an integer when - some property such as maximum value or number of bits is known. Useful - for generic programming. -

            +

            + Templates for integer type selection based on properties such as + maximum value or number of bits: Use to select the type of an integer + when some property such as maximum value or number of bits is known. + Useful for generic programming. +

            -

            - Integer Masks. -

            +

            + Integer Masks. +

            -

            - <boost/integer/integer_mask.hpp> -

            +

            + <boost/integer/integer_mask.hpp> +

            -

            - Templates for the selection of integer masks, single or lowest group, - based on the number of bits: Use to select a particular mask when the - bit position(s) are based on a compile-time variable. Useful for generic - programming. -

            +

            + Templates for the selection of integer masks, single or lowest group, + based on the number of bits: Use to select a particular mask when + the bit position(s) are based on a compile-time variable. Useful + for generic programming. +

            -

            - Compile time log2 Calculation. -

            +

            + Compile time log2 Calculation. +

            -

            - <boost/integer/static_log2.hpp> -

            +

            + <boost/integer/static_log2.hpp> +

            -

            - Template for finding the highest power of two in a number: Use to find - the bit-size/range based on a maximum value. Useful for generic programming. -

            +

            + Template for finding the highest power of two in a number: Use to + find the bit-size/range based on a maximum value. Useful for generic + programming. +

            -

            - Compile time min/max calculation. -

            +

            + Compile time min/max calculation. +

            -

            - <boost/integer/static_min_max.hpp> -

            +

            + <boost/integer/static_min_max.hpp> +

            -

            - Templates for finding the extrema of two numbers: Use to find a bound - based on a minimum or maximum value. Useful for generic programming. -

            +

            + Templates for finding the extrema of two numbers: Use to find a bound + based on a minimum or maximum value. Useful for generic programming. +

            @@ -237,7 +237,7 @@
            - +

            Last revised: December 11, 2009 at 17:54:58 GMT

            Last revised: April 05, 2010 at 07:20:03 GMT


            From cd98c4a2570604f35fdab1ed438309bbc1006f02 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Thu, 10 Jun 2010 19:49:34 +0000 Subject: [PATCH 07/19] Add a 64 bit specialization of low_bits_mask_t. Fixes #4332 [SVN r62756] --- include/boost/integer/integer_mask.hpp | 24 +++++++ include/boost/integer_fwd.hpp | 16 ----- test/integer_mask_test.cpp | 92 ++++++++++++++++++++++++-- 3 files changed, 110 insertions(+), 22 deletions(-) diff --git a/include/boost/integer/integer_mask.hpp b/include/boost/integer/integer_mask.hpp index 8c4e1bb..2acf7f7 100644 --- a/include/boost/integer/integer_mask.hpp +++ b/include/boost/integer/integer_mask.hpp @@ -20,6 +20,17 @@ #include // for std::numeric_limits +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer/integer_mask.hpp:93:35: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { @@ -89,6 +100,19 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int ); BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); #endif +#if defined(BOOST_HAS_LONG_LONG) + #if ((defined(ULLONG_MAX) && (ULLONG_MAX > ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX > ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX > ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX > ULONG_MAX))) + BOOST_LOW_BITS_MASK_SPECIALIZE( boost::ulong_long_type ); + #endif +#elif defined(BOOST_HAS_MS_INT64) + #if 18446744073709551615ui64 > ULONG_MAX + BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 ); + #endif +#endif + #ifdef BOOST_MSVC #pragma warning(pop) #endif diff --git a/include/boost/integer_fwd.hpp b/include/boost/integer_fwd.hpp index e6045ca..20eff2b 100644 --- a/include/boost/integer_fwd.hpp +++ b/include/boost/integer_fwd.hpp @@ -136,22 +136,6 @@ template < std::size_t Bits > template < > struct low_bits_mask_t< ::std::numeric_limits::digits >; -#if USHRT_MAX > UCHAR_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if UINT_MAX > USHRT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if ULONG_MAX > UINT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - - // From ------------------------------------// template diff --git a/test/integer_mask_test.cpp b/test/integer_mask_test.cpp index 4c1bb4b..a66ab8d 100644 --- a/test/integer_mask_test.cpp +++ b/test/integer_mask_test.cpp @@ -21,25 +21,35 @@ #pragma warning(disable:4127) // conditional expression is constant #endif +#if defined(BOOST_HAS_LONG_LONG) +#define MASK_TYPE ::boost::ulong_long_type +#elif defined(BOOST_HAS_MS_INT64) +#define MASK_TYPE unsigned __int64 +#else +#define MASK_TYPE unsigned long +#endif + +#define ONE (static_cast(1)) + #define PRIVATE_HIGH_BIT_SLOW_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ - (v) >::high_bit == (1ul << (v)) ); + (v) >::high_bit == (ONE << (v)) ); #define PRIVATE_HIGH_BIT_FAST_TEST(v) BOOST_TEST( ::boost::high_bit_mask_t< \ - (v) >::high_bit_fast == (1ul << (v)) ); + (v) >::high_bit_fast == (ONE << (v)) ); #define PRIVATE_HIGH_BIT_TEST(v) do { PRIVATE_HIGH_BIT_SLOW_TEST(v); \ PRIVATE_HIGH_BIT_FAST_TEST(v); } while (false) #define PRIVATE_LOW_BITS_SLOW_TEST(v) \ do{ \ - unsigned long mask = 0;\ + MASK_TYPE mask = 0;\ if(v > 0)\ - { mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\ + { mask = ((ONE << (v-1)) - 1); mask <<= 1; mask |= 1; }\ BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits == mask); \ }while(false); #define PRIVATE_LOW_BITS_FAST_TEST(v) \ do{ \ - unsigned long mask = 0;\ + MASK_TYPE mask = 0;\ if(v > 0)\ - { mask = ((1ul << (v-1)) - 1); mask <<= 1; mask |= 1; }\ + { mask = ((ONE << (v-1)) - 1); mask <<= 1; mask |= 1; }\ BOOST_TEST( ::boost::low_bits_mask_t< (v) >::sig_bits_fast == mask);\ }while(false); #define PRIVATE_LOW_BITS_TEST(v) do { PRIVATE_LOW_BITS_SLOW_TEST(v); \ @@ -52,6 +62,41 @@ int main( int, char*[] ) using std::endl; cout << "Doing high_bit_mask_t tests." << endl; + +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64) + PRIVATE_HIGH_BIT_TEST( 63 ); + PRIVATE_HIGH_BIT_TEST( 62 ); + PRIVATE_HIGH_BIT_TEST( 61 ); + PRIVATE_HIGH_BIT_TEST( 60 ); + PRIVATE_HIGH_BIT_TEST( 59 ); + PRIVATE_HIGH_BIT_TEST( 58 ); + PRIVATE_HIGH_BIT_TEST( 57 ); + PRIVATE_HIGH_BIT_TEST( 56 ); + PRIVATE_HIGH_BIT_TEST( 55 ); + PRIVATE_HIGH_BIT_TEST( 54 ); + PRIVATE_HIGH_BIT_TEST( 53 ); + PRIVATE_HIGH_BIT_TEST( 52 ); + PRIVATE_HIGH_BIT_TEST( 51 ); + PRIVATE_HIGH_BIT_TEST( 50 ); + PRIVATE_HIGH_BIT_TEST( 49 ); + PRIVATE_HIGH_BIT_TEST( 48 ); + PRIVATE_HIGH_BIT_TEST( 47 ); + PRIVATE_HIGH_BIT_TEST( 46 ); + PRIVATE_HIGH_BIT_TEST( 45 ); + PRIVATE_HIGH_BIT_TEST( 44 ); + PRIVATE_HIGH_BIT_TEST( 43 ); + PRIVATE_HIGH_BIT_TEST( 42 ); + PRIVATE_HIGH_BIT_TEST( 41 ); + PRIVATE_HIGH_BIT_TEST( 40 ); + PRIVATE_HIGH_BIT_TEST( 39 ); + PRIVATE_HIGH_BIT_TEST( 38 ); + PRIVATE_HIGH_BIT_TEST( 37 ); + PRIVATE_HIGH_BIT_TEST( 36 ); + PRIVATE_HIGH_BIT_TEST( 35 ); + PRIVATE_HIGH_BIT_TEST( 34 ); + PRIVATE_HIGH_BIT_TEST( 33 ); + PRIVATE_HIGH_BIT_TEST( 32 ); +#endif PRIVATE_HIGH_BIT_TEST( 31 ); PRIVATE_HIGH_BIT_TEST( 30 ); PRIVATE_HIGH_BIT_TEST( 29 ); @@ -86,6 +131,41 @@ int main( int, char*[] ) PRIVATE_HIGH_BIT_TEST( 0 ); cout << "Doing low_bits_mask_t tests." << endl; + +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64) + PRIVATE_LOW_BITS_TEST( 64 ); + PRIVATE_LOW_BITS_TEST( 63 ); + PRIVATE_LOW_BITS_TEST( 62 ); + PRIVATE_LOW_BITS_TEST( 61 ); + PRIVATE_LOW_BITS_TEST( 60 ); + PRIVATE_LOW_BITS_TEST( 59 ); + PRIVATE_LOW_BITS_TEST( 58 ); + PRIVATE_LOW_BITS_TEST( 57 ); + PRIVATE_LOW_BITS_TEST( 56 ); + PRIVATE_LOW_BITS_TEST( 55 ); + PRIVATE_LOW_BITS_TEST( 54 ); + PRIVATE_LOW_BITS_TEST( 53 ); + PRIVATE_LOW_BITS_TEST( 52 ); + PRIVATE_LOW_BITS_TEST( 51 ); + PRIVATE_LOW_BITS_TEST( 50 ); + PRIVATE_LOW_BITS_TEST( 49 ); + PRIVATE_LOW_BITS_TEST( 48 ); + PRIVATE_LOW_BITS_TEST( 47 ); + PRIVATE_LOW_BITS_TEST( 46 ); + PRIVATE_LOW_BITS_TEST( 45 ); + PRIVATE_LOW_BITS_TEST( 44 ); + PRIVATE_LOW_BITS_TEST( 43 ); + PRIVATE_LOW_BITS_TEST( 42 ); + PRIVATE_LOW_BITS_TEST( 41 ); + PRIVATE_LOW_BITS_TEST( 40 ); + PRIVATE_LOW_BITS_TEST( 39 ); + PRIVATE_LOW_BITS_TEST( 38 ); + PRIVATE_LOW_BITS_TEST( 37 ); + PRIVATE_LOW_BITS_TEST( 36 ); + PRIVATE_LOW_BITS_TEST( 35 ); + PRIVATE_LOW_BITS_TEST( 34 ); + PRIVATE_LOW_BITS_TEST( 33 ); +#endif PRIVATE_LOW_BITS_TEST( 32 ); PRIVATE_LOW_BITS_TEST( 31 ); PRIVATE_LOW_BITS_TEST( 30 ); From 794fdf9bad50594e9913bc0de0397eb5b616ff0d Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 20 Jun 2010 18:00:48 +0000 Subject: [PATCH 08/19] Update various libraries' documentation build. Mostly to use the images and css files under doc/src instead of doc/html, usually be deleting the settings in order to use the defaults. Also add 'boost.root' to some builds in order to fix links which rely on it. [SVN r63146] --- doc/Jamfile.v2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 18c50ae..de1f8a7 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -26,10 +26,6 @@ boostbook standalone generate.section.toc.level=4 # Path for links to Boost: boost.root=../../../.. - # Path for libraries index: - boost.libraries=../../../../libs/libraries.htm - # Use the main Boost stylesheet: - html.stylesheet=../../../../doc/html/boostbook.css # PDF Options: # TOC Generation: this is needed for FOP-0.9 and later: From 8368cd0a555b2de78d1a3b2636dce2670a580f1f Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 8 Jul 2010 20:50:29 +0000 Subject: [PATCH 09/19] Rebuild integer docs. [SVN r63765] --- doc/html/boost_integer/cstdint.html | 88 ++++++++++++++++++++--------- doc/html/boost_integer/history.html | 60 ++++++++++---------- doc/html/boost_integer/integer.html | 38 ++++++------- doc/html/boost_integer/log2.html | 30 +++++----- doc/html/boost_integer/mask.html | 26 ++++----- doc/html/boost_integer/minmax.html | 20 +++---- doc/html/boost_integer/traits.html | 18 +++--- doc/html/index.html | 16 +++--- 8 files changed, 164 insertions(+), 132 deletions(-) diff --git a/doc/html/boost_integer/cstdint.html b/doc/html/boost_integer/cstdint.html index b709cfc..151ee51 100644 --- a/doc/html/boost_integer/cstdint.html +++ b/doc/html/boost_integer/cstdint.html @@ -2,7 +2,7 @@ Standard Integer Types - + @@ -20,9 +20,9 @@
            -PrevUpHomeNext +PrevUpHomeNext
            -
            + -
            +
            @@ -62,7 +62,7 @@ a test program.

            -
            +
            @@ -82,7 +82,7 @@ conventions rather than C++ Standard Library header naming conventions.

            -
            +
            @@ -99,7 +99,7 @@ Use the respective names in namespace boost instead.

            -
            +

            Exact-width integer types @@ -119,7 +119,7 @@ The absence of int64_t and uint64_t is indicated by the macro BOOST_NO_INT64_T.

            -
            +

            Minimum-width integer types @@ -138,26 +138,42 @@ The following minimum-width integer types are provided for all platforms:

              -
            • int_least8_t
            • -
            • int_least16_t
            • -
            • int_least32_t
            • -
            • uint_least8_t
            • -
            • uint_least16_t
            • -
            • uint_least32_t
            • +
            • + int_least8_t +
            • +
            • + int_least16_t +
            • +
            • + int_least32_t +
            • +
            • + uint_least8_t +
            • +
            • + uint_least16_t +
            • +
            • + uint_least32_t +

            The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

              -
            • int_least64_t
            • -
            • uint_least64_t
            • +
            • + int_least64_t +
            • +
            • + uint_least64_t +

            All other minimum-width integer types are optional.

            -
            +

            Fastest minimum-width integer types @@ -176,26 +192,42 @@ The following fastest minimum-width integer types are provided for all platforms:

              -
            • int_fast8_t
            • -
            • int_fast16_t
            • -
            • int_fast32_t
            • -
            • uint_fast8_t
            • -
            • uint_fast16_t
            • -
            • uint_fast32_t
            • +
            • + int_fast8_t +
            • +
            • + int_fast16_t +
            • +
            • + int_fast32_t +
            • +
            • + uint_fast8_t +
            • +
            • + uint_fast16_t +
            • +
            • + uint_fast32_t +

            The following types are available only if, after including <boost/cstdint.hpp>, the macro BOOST_NO_INT64_T is not defined:

              -
            • int_fast64_t
            • -
            • uint_fast64_t
            • +
            • + int_fast64_t +
            • +
            • + uint_fast64_t +

            All other fastest minimum-width integer types are optional.

            -
            +

            Greatest-width integer types @@ -212,7 +244,7 @@ These types are provided for all platforms.

            -
            +

            Integer Constant Macros @@ -251,7 +283,7 @@
            -PrevUpHomeNext +PrevUpHomeNext
            diff --git a/doc/html/boost_integer/history.html b/doc/html/boost_integer/history.html index 3d6cb39..e858c84 100644 --- a/doc/html/boost_integer/history.html +++ b/doc/html/boost_integer/history.html @@ -2,7 +2,7 @@ History - + @@ -19,51 +19,51 @@
            -PrevUpHome +PrevUpHome
            -
            +
            - + 1.42.0
            • - Reverted Trunk to release branch state (i.e. a "known good state"). -
            • + Reverted Trunk to release branch state (i.e. a "known good state"). +
            • - Fixed issues: 653, - 3084, - 3177, - 3180, - 3568, - 3657, - 2134. -
            • + Fixed issues: 653, + 3084, + 3177, + 3180, + 3568, + 3657, + 2134. +
            • - Added long long support to boost::static_log2, boost::static_signed_min, - boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, - when available. -
            • + Added long long support to boost::static_log2, boost::static_signed_min, + boost::static_signed_max, boost::static_unsigned_minboost::static_unsigned_max, + when available. +
            • - The argument type and the result type of boost::static_signed_min - etc are now typedef'd. Formerly, they were hardcoded as unsigned - long and int respectively. Please, use the provided - typedefs in new code (and update old code as soon as possible). -
            • + The argument type and the result type of boost::static_signed_min + etc are now typedef'd. Formerly, they were hardcoded as unsigned + long and int respectively. Please, use the + provided typedefs in new code (and update old code as soon as possible). +
            - + 1.32.0
            • - The argument type and the result type of boost::static_log2 - are now typedef'd. Formerly, they were hardcoded as unsigned long - and int respectively. Please, use the provided typedefs - in new code (and update old code as soon as possible). -
            + The argument type and the result type of boost::static_log2 + are now typedef'd. Formerly, they were hardcoded as unsigned long + and int respectively. Please, use the provided typedefs + in new code (and update old code as soon as possible). +

        @@ -76,7 +76,7 @@

        -PrevUpHome +PrevUpHome
        diff --git a/doc/html/boost_integer/integer.html b/doc/html/boost_integer/integer.html index 4078a26..5f69206 100644 --- a/doc/html/boost_integer/integer.html +++ b/doc/html/boost_integer/integer.html @@ -2,7 +2,7 @@ Integer Type Selection - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -44,7 +44,7 @@ characteristics such as number of bits or maximum value. This facility is particularly useful for solving generic programming problems.

        -
        +
        @@ -102,7 +102,7 @@ } // namespace boost
        -
        +

        Easiest-to-Manipulate Types @@ -126,7 +126,7 @@ the input type.

        -
        +
        @@ -341,7 +341,7 @@

        -
        +
        @@ -363,7 +363,7 @@ }
        -
        +

        Demonstration Program @@ -374,7 +374,7 @@ of the sized type class templates.

        -
        +
        @@ -383,18 +383,18 @@

        • - Avoid recursion because of concern about C++'s limited guaranteed recursion - depth (17). -
        • + Avoid recursion because of concern about C++'s limited guaranteed recursion + depth (17). +
        • - Avoid macros on general principles. -
        • + Avoid macros on general principles. +
        • - Try to keep the design as simple as possible. -
        • + Try to keep the design as simple as possible. +
        -
        +
        @@ -403,7 +403,7 @@ to use the types supplied in <boost/cstdint.hpp>.

        -
        +
        @@ -426,7 +426,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/log2.html b/doc/html/boost_integer/log2.html index 44669ae..8204023 100644 --- a/doc/html/boost_integer/log2.html +++ b/doc/html/boost_integer/log2.html @@ -2,7 +2,7 @@ Compile Time log2 Calculation - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -39,7 +39,7 @@ determines the position of the highest bit in a given value. This facility is useful for solving generic programming problems.

        -
        +
        @@ -66,7 +66,7 @@ } // namespace boost
        -
        +
        @@ -87,16 +87,16 @@

        • -static_log2_argument_type is an unsigned integer - type (C++ standard, 3.9.1p3). -
        • + static_log2_argument_type is an unsigned + integer type (C++ standard, 3.9.1p3). +
        • -static_log2_result_type is an integer type - (C++ standard, 3.9.1p7). -
        • + static_log2_result_type is an integer type + (C++ standard, 3.9.1p7). +
        -
        +

        Demonstration Program @@ -107,7 +107,7 @@ of the binary logarithm class template.

        -
        +
        @@ -120,7 +120,7 @@ to be available statically (i.e. at compile-time).

        -
        +
        @@ -145,7 +145,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/mask.html b/doc/html/boost_integer/mask.html index ff9972f..068634d 100644 --- a/doc/html/boost_integer/mask.html +++ b/doc/html/boost_integer/mask.html @@ -2,7 +2,7 @@ Integer Masks - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -41,7 +41,7 @@
        Rationale
        Credits
        -
        +
        @@ -52,7 +52,7 @@ type selection templates header.

        -
        +
        @@ -90,7 +90,7 @@ } // namespace boost
        -
        +

        Single Bit-Mask Class Template @@ -191,7 +191,7 @@


        -
        +

        Group Bit-Mask Class Template @@ -292,7 +292,7 @@


        -
        +

        Implementation Notes @@ -304,7 +304,7 @@ bit counts.

        -
        +
        @@ -328,7 +328,7 @@ }
        -
        +

        Demonstration Program @@ -339,7 +339,7 @@ of the bit mask class templates.

        -
        +
        @@ -351,7 +351,7 @@ bits. This prevents contamination of values by the higher, unused bits.

        -
        +
        @@ -372,7 +372,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/minmax.html b/doc/html/boost_integer/minmax.html index 7e8d396..8f9b3e2 100644 --- a/doc/html/boost_integer/minmax.html +++ b/doc/html/boost_integer/minmax.html @@ -2,7 +2,7 @@ Compile time min/max calculation - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        +
        @@ -40,7 +40,7 @@ provide a compile-time evaluation of the minimum or maximum of two integers. These facilities are useful for generic programming problems.

        -
        +
        @@ -65,7 +65,7 @@ }
        -
        +
        @@ -77,7 +77,7 @@ which is set to the respective minimum or maximum of the template's parameters.

        -
        +
        @@ -112,7 +112,7 @@ }
        -
        +

        Demonstration Program @@ -123,7 +123,7 @@ extrema class templates.

        -
        +
        @@ -133,7 +133,7 @@ another class template.

        -
        +
        @@ -154,7 +154,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/boost_integer/traits.html b/doc/html/boost_integer/traits.html index d60fef3..08f8f38 100644 --- a/doc/html/boost_integer/traits.html +++ b/doc/html/boost_integer/traits.html @@ -2,7 +2,7 @@ Integer Traits - + @@ -20,9 +20,9 @@
        -PrevUpHomeNext +PrevUpHomeNext
        -
        + -
        +
        @@ -62,7 +62,7 @@ The template class integer_traits addresses this problem.

        -
        +
        @@ -82,7 +82,7 @@ }
        -
        +
        @@ -179,7 +179,7 @@ unless boost::integer_traits is also specialized.

        -
        +
        @@ -188,7 +188,7 @@ exercises the integer_traits class.

        -
        +
        @@ -209,7 +209,7 @@
        -PrevUpHomeNext +PrevUpHomeNext
        diff --git a/doc/html/index.html b/doc/html/index.html index 1e4d3da..4c106d4 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -2,7 +2,7 @@ Boost.Integer - + @@ -17,8 +17,8 @@ More
        -
        Next
        -
        +
        Next
        +

        @@ -39,8 +39,8 @@

        -
        -

        +

        +

        Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

        @@ -61,7 +61,7 @@
        History
        -
        +
        @@ -237,10 +237,10 @@
        - +

        Last revised: April 05, 2010 at 07:20:03 GMT

        Last revised: July 08, 2010 at 20:45:20 GMT


        -
        Next
        +
        Next
        From 7c622779864fdf926ae4d0a5e13692f8641206e7 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 12 Aug 2010 12:36:42 +0000 Subject: [PATCH 10/19] Add VMS support. Fixes #4474. [SVN r64750] --- include/boost/cstdint.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ee55e69..750a120 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -137,7 +137,7 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) // FreeBSD and Tru64 have an that contains much of what we need. # include From 7bd48eb3f38b8cbfecaf4aeee918f8910d833f37 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 5 Sep 2010 16:27:09 +0000 Subject: [PATCH 11/19] Change logic so that int32_t etc is an int rather than a long where possible. [SVN r65299] --- include/boost/cstdint.hpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 750a120..ea84b65 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -256,20 +256,27 @@ namespace boost // 32-bit types -----------------------------------------------------------// -# if ULONG_MAX == 0xffffffff - typedef long int32_t; - typedef long int_least32_t; - typedef long int_fast32_t; - typedef unsigned long uint32_t; - typedef unsigned long uint_least32_t; - typedef unsigned long uint_fast32_t; -# elif UINT_MAX == 0xffffffff +# if UINT_MAX == 0xffffffff typedef int int32_t; typedef int int_least32_t; typedef int int_fast32_t; typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (USHRT_MAX == 0xffffffff) + typedef short int32_t; + typedef short int_least32_t; + typedef short int_fast32_t; + typedef unsigned short uint32_t; + typedef unsigned short uint_least32_t; + typedef unsigned short uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; # elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) // Integers are 64 bits on the MTA / XMT typedef __int32 int32_t; From 707faa1086c68cbe2282f34201cc32228b6d5ef5 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 13 Jan 2011 13:43:08 +0000 Subject: [PATCH 12/19] Remove old dead code. [SVN r68097] --- include/boost/detail/extended_integer.hpp | 177 ---------------------- 1 file changed, 177 deletions(-) delete mode 100644 include/boost/detail/extended_integer.hpp diff --git a/include/boost/detail/extended_integer.hpp b/include/boost/detail/extended_integer.hpp deleted file mode 100644 index c69636c..0000000 --- a/include/boost/detail/extended_integer.hpp +++ /dev/null @@ -1,177 +0,0 @@ -// Boost detail/extended_integer.hpp header file ----------------------------// - -// (C) Copyright Daryle Walker 2008. Distributed under the Boost Software -// License, Version 1.0. (See the accompanying file LICENSE_1_0.txt or a copy -// at .) - -// Encapsulates the double-long and __int64 type families as a single family, -// as they are mutually exclusive. - -/** \file - \brief Common definition of extended integer types. - - Instead of other Boost headers making separate \#defines for the double-long - and __int64 type families, since they're mutually exclusive, make a single - set of types and macros for the family that exists (if either). - */ - -#ifndef BOOST_DETAIL_EXTENDED_INTEGER_HPP -#define BOOST_DETAIL_EXTENDED_INTEGER_HPP - -#include // for BOOST_HAS_LONG_LONG and BOOST_HAS_MS_INT64 - -#include // for CHAR_BIT, etc. - - -namespace boost -{ -namespace detail -{ - - -// Extended integer type macro and alias definitions -----------------------// - -// (Unsigned) long long family -#ifdef BOOST_HAS_LONG_LONG - -// Existence -#define BOOST_HAS_XINT 1 - -// Extents -#ifdef ULLONG_MAX -#define BOOST_XINT_MAX LLONG_MAX -#define BOOST_XINT_MIN LLONG_MIN -#define BOOST_UXINT_MAX ULLONG_MAX -#elif defined(ULONG_LONG_MAX) -#define BOOST_XINT_MAX LONG_LONG_MAX -#define BOOST_XINT_MIN LONG_LONG_MIN -#define BOOST_UXINT_MAX ULONG_LONG_MAX -#elif defined(ULONGLONG_MAX) -#define BOOST_XINT_MAX LONGLONG_MAX -#define BOOST_XINT_MIN LONGLONG_MIN -#define BOOST_UXINT_MAX ULONGLONG_MAX -#elif defined(_LLONG_MAX) && defined(_C2) -#define BOOST_XINT_MAX _LLONG_MAX -#define BOOST_XINT_MIN (-_LLONG_MAX - _C2) -#define BOOST_UXINT_MAX _ULLONG_MAX -#else // guess -// Sometimes we get the double-long types without the corresponding constants, -// e.g. GCC in "-ansi" mode. In this case, we'll just have to work out the -// values ourselves. (Here we assume a two's complement representation.) -#define BOOST_XINT_MIN (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1)) -#define BOOST_XINT_MAX (~ BOOST_XINT_MIN) -#define BOOST_UXINT_MAX (~ 0uLL) -#endif - -// Types -typedef ::boost:: long_long_type xint_t; -typedef ::boost::ulong_long_type uxint_t; - -// (Unsigned) __int64 family -#elif defined(BOOST_HAS_MS_INT64) - -// Existence -#define BOOST_HAS_XINT 1 - -// Extents -#ifdef _UI64_MAX -#define BOOST_XINT_MAX _I64_MAX -#define BOOST_XINT_MIN _I64_MIN -#define BOOST_UXINT_MAX _UI64_MAX -#else // guess -// The types are exactly 2's-compl. 64-bit, so we'll enter the values directly. -#define BOOST_XINT_MAX 0x7FFFFFFFFFFFFFFFi64 -#define BOOST_XINT_MIN 0x8000000000000000i64 -#define BOOST_UXINT_MAX 0xFFFFFFFFFFFFFFFFui64 -#endif - -// Types -typedef __int64 xint_t; -typedef unsigned __int64 uxint_t; - -// Neither -#else - -// Non-existence -#define BOOST_HAS_XINT 0 - -// Dummy extents -#define BOOST_XINT_MAX LONG_MAX -#define BOOST_XINT_MIN LONG_MIN -#define BOOST_UXINT_MAX ULONG_MAX - -// Dummy types -typedef signed long xint_t; -typedef unsigned long uxint_t; - -#endif // defined(BOOST_HAS_LONG_LONG)/defined(BOOST_HAS_MS_INT64)/else - -/** \def BOOST_HAS_XINT - - \brief Flag for extended integer types. - - Indicates the presence of one of the two common extended integer type - families, either (unsigned) long long or - (unsigned) __int64. \c BOOST_HAS_XINT is \c 1 if - either type family is defined, and \c 0 if neither is. - */ - -/** \def BOOST_XINT_MAX - - \brief Maximum value for the signed extended integer type. - - \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1. - - Macro constant representing the largest value the signed extended integer - type supports. Its composition may be another macro, an expression, or a - literal. Defaulted to \c LONG_MAX if \c BOOST_HAS_XINT is zero. - */ -/** \def BOOST_XINT_MIN - - \brief Minimum value for the signed extended integer type. - - \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1. - - Macro constant representing the smallest value the signed extended integer - type supports. Its composition may be another macro, an expression, or a - literal. Defaulted to \c LONG_MIN if \c BOOST_HAS_XINT is zero. - */ -/** \def BOOST_UXINT_MAX - - \brief Maximum value for the unsigned extended integer type. - - \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1. - - Macro constant representing the largest value the unsigned extended integer - type supports. Its composition may be another macro, an expression, or a - literal. Defaulted to \c ULONG_MAX if \c BOOST_HAS_XINT is zero. (Use - \c 0u for the type's minimum value.) - */ - -/** \typedef signed long boost::detail::xint_t - - \brief Alias for the signed extended integer type. - - \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1. - - Alias representing the signed extended integer type, no matter which type - family it came from. Defaulted to signed long if - \c BOOST_HAS_XINT is zero. - */ -/** \typedef unsigned long ::boost::detail::uxint_t - - \brief Alias for the signed extended integer type. - - \pre \c BOOST_HAS_XINT is \c \#defined to be \c 1. - - Alias representing the unsigned extended integer type, no matter which type - family it came from. Defaulted to unsigned long if - \c BOOST_HAS_XINT is zero. - */ - - -} // namespace detail -} // namespace boost - - -#endif // BOOST_DETAIL_EXTENDED_INTEGER_HPP From 8457bd01b152c7f6cdc89e89cc884663c86c5fab Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 12 Feb 2011 15:06:21 +0000 Subject: [PATCH 13/19] Fix integer_traits when no macro from limits.h is available. [SVN r68802] --- include/boost/integer_traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/integer_traits.hpp b/include/boost/integer_traits.hpp index 34b3570..e31a638 100644 --- a/include/boost/integer_traits.hpp +++ b/include/boost/integer_traits.hpp @@ -227,7 +227,7 @@ class integer_traits< ::boost::ulong_long_type> template<> class integer_traits< ::boost::long_long_type> : public std::numeric_limits< ::boost::long_long_type>, - public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))> + public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1)), ~(1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1))> { }; template<> From cc73477d13a6315d511b0bfeff8ec417014f889e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 24 Dec 2011 17:29:03 +0000 Subject: [PATCH 14/19] Fix typo. Refs #6003. [SVN r76137] --- test/integer_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integer_test.cpp b/test/integer_test.cpp index bef0308..fd9e6df 100644 --- a/test/integer_test.cpp +++ b/test/integer_test.cpp @@ -152,7 +152,7 @@ void do_test_bits() if(boost::detail::test_errors() != last_error_count) { last_error_count = boost::detail::test_errors(); - std::cout << "Errors occured while testing with bit count = " << Bits << std::endl; + std::cout << "Errors occurred while testing with bit count = " << Bits << std::endl; std::cout << "Type int_t<" << Bits << ">::least was " << get_name_of_type(least_int(0)) << std::endl; std::cout << "Type int_t<" << Bits << ">::fast was " << get_name_of_type(fast_int(0)) << std::endl; std::cout << "Type uint_t<" << Bits << ">::least was " << get_name_of_type(least_uint(0)) << std::endl; From 1898e66238faa42cb2380be31cae11bb6045fef0 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 24 Feb 2012 16:57:13 +0000 Subject: [PATCH 15/19] Apply patch from Vincent Botet Escriba: fix check for size > long long. [SVN r77109] --- include/boost/integer.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index fc0b398..345ae35 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -114,7 +114,7 @@ namespace boost typedef typename detail::int_least_helper < #ifdef BOOST_HAS_LONG_LONG - (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + + (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else 1 + #endif @@ -144,7 +144,7 @@ namespace boost < 5 + #ifdef BOOST_HAS_LONG_LONG - (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + + (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else 1 + #endif From 90f779a9a3c5584cf5eb8600a7e0a3c2ab7bf354 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 2 May 2012 17:10:20 +0000 Subject: [PATCH 16/19] Fix integer.hpp so a compiler error is generated when the number of bits requested is greater than the max available. Added new tests to catch this case. [SVN r78307] --- include/boost/integer.hpp | 30 +++++++++++++++++------------- test/Jamfile.v2 | 6 ++++++ test/fail_int_exact.cpp | 8 ++++++++ test/fail_int_fast.cpp | 8 ++++++++ test/fail_int_least.cpp | 8 ++++++++ test/fail_uint_exact.cpp | 8 ++++++++ test/fail_uint_fast.cpp | 8 ++++++++ test/fail_uint_least.cpp | 8 ++++++++ 8 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 test/fail_int_exact.cpp create mode 100644 test/fail_int_fast.cpp create mode 100644 test/fail_int_least.cpp create mode 100644 test/fail_uint_exact.cpp create mode 100644 test/fail_uint_fast.cpp create mode 100644 test/fail_uint_least.cpp diff --git a/include/boost/integer.hpp b/include/boost/integer.hpp index 345ae35..35a1e10 100644 --- a/include/boost/integer.hpp +++ b/include/boost/integer.hpp @@ -20,6 +20,7 @@ #include // for boost::::boost::integer_traits #include // for ::std::numeric_limits #include // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T +#include // // We simply cannot include this header on gcc without getting copious warnings of the kind: @@ -51,6 +52,7 @@ namespace boost // convert category to type template< int Category > struct int_least_helper {}; // default is empty + template< int Category > struct uint_least_helper {}; // default is empty // specializatons: 1=long, 2=int, 3=short, 4=signed char, // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char @@ -65,14 +67,14 @@ namespace boost template<> struct int_least_helper<4> { typedef short least; }; template<> struct int_least_helper<5> { typedef signed char least; }; #ifdef BOOST_HAS_LONG_LONG - template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; + template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) - template<> struct int_least_helper<6> { typedef unsigned __int64 least; }; + template<> struct uint_least_helper<1> { typedef unsigned __int64 least; }; #endif - template<> struct int_least_helper<7> { typedef unsigned long least; }; - template<> struct int_least_helper<8> { typedef unsigned int least; }; - template<> struct int_least_helper<9> { typedef unsigned short least; }; - template<> struct int_least_helper<10> { typedef unsigned char least; }; + template<> struct uint_least_helper<2> { typedef unsigned long least; }; + template<> struct uint_least_helper<3> { typedef unsigned int least; }; + template<> struct uint_least_helper<4> { typedef unsigned short least; }; + template<> struct uint_least_helper<5> { typedef unsigned char least; }; template struct exact_signed_base_helper{}; @@ -111,6 +113,8 @@ namespace boost template< int Bits > // bits (including sign) required struct int_t : public detail::exact_signed_base_helper { + BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::intmax_t) * CHAR_BIT), + "No suitable signed integer type with the requested number of bits is available."); typedef typename detail::int_least_helper < #ifdef BOOST_HAS_LONG_LONG @@ -130,6 +134,8 @@ namespace boost template< int Bits > // bits required struct uint_t : public detail::exact_unsigned_base_helper { + BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::uintmax_t) * CHAR_BIT), + "No suitable unsigned integer type with the requested number of bits is available."); #if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) // It's really not clear why this workaround should be needed... shrug I guess! JM BOOST_STATIC_CONSTANT(int, s = @@ -140,9 +146,8 @@ namespace boost (Bits <= ::std::numeric_limits::digits)); typedef typename detail::int_least_helper< ::boost::uint_t::s>::least least; #else - typedef typename detail::int_least_helper + typedef typename detail::uint_least_helper < - 5 + #ifdef BOOST_HAS_LONG_LONG (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else @@ -217,7 +222,7 @@ namespace boost // It's really not clear why this workaround should be needed... shrug I guess! JM #if defined(BOOST_NO_INTEGRAL_INT64_T) BOOST_STATIC_CONSTANT(unsigned, which = - 6 + + 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + @@ -225,18 +230,17 @@ namespace boost typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; #else // BOOST_NO_INTEGRAL_INT64_T BOOST_STATIC_CONSTANT(unsigned, which = - 5 + + 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max)); - typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; + typedef typename detail::uint_least_helper< ::boost::uint_value_t::which>::least least; #endif // BOOST_NO_INTEGRAL_INT64_T #else - typedef typename detail::int_least_helper + typedef typename detail::uint_least_helper < - 5 + #if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) (MaxValue <= ::boost::integer_traits::const_max) + #else diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 690befa..0f58345 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -22,4 +22,10 @@ test-suite integer [ compile static_log2_include_test.cpp ] [ compile static_min_max_include_test.cpp ] [ compile integer_fwd_include_test.cpp ] + [ compile-fail fail_int_exact.cpp ] + [ compile-fail fail_int_fast.cpp ] + [ compile-fail fail_int_least.cpp ] + [ compile-fail fail_uint_exact.cpp ] + [ compile-fail fail_uint_fast.cpp ] + [ compile-fail fail_uint_least.cpp ] ; diff --git a/test/fail_int_exact.cpp b/test/fail_int_exact.cpp new file mode 100644 index 0000000..1b6e66a --- /dev/null +++ b/test/fail_int_exact.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::int_t::exact fail_int_exact; diff --git a/test/fail_int_fast.cpp b/test/fail_int_fast.cpp new file mode 100644 index 0000000..8e65b7c --- /dev/null +++ b/test/fail_int_fast.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::int_t::fast fail_int_fast; diff --git a/test/fail_int_least.cpp b/test/fail_int_least.cpp new file mode 100644 index 0000000..d06ce6d --- /dev/null +++ b/test/fail_int_least.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::int_t::least fail_int_least; diff --git a/test/fail_uint_exact.cpp b/test/fail_uint_exact.cpp new file mode 100644 index 0000000..36f8628 --- /dev/null +++ b/test/fail_uint_exact.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::uint_t::exact fail_uint_exact; diff --git a/test/fail_uint_fast.cpp b/test/fail_uint_fast.cpp new file mode 100644 index 0000000..99f92b2 --- /dev/null +++ b/test/fail_uint_fast.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::uint_t::fast fail_uint_fast; diff --git a/test/fail_uint_least.cpp b/test/fail_uint_least.cpp new file mode 100644 index 0000000..8cdfbaf --- /dev/null +++ b/test/fail_uint_least.cpp @@ -0,0 +1,8 @@ +// Copyright John Maddock 2012. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +typedef boost::uint_t::least fail_uint_least; From d131434ef15648dae87f03fc064725b7fb93d666 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 14 Jul 2012 11:21:03 +0000 Subject: [PATCH 17/19] Fix PDF install rule so that it's explicit and automatically invokes a PDF build when specified on the command line. So "bjam pdfinstall" will now build and install the PDF to the current directory. This works around some problems that the previous versions had if the user did not have an FO processor installed (basically Daniel James was unable to build the HTML docs for the distribution if the pdfinstall rule was implicit). [SVN r79492] --- doc/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index de1f8a7..92609ff 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -50,6 +50,7 @@ boostbook standalone pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/libs/regex/doc/html ; -install pdf-install : standalone : . PDF ; +install pdfinstall : standalone/pdf : . PDF ; +explicit pdfinstall ; From 72438055a93c2ad2f53b7e7888fad2b935c832e7 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 16 Jun 2013 15:02:27 +0000 Subject: [PATCH 18/19] Extracted intptr_t and uintptr_t types to cstdint.hpp. Refs #7823. [SVN r84805] --- include/boost/cstdint.hpp | 212 ++++++++++++++++++++++---------------- 1 file changed, 123 insertions(+), 89 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index ea84b65..1ccf216 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -1,8 +1,8 @@ // boost cstdint.hpp header file ------------------------------------------// -// (C) Copyright Beman Dawes 1999. -// (C) Copyright Jens Mauer 2001 -// (C) Copyright John Maddock 2001 +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -24,9 +24,9 @@ #define BOOST_CSTDINT_HPP // -// Since we always define the INT#_C macros as per C++0x, +// Since we always define the INT#_C macros as per C++0x, // define __STDC_CONSTANT_MACROS so that does the right -// thing if possible, and so that the user knows that the macros +// thing if possible, and so that the user knows that the macros // are actually defined as per C99. // #ifndef __STDC_CONSTANT_MACROS @@ -50,7 +50,7 @@ # ifdef __STDC_32_MODE__ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T -# endif +# endif # elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else @@ -100,40 +100,40 @@ typedef ::uintfast64_t uint_fast64_t; namespace boost { - using ::int8_t; - using ::int_least8_t; - using ::int_fast8_t; - using ::uint8_t; - using ::uint_least8_t; - using ::uint_fast8_t; - - using ::int16_t; - using ::int_least16_t; - using ::int_fast16_t; - using ::uint16_t; - using ::uint_least16_t; - using ::uint_fast16_t; - - using ::int32_t; - using ::int_least32_t; - using ::int_fast32_t; - using ::uint32_t; - using ::uint_least32_t; - using ::uint_fast32_t; - + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + # ifndef BOOST_NO_INT64_T - using ::int64_t; - using ::int_least64_t; - using ::int_fast64_t; - using ::uint64_t; - using ::uint_least64_t; - using ::uint_fast64_t; - + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + # endif - using ::intmax_t; - using ::uintmax_t; + using ::intmax_t; + using ::uintmax_t; } // namespace boost @@ -143,35 +143,35 @@ namespace boost namespace boost { - using ::int8_t; - typedef int8_t int_least8_t; - typedef int8_t int_fast8_t; - using ::uint8_t; - typedef uint8_t uint_least8_t; - typedef uint8_t uint_fast8_t; - - using ::int16_t; - typedef int16_t int_least16_t; - typedef int16_t int_fast16_t; - using ::uint16_t; - typedef uint16_t uint_least16_t; - typedef uint16_t uint_fast16_t; - - using ::int32_t; - typedef int32_t int_least32_t; - typedef int32_t int_fast32_t; - using ::uint32_t; - typedef uint32_t uint_least32_t; - typedef uint32_t uint_fast32_t; - -# ifndef BOOST_NO_INT64_T + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; - using ::int64_t; - typedef int64_t int_least64_t; - typedef int64_t int_fast64_t; - using ::uint64_t; - typedef uint64_t uint_least64_t; - typedef uint64_t uint_fast64_t; + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; typedef int64_t intmax_t; typedef uint64_t uintmax_t; @@ -235,15 +235,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif -# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) - // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified - // MTA / XMT does support the following non-standard integer types - typedef __short16 int16_t; - typedef __short16 int_least16_t; - typedef __short16 int_fast16_t; - typedef unsigned __short16 uint16_t; - typedef unsigned __short16 uint_least16_t; - typedef unsigned __short16 uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -277,14 +277,14 @@ namespace boost typedef unsigned long uint32_t; typedef unsigned long uint_least32_t; typedef unsigned long uint_fast32_t; -# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) - // Integers are 64 bits on the MTA / XMT - typedef __int32 int32_t; - typedef __int32 int_least32_t; - typedef __int32 int_fast32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 uint_least32_t; - typedef unsigned __int32 uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -358,6 +358,40 @@ namespace boost #endif // BOOST_HAS_STDINT_H +// intptr_t/uintptr_t are defined separately because they are optional and not universally available +#if defined(BOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(BOOST_HAS_STDINT_H) +// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h +#include +#endif + +// PGI seems to not support intptr_t/uintptr_t properly. BOOST_HAS_STDINT_H is not defined for this compiler by Boost.Config. +#if !defined(__PGIC__) + +#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \ + || (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \ + || defined(__CYGWIN__) \ + || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \ + || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) + +namespace boost { + using ::intptr_t; + using ::uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +// Clang pretends to be GCC, so it'll match this condition +#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__) + +namespace boost { + typedef __INTPTR_TYPE__ intptr_t; + typedef __UINTPTR_TYPE__ uintptr_t; +} +#define BOOST_HAS_INTPTR_T + +#endif + +#endif // !defined(__PGIC__) + #endif // BOOST_CSTDINT_HPP @@ -376,15 +410,15 @@ INT#_C macros if they're not already defined (John Maddock). #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) // -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. +// For the following code we get several warnings along the lines of: // -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED From 365d61fc4e58e742e8174faa5e5392bc30678229 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 4 Jul 2013 09:13:23 +0000 Subject: [PATCH 19/19] Patch for recent versions of glibc which always assume int64_t support. Fixes #8731. [SVN r84950] --- include/boost/cstdint.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 1ccf216..98faeae 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -41,7 +41,10 @@ // so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. // See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 // -#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) +#if defined(BOOST_HAS_STDINT_H) \ + && (!defined(__GLIBC__) \ + || defined(__GLIBC_HAVE_LONG_LONG) \ + || (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17))))) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux