diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2016-09-06 22:16:25 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2016-09-06 22:16:25 -0500 |
commit | 0b1b8701d9b106d38441b35611c40d40e3a3c188 (patch) | |
tree | 1cce87caa60e3942d08c331b0122bde1fe08ed41 /src/tools | |
parent | c56533c917c902eb5595761986f11edf1214fecb (diff) | |
download | tqt3-0b1b8701d9b106d38441b35611c40d40e3a3c188.tar.gz tqt3-0b1b8701d9b106d38441b35611c40d40e3a3c188.zip |
Use time_t for UNIX timestamps
WARNING: This breaks the ABI!
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qdatetime.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/qdatetime.cpp b/src/tools/qdatetime.cpp index 3fb1e29c2..9ab03b6bf 100644 --- a/src/tools/qdatetime.cpp +++ b/src/tools/qdatetime.cpp @@ -1997,7 +1997,7 @@ TQDateTime::TQDateTime( const TQDate &date, const TQTime &time ) \sa setTime_t() */ -uint TQDateTime::toTime_t() const +time_t TQDateTime::toTime_t() const { tm brokenDown; brokenDown.tm_sec = t.second(); @@ -2007,10 +2007,10 @@ uint TQDateTime::toTime_t() const brokenDown.tm_mon = d.month() - 1; brokenDown.tm_year = d.year() - 1900; brokenDown.tm_isdst = -1; - int secsSince1Jan1970UTC = (int) mktime( &brokenDown ); + time_t secsSince1Jan1970UTC = mktime( &brokenDown ); if ( secsSince1Jan1970UTC < -1 ) secsSince1Jan1970UTC = -1; - return (uint) secsSince1Jan1970UTC; + return secsSince1Jan1970UTC; } /*! @@ -2020,7 +2020,7 @@ uint TQDateTime::toTime_t() const based on the given UTC time. */ -void TQDateTime::setTime_t( uint secsSince1Jan1970UTC ) +void TQDateTime::setTime_t( time_t secsSince1Jan1970UTC ) { setTime_t( secsSince1Jan1970UTC, TQt::LocalTime ); } @@ -2037,9 +2037,9 @@ void TQDateTime::setTime_t( uint secsSince1Jan1970UTC ) \sa toTime_t() */ -void TQDateTime::setTime_t( uint secsSince1Jan1970UTC, TQt::TimeSpec ts ) +void TQDateTime::setTime_t( time_t secsSince1Jan1970UTC, TQt::TimeSpec ts ) { - time_t tmp = (time_t) secsSince1Jan1970UTC; + time_t tmp = secsSince1Jan1970UTC; tm *brokenDown = 0; #if defined(Q_OS_UNIX) && defined(QT_THREAD_SUPPORT) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) |