Skip to content
  • Nick Mathewson's avatar
    Cleanup on time-relaqted constants. New conventions: · 474c60b7
    Nick Mathewson authored
      1) Surround all constants by (parens), whether we'll be using them
         in a denominator or not.
      2) Express all time periods as products (24*60*60), not as multiplied-out
         constants (86400).
      3) Comments like "(60*60) /* one hour */" are as pointless as comments
         like "c = a + b; /* set c to the sum of a and b */".  Remove them.
      4) All time periods should be #defined constants, not given inline.
      5) All time periods should have doxygen comments.
      6) All time periods, unless specified, are in seconds.  It's not necessary
         to say so.
    
    To summarize, the old (lack of) style would allow:
    
      #define FOO_RETRY_INTERVAL 60*60 /* one hour (seconds) */
      next_try = now + 3600;
    
    The new style is:
    
      /** How often do we reattempt foo? */
      #define FOO_RETRY_INTERVAL (60*60)
    
      next_try = now + RETRY_INTERVAL;
    
    
    svn:r6142
    474c60b7