mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-25 13:56:38 +02:00
a3b5f29626
explicit cast to (long long). On *NIX we could get away with lazily assuming time_t is of the same length as long (and use %ld), even though the specification says nothing about it. Unfortunately on Windows things are not that simple: 'time_t' is 'long long' (64 bits) and both 'int' and 'long' are 32 bits, even when compiling in 64 bit mode. This problem could be 'fixed' in multiple ways: One way would be to minimize the usage of time_t and use 'long long' or 'uint64_t' everywhere for variables to minimize casting later. I, however, chose to maintain 'time_t' for most of time grabbing and time calculations (eg: delta), and do the explicit cast in any printf-like functions that may be there. Both solutions work. I mostly like the explicit time_t look, so one can immediately recognize a variable relates to time.