|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65523 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-09-21 16:58:10
Author: viboes
Date: 2010-09-21 16:58:09 EDT (Tue, 21 Sep 2010)
New Revision: 65523
URL: http://svn.boost.org/trac/boost/changeset/65523
Log:
Chrono fix warnings
Text files modified:
sandbox/chrono/boost/chrono/chrono_io.hpp | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
Modified: sandbox/chrono/boost/chrono/chrono_io.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono_io.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono_io.hpp 2010-09-21 16:58:09 EDT (Tue, 21 Sep 2010)
@@ -159,7 +159,7 @@
static std::locale::id id;
explicit duration_punct(int use = use_long)
- : use_short_(use) {init_C();}
+ : use_short_(use==use_short) {init_C();}
duration_punct(int use,
const string_type& long_seconds, const string_type& long_minutes,
@@ -177,8 +177,10 @@
{return long_name(typename Period::type());}
template <class Period>
- string_type name() const
- {return use_short_ ? short_name<Period>() : long_name<Period>();}
+ string_type name() const {
+ if (use_short_) return short_name<Period>()
+ else return long_name<Period>();
+ }
bool is_short_name() const {return use_short_;}
bool is_long_name() const {return !use_short_;}
@@ -208,7 +210,7 @@
const string_type& long_seconds, const string_type& long_minutes,
const string_type& long_hours, const string_type& short_seconds,
const string_type& short_minutes, const string_type& short_hours)
- : use_short_(use),
+ : use_short_(use==use_short),
long_seconds_(long_seconds),
long_minutes_(long_minutes),
long_hours_(long_hours),
@@ -219,7 +221,7 @@
template <class CharT>
duration_punct<CharT>::duration_punct(int use, const duration_punct& d)
- : use_short_(use),
+ : use_short_(use==use_short),
long_seconds_(d.long_seconds_),
long_minutes_(d.long_minutes_),
long_hours_(d.long_hours_),
@@ -351,7 +353,7 @@
++i;
CharT x;
is >> num >> x >> den;
- if (!is.good() || x != '/')
+ if (!is.good() || (x != '/'))
{
is.setstate(is.failbit);
return is;
@@ -547,7 +549,7 @@
return is;
}
}
- if (r > duration_values<common_type_t>::max() / num)
+ if (r > (duration_values<common_type_t>::max() / num))
{
// Conversion to Period overflowed
is.setstate(is.failbit);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk