From bb934bbe5d53bee1f681c60f37472b1c7f41d0ba Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Fri, 5 Mar 2021 10:22:32 +0100 Subject: [PATCH] fix arm32 build --- include/siri/db/time.h | 4 ++-- src/siri/db/time.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/siri/db/time.h b/include/siri/db/time.h index eee80ea1..35219e73 100644 --- a/include/siri/db/time.h +++ b/include/siri/db/time.h @@ -23,14 +23,14 @@ typedef struct siridb_time_s siridb_time_t; static const char * SIRIDB_TIME_SHORT_MAP[SIRIDB_TIME_END] = {"s", "ms", "us", "ns"}; siridb_time_t * siridb_time_new(siridb_timep_t precision); -uint32_t siridb_time_in_seconds(siridb_t * siridb, int64_t ts); +uint64_t siridb_time_in_seconds(siridb_t * siridb, int64_t ts); uint64_t siridb_time_now(siridb_t * siridb, struct timespec now); uint64_t siridb_time_parse(const char * str, size_t len); struct siridb_time_s { siridb_timep_t precision; - uint32_t factor; + uint64_t factor; size_t ts_sz; }; diff --git a/src/siri/db/time.c b/src/siri/db/time.c index fb4f26da..57666cd0 100644 --- a/src/siri/db/time.c +++ b/src/siri/db/time.c @@ -24,7 +24,7 @@ siridb_time_t * siridb_time_new(siridb_timep_t precision) else { time->precision = precision; - time->factor = xmath_ipow(1000, precision); + time->factor = (uint64_t) xmath_ipow(1000, precision); time->ts_sz = (precision == SIRIDB_TIME_SECONDS) ? sizeof(uint32_t) : sizeof(uint64_t); } @@ -53,7 +53,7 @@ uint64_t siridb_time_parse(const char * str, size_t len) return 0; } -uint32_t siridb_time_in_seconds(siridb_t * siridb, int64_t ts) +uint64_t siridb_time_in_seconds(siridb_t * siridb, int64_t ts) { return ts / siridb->time->factor; } -- 2.30.2