Squash vc98 warn 2

This commit is contained in:
cpq committed 2022-08-09 18:58:58 +01:00
1 parent bd32f6e2ef
commit e5585cb0e7
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -3970,10 +3970,10 @@ void mg_sntp_request(struct mg_connection *c) {
uint64_t now = mg_millis();
uint8_t buf[48] = {0};
uint32_t *t = (uint32_t *) &buf[40];
double frac = ((double) (now % 1000)) / 1000.0;
double frac = ((double) (now % 1000)) / 1000.0 * SNTP_MAX_FRAC;
buf[0] = (0 << 6) | (4 << 3) | 3;
t[0] = mg_htonl((uint32_t) (now / 1000) + SNTP_TIME_OFFSET);
t[1] = mg_htonl((uint32_t) ((int32_t) (frac * SNTP_MAX_FRAC)));
t[1] = mg_htonl((uint32_t) frac);
mg_send(c, buf, sizeof(buf));
}
}
+2 -2
View File
@@ -62,10 +62,10 @@ void mg_sntp_request(struct mg_connection *c) {
uint64_t now = mg_millis();
uint8_t buf[48] = {0};
uint32_t *t = (uint32_t *) &buf[40];
double frac = ((double) (now % 1000)) / 1000.0;
double frac = ((double) (now % 1000)) / 1000.0 * SNTP_MAX_FRAC;
buf[0] = (0 << 6) | (4 << 3) | 3;
t[0] = mg_htonl((uint32_t) (now / 1000) + SNTP_TIME_OFFSET);
t[1] = mg_htonl((uint32_t) ((int32_t) (frac * SNTP_MAX_FRAC)));
t[1] = mg_htonl((uint32_t) frac);
mg_send(c, buf, sizeof(buf));
}
}