Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80710 - trunk/boost/date_time
From: marshall_at_[hidden]
Date: 2012-09-26 12:57:59


Author: marshall
Date: 2012-09-26 12:57:58 EDT (Wed, 26 Sep 2012)
New Revision: 80710
URL: http://svn.boost.org/trac/boost/changeset/80710

Log:
Use memset instead of default constructor (std::tm) for deficient compilers; Refs #5550
Text files modified:
   trunk/boost/date_time/date_facet.hpp | 9 ++++++---
   1 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/boost/date_time/date_facet.hpp
==============================================================================
--- trunk/boost/date_time/date_facet.hpp (original)
+++ trunk/boost/date_time/date_facet.hpp 2012-09-26 12:57:58 EDT (Wed, 26 Sep 2012)
@@ -208,7 +208,8 @@
       // return do_put_special(next, a_ios, fill_char, d.as_special());
       //}
       //The following line of code required the date to support a to_tm function
- std::tm dtm = {};
+ std::tm dtm;
+ std::memset(&dtm, 0, sizeof(dtm));
       dtm.tm_mon = m - 1;
       return do_put_tm(next, a_ios, fill_char, dtm, m_month_format);
     }
@@ -219,7 +220,8 @@
                 char_type fill_char,
                 const day_type& day) const
     {
- std::tm dtm = {};
+ std::tm dtm;
+ std::memset(&dtm, 0, sizeof(dtm));
       dtm.tm_mday = day.as_number();
       char_type tmp[3] = {'%','d'};
       string_type temp_format(tmp);
@@ -235,7 +237,8 @@
       // return do_put_special(next, a_ios, fill_char, d.as_special());
       //}
       //The following line of code required the date to support a to_tm function
- std::tm dtm = {};
+ std::tm dtm;
+ std::memset(&dtm, 0, sizeof(dtm));
       dtm.tm_wday = dow;
       return do_put_tm(next, a_ios, fill_char, dtm, m_weekday_format);
     }


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