From 52e36772703912e7f7c260860fee91dbbe663499 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Sat, 3 Aug 2024 11:30:43 -0400 Subject: [PATCH] fix problem with ULL for 32-bit, on 64-bit this wasn't a problem as the numbers were all treated as 8 bytes wide (on Linux anyway), but for 32-bit this truncated the numbers and caused weird problems; --- src/host/network/Network.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/host/network/Network.cpp b/src/host/network/Network.cpp index 36430301..751a87a3 100644 --- a/src/host/network/Network.cpp +++ b/src/host/network/Network.cpp @@ -27,7 +27,7 @@ using namespace network; // Constants // --------------------------------------------------------------------------- -#define MAX_SERVER_DIFF 250 // maximum difference in time between a server timestamp and local timestamp in milliseconds +#define MAX_SERVER_DIFF 250ULL // maximum difference in time between a server timestamp and local timestamp in milliseconds // --------------------------------------------------------------------------- // Public Class Members @@ -609,7 +609,7 @@ void Network::clock(uint32_t ms) // check the ping RTT and report any over the maximum defined time uint64_t dt = (uint64_t)fabs(now - serverNow); if (dt > MAX_SERVER_DIFF) - LogWarning(LOG_NET, "PEER %u pong, time delay greater than %ums, now = %u, server = %u, dt = %u", m_peerId, MAX_SERVER_DIFF, now, serverNow, dt); + LogWarning(LOG_NET, "PEER %u pong, time delay greater than %llums, now = %llu, server = %llu, dt = %llu", m_peerId, MAX_SERVER_DIFF, now, serverNow, dt); } break; default: