From 82bda71faa8a0ad1bc6815e0e60e1f1afc621d96 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 25 Sep 2007 13:45:52 +0000 Subject: [PATCH 01/12] Clear compiler warnings [SVN r39520] --- utf8_codecvt_facet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 20d79de..8a8c3ca 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -139,8 +139,8 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int shift_exponent = (cont_octet_count) * 6; // Process the first character - *to++ = octet1_modifier_table[cont_octet_count] + - (unsigned char)(*from / (1 << shift_exponent)); + *to++ = static_cast(octet1_modifier_table[cont_octet_count] + + (unsigned char)(*from / (1 << shift_exponent))); // Process the continuation characters // Invariants: At the start of the loop: @@ -150,7 +150,7 @@ std::codecvt_base::result utf8_codecvt_facet::do_out( int i = 0; while (i != cont_octet_count && to != to_end) { shift_exponent -= 6; - *to++ = 0x80 + ((*from / (1 << shift_exponent)) % (1 << 6)); + *to++ = static_cast(0x80 + ((*from / (1 << shift_exponent)) % (1 << 6))); ++i; } // If we filled up the out buffer before encoding the character @@ -199,7 +199,7 @@ int utf8_codecvt_facet::do_length( last_octet_count = (get_octet_count(*from_next)); ++char_count; } - return from_next-from_end; + return static_cast(from_next-from_end); } unsigned int utf8_codecvt_facet::get_octet_count( From 6443246b4bd827ba9be581abac44f9a9a9a85d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Thu, 11 Oct 2007 10:57:30 +0000 Subject: [PATCH 02/12] Boost 1.35 version of Boost.MultiIndex allocator_utilities.hpp: added partial_std_allocator_wrapper::value_type composite_key.hpp: used hash_fwd.hpp auto_space.hpp: added support for non-standard allocators bidir_node_iterator.hpp: moved friend-injected operators out of class copy_map.hpp: added support for non-standard allocators hash_index_args.hpp: removed deprecated use of hash_index_iterator.hpp: moved friend-injected operators our of class hash_index_node.hpp: added support for non-standard allocators header_holder.hpp:added support for non-standard allocators index_base.hpp: added support for non-standard allocators, added modify_rollback, added small improvement to modify index_loader.hpp: added support for non-standard allocators index_matcher.hpp: added support for non-standard allocators index_node_base.hpp: added support for non-standard allocators iter_adaptor.hpp: added some out-of-class operators to alleviate a MSVC++ 6.0 problem modify_key_adaptor.hpp: renamed some vars to accomudate broader usage scope node_type.hpp: added support for non-standard allocators ord_index_node.hpp: added support for non-standard allocators ord_index_ops.hpp: implemented a more efficient equal_range rnd_index_loader.hpp: added support for non-standard allocators rnd_index_node.hpp: added support for non-standard allocators rnd_index_ops.hpp: added support for non-standard allocators rnd_index_ptr_array.hpp: added support for non-standard allocators rnd_node_iterator.hpp: moved friend-injected operators out of class seq_index_node.hpp: added support for non-standard allocators seq_index_ops.hpp: added support for non-standard allocators uintptr_type.hpp: added support for __int64 unbounded.hpp: fixed ODR problem value_compare.hpp: fixed a small unefficiency global_fun: initial commit hashed_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, [local_]iterator_to, rollback modify identity_fwd.hpp: fixed wrong include guard name key_extractors.hpp: added global_fun mem_fun.hpp: removed superfluous =0's ordered_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, improved equal_range and range, added conformance to DR 233 random_access_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9 sequenced_index.hpp: added support for non-standard allocators, added c[r]{begin|end}, iterator_to, rollback modify, added conformance to 23.1.1/9, improved resize multi_index_container.hpp: added support for non-standard allocators, improved ctor_args_list, rollback modify acknowledgements.html: added entry for Boost 1.35 examples.html: renamed example 2, added B.IP example/composite_keys.cpp future_work.html: removed entry on bimap hash_indices.html: added c[r]{begin|end}, [local_]iterator_to, rollback modify reference/index.html: added global_fun reference/key_extraction.html: added global_fun, added technical correction multi_index_container.html: added support for non-standard allocators ord_indices.html: added c[r]{begin|end}, iterator_to, rollback modify rnd_indices.html: added c[r]{begin|end}, iterator_to, rollback modify seq_indices.html: added c[r]{begin|end}, iterator_to, rollback modify release_notes.html: added entry for Boost 1.35 tests.html: added new serialization test file basics.html: added rollback modify creation.html: added support for non-standard allocators tutorial/indices.html: added iterator_to tutorial/key_extraction.html: added global_fun composite_keys.cpp: fixed technicality fun_key.cpp: was memfun_key.cpp, added global_fun ip_allocator.cpp: initial commit example/Jamfile.v2: renamed memfun_key, added ip_allocator test_perf.cpp: fixed technicality employee.hpp: used a non-standard allocator test/Jamfile.v2: added new test file non_std_allocator.hpp: initial commit pair_of_ints.hpp: added decrement facilities test_capacity.cpp: added extra check on resize test_copy_assignment.cpp: added test for 23.1.1/9 test_iterators.cpp: added tests for c[r]{begin|end} and [local_]iterator_to, fixed technicality test_key_extractors.cpp: added tests for global_fun test_modifiers.cpp: added tests dor DR 233, fixed technicality test_range.cpp: added extra checks to secure range refactoring test_rearrange.cpp: fixed technicality test_serialization.cpp: added new test file test_serialization1.cpp: corrected include, used a non-standard allocator test_serialization2.cpp: corrected include, used a non-standard allocator, split some stuff ro test_serialization3.cpp test_serialization3.cpp: initial commit test_serialization3.hpp: initial commit test_serialization_template.hpp: removed some reliance on ADL test_update.cpp: addes tests for rollback modify, fixed technicality [SVN r39922] --- include/boost/detail/allocator_utilities.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 6929087..5a9a79e 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2005 Joaquín M López Muñoz. +/* Copyright 2003-2007 Joaquín M López Muñoz. * 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) @@ -30,13 +30,21 @@ namespace detail{ namespace allocator{ /* partial_std_allocator_wrapper inherits the functionality of a std - * allocator while providing a templatized ctor. + * allocator while providing a templatized ctor and other bits missing + * in some stdlib implementation or another. */ template class partial_std_allocator_wrapper:public std::allocator { public: + /* Oddly enough, STLport does not define std::allocator::value_type + * when configured to work without partial template specialization. + * No harm in supplying the definition here unconditionally. + */ + + typedef Type value_type; + partial_std_allocator_wrapper(){}; template From 715c05005fee28d7e990255adb9efbe1c0f7da24 Mon Sep 17 00:00:00 2001 From: Anthony Williams Date: Fri, 2 Nov 2007 09:17:02 +0000 Subject: [PATCH 03/12] Added changes from David Deakins to enable compilation on Windows CE [SVN r40679] --- include/boost/detail/interlocked.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 76a24c3..258320c 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -47,6 +47,11 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); # define BOOST_INTERLOCKED_EXCHANGE InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD InterlockedExchangeAdd +# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \ + ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long*)(dest),(long)(exchange),(long)(compare))) +# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \ + ((void*)BOOST_INTERLOCKED_EXCHANGE((long*)(dest),(long)(exchange))) + #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) extern "C" long __cdecl _InterlockedIncrement( long volatile * ); From 9dcdea9efc0ddd74a7617d5da66058c72faaa011 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 2 Apr 2008 01:42:32 +0000 Subject: [PATCH 04/12] Replaced all occurrences of non-ASCII copyright symbol with '(c)' for people using non-ASCII code pages [SVN r43992] --- include/boost/detail/utf8_codecvt_facet.hpp | 2 +- utf8_codecvt_facet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index 3826ee6..ac7e7bf 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -1,4 +1,4 @@ -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/utf8_codecvt_facet.cpp b/utf8_codecvt_facet.cpp index 8a8c3ca..658ab6a 100644 --- a/utf8_codecvt_facet.cpp +++ b/utf8_codecvt_facet.cpp @@ -1,7 +1,7 @@ /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // utf8_codecvt_facet.cpp -// Copyright © 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) +// Copyright (c) 2001 Ronald Garcia, Indiana University (garcia@osl.iu.edu) // Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at From e4054d843aee99a1a7a0c3699398e96054be3270 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 5 Apr 2008 15:06:31 +0000 Subject: [PATCH 05/12] spinlock_nt.hpp added, Cygwin fixes. [SVN r44055] --- include/boost/detail/interlocked.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/interlocked.hpp b/include/boost/detail/interlocked.hpp index 258320c..b6c8d75 100644 --- a/include/boost/detail/interlocked.hpp +++ b/include/boost/detail/interlocked.hpp @@ -92,7 +92,7 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* ); # define BOOST_INTERLOCKED_EXCHANGE _InterlockedExchange # define BOOST_INTERLOCKED_EXCHANGE_ADD _InterlockedExchangeAdd -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) +#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ ) namespace boost { From 3d539b76df2514a6fdb5355ccbf13394b8890064 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 20 Apr 2008 15:37:08 +0000 Subject: [PATCH 06/12] Factored out boost/detail/lightweight_thread.hpp. [SVN r44638] --- include/boost/detail/lightweight_thread.hpp | 135 ++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 include/boost/detail/lightweight_thread.hpp diff --git a/include/boost/detail/lightweight_thread.hpp b/include/boost/detail/lightweight_thread.hpp new file mode 100644 index 0000000..6fe70a6 --- /dev/null +++ b/include/boost/detail/lightweight_thread.hpp @@ -0,0 +1,135 @@ +#ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED +#define BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED + +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +// boost/detail/lightweight_thread.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2008 Peter Dimov +// +// 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 +#include +#include + +// pthread_create, pthread_join + +#if defined( BOOST_HAS_PTHREADS ) + +#include + +#else + +#include +#include + +typedef HANDLE pthread_t; + +int pthread_create( pthread_t * thread, void const *, unsigned (__stdcall * start_routine) (void*), void* arg ) +{ + HANDLE h = (HANDLE)_beginthreadex( 0, 0, start_routine, arg, 0, 0 ); + + if( h != 0 ) + { + *thread = h; + return 0; + } + else + { + return EAGAIN; + } +} + +int pthread_join( pthread_t thread, void ** /*value_ptr*/ ) +{ + ::WaitForSingleObject( thread, INFINITE ); + ::CloseHandle( thread ); + return 0; +} + +#endif + +// template int lw_thread_create( pthread_t & pt, F f ); + +namespace boost +{ + +namespace detail +{ + +class lw_abstract_thread +{ +public: + + virtual ~lw_abstract_thread() {} + virtual void run() = 0; +}; + +#if defined( BOOST_HAS_PTHREADS ) + +extern "C" void * lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#else + +unsigned __stdcall lw_thread_routine( void * pv ) +{ + std::auto_ptr pt( static_cast( pv ) ); + + pt->run(); + + return 0; +} + +#endif + +template class lw_thread_impl: public lw_abstract_thread +{ +public: + + explicit lw_thread_impl( F f ): f_( f ) + { + } + + void run() + { + f_(); + } + +private: + + F f_; +}; + +template int lw_thread_create( pthread_t & pt, F f ) +{ + std::auto_ptr p( new lw_thread_impl( f ) ); + + int r = pthread_create( &pt, 0, lw_thread_routine, p.get() ); + + if( r == 0 ) + { + p.release(); + } + + return r; +} + +} // namespace detail +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_THREAD_HPP_INCLUDED From 7e259580c1532e678509075c0944d2086bc34f52 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 21 May 2008 15:39:41 +0000 Subject: [PATCH 07/12] Apply NetBSD fix from issue #1922. [SVN r45608] --- include/boost/detail/endian.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/detail/endian.hpp b/include/boost/detail/endian.hpp index 6936dba..6394d92 100644 --- a/include/boost/detail/endian.hpp +++ b/include/boost/detail/endian.hpp @@ -42,10 +42,10 @@ # error Unknown machine endianness detected. # endif # define BOOST_BYTE_ORDER __BYTE_ORDER -#elif defined(_BIG_ENDIAN) +#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 -#elif defined(_LITTLE_ENDIAN) +#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ From 96b53f28a8bf5002764021bbad796871fd5cf821 Mon Sep 17 00:00:00 2001 From: Jonathan Turkanis Date: Sun, 25 May 2008 23:36:55 +0000 Subject: [PATCH 08/12] silenced warning about comma operator (C4913) for VC 8-9 with warning level 4 [SVN r45754] --- include/boost/detail/is_incrementable.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) mode change 100755 => 100644 include/boost/detail/is_incrementable.hpp diff --git a/include/boost/detail/is_incrementable.hpp b/include/boost/detail/is_incrementable.hpp old mode 100755 new mode 100644 index cb7d7a7..1c8fd57 --- a/include/boost/detail/is_incrementable.hpp +++ b/include/boost/detail/is_incrementable.hpp @@ -63,7 +63,12 @@ namespace is_incrementable_ tag operator,(tag,int); # define BOOST_comma(a,b) (a,b) # endif - + +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable:4913) // Warning about operator, +# endif + // two check overloads help us identify which operator++ was picked char (& check(tag) )[2]; @@ -92,6 +97,11 @@ namespace is_incrementable_ , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 ); }; + +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif + } # undef BOOST_comma From 7c911e570ffb3878c6487587e4492a8c1ceacbe0 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sat, 14 Jun 2008 17:46:41 +0000 Subject: [PATCH 09/12] modification to correct error detected on stdxxx tests [SVN r46392] --- include/boost/detail/utf8_codecvt_facet.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index ac7e7bf..a8bedc2 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -79,10 +79,8 @@ // specialized on those types for this to work. #include -// for mbstate_t -#include -// for std::size_t -#include +#include // for mbstate_t +#include // for std::size_t #include #include From 3c2c779258e0f8e4773c6839791228cc2734f86f Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Sun, 15 Jun 2008 17:01:43 +0000 Subject: [PATCH 10/12] simplified namespace issue with mbstate_t [SVN r46408] --- include/boost/detail/utf8_codecvt_facet.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.hpp b/include/boost/detail/utf8_codecvt_facet.hpp index a8bedc2..13c8346 100644 --- a/include/boost/detail/utf8_codecvt_facet.hpp +++ b/include/boost/detail/utf8_codecvt_facet.hpp @@ -85,17 +85,10 @@ #include #include -namespace std { - #if defined(__LIBCOMO__) - using ::mbstate_t; - #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__) - using ::mbstate_t; - #elif defined(__SGI_STL_PORT) - #elif defined(BOOST_NO_STDC_NAMESPACE) - using ::mbstate_t; - using ::codecvt; - #endif -} // namespace std +#if defined(BOOST_NO_STDC_NAMESPACE) + using ::codecvt; + using ::mbstate_t; +#endif #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__) #define BOOST_CODECVT_DO_LENGTH_CONST const From 06946f66073853f8a99650b6a88cbee741b43819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Fri, 27 Jun 2008 13:32:24 +0000 Subject: [PATCH 11/12] Boost 1.36 version of Boost.MultiIndex passim: supressed non-ASCII chars in C++ code bidir_node_iterator.hpp: deleted unused template parameter bucket_array.hpp: avoided allocator instantiations hash_index_iterator.hpp: avoided allocator instantiations hash_index_node.hpp: avoided allocator instantiations, renamed var ord_index_node.hpp: avoided allocator instantiations rnd_index_loader.hpp: avoided allocator instantiations rnd_index_node.hpp: avoided allocator instantiations rnd_index_ptr_array.hpp: avoided allocator instantiations rnd_node_iterator.hpp: deleted unused template parameter seq_index_node.hpp: avoided allocator instantiations hashed_index.hpp: rewritten modify_ so that elements with unmodified key do not change position multi_index_container.hpp: added allocator ctor acknowledgements.html: added acknowledgements for Boost 1.36 compiler_specifics.html: typo hash_indices.html: documented updating functions behavior wrt unmodified keys, formatting typos key_extraction.html: formatting typos multi_index_container.html: added allocator ctor, formatting typos ord_indices.html: documented updating functions behavior wrt unmodified keys, formatting typos rnd_indices.html: formatting typos seq_indices.html: formatting typos release_notes.html: added release notes for Boost 1.36 hashed.cpp: blocked Boost inspect tool check for ASCII only chars non_std_allocator.hpp: removed void specialization to verify that no allocator instantiations are generated test_copy_assignment.cpp: added test for multi_index_container allocator ctor test_update.cpp: added test for stability of update functions wrt to unmodified keys [SVN r46770] --- include/boost/detail/allocator_utilities.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index 5a9a79e..91b0fa7 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2007 Joaquín M López Muñoz. +/* Copyright 2003-2008 Joaquin M Lopez Munoz. * 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) From 18dbae470094879cadc732688b8408e028b074c0 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Wed, 20 Aug 2008 11:06:23 +0000 Subject: [PATCH 12/12] integer_log2.hpp and lowest_bit.hpp, in boost/pending/: little comment cleanup (svn anchors, etc.); added a static_cast<> to silence (harmless) MSVC++ warnings [SVN r48251] --- include/boost/pending/integer_log2.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/boost/pending/integer_log2.hpp b/include/boost/pending/integer_log2.hpp index 15fd8b5..f4bc846 100644 --- a/include/boost/pending/integer_log2.hpp +++ b/include/boost/pending/integer_log2.hpp @@ -1,20 +1,16 @@ -// ------------------------------------- +// ----------------------------------------------------------- // integer_log2.hpp // // Gives the integer part of the logarithm, in base 2, of a // given number. Behavior is undefined if the argument is <= 0. // -// -// (C) Copyright Gennaro Prota 2003 - 2004. +// Copyright (c) 2003-2004, 2008 Gennaro Prota // // 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) // -// ------------------------------------------------------ -// -// $Id$ - +// ----------------------------------------------------------- #ifndef BOOST_INTEGER_LOG2_HPP_GP_20030301 #define BOOST_INTEGER_LOG2_HPP_GP_20030301 @@ -37,7 +33,7 @@ namespace boost { while (x != 1) { - const T t = x >> n; + const T t = static_cast(x >> n); if (t) { result += n; x = t;