Changeset 16588 for trunk


Ignore:
Timestamp:
06/02/13 15:52:07 (11 years ago)
Author:
tbretz
Message:
Access the static data members as static data members (removes also some valgrind error)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Time.cc

    r16376 r16588  
    102102//
    103103Time::Time(const time_t &tm, const suseconds_t &usec)
    104 : ptime(fUnixOffset, time_duration(0, 0, tm, usec*pow(10, time_of_day().num_fractional_digits()-6)))
     104: ptime(fUnixOffset, time_duration(0, 0, tm, usec*pow(10, time_duration::num_fractional_digits()-6)))
    105105{
    106106}
     
    114114//!
    115115Time::Time(const timeval &tv)
    116 : ptime(fUnixOffset, time_duration(0, 0, tv.tv_sec, tv.tv_usec*pow(10, time_of_day().num_fractional_digits()-6)))
     116: ptime(fUnixOffset, time_duration(0, 0, tv.tv_sec, tv.tv_usec*pow(10, time_duration::num_fractional_digits()-6)))
    117117{
    118118}
     
    130130// Last argument is fractional_seconds ( correct with num_fractional_digits() )
    131131: ptime(boost::gregorian::date(year, month, day),
    132         time_duration(hh, mm, ss, microsec*pow(10, time_of_day().num_fractional_digits()-6)))
     132        time_duration(hh, mm, ss, microsec*pow(10, time_duration::num_fractional_digits()-6)))
    133133{
    134134}
     
    152152    mjd *= 24*60*60;
    153153
    154     const int exp = time_of_day().num_fractional_digits();
    155     const double frac = fmod(mjd, 1)*pow(10, exp);
     154    const double frac = fmod(mjd, 1)*pow(10, time_duration::num_fractional_digits());
    156155
    157156    *this = ptime(fUnixOffset, time_duration(0, 0, mjd, frac));
     
    166165    const time_duration tod = time_of_day();
    167166
    168     const int exp = tod.num_fractional_digits();
    169 
    170     const double frac = tod.fractional_seconds()/pow(10, exp);
     167    const double frac = tod.fractional_seconds()/pow(10, time_duration::num_fractional_digits());
    171168    const double sec  = tod.total_seconds()+frac;
    172169
Note: See TracChangeset for help on using the changeset viewer.