comparison src/c/urweb.c @ 2034:1d36654c2d21

Fix uw_Basis_lt_time
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 Jun 2014 08:31:21 -0400
parents ea0ecd5fa9df
children ced78ef1c82f
comparison
equal deleted inserted replaced
2033:ea0ecd5fa9df 2034:1d36654c2d21
4269 uw_Basis_bool uw_Basis_eq_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { 4269 uw_Basis_bool uw_Basis_eq_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) {
4270 return !!(t1.seconds == t2.seconds && t1.microseconds == t2.microseconds); 4270 return !!(t1.seconds == t2.seconds && t1.microseconds == t2.microseconds);
4271 } 4271 }
4272 4272
4273 uw_Basis_bool uw_Basis_lt_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { 4273 uw_Basis_bool uw_Basis_lt_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) {
4274 return !!(t1.seconds < t2.seconds || t1.microseconds < t2.microseconds); 4274 return !!(t1.seconds < t2.seconds || (t1.seconds == t2.seconds && t1.microseconds < t2.microseconds));
4275 } 4275 }
4276 4276
4277 uw_Basis_bool uw_Basis_le_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { 4277 uw_Basis_bool uw_Basis_le_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) {
4278 return !!(uw_Basis_eq_time(ctx, t1, t2) || uw_Basis_lt_time(ctx, t1, t2)); 4278 return !!(uw_Basis_eq_time(ctx, t1, t2) || uw_Basis_lt_time(ctx, t1, t2));
4279 } 4279 }