Changeset 93c2e0a for src/libcfa/time
- Timestamp:
- Aug 11, 2018, 5:04:35 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- e765794
- Parents:
- a37133c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/time
ra37133c r93c2e0a 10 10 // Created On : Wed Mar 14 23:18:57 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 2 21:28:38201813 // Update Count : 64 112 // Last Modified On : Sat Aug 11 13:55:33 2018 13 // Update Count : 642 14 14 // 15 15 … … 52 52 Duration ?%=?( Duration & lhs, Duration rhs ) { lhs = lhs % rhs; return lhs; } 53 53 54 _Bool ?==?( Duration lhs, Duration rhs ) { return lhs.tv == rhs.tv; }55 _Bool ?!=?( Duration lhs, Duration rhs ) { return lhs.tv != rhs.tv; }56 _Bool ?<? ( Duration lhs, Duration rhs ) { return lhs.tv < rhs.tv; }57 _Bool ?<=?( Duration lhs, Duration rhs ) { return lhs.tv <= rhs.tv; }58 _Bool ?>? ( Duration lhs, Duration rhs ) { return lhs.tv > rhs.tv; }59 _Bool ?>=?( Duration lhs, Duration rhs ) { return lhs.tv >= rhs.tv; }60 61 _Bool ?==?( Duration lhs, zero_t ) { return lhs.tv == 0; }62 _Bool ?!=?( Duration lhs, zero_t ) { return lhs.tv != 0; }63 _Bool ?<? ( Duration lhs, zero_t ) { return lhs.tv < 0; }64 _Bool ?<=?( Duration lhs, zero_t ) { return lhs.tv <= 0; }65 _Bool ?>? ( Duration lhs, zero_t ) { return lhs.tv > 0; }66 _Bool ?>=?( Duration lhs, zero_t ) { return lhs.tv >= 0; }54 bool ?==?( Duration lhs, Duration rhs ) { return lhs.tv == rhs.tv; } 55 bool ?!=?( Duration lhs, Duration rhs ) { return lhs.tv != rhs.tv; } 56 bool ?<? ( Duration lhs, Duration rhs ) { return lhs.tv < rhs.tv; } 57 bool ?<=?( Duration lhs, Duration rhs ) { return lhs.tv <= rhs.tv; } 58 bool ?>? ( Duration lhs, Duration rhs ) { return lhs.tv > rhs.tv; } 59 bool ?>=?( Duration lhs, Duration rhs ) { return lhs.tv >= rhs.tv; } 60 61 bool ?==?( Duration lhs, zero_t ) { return lhs.tv == 0; } 62 bool ?!=?( Duration lhs, zero_t ) { return lhs.tv != 0; } 63 bool ?<? ( Duration lhs, zero_t ) { return lhs.tv < 0; } 64 bool ?<=?( Duration lhs, zero_t ) { return lhs.tv <= 0; } 65 bool ?>? ( Duration lhs, zero_t ) { return lhs.tv > 0; } 66 bool ?>=?( Duration lhs, zero_t ) { return lhs.tv >= 0; } 67 67 68 68 Duration abs( Duration rhs ) { return rhs.tv >= 0 ? rhs : -rhs; } … … 106 106 timeval ?+?( timeval & lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_usec + rhs.tv_usec }; } 107 107 timeval ?-?( timeval & lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_usec - rhs.tv_usec }; } 108 _Bool ?==?( timeval lhs, timeval rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_usec == rhs.tv_usec; }109 _Bool ?!=?( timeval lhs, timeval rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_usec != rhs.tv_usec; }108 bool ?==?( timeval lhs, timeval rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_usec == rhs.tv_usec; } 109 bool ?!=?( timeval lhs, timeval rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_usec != rhs.tv_usec; } 110 110 } // distribution 111 111 … … 121 121 timespec ?+?( timespec & lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_nsec + rhs.tv_nsec }; } 122 122 timespec ?-?( timespec & lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_nsec - rhs.tv_nsec }; } 123 _Bool ?==?( timespec lhs, timespec rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_nsec == rhs.tv_nsec; }124 _Bool ?!=?( timespec lhs, timespec rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_nsec != rhs.tv_nsec; }123 bool ?==?( timespec lhs, timespec rhs ) { return lhs.tv_sec == rhs.tv_sec && lhs.tv_nsec == rhs.tv_nsec; } 124 bool ?!=?( timespec lhs, timespec rhs ) { return lhs.tv_sec != rhs.tv_sec || lhs.tv_nsec != rhs.tv_nsec; } 125 125 } // distribution 126 126 … … 166 166 Time ?-?( Time lhs, Duration rhs ) { return (Time)@{ lhs.tv - rhs.tv }; } 167 167 Time ?-=?( Time & lhs, Duration rhs ) { lhs = lhs - rhs; return lhs; } 168 _Bool ?==?( Time lhs, Time rhs ) { return lhs.tv == rhs.tv; }169 _Bool ?!=?( Time lhs, Time rhs ) { return lhs.tv != rhs.tv; }170 _Bool ?<?( Time lhs, Time rhs ) { return lhs.tv < rhs.tv; }171 _Bool ?<=?( Time lhs, Time rhs ) { return lhs.tv <= rhs.tv; }172 _Bool ?>?( Time lhs, Time rhs ) { return lhs.tv > rhs.tv; }173 _Bool ?>=?( Time lhs, Time rhs ) { return lhs.tv >= rhs.tv; }168 bool ?==?( Time lhs, Time rhs ) { return lhs.tv == rhs.tv; } 169 bool ?!=?( Time lhs, Time rhs ) { return lhs.tv != rhs.tv; } 170 bool ?<?( Time lhs, Time rhs ) { return lhs.tv < rhs.tv; } 171 bool ?<=?( Time lhs, Time rhs ) { return lhs.tv <= rhs.tv; } 172 bool ?>?( Time lhs, Time rhs ) { return lhs.tv > rhs.tv; } 173 bool ?>=?( Time lhs, Time rhs ) { return lhs.tv >= rhs.tv; } 174 174 } // distribution 175 175
Note: See TracChangeset
for help on using the changeset viewer.