Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed siridb_time_now returns incorrect number in arm32 build #169

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/siri/db/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ static int QUERY_time_expr(
*size,
"%" PRIu64,
siridb_time_parse(node->str, node->len) *
walker->siridb->time->factor);
(uint64_t)walker->siridb->time->factor);
if (n >= (ssize_t) *size)
{
return EXPR_TOO_LONG;
Expand Down Expand Up @@ -930,7 +930,7 @@ static int QUERY_time_expr(
buf + EXPR_MAX_SIZE - *size,
*size,
"%" PRId64,
ts * walker->siridb->time->factor);
ts * (uint64_t)walker->siridb->time->factor);

if (n >= (ssize_t) *size)
{
Expand Down
4 changes: 2 additions & 2 deletions src/siri/db/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ uint32_t siridb_time_in_seconds(siridb_t * siridb, int64_t ts)

uint64_t siridb_time_now(siridb_t * siridb, struct timespec now)
{
return now.tv_sec * siridb->time->factor +
now.tv_nsec * (siridb->time->factor / 1000000000.0);
return now.tv_sec * (uint64_t)siridb->time->factor +
now.tv_nsec * ((uint64_t)siridb->time->factor / 1000000000.0);
}