Boost logo

Boost-Commit :

From: arseny.kapoulkine_at_[hidden]
Date: 2007-07-29 16:19:02


Author: zeux
Date: 2007-07-29 16:19:00 EDT (Sun, 29 Jul 2007)
New Revision: 7580
URL: http://svn.boost.org/trac/boost/changeset/7580

Log:
MSVC8 warnings fixed
Text files modified:
   sandbox/SOC/2007/bigint/boost/bigint/bigint_default.hpp | 9 +++++++--
   1 files changed, 7 insertions(+), 2 deletions(-)

Modified: sandbox/SOC/2007/bigint/boost/bigint/bigint_default.hpp
==============================================================================
--- sandbox/SOC/2007/bigint/boost/bigint/bigint_default.hpp (original)
+++ sandbox/SOC/2007/bigint/boost/bigint/bigint_default.hpp 2007-07-29 16:19:00 EDT (Sun, 29 Jul 2007)
@@ -755,7 +755,12 @@
                                 return;
                         }
 
- data.resize(lhs.data.size() + rhs / limb_bit_number);
+ if (rhs / limb_bit_number > (static_cast<boost::uint64_t>(1) << (sizeof(size_t) * 8)))
+ {
+ throw std::bad_alloc();
+ }
+
+ data.resize(lhs.data.size() + static_cast<size_t>(rhs / limb_bit_number));
 
                         limb_t* di = data.begin() + rhs / limb_bit_number;
 
@@ -790,7 +795,7 @@
                                 return;
                         }
 
- data.resize(lhs.data.size() - rhs / limb_bit_number);
+ data.resize(lhs.data.size() - static_cast<size_t>(rhs / limb_bit_number));
                                 
                         limb_t* di = data.begin();
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk