1 #include "taia.h" 2 3 /* XXX: breaks tai encapsulation */ 4 taia_add(struct taia * t,const struct taia * u,const struct taia * v)5void taia_add(struct taia *t,const struct taia *u,const struct taia *v) 6 { 7 t->sec.x = u->sec.x + v->sec.x; 8 t->nano = u->nano + v->nano; 9 t->atto = u->atto + v->atto; 10 if (t->atto > 999999999UL) { 11 t->atto -= (uint32)1000000000UL; 12 ++t->nano; 13 } 14 if (t->nano > 999999999UL) { 15 t->nano -= (uint32)1000000000UL; 16 ++t->sec.x; 17 } 18 } 19