summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-02-21 12:05:07 +0000
commit49d8fa1058aaf23c29e074b2314492ae40d2f557 (patch)
tree393f884d5a99f984e992a0f35f1b02ac43536217 /tools
parentfdffefb8032922ce7ffe4c00816072a8ff2148fc (diff)
downloadskalibs-49d8fa1058aaf23c29e074b2314492ae40d2f557.tar.xz
Types change: big pass on libstddjb and libunixonacid
libdatastruct still missing, library still not functional
Diffstat (limited to 'tools')
-rw-r--r--tools/convert-leapsecs.c15
-rwxr-xr-xtools/make-leapsecs_table4
2 files changed, 11 insertions, 8 deletions
diff --git a/tools/convert-leapsecs.c b/tools/convert-leapsecs.c
index 82410e6..9964b74 100644
--- a/tools/convert-leapsecs.c
+++ b/tools/convert-leapsecs.c
@@ -1,3 +1,6 @@
+/* ISC license. */
+
+#include <sys/types.h>
#include <time.h>
#include <skalibs/uint64.h>
#include <skalibs/buffer.h>
@@ -8,11 +11,11 @@
static genalloc table = GENALLOC_ZERO ; /* uint64 */
-static void add_leapsecs (uint64 *t)
+static void add_leapsecs (uint64_t *t)
{
- uint64 *tab = genalloc_s(uint64, &table) ;
- unsigned int n = genalloc_len(uint64, &table) ;
- unsigned int i = 0 ;
+ uint64_t *tab = genalloc_s(uint64, &table) ;
+ size_t n = genalloc_len(uint64, &table) ;
+ size_t i = 0 ;
for (; i < n ; i++) if (*t >= tab[i]) (*t)++ ;
}
@@ -22,7 +25,7 @@ int main (int argc, char const *const *argv)
for (;;)
{
struct tm tm ;
- uint64 tt ;
+ uint64_t tt ;
time_t t ;
char *p ;
int r ;
@@ -40,7 +43,7 @@ int main (int argc, char const *const *argv)
if (t < 0) strerr_diefu1sys(111, "mktime") ;
tt = t + 10 ;
add_leapsecs(&tt) ;
- if (!genalloc_append(uint64, &table, &tt))
+ if (!genalloc_append(uint64_t, &table, &tt))
strerr_diefu1sys(111, "genalloc_append") ;
fmt[uint64_fmt(fmt, tt)] = 0 ;
buffer_puts(buffer_1, " TAI_MAGIC + ") ;
diff --git a/tools/make-leapsecs_table b/tools/make-leapsecs_table
index 7457dad..fe23feb 100755
--- a/tools/make-leapsecs_table
+++ b/tools/make-leapsecs_table
@@ -27,7 +27,7 @@ if
#include \"djbtime-internal.h\"
unsigned int const leapsecs_table_len = ${N} ;
-static uint64 const leapsecs_table_[${N}] =\n{"
+static uint64_t const leapsecs_table_[${N}] =\n{"
}
if
@@ -36,4 +36,4 @@ if
${PREFIX}/convert-leapsecs
}
-s6-echo "} ;\nuint64 const *const leapsecs_table = leapsecs_table_ ;"
+s6-echo "} ;\nuint64_t const *const leapsecs_table = leapsecs_table_ ;"