Re: [Boost-bugs] [Boost C++ Libraries] #2819: boost::posix_time::hours, minutes, and seconds assume sizeof(long) == sizeof(int)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2819: boost::posix_time::hours, minutes, and seconds assume sizeof(long) == sizeof(int)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-03-03 22:38:49


#2819: boost::posix_time::hours, minutes, and seconds assume sizeof(long) ==
sizeof(int)
-----------------------------------+----------------------------------------
  Reporter: pelee_at_[hidden] | Owner: az_sw_dude
      Type: Bugs | Status: new
 Milestone: Boost 1.39.0 | Component: date_time
   Version: Boost Release Branch | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment(by pelee_at_[hidden]):

 Making this change also causes a 64-to-32 bit warning in xtime. The
 solution is to update a call to posix_time::seconds() to cast its argument
 to boost::int32_t instead of long.


 {{{
     operator system_time() const
     {
         return boost::posix_time::from_time_t(0)+
 boost::posix_time::seconds(static_cast<boost::int32_t>(sec))+
 #ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
             boost::posix_time::nanoseconds(nsec);
 #else
         boost::posix_time::microseconds((nsec+500)/1000);
 #endif
     }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2819#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC