mirror of
https://github.com/boostorg/integer.git
synced 2025-07-29 12:17:13 +02:00
Get the tests warning free again with GCC.
Finally get everything working with the Borland compiler. Fix a few typos: use of long rather than unsigned long, use of long long rather than long_long_type etc. [SVN r58056]
This commit is contained in:
@ -94,8 +94,8 @@ namespace boost
|
|||||||
(defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\
|
(defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\
|
||||||
(defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\
|
(defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\
|
||||||
(defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX)))
|
(defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX)))
|
||||||
template <> struct exact_signed_base_helper<sizeof(long long)* CHAR_BIT> { typedef long long exact; };
|
template <> struct exact_signed_base_helper<sizeof(boost::long_long_type)* CHAR_BIT> { typedef boost::long_long_type exact; };
|
||||||
template <> struct exact_unsigned_base_helper<sizeof(unsigned long long)* CHAR_BIT> { typedef unsigned long long exact; };
|
template <> struct exact_unsigned_base_helper<sizeof(boost::ulong_long_type)* CHAR_BIT> { typedef boost::ulong_long_type exact; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -194,10 +194,20 @@ namespace boost
|
|||||||
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
||||||
template< boost::ulong_long_type MaxValue > // minimum value to require support
|
template< boost::ulong_long_type MaxValue > // minimum value to require support
|
||||||
#else
|
#else
|
||||||
template< long MaxValue > // minimum value to require support
|
template< unsigned long MaxValue > // minimum value to require support
|
||||||
#endif
|
#endif
|
||||||
struct uint_value_t
|
struct uint_value_t
|
||||||
{
|
{
|
||||||
|
#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(unsigned, which =
|
||||||
|
6 +
|
||||||
|
(MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
|
||||||
|
(MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
|
||||||
|
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
||||||
|
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
|
||||||
|
typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
|
||||||
|
#else
|
||||||
typedef typename detail::int_least_helper
|
typedef typename detail::int_least_helper
|
||||||
<
|
<
|
||||||
5 +
|
5 +
|
||||||
@ -211,6 +221,7 @@ namespace boost
|
|||||||
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
(MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
|
||||||
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max)
|
(MaxValue <= ::boost::integer_traits<unsigned char>::const_max)
|
||||||
>::least least;
|
>::least least;
|
||||||
|
#endif
|
||||||
typedef typename int_fast_t<least>::type fast;
|
typedef typename int_fast_t<least>::type fast;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ template< int Bits >
|
|||||||
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
|
||||||
template< boost::ulong_long_type MaxValue > // maximum value to require support
|
template< boost::ulong_long_type MaxValue > // maximum value to require support
|
||||||
#else
|
#else
|
||||||
template< long MaxValue > // maximum value to require support
|
template< unsigned long MaxValue > // maximum value to require support
|
||||||
#endif
|
#endif
|
||||||
struct uint_value_t;
|
struct uint_value_t;
|
||||||
|
|
||||||
|
@ -12,6 +12,12 @@
|
|||||||
// 12 Nov 00 Adapted to merged <boost/cstdint.hpp>
|
// 12 Nov 00 Adapted to merged <boost/cstdint.hpp>
|
||||||
// 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock).
|
// 23 Sep 00 Added INTXX_C constant macro support + int64_t support (John Maddock).
|
||||||
// 28 Jun 00 Initial version
|
// 28 Jun 00 Initial version
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))
|
||||||
|
// We can't suppress this warning on the command line as not all GCC versions support -Wno-type-limits :
|
||||||
|
#pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define __STDC_CONSTANT_MACROS
|
#define __STDC_CONSTANT_MACROS
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
|
@ -165,8 +165,8 @@ void do_test_bits<-1>()
|
|||||||
// Nothing to do here!!
|
// Nothing to do here!!
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Traits, class Expected, class Value>
|
template <class Traits, class Expected>
|
||||||
void test_min_max_type(Value val)
|
void test_min_max_type(Expected val)
|
||||||
{
|
{
|
||||||
typedef typename Traits::least least_type;
|
typedef typename Traits::least least_type;
|
||||||
typedef typename Traits::fast fast_type;
|
typedef typename Traits::fast fast_type;
|
||||||
|
Reference in New Issue
Block a user