Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80797 - in branches/release: boost/date_time boost/date_time/gregorian boost/date_time/posix_time libs/date_time libs/date_time/src/gregorian libs/date_time/test/gregorian
From: marshall_at_[hidden]
Date: 2012-09-30 19:25:24


Author: marshall
Date: 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
New Revision: 80797
URL: http://svn.boost.org/trac/boost/changeset/80797

Log:
Merge bug fixes to release; Fixes #5550 Fixes #6136 Fixes #6513 Fixes #7111 Fixes #7112 Fixes #7113 Fixes #7342 Fixes #7426
Properties modified:
   branches/release/boost/date_time/ (props changed)
   branches/release/libs/date_time/ (props changed)
   branches/release/libs/date_time/src/gregorian/ (props changed)
Text files modified:
   branches/release/boost/date_time/date_facet.hpp | 9 ++++++---
   branches/release/boost/date_time/date_formatting.hpp | 4 +++-
   branches/release/boost/date_time/date_parsing.hpp | 2 ++
   branches/release/boost/date_time/dst_rules.hpp | 2 +-
   branches/release/boost/date_time/format_date_parser.hpp | 6 ------
   branches/release/boost/date_time/gregorian/greg_serialize.hpp | 28 ++++++++++++++--------------
   branches/release/boost/date_time/posix_time/time_serialize.hpp | 2 +-
   branches/release/boost/date_time/time_parsing.hpp | 2 ++
   branches/release/libs/date_time/src/gregorian/greg_month.cpp | 8 ++++----
   branches/release/libs/date_time/test/gregorian/testdate_input_facet.cpp | 2 +-
   10 files changed, 34 insertions(+), 31 deletions(-)

Modified: branches/release/boost/date_time/date_facet.hpp
==============================================================================
--- branches/release/boost/date_time/date_facet.hpp (original)
+++ branches/release/boost/date_time/date_facet.hpp 2012-09-30 19:25:22 EDT (Sun, 30 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);
     }

Modified: branches/release/boost/date_time/date_formatting.hpp
==============================================================================
--- branches/release/boost/date_time/date_formatting.hpp (original)
+++ branches/release/boost/date_time/date_formatting.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -54,7 +54,9 @@
           os << std::setw(2) << std::setfill(os.widen('0')) << month.as_number();
           break;
         }
-
+ default:
+ break;
+
       }
       return os;
     } // format_month

Modified: branches/release/boost/date_time/date_parsing.hpp
==============================================================================
--- branches/release/boost/date_time/date_parsing.hpp (original)
+++ branches/release/boost/date_time/date_parsing.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -148,6 +148,7 @@
             day = boost::lexical_cast<unsigned short>(*beg);
             break;
           }
+ default: break;
         } //switch
       }
       return date_type(year, month, day);
@@ -180,6 +181,7 @@
         case 0: y = i; break;
         case 1: m = i; break;
         case 2: d = i; break;
+ default: break;
         }
         pos++;
       }

Modified: branches/release/boost/date_time/dst_rules.hpp
==============================================================================
--- branches/release/boost/date_time/dst_rules.hpp (original)
+++ branches/release/boost/date_time/dst_rules.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -371,7 +371,7 @@
         return is_not_in_dst;
       }
 
- static bool is_dst_boundary_day(date_type )
+ static bool is_dst_boundary_day(date_type /*d*/)
       {
         return false;
       }

Modified: branches/release/boost/date_time/format_date_parser.hpp
==============================================================================
--- branches/release/boost/date_time/format_date_parser.hpp (original)
+++ branches/release/boost/date_time/format_date_parser.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -256,7 +256,6 @@
     
     // skip leading whitespace
     while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; }
- charT current_char = *sitr;
 
     short year(0), month(0), day(0), day_of_year(0);// wkday(0);
     /* Initialized the following to their minimum values. These intermediate
@@ -290,7 +289,6 @@
               }
               wkday = mr.current_match;
               if (mr.has_remaining()) {
- current_char = mr.last_char();
                 use_current_char = true;
               }
               break;
@@ -310,7 +308,6 @@
               }
               wkday = mr.current_match;
               if (mr.has_remaining()) {
- current_char = mr.last_char();
                 use_current_char = true;
               }
               break;
@@ -326,7 +323,6 @@
               }
               t_month = month_type(mr.current_match);
               if (mr.has_remaining()) {
- current_char = mr.last_char();
                 use_current_char = true;
               }
               break;
@@ -342,7 +338,6 @@
               }
               t_month = month_type(mr.current_match);
               if (mr.has_remaining()) {
- current_char = mr.last_char();
                 use_current_char = true;
               }
               break;
@@ -438,7 +433,6 @@
         itr++;
         if (use_current_char) {
           use_current_char = false;
- current_char = *sitr;
         }
         else {
           sitr++;

Modified: branches/release/boost/date_time/gregorian/greg_serialize.hpp
==============================================================================
--- branches/release/boost/date_time/gregorian/greg_serialize.hpp (original)
+++ branches/release/boost/date_time/gregorian/greg_serialize.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -88,7 +88,7 @@
 
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 ::boost::gregorian::date* dp,
                                 const unsigned int /*file_version*/)
 {
@@ -117,7 +117,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::date_duration* dd,
+inline void load_construct_data(Archive & /*ar*/, gregorian::date_duration* dd,
                                 const unsigned int /*file_version*/)
 {
   ::new(dd) gregorian::date_duration(gregorian::not_a_date_time);
@@ -143,7 +143,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::date_duration::duration_rep* dr,
+inline void load_construct_data(Archive & /*ar*/, gregorian::date_duration::duration_rep* dr,
                                 const unsigned int /*file_version*/)
 {
   ::new(dr) gregorian::date_duration::duration_rep(0);
@@ -179,7 +179,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::date_period* dp,
+inline void load_construct_data(Archive & /*ar*/, gregorian::date_period* dp,
                                 const unsigned int /*file_version*/)
 {
   gregorian::date d(gregorian::not_a_date_time);
@@ -207,7 +207,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::greg_year* gy,
+inline void load_construct_data(Archive & /*ar*/, gregorian::greg_year* gy,
                                 const unsigned int /*file_version*/)
 {
   ::new(gy) gregorian::greg_year(1900);
@@ -233,7 +233,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::greg_month* gm,
+inline void load_construct_data(Archive & /*ar*/, gregorian::greg_month* gm,
                                 const unsigned int /*file_version*/)
 {
   ::new(gm) gregorian::greg_month(1);
@@ -259,7 +259,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::greg_day* gd,
+inline void load_construct_data(Archive & /*ar*/, gregorian::greg_day* gd,
                                 const unsigned int /*file_version*/)
 {
   ::new(gd) gregorian::greg_day(1);
@@ -285,7 +285,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::greg_weekday* gd,
+inline void load_construct_data(Archive & /*ar*/, gregorian::greg_weekday* gd,
                                 const unsigned int /*file_version*/)
 {
   ::new(gd) gregorian::greg_weekday(1);
@@ -323,7 +323,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar, gregorian::partial_date* pd,
+inline void load_construct_data(Archive & /*ar*/, gregorian::partial_date* pd,
                                 const unsigned int /*file_version*/)
 {
   gregorian::greg_month gm(1);
@@ -366,7 +366,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 gregorian::nth_kday_of_month* nkd,
                                 const unsigned int /*file_version*/)
 {
@@ -406,7 +406,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 gregorian::first_kday_of_month* fkd,
                                 const unsigned int /*file_version*/)
 {
@@ -445,7 +445,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 gregorian::last_kday_of_month* lkd,
                                 const unsigned int /*file_version*/)
 {
@@ -474,7 +474,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 gregorian::first_kday_before* fkdb,
                                 const unsigned int /*file_version*/)
 {
@@ -503,7 +503,7 @@
 }
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 gregorian::first_kday_after* fkda,
                                 const unsigned int /*file_version*/)
 {

Modified: branches/release/boost/date_time/posix_time/time_serialize.hpp
==============================================================================
--- branches/release/boost/date_time/posix_time/time_serialize.hpp (original)
+++ branches/release/boost/date_time/posix_time/time_serialize.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -184,7 +184,7 @@
 
 //!override needed b/c no default constructor
 template<class Archive>
-inline void load_construct_data(Archive & ar,
+inline void load_construct_data(Archive & /*ar*/,
                                 boost::posix_time::time_period* tp,
                                 const unsigned int /*file_version*/)
 {

Modified: branches/release/boost/date_time/time_parsing.hpp
==============================================================================
--- branches/release/boost/date_time/time_parsing.hpp (original)
+++ branches/release/boost/date_time/time_parsing.hpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -116,6 +116,7 @@
         
         break;
       }
+ default: break;
       }//switch
       pos++;
     }
@@ -280,6 +281,7 @@
             
             break;
           }
+ default: break;
       };
       pos++;
     }

Modified: branches/release/libs/date_time/src/gregorian/greg_month.cpp
==============================================================================
--- branches/release/libs/date_time/src/gregorian/greg_month.cpp (original)
+++ branches/release/libs/date_time/src/gregorian/greg_month.cpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -108,7 +108,7 @@
    */
   BOOST_DATE_TIME_DECL
   boost::date_time::all_date_names_put<greg_facet_config, char>*
- create_facet_def(char type)
+ create_facet_def(char /*type*/)
   {
     typedef
       boost::date_time::all_date_names_put<greg_facet_config, char> facet_def;
@@ -121,7 +121,7 @@
   }
   
   //! generates a locale with the set of gregorian name-strings of type char*
- BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, char type){
+ BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, char /*type*/){
     typedef boost::date_time::all_date_names_put<greg_facet_config, char> facet_def;
     return std::locale(loc, new facet_def(short_month_names,
                                           long_month_names,
@@ -139,7 +139,7 @@
    */
   BOOST_DATE_TIME_DECL
   boost::date_time::all_date_names_put<greg_facet_config, wchar_t>*
- create_facet_def(wchar_t type)
+ create_facet_def(wchar_t /*type*/)
   {
     typedef
       boost::date_time::all_date_names_put<greg_facet_config,wchar_t> facet_def;
@@ -152,7 +152,7 @@
   }
 
   //! generates a locale with the set of gregorian name-strings of type wchar_t*
- BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, wchar_t type){
+ BOOST_DATE_TIME_DECL std::locale generate_locale(std::locale& loc, wchar_t /*type*/){
     typedef boost::date_time::all_date_names_put<greg_facet_config, wchar_t> facet_def;
     return std::locale(loc, new facet_def(w_short_month_names,
                                           w_long_month_names,

Modified: branches/release/libs/date_time/test/gregorian/testdate_input_facet.cpp
==============================================================================
--- branches/release/libs/date_time/test/gregorian/testdate_input_facet.cpp (original)
+++ branches/release/libs/date_time/test/gregorian/testdate_input_facet.cpp 2012-09-30 19:25:22 EDT (Sun, 30 Sep 2012)
@@ -79,7 +79,7 @@
 
     date_input_facet* f = new date_input_facet();
     f->get(sitr, str_end, ss, m);
- check("No extra characters consumed", m = greg_month(Mar) && *sitr == '.');
+ check("No extra characters consumed", m == greg_month(Mar) && *sitr == '.');
   }
  
   // set up initial objects


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