diff options
Diffstat (limited to 'boost/date_time')
101 files changed, 342 insertions, 329 deletions
diff --git a/boost/date_time/adjust_functors.hpp b/boost/date_time/adjust_functors.hpp index dde8ca8590..f6c5a04c4d 100644 --- a/boost/date_time/adjust_functors.hpp +++ b/boost/date_time/adjust_functors.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/date.hpp" diff --git a/boost/date_time/c_local_time_adjustor.hpp b/boost/date_time/c_local_time_adjustor.hpp index 45e96d3af8..aa563122b1 100644 --- a/boost/date_time/c_local_time_adjustor.hpp +++ b/boost/date_time/c_local_time_adjustor.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ /*! @file c_local_time_adjustor.hpp @@ -42,7 +42,10 @@ namespace date_time { } date_duration_type dd = t.date() - time_t_start_day; time_duration_type td = t.time_of_day(); - std::time_t t2 = dd.days()*86400 + td.hours()*3600 + td.minutes()*60 + td.seconds(); + std::time_t t2 = static_cast<std::time_t>(dd.days())*86400 + + static_cast<std::time_t>(td.hours())*3600 + + static_cast<std::time_t>(td.minutes())*60 + + td.seconds(); std::tm tms, *tms_ptr; tms_ptr = c_time::localtime(&t2, &tms); date_type d(static_cast<unsigned short>(tms_ptr->tm_year + 1900), diff --git a/boost/date_time/c_time.hpp b/boost/date_time/c_time.hpp index b3509afec6..5998908c4e 100644 --- a/boost/date_time/c_time.hpp +++ b/boost/date_time/c_time.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ @@ -88,7 +88,7 @@ namespace date_time { boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); return result; } -#else // BOOST_HAS_THREADS +#else // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) #pragma warning(push) // preserve warning settings @@ -116,7 +116,7 @@ namespace date_time { #pragma warning(pop) // restore warnings to previous state #endif // _MSC_VER >= 1400 -#endif // BOOST_HAS_THREADS +#endif // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS }; }} // namespaces diff --git a/boost/date_time/compiler_config.hpp b/boost/date_time/compiler_config.hpp index 1aa1330f64..e37d0614a4 100644 --- a/boost/date_time/compiler_config.hpp +++ b/boost/date_time/compiler_config.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2011-07-26 10:40:21 -0700 (Tue, 26 Jul 2011) $ + * $Date$ */ #include <cstdlib> diff --git a/boost/date_time/constrained_value.hpp b/boost/date_time/constrained_value.hpp index 7338105e2d..910e99a861 100644 --- a/boost/date_time/constrained_value.hpp +++ b/boost/date_time/constrained_value.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <exception> diff --git a/boost/date_time/date.hpp b/boost/date_time/date.hpp index 81730cab07..2bd936cd5b 100644 --- a/boost/date_time/date.hpp +++ b/boost/date_time/date.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/operators.hpp> @@ -191,8 +191,8 @@ namespace date_time { dates. It is not exposed to users since that would require class users to understand the inner workings of the date class. */ - explicit date(date_int_type days) : days_(days) {}; - explicit date(date_rep_type days) : days_(days.as_number()) {}; + explicit date(date_int_type days) : days_(days) {} + explicit date(date_rep_type days) : days_(days.as_number()) {} date_int_type days_; }; diff --git a/boost/date_time/date_clock_device.hpp b/boost/date_time/date_clock_device.hpp index 6202f6c58f..2145d65fd5 100644 --- a/boost/date_time/date_clock_device.hpp +++ b/boost/date_time/date_clock_device.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/c_time.hpp" @@ -36,18 +36,18 @@ namespace date_time { { ::std::tm result; ::std::tm* curr = get_local_time(result); - return ymd_type(curr->tm_year + 1900, - curr->tm_mon + 1, - curr->tm_mday); + return ymd_type(static_cast<unsigned short>(curr->tm_year + 1900), + static_cast<unsigned short>(curr->tm_mon + 1), + static_cast<unsigned short>(curr->tm_mday)); } //! Get the current day in universal date as a ymd_type static typename date_type::ymd_type universal_day_ymd() { ::std::tm result; ::std::tm* curr = get_universal_time(result); - return ymd_type(curr->tm_year + 1900, - curr->tm_mon + 1, - curr->tm_mday); + return ymd_type(static_cast<unsigned short>(curr->tm_year + 1900), + static_cast<unsigned short>(curr->tm_mon + 1), + static_cast<unsigned short>(curr->tm_mday)); } //! Get the UTC day as a date type static date_type universal_day() diff --git a/boost/date_time/date_defs.hpp b/boost/date_time/date_defs.hpp index ae7e4c5a03..6c80db3a83 100644 --- a/boost/date_time/date_defs.hpp +++ b/boost/date_time/date_defs.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ diff --git a/boost/date_time/date_duration.hpp b/boost/date_time/date_duration.hpp index 7bd48fd2b7..f5b4b083d7 100644 --- a/boost/date_time/date_duration.hpp +++ b/boost/date_time/date_duration.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_DATE_DURATION__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ @@ -26,14 +26,14 @@ namespace date_time { , boost::subtractable1< date_duration< duration_rep_traits > , boost::dividable2< date_duration< duration_rep_traits >, int > > > > > - { + { public: typedef typename duration_rep_traits::int_type duration_rep_type; typedef typename duration_rep_traits::impl_type duration_rep; - + //! Construct from a day count - explicit date_duration(duration_rep day_count) : days_(day_count) {}; - + explicit date_duration(duration_rep day_count) : days_(day_count) {} + /*! construct from special_values - only works when * instantiated with duration_traits_adapted */ date_duration(special_values sv) : @@ -125,7 +125,7 @@ namespace date_time { { typedef long int_type; typedef long impl_type; - static int_type as_number(impl_type i) { return i; }; + static int_type as_number(impl_type i) { return i; } }; /*! Struct for instantiating date_duration <b>WITH</b> special values @@ -135,9 +135,9 @@ namespace date_time { { typedef long int_type; typedef boost::date_time::int_adapter<long> impl_type; - static int_type as_number(impl_type i) { return i.as_number(); }; + static int_type as_number(impl_type i) { return i.as_number(); } }; - + } } //namspace date_time diff --git a/boost/date_time/date_duration_types.hpp b/boost/date_time/date_duration_types.hpp index e44c59fff6..8c0e9860d0 100644 --- a/boost/date_time/date_duration_types.hpp +++ b/boost/date_time/date_duration_types.hpp @@ -6,7 +6,7 @@ * (See accompanying file LICENSE_1_0.txt or * http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <boost/date_time/int_adapter.hpp> diff --git a/boost/date_time/date_facet.hpp b/boost/date_time/date_facet.hpp index 1584fe56a4..c3574cc953 100644 --- a/boost/date_time/date_facet.hpp +++ b/boost/date_time/date_facet.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2009-06-04 04:40:18 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ #include <locale> @@ -208,7 +208,8 @@ namespace boost { namespace date_time { // 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 @@ namespace boost { namespace date_time { 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 @@ namespace boost { namespace date_time { // 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); } diff --git a/boost/date_time/date_format_simple.hpp b/boost/date_time/date_format_simple.hpp index 05119c4413..452990379b 100644 --- a/boost/date_time/date_format_simple.hpp +++ b/boost/date_time/date_format_simple.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/parse_format_base.hpp" diff --git a/boost/date_time/date_formatting.hpp b/boost/date_time/date_formatting.hpp index 0903c75bfb..d4ca3dd27c 100644 --- a/boost/date_time/date_formatting.hpp +++ b/boost/date_time/date_formatting.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include "boost/date_time/iso_format.hpp" @@ -54,7 +54,9 @@ namespace date_time { os << std::setw(2) << std::setfill(os.widen('0')) << month.as_number(); break; } - + default: + break; + } return os; } // format_month diff --git a/boost/date_time/date_formatting_limited.hpp b/boost/date_time/date_formatting_limited.hpp index 5721473ba1..7c5c1735a3 100644 --- a/boost/date_time/date_formatting_limited.hpp +++ b/boost/date_time/date_formatting_limited.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/iso_format.hpp" diff --git a/boost/date_time/date_formatting_locales.hpp b/boost/date_time/date_formatting_locales.hpp index e3aec4967c..2c17c055cd 100644 --- a/boost/date_time/date_formatting_locales.hpp +++ b/boost/date_time/date_formatting_locales.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ diff --git a/boost/date_time/date_generator_formatter.hpp b/boost/date_time/date_generator_formatter.hpp index 159cf36eb8..42c396b2c0 100644 --- a/boost/date_time/date_generator_formatter.hpp +++ b/boost/date_time/date_generator_formatter.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <iostream> diff --git a/boost/date_time/date_generator_parser.hpp b/boost/date_time/date_generator_parser.hpp index 7cff9ca363..f4d7b27a79 100644 --- a/boost/date_time/date_generator_parser.hpp +++ b/boost/date_time/date_generator_parser.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <string> diff --git a/boost/date_time/date_generators.hpp b/boost/date_time/date_generators.hpp index 1944c3412c..274ce1f06a 100644 --- a/boost/date_time/date_generators.hpp +++ b/boost/date_time/date_generators.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_DATE_GENERATORS_HPP__ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * Author: Jeff Garland, Bart Garst + * $Date$ */ /*! @file date_generators.hpp @@ -34,16 +34,16 @@ namespace date_time { public: typedef typename date_type::calendar_type calendar_type; typedef typename calendar_type::year_type year_type; - year_based_generator() {}; - virtual ~year_based_generator() {}; + year_based_generator() {} + virtual ~year_based_generator() {} virtual date_type get_date(year_type y) const = 0; //! Returns a string for use in a POSIX time_zone string virtual std::string to_string() const =0; }; - + //! Generates a date by applying the year to the given month and day. /*! - Example usage: + Example usage: @code partial_date pd(1, Jan); partial_date pd2(70); @@ -123,9 +123,9 @@ namespace date_time { //months are equal return (day_ < rhs.day_); } - + // added for streaming purposes - month_type month() const + month_type month() const { return month_; } @@ -135,15 +135,15 @@ namespace date_time { } //! Returns string suitable for use in POSIX time zone string - /*! Returns string formatted with up to 3 digits: - * Jan-01 == "0" + /*! Returns string formatted with up to 3 digits: + * Jan-01 == "0" * Feb-29 == "58" * Dec-31 == "365" */ virtual std::string to_string() const { std::ostringstream ss; date_type d(2004, month_, day_); - unsigned short c = d.day_of_year(); + unsigned short c = d.day_of_year(); c--; // numbered 0-365 while day_of_year is 1 based... ss << c; return ss.str(); @@ -161,7 +161,7 @@ namespace date_time { /*! Based on the idea in Cal. Calc. for finding holidays that are * the 'first Monday of September'. When instantiated with * 'fifth' kday of month, the result will be the last kday of month - * which can be the fourth or fifth depending on the structure of + * which can be the fourth or fifth depending on the structure of * the month. * * The algorithm here basically guesses for the first @@ -169,8 +169,8 @@ namespace date_time { * type. That is, if the first of the month is a Tuesday * and it needs Wenesday then we simply increment by a day * and then we can add the length of a week until we get - * to the 'nth kday'. There are probably more efficient - * algorithms based on using a mod 7, but this one works + * to the 'nth kday'. There are probably more efficient + * algorithms based on using a mod 7, but this one works * reasonably well for basic applications. * \ingroup date_alg */ @@ -233,7 +233,7 @@ namespace date_time { virtual std::string to_string() const { std::ostringstream ss; - ss << 'M' + ss << 'M' << static_cast<int>(month_) << '.' << static_cast<int>(wn_) << '.' << static_cast<int>(dow_); @@ -244,7 +244,7 @@ namespace date_time { week_num wn_; day_of_week_type dow_; }; - + //! Useful generator functor for finding holidays and daylight savings /*! Similar to nth_kday_of_month, but requires less paramters * \ingroup date_alg @@ -290,7 +290,7 @@ namespace date_time { virtual std::string to_string() const { std::ostringstream ss; - ss << 'M' + ss << 'M' << static_cast<int>(month_) << '.' << 1 << '.' << static_cast<int>(dow_); @@ -300,9 +300,9 @@ namespace date_time { month_type month_; day_of_week_type dow_; }; - - - + + + //! Calculate something like Last Sunday of January /*! Useful generator functor for finding holidays and daylight savings * Get the last day of the month and then calculate the difference @@ -351,7 +351,7 @@ namespace date_time { virtual std::string to_string() const { std::ostringstream ss; - ss << 'M' + ss << 'M' << static_cast<int>(month_) << '.' << 5 << '.' << static_cast<int>(dow_); @@ -361,8 +361,8 @@ namespace date_time { month_type month_; day_of_week_type dow_; }; - - + + //! Calculate something like "First Sunday after Jan 1,2002 /*! Date generator that takes a date and finds kday after *@code @@ -400,7 +400,7 @@ namespace date_time { private: day_of_week_type dow_; }; - + //! Calculate something like "First Sunday before Jan 1,2002 /*! Date generator that takes a date and finds kday after *@code @@ -438,10 +438,10 @@ namespace date_time { private: day_of_week_type dow_; }; - + //! Calculates the number of days until the next weekday /*! Calculates the number of days until the next weekday. - * If the date given falls on a Sunday and the given weekday + * If the date given falls on a Sunday and the given weekday * is Tuesday the result will be 2 days */ template<typename date_type, class weekday_type> inline @@ -458,8 +458,8 @@ namespace date_time { //! Calculates the number of days since the previous weekday /*! Calculates the number of days since the previous weekday - * If the date given falls on a Sunday and the given weekday - * is Tuesday the result will be 5 days. The answer will be a positive + * If the date given falls on a Sunday and the given weekday + * is Tuesday the result will be 5 days. The answer will be a positive * number because Tuesday is 5 days before Sunday, not -5 days before. */ template<typename date_type, class weekday_type> inline @@ -477,9 +477,9 @@ namespace date_time { } //! Generates a date object representing the date of the following weekday from the given date - /*! Generates a date object representing the date of the following - * weekday from the given date. If the date given is 2004-May-9 - * (a Sunday) and the given weekday is Tuesday then the resulting date + /*! Generates a date object representing the date of the following + * weekday from the given date. If the date given is 2004-May-9 + * (a Sunday) and the given weekday is Tuesday then the resulting date * will be 2004-May-11. */ template<class date_type, class weekday_type> inline @@ -489,9 +489,9 @@ namespace date_time { } //! Generates a date object representing the date of the previous weekday from the given date - /*! Generates a date object representing the date of the previous - * weekday from the given date. If the date given is 2004-May-9 - * (a Sunday) and the given weekday is Tuesday then the resulting date + /*! Generates a date object representing the date of the previous + * weekday from the given date. If the date given is 2004-May-9 + * (a Sunday) and the given weekday is Tuesday then the resulting date * will be 2004-May-4. */ template<class date_type, class weekday_type> inline diff --git a/boost/date_time/date_iterator.hpp b/boost/date_time/date_iterator.hpp index 20bfb05c9f..3526ba18b4 100644 --- a/boost/date_time/date_iterator.hpp +++ b/boost/date_time/date_iterator.hpp @@ -2,11 +2,11 @@ #define DATE_ITERATOR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <iterator> @@ -32,7 +32,7 @@ namespace date_time { template<class date_type> class date_itr_base { // works, but benefit unclear at the moment - // class date_itr_base : public std::iterator<std::input_iterator_tag, + // class date_itr_base : public std::iterator<std::input_iterator_tag, // date_type, void, void, void>{ public: typedef typename date_type::duration_type duration_type; @@ -40,31 +40,31 @@ namespace date_time { typedef std::input_iterator_tag iterator_category; date_itr_base(date_type d) : current_(d) {} - virtual ~date_itr_base() {}; - date_itr_base& operator++() + virtual ~date_itr_base() {} + date_itr_base& operator++() { current_ = current_ + get_offset(current_); return *this; } - date_itr_base& operator--() + date_itr_base& operator--() { current_ = current_ + get_neg_offset(current_); return *this; } virtual duration_type get_offset(const date_type& current) const=0; virtual duration_type get_neg_offset(const date_type& current) const=0; - date_type operator*() {return current_;}; - date_type* operator->() {return ¤t_;}; + date_type operator*() {return current_;} + date_type* operator->() {return ¤t_;} bool operator< (const date_type& d) {return current_ < d;} bool operator<= (const date_type& d) {return current_ <= d;} bool operator> (const date_type& d) {return current_ > d;} bool operator>= (const date_type& d) {return current_ >= d;} bool operator== (const date_type& d) {return current_ == d;} - bool operator!= (const date_type& d) {return current_ != d;} + bool operator!= (const date_type& d) {return current_ != d;} private: date_type current_; }; - + //! Overrides the base date iterator providing hook for functors /* * <b>offset_functor</b> @@ -77,9 +77,9 @@ namespace date_time { class date_itr : public date_itr_base<date_type> { public: typedef typename date_type::duration_type duration_type; - date_itr(date_type d, int factor=1) : - date_itr_base<date_type>(d), - of_(factor) + date_itr(date_type d, int factor=1) : + date_itr_base<date_type>(d), + of_(factor) {} private: virtual duration_type get_offset(const date_type& current) const @@ -92,9 +92,9 @@ namespace date_time { } offset_functor of_; }; - - + + } } //namespace date_time diff --git a/boost/date_time/date_names_put.hpp b/boost/date_time/date_names_put.hpp index 6606f43153..e055fa8734 100644 --- a/boost/date_time/date_names_put.hpp +++ b/boost/date_time/date_names_put.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_DATE_NAMES_PUT_HPP___ /* Copyright (c) 2002-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * Author: Jeff Garland, Bart Garst + * $Date$ */ @@ -27,22 +27,22 @@ namespace date_time { //! Output facet base class for gregorian dates. /*! This class is a base class for date facets used to localize the * names of months and the names of days in the week. - * + * * Requirements of Config - * - define an enumeration month_enum that enumerates the months. + * - define an enumeration month_enum that enumerates the months. * The enumeration should be '1' based eg: Jan==1 * - define as_short_string and as_long_string * * (see langer & kreft p334). - * + * */ template<class Config, - class charT = char, + class charT = char, class OutputIterator = std::ostreambuf_iterator<charT> > class date_names_put : public std::locale::facet { public: - date_names_put() {}; + date_names_put() {} typedef OutputIterator iter_type; typedef typename Config::month_type month_type; typedef typename Config::month_enum month_enum; @@ -118,7 +118,7 @@ namespace date_time { put_string(oitr, gm.as_short_string(c)); } //! Default facet implementation uses month_type defaults - virtual void do_put_month_long(iter_type& oitr, + virtual void do_put_month_long(iter_type& oitr, month_enum moy) const { month_type gm(moy); @@ -160,7 +160,7 @@ namespace date_time { string_type s(separator); //put in '-' put_string(oitr, s); } - //! Default for date order + //! Default for date order virtual ymd_order_spec do_date_order() const { return ymd_order_iso; @@ -186,27 +186,27 @@ namespace date_time { } } }; - + template<class Config, class charT, class OutputIterator> - const typename date_names_put<Config, charT, OutputIterator>::char_type - date_names_put<Config, charT, OutputIterator>::default_special_value_names[3][17] = { + const typename date_names_put<Config, charT, OutputIterator>::char_type + date_names_put<Config, charT, OutputIterator>::default_special_value_names[3][17] = { {'n','o','t','-','a','-','d','a','t','e','-','t','i','m','e'}, {'-','i','n','f','i','n','i','t','y'}, {'+','i','n','f','i','n','i','t','y'} }; template<class Config, class charT, class OutputIterator> - const typename date_names_put<Config, charT, OutputIterator>::char_type - date_names_put<Config, charT, OutputIterator>::separator[2] = + const typename date_names_put<Config, charT, OutputIterator>::char_type + date_names_put<Config, charT, OutputIterator>::separator[2] = {'-', '\0'} ; - - //! Generate storage location for a std::locale::id + + //! Generate storage location for a std::locale::id template<class Config, class charT, class OutputIterator> std::locale::id date_names_put<Config, charT, OutputIterator>::id; //! A date name output facet that takes an array of char* to define strings template<class Config, - class charT = char, + class charT = char, class OutputIterator = std::ostreambuf_iterator<charT> > class all_date_names_put : public date_names_put<Config, charT, OutputIterator> { @@ -230,29 +230,29 @@ namespace date_time { separator_char_[0] = separator_char; separator_char_[1] = '\0'; - }; + } typedef OutputIterator iter_type; typedef typename Config::month_enum month_enum; typedef typename Config::weekday_enum weekday_enum; typedef typename Config::special_value_enum special_value_enum; - const charT* const* get_short_month_names() const + const charT* const* get_short_month_names() const { return month_short_names_; } - const charT* const* get_long_month_names() const + const charT* const* get_long_month_names() const { return month_long_names_; } - const charT* const* get_special_value_names() const + const charT* const* get_special_value_names() const { return special_value_names_; } - const charT* const* get_short_weekday_names()const + const charT* const* get_short_weekday_names()const { return weekday_short_names_; } - const charT* const* get_long_weekday_names()const + const charT* const* get_long_weekday_names()const { return weekday_long_names_; } @@ -263,7 +263,7 @@ namespace date_time { { this->put_string(oitr, month_short_names_[moy-1]); } - //! Long month names + //! Long month names virtual void do_put_month_long(iter_type& oitr, month_enum moy) const { this->put_string(oitr, month_long_names_[moy-1]); @@ -310,7 +310,7 @@ namespace date_time { const charT* const* weekday_long_names_; charT separator_char_[2]; ymd_order_spec order_spec_; - month_format_spec month_format_spec_; + month_format_spec month_format_spec_; }; } } //namespace boost::date_time diff --git a/boost/date_time/date_parsing.hpp b/boost/date_time/date_parsing.hpp index aa8e8e0836..33c5366027 100644 --- a/boost/date_time/date_parsing.hpp +++ b/boost/date_time/date_parsing.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ #include <string> @@ -113,7 +113,6 @@ namespace date_time { spec_str = "mdy"; } - typedef typename date_type::year_type year_type; typedef typename date_type::month_type month_type; unsigned pos = 0; unsigned short year(0), month(0), day(0); @@ -148,6 +147,7 @@ namespace date_time { day = boost::lexical_cast<unsigned short>(*beg); break; } + default: break; } //switch } return date_type(year, month, day); @@ -159,7 +159,6 @@ namespace date_time { parse_undelimited_date(const std::string& s) { int offsets[] = {4,2,2}; int pos = 0; - typedef typename date_type::year_type year_type; //typename date_type::ymd_type ymd((year_type::min)(),1,1); unsigned short y = 0, m = 0, d = 0; @@ -180,6 +179,7 @@ namespace date_time { case 0: y = i; break; case 1: m = i; break; case 2: d = i; break; + default: break; } pos++; } diff --git a/boost/date_time/dst_rules.hpp b/boost/date_time/dst_rules.hpp index 503a255f1d..32290190d9 100644 --- a/boost/date_time/dst_rules.hpp +++ b/boost/date_time/dst_rules.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file dst_rules.hpp @@ -371,7 +371,7 @@ namespace boost { return is_not_in_dst; } - static bool is_dst_boundary_day(date_type d) + static bool is_dst_boundary_day(date_type /*d*/) { return false; } diff --git a/boost/date_time/dst_transition_generators.hpp b/boost/date_time/dst_transition_generators.hpp index 6c4da1c3c9..16c1fd6361 100644 --- a/boost/date_time/dst_transition_generators.hpp +++ b/boost/date_time/dst_transition_generators.hpp @@ -18,7 +18,7 @@ namespace date_time { { public: typedef typename date_type::year_type year_type; - virtual ~dst_day_calc_rule() {}; + virtual ~dst_day_calc_rule() {} virtual date_type start_day(year_type y) const=0; virtual std::string start_rule_as_string() const=0; virtual date_type end_day(year_type y) const=0; diff --git a/boost/date_time/filetime_functions.hpp b/boost/date_time/filetime_functions.hpp index 2460fd9791..ca5a1ad933 100644 --- a/boost/date_time/filetime_functions.hpp +++ b/boost/date_time/filetime_functions.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ /*! @file filetime_functions.hpp diff --git a/boost/date_time/format_date_parser.hpp b/boost/date_time/format_date_parser.hpp index 4a76529f6c..a40dee6fb6 100644 --- a/boost/date_time/format_date_parser.hpp +++ b/boost/date_time/format_date_parser.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ @@ -63,7 +63,7 @@ fixed_string_to_int(std::istreambuf_iterator<charT>& itr, itr++; j++; } - int_type i = -1; + int_type i = static_cast<int_type>(-1); // mr.cache will hold leading zeros. size() tells us when input is too short. if(mr.cache.size() < length) { return i; @@ -111,7 +111,7 @@ var_string_to_int(std::istreambuf_iterator<charT>& itr, ++itr; ++j; } - int_type i = -1; + int_type i = static_cast<int_type>(-1); if(!s.empty()) { i = boost::lexical_cast<int_type>(s); } @@ -256,7 +256,6 @@ class format_date_parser // 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 @@ -272,7 +271,8 @@ class format_date_parser const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'a': @@ -290,7 +290,6 @@ class format_date_parser } wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -310,7 +309,6 @@ class format_date_parser } wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -326,7 +324,6 @@ class format_date_parser } t_month = month_type(mr.current_match); if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -342,7 +339,6 @@ class format_date_parser } t_month = month_type(mr.current_match); if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -438,7 +434,6 @@ class format_date_parser itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; @@ -476,14 +471,14 @@ class format_date_parser // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; short month(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'b': @@ -491,7 +486,6 @@ class format_date_parser mr = m_month_short_names.match(sitr, stream_end); month = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -501,7 +495,6 @@ class format_date_parser mr = m_month_long_names.match(sitr, stream_end); month = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -529,7 +522,6 @@ class format_date_parser itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; @@ -581,14 +573,14 @@ class format_date_parser // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; short wkday(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { switch(*itr) { case 'a': @@ -600,7 +592,6 @@ class format_date_parser mr = m_weekday_short_names.match(sitr, stream_end); wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -614,7 +605,6 @@ class format_date_parser mr = m_weekday_long_names.match(sitr, stream_end); wkday = mr.current_match; if (mr.has_remaining()) { - current_char = mr.last_char(); use_current_char = true; } break; @@ -641,7 +631,6 @@ class format_date_parser itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; @@ -674,14 +663,14 @@ class format_date_parser // skip leading whitespace while(std::isspace(*sitr) && sitr != stream_end) { ++sitr; } - charT current_char = *sitr; unsigned short year(0); const_itr itr(format_str.begin()); while (itr != format_str.end() && (sitr != stream_end)) { if (*itr == '%') { - itr++; + if ( ++itr == format_str.end()) + break; if (*itr != '%') { //match_results mr; switch(*itr) { @@ -714,7 +703,6 @@ class format_date_parser itr++; if (use_current_char) { use_current_char = false; - current_char = *sitr; } else { sitr++; diff --git a/boost/date_time/gregorian/conversion.hpp b/boost/date_time/gregorian/conversion.hpp index 33f6856bf0..c844c4e34b 100644 --- a/boost/date_time/gregorian/conversion.hpp +++ b/boost/date_time/gregorian/conversion.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $ + * $Date$ */ #include <cstring> diff --git a/boost/date_time/gregorian/formatters.hpp b/boost/date_time/gregorian/formatters.hpp index eda7dc34be..d486ef0f4c 100644 --- a/boost/date_time/gregorian/formatters.hpp +++ b/boost/date_time/gregorian/formatters.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/compiler_config.hpp" diff --git a/boost/date_time/gregorian/formatters_limited.hpp b/boost/date_time/gregorian/formatters_limited.hpp index 8dfd2d0c60..755f5aa68b 100644 --- a/boost/date_time/gregorian/formatters_limited.hpp +++ b/boost/date_time/gregorian/formatters_limited.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" diff --git a/boost/date_time/gregorian/greg_calendar.hpp b/boost/date_time/gregorian/greg_calendar.hpp index e9c1852e0b..34ce0aec47 100644 --- a/boost/date_time/gregorian/greg_calendar.hpp +++ b/boost/date_time/gregorian/greg_calendar.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/cstdint.hpp> diff --git a/boost/date_time/gregorian/greg_date.hpp b/boost/date_time/gregorian/greg_date.hpp index 860a407c95..f7aa2fc5f1 100644 --- a/boost/date_time/gregorian/greg_date.hpp +++ b/boost/date_time/gregorian/greg_date.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/throw_exception.hpp> diff --git a/boost/date_time/gregorian/greg_day.hpp b/boost/date_time/gregorian/greg_day.hpp index 4ea829fbec..4a2d5e7e46 100644 --- a/boost/date_time/gregorian/greg_day.hpp +++ b/boost/date_time/gregorian/greg_day.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" diff --git a/boost/date_time/gregorian/greg_day_of_year.hpp b/boost/date_time/gregorian/greg_day_of_year.hpp index 2f8874d2b7..abf0c9eeb3 100644 --- a/boost/date_time/gregorian/greg_day_of_year.hpp +++ b/boost/date_time/gregorian/greg_day_of_year.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" diff --git a/boost/date_time/gregorian/greg_duration.hpp b/boost/date_time/gregorian/greg_duration.hpp index a9c0c171b8..dc6ad60755 100644 --- a/boost/date_time/gregorian/greg_duration.hpp +++ b/boost/date_time/gregorian/greg_duration.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <boost/date_time/date_duration.hpp> diff --git a/boost/date_time/gregorian/greg_duration_types.hpp b/boost/date_time/gregorian/greg_duration_types.hpp index 8328ca303f..d1f9a65f97 100644 --- a/boost/date_time/gregorian/greg_duration_types.hpp +++ b/boost/date_time/gregorian/greg_duration_types.hpp @@ -5,7 +5,7 @@ * Subject to Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/gregorian/greg_facet.hpp b/boost/date_time/gregorian/greg_facet.hpp index 9efc61951a..b8c6d57fe5 100644 --- a/boost/date_time/gregorian/greg_facet.hpp +++ b/boost/date_time/gregorian/greg_facet.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-23 03:13:35 -0800 (Sun, 23 Nov 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" @@ -97,7 +97,7 @@ namespace gregorian { std::locale locale = os.getloc(); if (std::has_facet<facet_def>(locale)) { const facet_def& f = std::use_facet<facet_def>(locale); - greg_weekday_formatter::format_weekday(wd.as_enum(), os, f, true); + greg_weekday_formatter::format_weekday(wd, os, f, true); } else { //default to short English string eg: Sun, Mon, Tue, Wed... os << wd.as_short_string(); @@ -214,8 +214,6 @@ namespace gregorian { std::basic_istream<charT>& operator>>(std::basic_istream<charT>& is, date& d) { std::istream_iterator<std::basic_string<charT>, charT> beg(is), eos; - - typedef boost::date_time::all_date_names_put<greg_facet_config, charT> facet_def; d = from_stream(beg, eos); return is; } diff --git a/boost/date_time/gregorian/greg_month.hpp b/boost/date_time/gregorian/greg_month.hpp index b48a8a8911..d483f77424 100644 --- a/boost/date_time/gregorian/greg_month.hpp +++ b/boost/date_time/gregorian/greg_month.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" diff --git a/boost/date_time/gregorian/greg_serialize.hpp b/boost/date_time/gregorian/greg_serialize.hpp index a94bd73620..a870c7068a 100644 --- a/boost/date_time/gregorian/greg_serialize.hpp +++ b/boost/date_time/gregorian/greg_serialize.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" @@ -88,7 +88,7 @@ void load(Archive & ar, //!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 @@ void load(Archive & ar, gregorian::date_duration & dd, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::date_duration::duration_rep & dr, unsigned in } //!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 @@ void load(Archive & ar, gregorian::date_period& dp, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::greg_year& gy, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::greg_month& gm, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::greg_day& gd, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::greg_weekday& gd, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::partial_date& pd, unsigned int /*version*/) } //!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 @@ void load(Archive & ar, gregorian::nth_kday_of_month& nkd, unsigned int /*versio } //!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 @@ void load(Archive & ar, gregorian::first_kday_of_month& fkd, unsigned int /*vers } //!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 @@ void load(Archive & ar, gregorian::last_kday_of_month& lkd, unsigned int /*versi } //!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 @@ void load(Archive & ar, gregorian::first_kday_before& fkdb, unsigned int /*versi } //!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 @@ void load(Archive & ar, gregorian::first_kday_after& fkda, unsigned int /*versio } //!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*/) { diff --git a/boost/date_time/gregorian/greg_weekday.hpp b/boost/date_time/gregorian/greg_weekday.hpp index ab68fcd19b..60fec32297 100644 --- a/boost/date_time/gregorian/greg_weekday.hpp +++ b/boost/date_time/gregorian/greg_weekday.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" diff --git a/boost/date_time/gregorian/greg_year.hpp b/boost/date_time/gregorian/greg_year.hpp index 322f40d0d0..3d98fd06b2 100644 --- a/boost/date_time/gregorian/greg_year.hpp +++ b/boost/date_time/gregorian/greg_year.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/constrained_value.hpp" diff --git a/boost/date_time/gregorian/greg_ymd.hpp b/boost/date_time/gregorian/greg_ymd.hpp index e7d441efea..503666c31d 100644 --- a/boost/date_time/gregorian/greg_ymd.hpp +++ b/boost/date_time/gregorian/greg_ymd.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/year_month_day.hpp" diff --git a/boost/date_time/gregorian/gregorian.hpp b/boost/date_time/gregorian/gregorian.hpp index becbc06817..47d545eccd 100644 --- a/boost/date_time/gregorian/gregorian.hpp +++ b/boost/date_time/gregorian/gregorian.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file gregorian.hpp diff --git a/boost/date_time/gregorian/gregorian_io.hpp b/boost/date_time/gregorian/gregorian_io.hpp index e6ba01fe50..e0a23f3269 100644 --- a/boost/date_time/gregorian/gregorian_io.hpp +++ b/boost/date_time/gregorian/gregorian_io.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <locale> diff --git a/boost/date_time/gregorian/gregorian_types.hpp b/boost/date_time/gregorian/gregorian_types.hpp index 3f4b92fd87..d50e9cc7d7 100644 --- a/boost/date_time/gregorian/gregorian_types.hpp +++ b/boost/date_time/gregorian/gregorian_types.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file gregorian_types.hpp diff --git a/boost/date_time/gregorian/parsers.hpp b/boost/date_time/gregorian/parsers.hpp index a2fa4e1dae..afc6537c3b 100644 --- a/boost/date_time/gregorian/parsers.hpp +++ b/boost/date_time/gregorian/parsers.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian_types.hpp" diff --git a/boost/date_time/gregorian_calendar.hpp b/boost/date_time/gregorian_calendar.hpp index b645aa49b0..dfe3771aab 100644 --- a/boost/date_time/gregorian_calendar.hpp +++ b/boost/date_time/gregorian_calendar.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ diff --git a/boost/date_time/gregorian_calendar.ipp b/boost/date_time/gregorian_calendar.ipp index 77fa03e4af..8a58c8844a 100644 --- a/boost/date_time/gregorian_calendar.ipp +++ b/boost/date_time/gregorian_calendar.ipp @@ -3,7 +3,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #ifndef NO_BOOST_DATE_TIME_INLINE diff --git a/boost/date_time/int_adapter.hpp b/boost/date_time/int_adapter.hpp index d1246e7b50..81f68f645c 100644 --- a/boost/date_time/int_adapter.hpp +++ b/boost/date_time/int_adapter.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/iso_format.hpp b/boost/date_time/iso_format.hpp index 1f9e73d678..2e7942d8ba 100644 --- a/boost/date_time/iso_format.hpp +++ b/boost/date_time/iso_format.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/parse_format_base.hpp" diff --git a/boost/date_time/local_time/conversion.hpp b/boost/date_time/local_time/conversion.hpp index a530de4224..aa0b72c6c4 100644 --- a/boost/date_time/local_time/conversion.hpp +++ b/boost/date_time/local_time/conversion.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ diff --git a/boost/date_time/local_time/custom_time_zone.hpp b/boost/date_time/local_time/custom_time_zone.hpp index 390c3f484a..b89218a659 100644 --- a/boost/date_time/local_time/custom_time_zone.hpp +++ b/boost/date_time/local_time/custom_time_zone.hpp @@ -2,10 +2,10 @@ #define LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/time_zone_base.hpp" @@ -34,8 +34,8 @@ namespace local_time { typedef typename base_type::stringstream_type stringstream_type; typedef date_time::time_zone_names_base<CharT> time_zone_names; typedef CharT char_type; - - custom_time_zone_base(const time_zone_names& zone_names, + + custom_time_zone_base(const time_zone_names& zone_names, const time_duration_type& utc_offset, const dst_adjustment_offsets& dst_shift, boost::shared_ptr<dst_calc_rule> calc_rule) : @@ -43,8 +43,8 @@ namespace local_time { base_utc_offset_(utc_offset), dst_offsets_(dst_shift), dst_calc_rules_(calc_rule) - {}; - virtual ~custom_time_zone_base() {}; + {} + virtual ~custom_time_zone_base() {} virtual string_type dst_zone_abbrev() const { return zone_names_.dst_zone_abbrev(); @@ -64,7 +64,7 @@ namespace local_time { //! True if zone uses daylight savings adjustments virtual bool has_dst() const { - return (dst_calc_rules_); //if calc_rule is set the tz has dst + return (bool) dst_calc_rules_; //if calc_rule is set the tz has dst } //! Local time that DST starts -- NADT if has_dst is false virtual posix_time::ptime dst_local_start_time(gregorian::greg_year y) const diff --git a/boost/date_time/local_time/date_duration_operators.hpp b/boost/date_time/local_time/date_duration_operators.hpp index b4c325df0a..e0f170fd7c 100644 --- a/boost/date_time/local_time/date_duration_operators.hpp +++ b/boost/date_time/local_time/date_duration_operators.hpp @@ -6,7 +6,7 @@ * (See accompanying file LICENSE_1_0.txt or * http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/greg_duration_types.hpp" diff --git a/boost/date_time/local_time/dst_transition_day_rules.hpp b/boost/date_time/local_time/dst_transition_day_rules.hpp index d82731c084..f372e44a45 100644 --- a/boost/date_time/local_time/dst_transition_day_rules.hpp +++ b/boost/date_time/local_time/dst_transition_day_rules.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ diff --git a/boost/date_time/local_time/local_date_time.hpp b/boost/date_time/local_time/local_date_time.hpp index 6955439cd7..a3762d9243 100644 --- a/boost/date_time/local_time/local_date_time.hpp +++ b/boost/date_time/local_time/local_date_time.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <string> @@ -208,7 +208,7 @@ namespace local_time { } //! Simple destructor, releases time zone if last referrer - ~local_date_time_base() {}; + ~local_date_time_base() {} //! Copy constructor local_date_time_base(const local_date_time_base& rhs) : diff --git a/boost/date_time/local_time/local_time.hpp b/boost/date_time/local_time/local_time.hpp index 162cac5b36..880989b6e7 100644 --- a/boost/date_time/local_time/local_time.hpp +++ b/boost/date_time/local_time/local_time.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time.hpp" diff --git a/boost/date_time/local_time/local_time_io.hpp b/boost/date_time/local_time/local_time_io.hpp index b5e3c3f1ba..c32b81e407 100644 --- a/boost/date_time/local_time/local_time_io.hpp +++ b/boost/date_time/local_time/local_time_io.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <locale> @@ -36,7 +36,6 @@ namespace local_time { boost::io::ios_flags_saver iflags(os); typedef local_date_time time_type;//::utc_time_type typename typedef date_time::time_facet<time_type, CharT> custom_time_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if(std::has_facet<custom_time_facet>(os.getloc())) { @@ -123,7 +122,6 @@ namespace local_time { const boost::local_time::local_time_period& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<local_date_time, CharT> custom_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_facet>(os.getloc())) { std::use_facet<custom_facet>(os.getloc()).put(oitr, os, os.fill(), p); diff --git a/boost/date_time/local_time/local_time_types.hpp b/boost/date_time/local_time/local_time_types.hpp index 5e04422e8f..df2d08cb49 100644 --- a/boost/date_time/local_time/local_time_types.hpp +++ b/boost/date_time/local_time/local_time_types.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/local_time/local_date_time.hpp" diff --git a/boost/date_time/local_time/posix_time_zone.hpp b/boost/date_time/local_time/posix_time_zone.hpp index f640675bbd..d0ef31d5b8 100644 --- a/boost/date_time/local_time/posix_time_zone.hpp +++ b/boost/date_time/local_time/posix_time_zone.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-10 10:24:38 -0700 (Thu, 10 Jun 2010) $ + * $Date$ */ #include <string> @@ -115,7 +115,7 @@ namespace local_time{ calc_rules(dst_begin, dst_end); } } - virtual ~posix_time_zone_base() {}; + virtual ~posix_time_zone_base() {} //!String for the zone when not in daylight savings (eg: EST) virtual string_type std_zone_abbrev()const { @@ -430,9 +430,9 @@ namespace local_time{ dst_calc_rules_ = shared_ptr<dst_calc_rule>( new partial_date_dst_rule( partial_date_dst_rule::start_rule( - sd, static_cast<date_time::months_of_year>(sm)), + static_cast<unsigned short>(sd), static_cast<date_time::months_of_year>(sm)), partial_date_dst_rule::end_rule( - ed, static_cast<date_time::months_of_year>(em)) + static_cast<unsigned short>(ed), static_cast<date_time::months_of_year>(em)) ) ); } diff --git a/boost/date_time/local_time/tz_database.hpp b/boost/date_time/local_time/tz_database.hpp index aceda93915..0c6fbbf9ea 100644 --- a/boost/date_time/local_time/tz_database.hpp +++ b/boost/date_time/local_time/tz_database.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <string> diff --git a/boost/date_time/local_time_adjustor.hpp b/boost/date_time/local_time_adjustor.hpp index 13251a2cfb..64134f3b28 100644 --- a/boost/date_time/local_time_adjustor.hpp +++ b/boost/date_time/local_time_adjustor.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ /*! @file local_time_adjustor.hpp diff --git a/boost/date_time/local_timezone_defs.hpp b/boost/date_time/local_timezone_defs.hpp index b56278ed28..5564a11080 100644 --- a/boost/date_time/local_timezone_defs.hpp +++ b/boost/date_time/local_timezone_defs.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include "boost/date_time/dst_rules.hpp" diff --git a/boost/date_time/locale_config.hpp b/boost/date_time/locale_config.hpp index 194d5dd37b..42a2b73043 100644 --- a/boost/date_time/locale_config.hpp +++ b/boost/date_time/locale_config.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ // This file configures whether the library will support locales and hence diff --git a/boost/date_time/microsec_time_clock.hpp b/boost/date_time/microsec_time_clock.hpp index 177811ee6f..bffc74137e 100644 --- a/boost/date_time/microsec_time_clock.hpp +++ b/boost/date_time/microsec_time_clock.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-05-10 02:15:48 -0700 (Mon, 10 May 2010) $ + * $Date$ */ diff --git a/boost/date_time/parse_format_base.hpp b/boost/date_time/parse_format_base.hpp index 087baf9532..d4b2f5975b 100644 --- a/boost/date_time/parse_format_base.hpp +++ b/boost/date_time/parse_format_base.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { diff --git a/boost/date_time/period.hpp b/boost/date_time/period.hpp index 3e34def323..1a88209341 100644 --- a/boost/date_time/period.hpp +++ b/boost/date_time/period.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! \file period.hpp diff --git a/boost/date_time/period_formatter.hpp b/boost/date_time/period_formatter.hpp index 925b20c03c..0cce32a68a 100644 --- a/boost/date_time/period_formatter.hpp +++ b/boost/date_time/period_formatter.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ @@ -114,10 +114,10 @@ namespace boost { namespace date_time { { m_range_option = option; } - void delimiter_strings(const string_type& separator, - const string_type& start_delim, - const string_type& open_end_delim, - const string_type& closed_end_delim) + void delimiter_strings(const string_type& , + const string_type& , + const string_type& , + const string_type& ) { m_period_separator; m_period_start_delimeter; diff --git a/boost/date_time/period_parser.hpp b/boost/date_time/period_parser.hpp index 84b9d1378c..8374234897 100644 --- a/boost/date_time/period_parser.hpp +++ b/boost/date_time/period_parser.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <boost/throw_exception.hpp> diff --git a/boost/date_time/posix_time/conversion.hpp b/boost/date_time/posix_time/conversion.hpp index 83ccf60068..59e5cb7c12 100644 --- a/boost/date_time/posix_time/conversion.hpp +++ b/boost/date_time/posix_time/conversion.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-06-09 11:10:13 -0700 (Wed, 09 Jun 2010) $ + * $Date$ */ #include <cstring> diff --git a/boost/date_time/posix_time/date_duration_operators.hpp b/boost/date_time/posix_time/date_duration_operators.hpp index 6846a77815..60821f0c46 100644 --- a/boost/date_time/posix_time/date_duration_operators.hpp +++ b/boost/date_time/posix_time/date_duration_operators.hpp @@ -6,7 +6,7 @@ * (See accompanying file LICENSE_1_0.txt or * http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/greg_duration_types.hpp" diff --git a/boost/date_time/posix_time/posix_time.hpp b/boost/date_time/posix_time/posix_time.hpp index 3b85ff46ff..aecf8a818d 100644 --- a/boost/date_time/posix_time/posix_time.hpp +++ b/boost/date_time/posix_time/posix_time.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*!@file posix_time.hpp Global header file to get all of posix time types */ diff --git a/boost/date_time/posix_time/posix_time_config.hpp b/boost/date_time/posix_time/posix_time_config.hpp index 716f5e650f..60b34683fd 100644 --- a/boost/date_time/posix_time/posix_time_config.hpp +++ b/boost/date_time/posix_time/posix_time_config.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 04:52:28 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ #include <cstdlib> //for MCW 7.2 std::abs(long long) @@ -81,7 +81,7 @@ namespace posix_time { {} //Give duration access to ticks constructor -- hide from users friend class date_time::time_duration<time_duration, time_res_traits>; - private: + protected: explicit time_duration(impl_type tick_count) : date_time::time_duration<time_duration, time_res_traits>(tick_count) {} diff --git a/boost/date_time/posix_time/posix_time_duration.hpp b/boost/date_time/posix_time/posix_time_duration.hpp index 9778fd7f3e..7e15df2302 100644 --- a/boost/date_time/posix_time/posix_time_duration.hpp +++ b/boost/date_time/posix_time/posix_time_duration.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time_config.hpp" diff --git a/boost/date_time/posix_time/posix_time_io.hpp b/boost/date_time/posix_time/posix_time_io.hpp index fb63a9165c..45c338b220 100644 --- a/boost/date_time/posix_time/posix_time_io.hpp +++ b/boost/date_time/posix_time/posix_time_io.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 11:05:31 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ #include <locale> @@ -47,7 +47,6 @@ namespace posix_time { const ptime& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_ptime_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p); @@ -114,7 +113,6 @@ namespace posix_time { const boost::posix_time::time_period& p) { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_time_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) { std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), p); @@ -180,7 +178,6 @@ namespace posix_time { { boost::io::ios_flags_saver iflags(os); typedef boost::date_time::time_facet<ptime, CharT> custom_ptime_facet; - typedef std::time_put<CharT> std_ptime_facet; std::ostreambuf_iterator<CharT> oitr(os); if (std::has_facet<custom_ptime_facet>(os.getloc())) std::use_facet<custom_ptime_facet>(os.getloc()).put(oitr, os, os.fill(), td); diff --git a/boost/date_time/posix_time/posix_time_legacy_io.hpp b/boost/date_time/posix_time/posix_time_legacy_io.hpp index fcc3fac1d9..b31fb98723 100644 --- a/boost/date_time/posix_time/posix_time_legacy_io.hpp +++ b/boost/date_time/posix_time/posix_time_legacy_io.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file posix_time_pre133_operators.hpp @@ -80,7 +80,7 @@ namespace posix_time { // any marker (such as '\0'). typename std::basic_string<charT>::iterator e = inp_s.end(); while(b != e){ - out_ss << out_ss.narrow(*b, 0); + out_ss << is.narrow(*b, 0); ++b; } diff --git a/boost/date_time/posix_time/posix_time_system.hpp b/boost/date_time/posix_time/posix_time_system.hpp index 13626e9bad..84c21ca00f 100644 --- a/boost/date_time/posix_time/posix_time_system.hpp +++ b/boost/date_time/posix_time/posix_time_system.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ diff --git a/boost/date_time/posix_time/ptime.hpp b/boost/date_time/posix_time/ptime.hpp index 3f1cb0473f..e4f9d02d1f 100644 --- a/boost/date_time/posix_time/ptime.hpp +++ b/boost/date_time/posix_time/ptime.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time_system.hpp" diff --git a/boost/date_time/posix_time/time_formatters.hpp b/boost/date_time/posix_time/time_formatters.hpp index 534b9525b8..ce19568228 100644 --- a/boost/date_time/posix_time/time_formatters.hpp +++ b/boost/date_time/posix_time/time_formatters.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/date_time/gregorian/gregorian.hpp> diff --git a/boost/date_time/posix_time/time_formatters_limited.hpp b/boost/date_time/posix_time/time_formatters_limited.hpp index 8d2ebdce58..c74fcfa0b0 100644 --- a/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/boost/date_time/posix_time/time_formatters_limited.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2010-01-10 11:17:23 -0800 (Sun, 10 Jan 2010) $ + * $Date$ */ #include <boost/date_time/gregorian/gregorian.hpp> diff --git a/boost/date_time/posix_time/time_parsers.hpp b/boost/date_time/posix_time/time_parsers.hpp index 3dc02b18a3..55b6ccf1f8 100644 --- a/boost/date_time/posix_time/time_parsers.hpp +++ b/boost/date_time/posix_time/time_parsers.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/gregorian/gregorian.hpp" diff --git a/boost/date_time/posix_time/time_period.hpp b/boost/date_time/posix_time/time_period.hpp index 11f8120732..7c6095b896 100644 --- a/boost/date_time/posix_time/time_period.hpp +++ b/boost/date_time/posix_time/time_period.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/period.hpp" diff --git a/boost/date_time/posix_time/time_serialize.hpp b/boost/date_time/posix_time/time_serialize.hpp index 3279d8d55d..8650ae1da9 100644 --- a/boost/date_time/posix_time/time_serialize.hpp +++ b/boost/date_time/posix_time/time_serialize.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include "boost/date_time/posix_time/posix_time.hpp" @@ -184,7 +184,7 @@ void load(Archive & ar, //!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*/) { diff --git a/boost/date_time/special_defs.hpp b/boost/date_time/special_defs.hpp index 661814ec19..5a757be103 100644 --- a/boost/date_time/special_defs.hpp +++ b/boost/date_time/special_defs.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { diff --git a/boost/date_time/special_values_formatter.hpp b/boost/date_time/special_values_formatter.hpp index 53fe98452d..c8653c1f48 100644 --- a/boost/date_time/special_values_formatter.hpp +++ b/boost/date_time/special_values_formatter.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <vector> diff --git a/boost/date_time/string_convert.hpp b/boost/date_time/string_convert.hpp index a3cc86c2db..30be3567a5 100644 --- a/boost/date_time/string_convert.hpp +++ b/boost/date_time/string_convert.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/date_time/compiler_config.hpp" @@ -21,7 +21,6 @@ namespace date_time { inline std::basic_string<OutputT> convert_string_type(const std::basic_string<InputT>& inp_str) { - typedef std::basic_string<InputT> input_type; typedef std::basic_string<OutputT> output_type; output_type result; result.insert(result.begin(), inp_str.begin(), inp_str.end()); diff --git a/boost/date_time/string_parse_tree.hpp b/boost/date_time/string_parse_tree.hpp index d67bf6b7d0..9e977663fa 100644 --- a/boost/date_time/string_parse_tree.hpp +++ b/boost/date_time/string_parse_tree.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/strings_from_facet.hpp b/boost/date_time/strings_from_facet.hpp index 845aeb84b9..800919a0b5 100644 --- a/boost/date_time/strings_from_facet.hpp +++ b/boost/date_time/strings_from_facet.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include <sstream> @@ -35,7 +35,6 @@ gather_month_strings(const std::locale& locale, bool short_strings=true) { typedef std::basic_string<charT> string_type; typedef std::vector<string_type> collection_type; - typedef std::basic_ostringstream<charT> ostream_type; typedef std::ostreambuf_iterator<charT> ostream_iter_type; typedef std::basic_ostringstream<charT> stringstream_type; typedef std::time_put<charT> time_put_facet_type; @@ -50,7 +49,8 @@ gather_month_strings(const std::locale& locale, bool short_strings=true) //grab the needed strings by using the locale to //output each month const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size(); - tm tm_value = {}; + tm tm_value; + memset(&tm_value, 0, sizeof(tm_value)); for (int m=0; m < 12; m++) { tm_value.tm_mon = m; stringstream_type ss; @@ -85,7 +85,6 @@ gather_weekday_strings(const std::locale& locale, bool short_strings=true) { typedef std::basic_string<charT> string_type; typedef std::vector<string_type> collection_type; - typedef std::basic_ostringstream<charT> ostream_type; typedef std::ostreambuf_iterator<charT> ostream_iter_type; typedef std::basic_ostringstream<charT> stringstream_type; typedef std::time_put<charT> time_put_facet_type; @@ -103,7 +102,8 @@ gather_weekday_strings(const std::locale& locale, bool short_strings=true) //grab the needed strings by using the locale to //output each month / weekday const charT* p_outfmt = outfmt.c_str(), *p_outfmt_end = p_outfmt + outfmt.size(); - tm tm_value = {}; + tm tm_value; + memset(&tm_value, 0, sizeof(tm_value)); for (int i=0; i < 7; i++) { tm_value.tm_wday = i; stringstream_type ss; diff --git a/boost/date_time/time.hpp b/boost/date_time/time.hpp index 8b21144b6e..0a7810a0ef 100644 --- a/boost/date_time/time.hpp +++ b/boost/date_time/time.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/time_clock.hpp b/boost/date_time/time_clock.hpp index 9aa2ff0e39..a64a5b81b9 100644 --- a/boost/date_time/time_clock.hpp +++ b/boost/date_time/time_clock.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ /*! @file time_clock.hpp diff --git a/boost/date_time/time_defs.hpp b/boost/date_time/time_defs.hpp index d74631d5eb..852207e685 100644 --- a/boost/date_time/time_defs.hpp +++ b/boost/date_time/time_defs.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/time_duration.hpp b/boost/date_time/time_duration.hpp index b6df827f19..92a0e2d59a 100644 --- a/boost/date_time/time_duration.hpp +++ b/boost/date_time/time_duration.hpp @@ -2,15 +2,16 @@ #define DATE_TIME_TIME_DURATION_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-04 01:24:49 -0700 (Thu, 04 Jun 2009) $ + * $Date$ */ #include <boost/cstdint.hpp> #include <boost/operators.hpp> +#include <boost/static_assert.hpp> #include <boost/date_time/time_defs.hpp> #include <boost/date_time/special_defs.hpp> #include <boost/date_time/compiler_config.hpp> @@ -179,7 +180,7 @@ namespace date_time { return duration_type(ticks_); } //! Division operations on a duration with an integer. - duration_type operator/=(int divisor) + duration_type operator/=(int divisor) { ticks_ = ticks_ / divisor; return duration_type(ticks_); @@ -251,7 +252,7 @@ namespace date_time { } protected: - explicit time_duration(impl_type in) : ticks_(in) {}; + explicit time_duration(impl_type in) : ticks_(in) {} impl_type ticks_; }; @@ -265,10 +266,20 @@ namespace date_time { class subsecond_duration : public base_duration { public: + typedef typename base_duration::impl_type impl_type; typedef typename base_duration::traits_type traits_type; + + private: + // To avoid integer overflow we precompute the duration resolution conversion coefficient (ticket #3471) + BOOST_STATIC_ASSERT_MSG((traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second % frac_of_second : frac_of_second % traits_type::ticks_per_second) == 0,\ + "The base duration resolution must be a multiple of the subsecond duration resolution"); + BOOST_STATIC_CONSTANT(boost::int64_t, adjustment_ratio = (traits_type::ticks_per_second >= frac_of_second ? traits_type::ticks_per_second / frac_of_second : frac_of_second / traits_type::ticks_per_second)); + + public: explicit subsecond_duration(boost::int64_t ss) : - base_duration(0,0,0,ss*traits_type::res_adjust()/frac_of_second) - {} + base_duration(impl_type(traits_type::ticks_per_second >= frac_of_second ? ss * adjustment_ratio : ss / adjustment_ratio)) + { + } }; diff --git a/boost/date_time/time_facet.hpp b/boost/date_time/time_facet.hpp index b3cda2c023..b9abedfba9 100644 --- a/boost/date_time/time_facet.hpp +++ b/boost/date_time/time_facet.hpp @@ -7,7 +7,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include <cctype> @@ -822,7 +822,7 @@ namespace date_time { const_itr itr(m_time_duration_format.begin()); while (itr != m_time_duration_format.end() && (sitr != stream_end)) { if (*itr == '%') { - ++itr; + if (++itr == m_time_duration_format.end()) break; if (*itr != '%') { switch(*itr) { case 'O': @@ -994,7 +994,7 @@ namespace date_time { const_itr itr(this->m_format.begin()); while (itr != this->m_format.end() && (sitr != stream_end)) { if (*itr == '%') { - ++itr; + if (++itr == this->m_format.end()) break; if (*itr != '%') { // the cases are grouped by date & time flags - not alphabetical order switch(*itr) { diff --git a/boost/date_time/time_formatting_streams.hpp b/boost/date_time/time_formatting_streams.hpp index 2d07d344ee..f69f87a348 100644 --- a/boost/date_time/time_formatting_streams.hpp +++ b/boost/date_time/time_formatting_streams.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ #include <boost/date_time/compiler_config.hpp> diff --git a/boost/date_time/time_iterator.hpp b/boost/date_time/time_iterator.hpp index 98397de8f3..64439363d7 100644 --- a/boost/date_time/time_iterator.hpp +++ b/boost/date_time/time_iterator.hpp @@ -2,50 +2,50 @@ #define DATE_TIME_TIME_ITERATOR_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { namespace date_time { - + //! Simple time iterator skeleton class template<class time_type> class time_itr { public: typedef typename time_type::time_duration_type time_duration_type; - time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {}; - time_itr& operator++() + time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {} + time_itr& operator++() { current_ = current_ + offset_; return *this; } - time_itr& operator--() + time_itr& operator--() { current_ = current_ - offset_; return *this; } - time_type operator*() {return current_;}; - time_type* operator->() {return ¤t_;}; - bool operator< (const time_type& t) {return current_ < t;}; - bool operator<= (const time_type& t) {return current_ <= t;}; - bool operator!= (const time_type& t) {return current_ != t;}; - bool operator== (const time_type& t) {return current_ == t;}; - bool operator> (const time_type& t) {return current_ > t;}; - bool operator>= (const time_type& t) {return current_ >= t;}; - + time_type operator*() {return current_;} + time_type* operator->() {return ¤t_;} + bool operator< (const time_type& t) {return current_ < t;} + bool operator<= (const time_type& t) {return current_ <= t;} + bool operator!= (const time_type& t) {return current_ != t;} + bool operator== (const time_type& t) {return current_ == t;} + bool operator> (const time_type& t) {return current_ > t;} + bool operator>= (const time_type& t) {return current_ >= t;} + private: time_type current_; time_duration_type offset_; }; - - + + } }//namespace date_time diff --git a/boost/date_time/time_parsing.hpp b/boost/date_time/time_parsing.hpp index 9258f94fc3..6de4b7dbde 100644 --- a/boost/date_time/time_parsing.hpp +++ b/boost/date_time/time_parsing.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include "boost/tokenizer.hpp" @@ -116,6 +116,7 @@ namespace date_time { break; } + default: break; }//switch pos++; } @@ -153,9 +154,10 @@ namespace date_time { std::string& first, std::string& second) { - int sep_pos = static_cast<int>(s.find(sep)); + std::string::size_type sep_pos = s.find(sep); first = s.substr(0,sep_pos); - second = s.substr(sep_pos+1); + if (sep_pos!=std::string::npos) + second = s.substr(sep_pos+1); return true; } @@ -280,6 +282,7 @@ namespace date_time { break; } + default: break; }; pos++; } diff --git a/boost/date_time/time_resolution_traits.hpp b/boost/date_time/time_resolution_traits.hpp index 903830c76e..37785d0e68 100644 --- a/boost/date_time/time_resolution_traits.hpp +++ b/boost/date_time/time_resolution_traits.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-06-06 04:25:55 -0700 (Sat, 06 Jun 2009) $ + * $Date$ */ diff --git a/boost/date_time/time_system_counted.hpp b/boost/date_time/time_system_counted.hpp index 5425f62af4..e5ed20b8c6 100644 --- a/boost/date_time/time_system_counted.hpp +++ b/boost/date_time/time_system_counted.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ diff --git a/boost/date_time/time_system_split.hpp b/boost/date_time/time_system_split.hpp index 6fc4a336b5..cf5931a4f2 100644 --- a/boost/date_time/time_system_split.hpp +++ b/boost/date_time/time_system_split.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-13 12:10:23 -0800 (Thu, 13 Nov 2008) $ + * $Date$ */ diff --git a/boost/date_time/time_zone_base.hpp b/boost/date_time/time_zone_base.hpp index 6ad7f70af5..576c77a223 100644 --- a/boost/date_time/time_zone_base.hpp +++ b/boost/date_time/time_zone_base.hpp @@ -2,10 +2,10 @@ #define _DATE_TIME_TIME_ZONE_BASE__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ @@ -26,9 +26,9 @@ namespace date_time { * would be to convert from POSIX timezone strings. Regardless of * the construction technique, this is the interface that these * time zone types must provide. - * + * * Note that this class is intended to be used as a shared - * resource (hence the derivation from boost::counted_base. + * resource (hence the derivation from boost::counted_base. */ template<typename time_type, typename CharT> class time_zone_base { @@ -39,8 +39,8 @@ namespace date_time { typedef typename time_type::date_type::year_type year_type; typedef typename time_type::time_duration_type time_duration_type; - time_zone_base() {}; - virtual ~time_zone_base() {}; + time_zone_base() {} + virtual ~time_zone_base() {} //!String for the timezone when in daylight savings (eg: EDT) virtual string_type dst_zone_abbrev() const=0; //!String for the zone when not in daylight savings (eg: EST) @@ -61,9 +61,9 @@ namespace date_time { virtual time_duration_type dst_offset() const=0; //! Returns a POSIX time_zone string for this object virtual string_type to_posix_string() const =0; - + private: - + }; @@ -82,7 +82,7 @@ namespace date_time { dst_start_offset_(dst_start_offset), dst_end_offset_(dst_end_offset) {} - + //! Amount DST adjusts the clock eg: plus one hour time_duration_type dst_adjust_; //! Time past midnight on start transition day that dst starts diff --git a/boost/date_time/time_zone_names.hpp b/boost/date_time/time_zone_names.hpp index a56502704e..405e7e0a70 100644 --- a/boost/date_time/time_zone_names.hpp +++ b/boost/date_time/time_zone_names.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ #include <string> diff --git a/boost/date_time/tz_db_base.hpp b/boost/date_time/tz_db_base.hpp index 17822cc65c..29d60063c3 100644 --- a/boost/date_time/tz_db_base.hpp +++ b/boost/date_time/tz_db_base.hpp @@ -5,7 +5,7 @@ * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2012-07-27 11:15:55 -0700 (Fri, 27 Jul 2012) $ + * $Date$ */ #include <map> @@ -180,7 +180,6 @@ namespace boost { /*! May throw data_not_accessible, or bad_field_count exceptions */ void load_from_file(const std::string& pathspec) { - string_type in_str; std::string buff; std::ifstream ifs(pathspec.c_str()); @@ -261,8 +260,12 @@ namespace boost { e_wn = get_week_num(e_nth); - return new rule_type(start_rule(s_wn, s_d, s_m), - end_rule(e_wn, e_d, e_m)); + return new rule_type(start_rule(s_wn, + static_cast<unsigned short>(s_d), + static_cast<unsigned short>(s_m)), + end_rule(e_wn, + static_cast<unsigned short>(e_d), + static_cast<unsigned short>(e_m))); } //! helper function for parse_rules() week_num get_week_num(int nth) const @@ -301,7 +304,15 @@ namespace boost { const char_type sep_char[] = { ';', '\0'}; char_separator_type sep(sep_char); tokenizer tokens(rule, sep); // 3 fields - + + if ( std::distance ( tokens.begin(), tokens.end ()) != 3 ) { + std::ostringstream msg; + msg << "Expecting 3 fields, got " + << std::distance ( tokens.begin(), tokens.end ()) + << " fields in line: " << rule; + boost::throw_exception(bad_field_count(msg.str())); + } + tokenizer_iterator tok_iter = tokens.begin(); nth = std::atoi(tok_iter->c_str()); ++tok_iter; d = std::atoi(tok_iter->c_str()); ++tok_iter; diff --git a/boost/date_time/wrapping_int.hpp b/boost/date_time/wrapping_int.hpp index abfc58c561..6f869d3023 100644 --- a/boost/date_time/wrapping_int.hpp +++ b/boost/date_time/wrapping_int.hpp @@ -2,11 +2,11 @@ #define _DATE_TIME_WRAPPING_INT_HPP__ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2008-11-12 11:37:53 -0800 (Wed, 12 Nov 2008) $ + * $Date$ */ @@ -16,15 +16,15 @@ namespace date_time { //! A wrapping integer used to support time durations (WARNING: only instantiate with a signed type) /*! In composite date and time types this type is used to * wrap at the day boundary. - * Ex: - * A wrapping_int<short, 10> will roll over after nine, and + * Ex: + * A wrapping_int<short, 10> will roll over after nine, and * roll under below zero. This gives a range of [0,9] * - * NOTE: it is strongly recommended that wrapping_int2 be used - * instead of wrapping_int as wrapping_int is to be depricated + * NOTE: it is strongly recommended that wrapping_int2 be used + * instead of wrapping_int as wrapping_int is to be depricated * at some point soon. * - * Also Note that warnings will occur if instantiated with an + * Also Note that warnings will occur if instantiated with an * unsigned type. Only a signed type should be used! */ template<typename int_type_, int_type_ wrap_val> @@ -34,17 +34,17 @@ public: //typedef overflow_type_ overflow_type; static int_type wrap_value() {return wrap_val;} //!Add, return true if wrapped - wrapping_int(int_type v) : value_(v) {}; + wrapping_int(int_type v) : value_(v) {} //! Explicit converion method int_type as_int() const {return value_;} operator int_type() const {return value_;} //!Add, return number of wraps performed - /*! The sign of the returned value will indicate which direction the + /*! The sign of the returned value will indicate which direction the * wraps went. Ex: add a negative number and wrapping under could occur, - * this would be indicated by a negative return value. If wrapping over + * this would be indicated by a negative return value. If wrapping over * took place, a positive value would be returned */ template< typename IntT > - IntT add(IntT v) + IntT add(IntT v) { int_type remainder = static_cast<int_type>(v % (wrap_val)); IntT overflow = static_cast<IntT>(v / (wrap_val)); @@ -53,12 +53,12 @@ public: } //! Subtract will return '+d' if wrapping under took place ('d' is the number of wraps) /*! The sign of the returned value will indicate which direction the - * wraps went (positive indicates wrap under, negative indicates wrap over). - * Ex: subtract a negative number and wrapping over could - * occur, this would be indicated by a negative return value. If + * wraps went (positive indicates wrap under, negative indicates wrap over). + * Ex: subtract a negative number and wrapping over could + * occur, this would be indicated by a negative return value. If * wrapping under took place, a positive value would be returned. */ template< typename IntT > - IntT subtract(IntT v) + IntT subtract(IntT v) { int_type remainder = static_cast<int_type>(v % (wrap_val)); IntT underflow = static_cast<IntT>(-(v / (wrap_val))); @@ -71,19 +71,19 @@ private: template< typename IntT > IntT calculate_wrap(IntT wrap) { - if ((value_) >= wrap_val) + if ((value_) >= wrap_val) { ++wrap; value_ -= (wrap_val); } - else if(value_ < 0) + else if(value_ < 0) { --wrap; value_ += (wrap_val); } return wrap; } - + }; @@ -113,12 +113,12 @@ public: int_type as_int() const {return value_;} operator int_type() const {return value_;} //!Add, return number of wraps performed - /*! The sign of the returned value will indicate which direction the + /*! The sign of the returned value will indicate which direction the * wraps went. Ex: add a negative number and wrapping under could occur, - * this would be indicated by a negative return value. If wrapping over + * this would be indicated by a negative return value. If wrapping over * took place, a positive value would be returned */ template< typename IntT > - IntT add(IntT v) + IntT add(IntT v) { int_type remainder = static_cast<int_type>(v % (wrap_max - wrap_min + 1)); IntT overflow = static_cast<IntT>(v / (wrap_max - wrap_min + 1)); @@ -127,30 +127,30 @@ public: } //! Subtract will return '-d' if wrapping under took place ('d' is the number of wraps) /*! The sign of the returned value will indicate which direction the - * wraps went. Ex: subtract a negative number and wrapping over could - * occur, this would be indicated by a positive return value. If + * wraps went. Ex: subtract a negative number and wrapping over could + * occur, this would be indicated by a positive return value. If * wrapping under took place, a negative value would be returned */ template< typename IntT > - IntT subtract(IntT v) + IntT subtract(IntT v) { int_type remainder = static_cast<int_type>(v % (wrap_max - wrap_min + 1)); IntT underflow = static_cast<IntT>(-(v / (wrap_max - wrap_min + 1))); value_ = static_cast<int_type>(value_ - remainder); return calculate_wrap(underflow); } - + private: int_type value_; template< typename IntT > IntT calculate_wrap(IntT wrap) { - if ((value_) > wrap_max) + if ((value_) > wrap_max) { ++wrap; value_ -= (wrap_max - wrap_min + 1); } - else if((value_) < wrap_min) + else if((value_) < wrap_min) { --wrap; value_ += (wrap_max - wrap_min + 1); diff --git a/boost/date_time/year_month_day.hpp b/boost/date_time/year_month_day.hpp index 9340e53f55..e1bf2c7001 100644 --- a/boost/date_time/year_month_day.hpp +++ b/boost/date_time/year_month_day.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland - * $Date: 2008-02-27 12:00:24 -0800 (Wed, 27 Feb 2008) $ + * $Date$ */ namespace boost { |