Skip to content

Commit

Permalink
fix problem with ULL for 32-bit, on 64-bit this wasn't a problem as t…
Browse files Browse the repository at this point in the history
…he numbers were all treated as 8 bytes wide (on Linux anyway), but for 32-bit this truncated the numbers and caused weird problems;
  • Loading branch information
gatekeep committed Aug 3, 2024
1 parent 7a7dff3 commit 52e3677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/host/network/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 52e3677

Please sign in to comment.