Changeset 579 for XIOS/branchs/xios-1.0


Ignore:
Timestamp:
03/23/15 11:18:04 (9 years ago)
Author:
rlacroix
Message:

Add a missing return statement to the CDuration::solveTimeStep method.

Cosmetic only, the return value was never used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-1.0/src/duration.cpp

    r501 r579  
    2020      CDuration & CDuration::operator=(const CDuration & duration) 
    2121      { 
    22          year = duration.year;  month  = duration.month ; day    = duration.day; 
    23          hour = duration.hour;  minute = duration.minute; second = duration.second; timestep=duration.timestep ; 
    24          return (*this); 
     22         year = duration.year;  month  = duration.month; day    = duration.day; 
     23         hour = duration.hour;  minute = duration.minute; second = duration.second; timestep=duration.timestep; 
     24         return *this; 
    2525      } 
    2626 
     
    2929         StdOStringStream sout; 
    3030         bool testValue = true; 
    31          if(duration.year   != 0.0) { testValue = false; sout << duration.year   << "y " ; } 
     31         if(duration.year   != 0.0) { testValue = false; sout << duration.year   << "y "; } 
    3232         if(duration.month  != 0.0) { testValue = false; sout << duration.month  << "mo "; } 
    33          if(duration.day    != 0.0) { testValue = false; sout << duration.day    << "d " ; } 
    34          if(duration.hour   != 0.0) { testValue = false; sout << duration.hour   << "h " ; } 
     33         if(duration.day    != 0.0) { testValue = false; sout << duration.day    << "d "; } 
     34         if(duration.hour   != 0.0) { testValue = false; sout << duration.hour   << "h "; } 
    3535         if(duration.minute != 0.0) { testValue = false; sout << duration.minute << "mi "; } 
    36          if(duration.second != 0.0) { testValue = false; sout << duration.second << "s " ; } 
    37          if(duration.timestep != 0.0 || testValue)       { sout << duration.timestep << "ts " ; } 
     36         if(duration.second != 0.0) { testValue = false; sout << duration.second << "s "; } 
     37         if(duration.timestep != 0.0 || testValue)       { sout << duration.timestep << "ts "; } 
    3838 
    3939         // << suppression de l'espace en fin de chaîne. 
    4040         out << (sout.str().substr(0, sout.str().size()-1)); 
    41          return (out); 
     41         return out; 
    4242      } 
    4343 
     
    5050         while (!in.eof()) 
    5151         { 
    52                if (!(in >> v >> c))  
     52               if (!(in >> v >> c)) 
    5353               { 
    54                  //DEBUG("----> Pb StdIStream & operator>>(StdIStream & in , CDuration & duration)") ; 
    55                  //if (in.eof())  DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)") ; 
     54                 //DEBUG("----> Pb StdIStream & operator>>(StdIStream & in , CDuration & duration)"); 
     55                 //if (in.eof())  DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)"); 
    5656               } 
    57                if (in.eof())   
     57               if (in.eof()) 
    5858               { 
    59                  //DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)") ; 
    60                  break ; 
     59                 //DEBUG("----> Fin de fichier StdIStream & operator>>(StdIStream & in , CDuration & duration)"); 
     60                 break; 
    6161               } 
    6262               switch (c) 
     
    8282                  { 
    8383                    in >> c; 
    84                     if (c=='s') duration.timestep = v;  
     84                    if (c=='s') duration.timestep = v; 
    8585                    break; 
    8686                  } 
    87                    
     87 
    8888                  default: 
    8989                     StdString valc; valc.append(1, c); 
     
    9292               } 
    9393            } 
    94             return (in); 
     94            return in; 
    9595      } 
    9696 
     
    101101         if ((year == 0) && (month  == 0) && (day    == 0) && 
    102102             (hour == 0) && (minute == 0) && (second == 0) && (timestep == 0)) 
    103             return (true); 
    104          return (false); 
     103            return true; 
     104         return false; 
    105105      } 
    106106 
     
    108108      CDuration & CDuration::solveTimeStep(const CCalendar & c) 
    109109      { 
    110         CDuration timeStep=c.getTimeStep() ; 
    111         second +=timestep*timeStep.second ;  
    112         minute +=timestep*timeStep.minute ;  
    113         hour +=timestep*timeStep.hour ;  
    114         day +=timestep*timeStep.day ;  
    115         month +=timestep*timeStep.month ;  
    116         year +=timestep*timeStep.year ;  
    117         timestep = 0 ; 
     110        CDuration timeStep=c.getTimeStep(); 
     111        second +=timestep*timeStep.second; 
     112        minute +=timestep*timeStep.minute; 
     113        hour +=timestep*timeStep.hour; 
     114        day +=timestep*timeStep.day; 
     115        month +=timestep*timeStep.month; 
     116        year +=timestep*timeStep.year; 
     117        timestep = 0; 
     118        return *this; 
     119      } 
    118120 
    119       } 
    120                 
    121          
    122121      CDuration & CDuration::resolve(const CCalendar & c) 
    123122      { 
     
    139138         month  += modf(year, &year) * (float)c.getYearLength(); 
    140139         year   += int(month) /c.getYearLength(); month  = int(month)%c.getYearLength(); 
    141          return (*this); 
     140         return *this; 
    142141      } 
    143142 
     
    148147         const  CDuration & own = *this; 
    149148         StdOStringStream oss; oss << own; 
    150          return (oss.str()); 
     149         return oss.str(); 
    151150      } 
    152151 
     
    155154         CDuration dr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; 
    156155         StdIStringStream iss(str); iss >> dr; 
    157          return (dr); 
     156         return dr; 
    158157      } 
    159158 
    160159      ///--------------------------------------------------------------- 
    161  
    162  
    163160} // namespace xios 
    164161 
Note: See TracChangeset for help on using the changeset viewer.