summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_addsec.c
blob: f4252a7fb58568adff2cbcb9fc03a90cba0c2ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* ISC license. */

#include <skalibs/tai.h>

void tain_addsec (tain_t *b, tain_t const *a, int c)
{
  b->nano = a->nano ;
  if (c >= 0)
  {
    tai_t t ;
    tai_u64(&t, c) ;
    tai_add(&b->sec, &a->sec, &t) ;
  }
  else
  {
    tai_t t ;
    tai_u64(&t, -c) ;
    tai_sub(&b->sec, &a->sec, &t) ;
  }
}