Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81591 - in trunk/libs/locale/src: std util
From: artyomtnk_at_[hidden]
Date: 2012-11-27 11:12:54


Author: artyom
Date: 2012-11-27 11:12:53 EST (Tue, 27 Nov 2012)
New Revision: 81591
URL: http://svn.boost.org/trac/boost/changeset/81591

Log:
Fixed #7701 missing "std::" in some places, problem on
platforms like QNX, Blackbarry

Text files modified:
   trunk/libs/locale/src/std/codecvt.cpp | 2 +-
   trunk/libs/locale/src/util/codecvt_converter.cpp | 12 ++++++------
   trunk/libs/locale/src/util/gregorian.cpp | 26 +++++++++++++-------------
   trunk/libs/locale/src/util/numeric.hpp | 13 +++++++------
   4 files changed, 27 insertions(+), 26 deletions(-)

Modified: trunk/libs/locale/src/std/codecvt.cpp
==============================================================================
--- trunk/libs/locale/src/std/codecvt.cpp (original)
+++ trunk/libs/locale/src/std/codecvt.cpp 2012-11-27 11:12:53 EST (Tue, 27 Nov 2012)
@@ -18,7 +18,7 @@
     std::locale codecvt_bychar( std::locale const &in,
                                 std::string const &locale_name)
     {
- return std::locale(in,new std::codecvt_byname<CharType,char,mbstate_t>(locale_name.c_str()));
+ return std::locale(in,new std::codecvt_byname<CharType,char,std::mbstate_t>(locale_name.c_str()));
     }
     
 

Modified: trunk/libs/locale/src/util/codecvt_converter.cpp
==============================================================================
--- trunk/libs/locale/src/util/codecvt_converter.cpp (original)
+++ trunk/libs/locale/src/util/codecvt_converter.cpp 2012-11-27 11:12:53 EST (Tue, 27 Nov 2012)
@@ -70,7 +70,7 @@
             if(!utf::is_valid_codepoint(u))
                 return illegal;
             int width = utf::utf_traits<char>::width(u);
- ptrdiff_t d=end-begin;
+ std::ptrdiff_t d=end-begin;
             if(d < width)
                 return incomplete;
             utf::utf_traits<char>::encode(u,begin);
@@ -229,11 +229,11 @@
     // Real codecvt
 
     template<typename CharType>
- class code_converter : public std::codecvt<CharType,char,mbstate_t>
+ class code_converter : public std::codecvt<CharType,char,std::mbstate_t>
     {
     public:
         code_converter(std::auto_ptr<base_converter> cvt,size_t refs = 0) :
- std::codecvt<CharType,char,mbstate_t>(refs),
+ std::codecvt<CharType,char,std::mbstate_t>(refs),
             cvt_(cvt)
         {
             max_len_ = cvt_->max_len();
@@ -627,14 +627,14 @@
 
     };
 
- static const char ensure_mbstate_size_is_at_least_2[sizeof(mbstate_t) >= 2 ? 1 : -1] = {0};
+ static const char ensure_mbstate_size_is_at_least_2[sizeof(std::mbstate_t) >= 2 ? 1 : -1] = {0};
     
     template<>
- class code_converter<char> : public std::codecvt<char,char,mbstate_t>
+ class code_converter<char> : public std::codecvt<char,char,std::mbstate_t>
     {
     public:
         code_converter(std::auto_ptr<base_converter> /*cvt*/,size_t refs = 0) :
- std::codecvt<char,char,mbstate_t>(refs)
+ std::codecvt<char,char,std::mbstate_t>(refs)
         {
         }
     };

Modified: trunk/libs/locale/src/util/gregorian.cpp
==============================================================================
--- trunk/libs/locale/src/util/gregorian.cpp (original)
+++ trunk/libs/locale/src/util/gregorian.cpp 2012-11-27 11:12:53 EST (Tue, 27 Nov 2012)
@@ -70,7 +70,7 @@
             return days[is_leap(year)][month-1] + day - 1;
         }
         
- time_t internal_timegm(std::tm const *t)
+ std::time_t internal_timegm(std::tm const *t)
         {
             int year = t->tm_year + 1900;
             int month = t->tm_mon;
@@ -88,8 +88,8 @@
             int day_of_year = days_from_1jan(year,month,day);
             int days_since_epoch = days_from_1970(year) + day_of_year;
             
- time_t seconds_in_day = 3600 * 24;
- time_t result = seconds_in_day * days_since_epoch + 3600 * t->tm_hour + 60 * t->tm_min + t->tm_sec;
+ std::time_t seconds_in_day = 3600 * 24;
+ std::time_t result = seconds_in_day * days_since_epoch + 3600 * t->tm_hour + 60 * t->tm_min + t->tm_sec;
             
             return result;
         }
@@ -150,7 +150,7 @@
             gregorian_calendar(std::string const &terr)
             {
                 first_day_of_week_ = first_day_of_week(terr.c_str());
- time_ = time(0);
+ time_ = std::time(0);
                 is_local_ = true;
                 tzoff_ = 0;
                 from_time(time_);
@@ -235,10 +235,10 @@
                     std::tm val = tm_updated_;
                     val.tm_isdst = -1;
                     val.tm_wday = -1; // indecator of error
- time_t point = -1;
+ std::time_t point = -1;
                     if(is_local_) {
- point = mktime(&val);
- if(point == static_cast<time_t>(-1)){
+ point = std::mktime(&val);
+ if(point == static_cast<std::time_t>(-1)){
                             #ifndef BOOST_WINDOWS
                             // windows does not handle negative time_t, under other plaforms
                             // it may be actually valid value in 1969-12-31 23:59:59
@@ -318,7 +318,7 @@
                         #ifdef BOOST_WINDOWS
                         return 1970; // Unix epoch windows can't handle negative time_t
                         #else
- if(sizeof(time_t) == 4)
+ if(sizeof(std::time_t) == 4)
                             return 1901; // minimal year with 32 bit time_t
                         else
                             return 1;
@@ -326,7 +326,7 @@
                     case absolute_maximum:
                     case least_maximum:
                     case actual_maximum:
- if(sizeof(time_t) == 4)
+ if(sizeof(std::time_t) == 4)
                             return 2038; // Y2K38 - maximal with 32 bit time_t
                         else
                             return std::numeric_limits<int>::max();
@@ -565,7 +565,7 @@
             ///
             virtual void set_time(posix_time const &p)
             {
- from_time(static_cast<time_t>(p.seconds));
+ from_time(static_cast<std::time_t>(p.seconds));
             }
             virtual posix_time get_time() const
             {
@@ -791,9 +791,9 @@
 
     private:
 
- void from_time(time_t point)
+ void from_time(std::time_t point)
         {
- time_t real_point = point + tzoff_;
+ std::time_t real_point = point + tzoff_;
             std::tm *t = 0;
             #ifdef BOOST_WINDOWS
             // Windows uses TLS, thread safe
@@ -811,7 +811,7 @@
             time_ = point;
         }
         int first_day_of_week_;
- time_t time_;
+ std::time_t time_;
         std::tm tm_;
         std::tm tm_updated_;
         bool normalized_;

Modified: trunk/libs/locale/src/util/numeric.hpp
==============================================================================
--- trunk/libs/locale/src/util/numeric.hpp (original)
+++ trunk/libs/locale/src/util/numeric.hpp 2012-11-27 11:12:53 EST (Tue, 27 Nov 2012)
@@ -14,6 +14,7 @@
 #include <boost/locale/info.hpp>
 #include <sstream>
 #include <vector>
+#include <ctime>
 #include <stdlib.h>
 
 #include "timezone.hpp"
@@ -129,13 +130,13 @@
                 return ret_ptr;
             }
         case flags::date:
- return format_time(out,ios,fill,static_cast<time_t>(val),'x');
+ return format_time(out,ios,fill,static_cast<std::time_t>(val),'x');
         case flags::time:
- return format_time(out,ios,fill,static_cast<time_t>(val),'X');
+ return format_time(out,ios,fill,static_cast<std::time_t>(val),'X');
         case flags::datetime:
- return format_time(out,ios,fill,static_cast<time_t>(val),'c');
+ return format_time(out,ios,fill,static_cast<std::time_t>(val),'c');
         case flags::strftime:
- return format_time(out,ios,fill,static_cast<time_t>(val),info.date_time_pattern<char_type>());
+ return format_time(out,ios,fill,static_cast<std::time_t>(val),info.date_time_pattern<char_type>());
         case flags::currency:
             {
                 bool nat = info.currency_flags()==flags::currency_default
@@ -177,7 +178,7 @@
         return out;
     }
 
- iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,time_t time,char c) const
+ iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,std::time_t time,char c) const
     {
         string_type fmt;
         fmt+=char_type('%');
@@ -185,7 +186,7 @@
         return format_time(out,ios,fill,time,fmt);
     }
 
- iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,time_t time,string_type const &format) const
+ iter_type format_time(iter_type out,std::ios_base &ios,char_type fill,std::time_t time,string_type const &format) const
     {
         std::string tz = ios_info::get(ios).time_zone();
         std::tm tm;


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