From bd32f6e2ef7bc54c754dd2140305a0d8bdbce82f Mon Sep 17 00:00:00 2001 From: cpq Date: Tue, 9 Aug 2022 15:49:54 +0100 Subject: [PATCH] Squash warn on vc98 --- mongoose.c | 2 +- src/sntp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 873ce1bd..206b5b31 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3973,7 +3973,7 @@ void mg_sntp_request(struct mg_connection *c) { double frac = ((double) (now % 1000)) / 1000.0; buf[0] = (0 << 6) | (4 << 3) | 3; t[0] = mg_htonl((uint32_t) (now / 1000) + SNTP_TIME_OFFSET); - t[1] = mg_htonl((uint32_t) ((uint32_t) (frac * SNTP_MAX_FRAC))); + t[1] = mg_htonl((uint32_t) ((int32_t) (frac * SNTP_MAX_FRAC))); mg_send(c, buf, sizeof(buf)); } } diff --git a/src/sntp.c b/src/sntp.c index 86bc4d6f..4f4dff1b 100644 --- a/src/sntp.c +++ b/src/sntp.c @@ -65,7 +65,7 @@ void mg_sntp_request(struct mg_connection *c) { double frac = ((double) (now % 1000)) / 1000.0; buf[0] = (0 << 6) | (4 << 3) | 3; t[0] = mg_htonl((uint32_t) (now / 1000) + SNTP_TIME_OFFSET); - t[1] = mg_htonl((uint32_t) ((uint32_t) (frac * SNTP_MAX_FRAC))); + t[1] = mg_htonl((uint32_t) ((int32_t) (frac * SNTP_MAX_FRAC))); mg_send(c, buf, sizeof(buf)); } }