summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_add.c
blob: 6c6a237dcd6941e859013305ddb7823c0021ac8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <skalibs/tai.h>

void tain_add (tain_t *t, tain_t const *u, tain_t const *v)
{
  tai_add(&t->sec, &u->sec, &v->sec) ;
  t->nano = u->nano + v->nano ;
  if (t->nano > 999999999U)
  {
    t->nano -= 1000000000U ;
    tai_u64(&t->sec, tai_sec(&t->sec)+1) ;
  }
}