blob: f5c1c9b514e774fc763efaa221fc24a92f7cb97e (
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/uint64.h>
#include "djbtime-internal.h"
int leapsecs_sub (uint64_t *t)
{
uint64_t u = *t ;
uint64_t d = 0 ;
unsigned int i = 0 ;
int hit = 0 ;
for (; i < leapsecs_table_len ; i++)
{
if (u < leapsecs_table[i]) break ;
++d ;
if (u == leapsecs_table[i]) hit = 1 ;
}
*t = u - d ;
return hit ;
}
|