Merge pull request #8333 from BlaiZephyr/change-time-timestamp-type

Change type from int to int64_t
This commit is contained in:
heinrich5991 2024-05-09 08:01:17 +00:00 committed by GitHub
commit 60dbd73ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View file

@ -2613,7 +2613,7 @@ int net_socket_read_wait(NETSOCKET sock, int time)
return 0;
}
int time_timestamp()
int64_t time_timestamp()
{
return time(0);
}

View file

@ -698,7 +698,7 @@ int64_t time_freq();
*
* @return The time as a UNIX timestamp
*/
int time_timestamp();
int64_t time_timestamp();
/**
* Retrieves the hours since midnight (0..23)

View file

@ -217,7 +217,7 @@ int CNetBan::Ban(T *pBanPool, const typename T::CDataType *pData, int Seconds, c
return -1;
}
int Stamp = Seconds > 0 ? time_timestamp() + Seconds : CBanInfo::EXPIRES_NEVER;
int64_t Stamp = Seconds > 0 ? time_timestamp() + Seconds : static_cast<int64_t>(CBanInfo::EXPIRES_NEVER);
// set up info
CBanInfo Info = {0};
@ -290,7 +290,7 @@ void CNetBan::Init(IConsole *pConsole, IStorage *pStorage)
void CNetBan::Update()
{
int Now = time_timestamp();
int64_t Now = time_timestamp();
// remove expired bans
char aBuf[256], aNetStr[256];
@ -522,7 +522,7 @@ void CNetBan::ConBansSave(IConsole::IResult *pResult, void *pUser)
return;
}
int Now = time_timestamp();
int64_t Now = time_timestamp();
char aAddrStr1[NETADDR_MAXSTRSIZE], aAddrStr2[NETADDR_MAXSTRSIZE];
for(CBanAddr *pBan = pThis->m_BanAddrPool.First(); pBan; pBan = pBan->m_pNext)
{

View file

@ -79,7 +79,7 @@ protected:
EXPIRES_NEVER = -1,
REASON_LENGTH = 64,
};
int m_Expires;
int64_t m_Expires;
char m_aReason[REASON_LENGTH];
};