Mercurial > octave
changeset 30070:2d662df32969
maint: use "m_" prefix for member variables in class time.
* oct-time.cc, oct-time.h: use "m_" prefix for member variables in class time.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 30 Aug 2021 07:54:15 -0700 |
parents | abf2e77cca42 |
children | 11bda5cb45b5 |
files | liboctave/system/oct-time.cc liboctave/system/oct-time.h |
diffstat | 2 files changed, 21 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/system/oct-time.cc Sun Aug 29 21:18:43 2021 -0700 +++ b/liboctave/system/oct-time.cc Mon Aug 30 07:54:15 2021 -0700 @@ -53,14 +53,14 @@ namespace sys { time::time (double d) - : ot_unix_time (static_cast<time_t> (d)), ot_usec (0) + : m_ot_unix_time (static_cast<time_t> (d)), m_ot_usec (0) { double ip; - ot_usec = static_cast<int> (std::modf (d, &ip) * 1e6); + m_ot_usec = static_cast<int> (std::modf (d, &ip) * 1e6); } time::time (const base_tm& tm) - : ot_unix_time (), ot_usec () + : m_ot_unix_time (), m_ot_usec () { struct ::tm t; @@ -84,13 +84,13 @@ t.tm_zone = ps; #endif - ot_unix_time = octave_mktime_wrapper (&t); + m_ot_unix_time = octave_mktime_wrapper (&t); #if defined (HAVE_STRUCT_TM_TM_ZONE) delete [] ps; #endif - ot_usec = tm.usec (); + m_ot_usec = tm.usec (); } std::string @@ -104,8 +104,8 @@ { preserve_stream_state stream_state (os); - os << ot.ot_unix_time << '.' - << std::setw (6) << std::setfill ('0') << ot.ot_usec; + os << ot.m_ot_unix_time << '.' + << std::setw (6) << std::setfill ('0') << ot.m_ot_usec; return os; } @@ -113,7 +113,7 @@ void time::stamp (void) { - octave_gettimeofday_wrapper (&ot_unix_time, &ot_usec); + octave_gettimeofday_wrapper (&m_ot_unix_time, &m_ot_usec); } // From the mktime() manual page:
--- a/liboctave/system/oct-time.h Sun Aug 29 21:18:43 2021 -0700 +++ b/liboctave/system/oct-time.h Mon Aug 30 07:54:15 2021 -0700 @@ -55,13 +55,13 @@ public: time (void) - : ot_unix_time (0), ot_usec (0) { stamp (); } + : m_ot_unix_time (0), m_ot_usec (0) { stamp (); } time (time_t t) - : ot_unix_time (t), ot_usec (0) { } + : m_ot_unix_time (t), m_ot_usec (0) { } time (time_t t, long us) - : ot_unix_time (t), ot_usec () + : m_ot_unix_time (t), m_ot_usec () { long rem, extra; @@ -78,8 +78,8 @@ rem = 1000000 - us % 1000000; } - ot_usec = rem; - ot_unix_time += extra; + m_ot_usec = rem; + m_ot_unix_time += extra; } OCTAVE_API time (double d); @@ -87,14 +87,14 @@ OCTAVE_API time (const base_tm& tm); time (const time& ot) - : ot_unix_time (ot.ot_unix_time), ot_usec (ot.ot_usec) { } + : m_ot_unix_time (ot.m_ot_unix_time), m_ot_usec (ot.m_ot_usec) { } time& operator = (const time& ot) { if (this != &ot) { - ot_unix_time = ot.ot_unix_time; - ot_usec = ot.ot_usec; + m_ot_unix_time = ot.m_ot_unix_time; + m_ot_usec = ot.m_ot_usec; } return *this; @@ -106,12 +106,12 @@ double double_value (void) const { - return as_double (ot_unix_time, ot_usec); + return as_double (m_ot_unix_time, m_ot_usec); } - time_t unix_time (void) const { return ot_unix_time; } + time_t unix_time (void) const { return m_ot_unix_time; } - long usec (void) const { return ot_usec; } + long usec (void) const { return m_ot_usec; } OCTAVE_API std::string ctime (void) const; @@ -120,10 +120,10 @@ private: // Seconds since the epoch. - time_t ot_unix_time; + time_t m_ot_unix_time; // Additional microseconds. - long ot_usec; + long m_ot_usec; }; inline bool