release
[hcoop/zz_old/debian/djbdns.git] / taia_add.c
1 #include "taia.h"
2
3 /* XXX: breaks tai encapsulation */
4
5 void 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 -= 1000000000UL;
12 ++t->nano;
13 }
14 if (t->nano > 999999999UL) {
15 t->nano -= 1000000000UL;
16 ++t->sec.x;
17 }
18 }