From 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 3 May 2018 16:02:14 +0200 Subject: mir_forkThread - stronger typizatioin for thread function parameter --- protocols/IcqOscarJ/src/chan_05ping.cpp | 4 ++-- protocols/IcqOscarJ/src/cookies.cpp | 6 +++--- protocols/IcqOscarJ/src/fam_01service.cpp | 2 +- protocols/IcqOscarJ/src/fam_02location.cpp | 2 +- protocols/IcqOscarJ/src/fam_03buddy.cpp | 2 +- protocols/IcqOscarJ/src/fam_04message.cpp | 20 ++++++++++---------- protocols/IcqOscarJ/src/fam_13servclist.cpp | 4 ++-- protocols/IcqOscarJ/src/fam_15icqserver.cpp | 2 +- protocols/IcqOscarJ/src/icq_avatar.cpp | 6 +++--- protocols/IcqOscarJ/src/icq_direct.cpp | 2 +- protocols/IcqOscarJ/src/icq_directmsg.cpp | 8 ++++---- protocols/IcqOscarJ/src/icq_filerequests.cpp | 2 +- protocols/IcqOscarJ/src/icq_infoupdate.cpp | 4 ++-- protocols/IcqOscarJ/src/icq_rates.cpp | 5 ++--- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 4 ++-- protocols/IcqOscarJ/src/icq_xtraz.cpp | 2 +- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 2 +- protocols/IcqOscarJ/src/init.cpp | 2 +- protocols/IcqOscarJ/src/oscar_filetransfer.cpp | 2 +- protocols/IcqOscarJ/src/stdpackets.cpp | 4 ++-- protocols/IcqOscarJ/src/utilities.cpp | 2 +- 22 files changed, 44 insertions(+), 45 deletions(-) (limited to 'protocols/IcqOscarJ') diff --git a/protocols/IcqOscarJ/src/chan_05ping.cpp b/protocols/IcqOscarJ/src/chan_05ping.cpp index 41e3046a55..05cbc27d74 100644 --- a/protocols/IcqOscarJ/src/chan_05ping.cpp +++ b/protocols/IcqOscarJ/src/chan_05ping.cpp @@ -33,7 +33,7 @@ void CIcqProto::handlePingChannel(BYTE*, size_t) void CIcqProto::StartKeepAlive(serverthread_info *info) { if (getByte("KeepAlive", DEFAULT_KEEPALIVE_ENABLED)) - info->tmPing = time(nullptr) + KEEPALIVE_INTERVAL; + info->tmPing = time(0) + KEEPALIVE_INTERVAL; else info->tmPing = -1; } @@ -48,7 +48,7 @@ void CIcqProto::CheckKeepAlive(serverthread_info *info) if (info->tmPing == -1) return; - if (time(nullptr) >= info->tmPing) { + if (time(0) >= info->tmPing) { // Send a keep alive packet to server icq_packet packet = { 0 }; write_flap(&packet, ICQ_PING_CHAN); diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp index 0eb4dcc2fd..f63b6d35c8 100644 --- a/protocols/IcqOscarJ/src/cookies.cpp +++ b/protocols/IcqOscarJ/src/cookies.cpp @@ -31,7 +31,7 @@ void CIcqProto::RemoveExpiredCookies() { - time_t tNow = time(nullptr); + time_t tNow = time(0); auto T = cookies.rev_iter(); for (auto &it : T) @@ -53,7 +53,7 @@ DWORD CIcqProto::AllocateCookie(BYTE bType, WORD wIdent, MCONTACT hContact, void p->dwCookie = dwThisSeq; p->hContact = hContact; p->pvExtra = pvExtra; - p->dwTime = time(nullptr); + p->dwTime = time(0); cookies.insert(p); return dwThisSeq; @@ -210,7 +210,7 @@ void CIcqProto::InitMessageCookie(cookie_message_data *pCookie) do { // ensure that message ids are unique - dwMsgID1 = time(nullptr); + dwMsgID1 = time(0); dwMsgID2 = RandRange(0, 0x0FFFF); } while (FindMessageCookie(dwMsgID1, dwMsgID2, nullptr, nullptr, nullptr)); diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index c77b939f51..9d1c54a498 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -272,7 +272,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, size_t wBufferLength, snac_heade if (dwValue) setDword("MemberTS", dwValue); dwValue = chain->getDWord(0x03, 1); - setDword("LogonTS", dwValue ? dwValue : time(nullptr)); + setDword("LogonTS", dwValue ? dwValue : time(0)); disposeChain(&chain); diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index 60ce774fd8..b1ba4e3b0b 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -248,7 +248,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, size_t wLen, DWORD dwCook PROTORECVEVENT pre = { 0 }; pre.szMessage = szMsg ? szMsg : (char *)""; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.lParam = dwCookie; ProtoChainRecv(hContact, PSR_AWAYMSG, status, (LPARAM)&pre); diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 19fcabec05..403e515182 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -624,7 +624,7 @@ void CIcqProto::handleUserOffline(BYTE *buf, size_t wLen) void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, MCONTACT hContact, oscar_tlv_chain *pChain) { - DWORD dwStatusNoteTS = time(nullptr); + DWORD dwStatusNoteTS = time(0); BYTE *pStatusNoteTS, *pStatusNote; WORD wStatusNoteTSLen, wStatusNoteLen; BYTE bStatusNoteFlags; diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index 71ac7a1a8e..5f56395682 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -318,7 +318,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, size_t wLen, DWORD dwUin, char } } - dwRecvTime = (DWORD)time(nullptr); + dwRecvTime = (DWORD)time(0); { // Check if the message was received as offline cookie_offline_messages *cookie; @@ -346,7 +346,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, size_t wLen, DWORD dwUin, char debugLogA("Message (format 1) received"); // Save tick value - setDword(hContact, "TickTS", time(nullptr) - (dwMsgID1 / 1000)); + setDword(hContact, "TickTS", time(0) - (dwMsgID1 / 1000)); } else debugLogA("Message (format %u) - Ignoring empty message", 1); @@ -457,7 +457,7 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, size_t wLen, DWORD dwUin, char // Save tick value BYTE bClientID = getByte(hContact, "ClientID", 0); if (bClientID == CLID_GENERIC || bClientID == CLID_ICQ6) - setDword(hContact, "TickTS", time(nullptr) - (dwMsgID1 / 1000)); + setDword(hContact, "TickTS", time(0) - (dwMsgID1 / 1000)); else setDword(hContact, "TickTS", 0); } @@ -687,7 +687,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, size_t wLen, MCONTACT hContac pMsgAck.wCookie = wCookie; pMsgAck.msgType = bMsgType; pMsgAck.bFlags = bFlags; - handleMessageTypes(dwUin, szUID, time(nullptr), dwMsgID1, dwMsgID2, wCookie, wVersion, bMsgType, bFlags, wAckType, wLen, wMsgLen, (char*)pDataBuf, 0, &pMsgAck); + handleMessageTypes(dwUin, szUID, time(0), dwMsgID1, dwMsgID2, wCookie, wVersion, bMsgType, bFlags, wAckType, wLen, wMsgLen, (char*)pDataBuf, 0, &pMsgAck); break; } } @@ -852,7 +852,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, size_t wLen, DWORD dwUi if (m_iStatus == ID_STATUS_NA) nMsgType = MTYPE_AUTONA; } - handleMessageTypes(dwUin, szUID, time(nullptr), dwMsgID1, dwMsgID2, wCookie, wVersion, nMsgType, bFlags, wAckType, dwLengthToEnd, 0, (char*)pDataBuf, MTF_PLUGIN | MTF_STATUS_EXTENDED, nullptr); + handleMessageTypes(dwUin, szUID, time(0), dwMsgID1, dwMsgID2, wCookie, wVersion, nMsgType, bFlags, wAckType, dwLengthToEnd, 0, (char*)pDataBuf, MTF_PLUGIN | MTF_STATUS_EXTENDED, nullptr); } else if (nTypeId) { if (!dwUin) { // AIM cannot send this, just sanity @@ -868,7 +868,7 @@ void CIcqProto::parseServRelayPluginData(BYTE *pDataBuf, size_t wLen, DWORD dwUi pMsgAck.wCookie = wCookie; pMsgAck.msgType = nTypeId; pMsgAck.bFlags = bFlags; - handleMessageTypes(dwUin, szUID, time(nullptr), dwMsgID1, dwMsgID2, wCookie, wVersion, nTypeId, bFlags, wAckType, dwLengthToEnd, dwDataLen, (char*)pDataBuf, MTF_PLUGIN, &pMsgAck); + handleMessageTypes(dwUin, szUID, time(0), dwMsgID1, dwMsgID2, wCookie, wVersion, nTypeId, bFlags, wAckType, dwLengthToEnd, dwDataLen, (char*)pDataBuf, MTF_PLUGIN, &pMsgAck); } else debugLogA("Unsupported plugin message type %d", nTypeId); } @@ -1035,7 +1035,7 @@ void CIcqProto::handleRecvServMsgContacts(BYTE *buf, size_t wLen, DWORD dwUin, c icq_sendContactsAck(dwUin, szUID, dwID1, dwID2); PROTORECVEVENT pre = { 0 }; - pre.timestamp = (DWORD)time(nullptr); + pre.timestamp = (DWORD)time(0); pre.szMessage = (char *)contacts; pre.lParam = nContacts; ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre); @@ -1105,7 +1105,7 @@ void CIcqProto::handleRecvServMsgType4(BYTE *buf, size_t wLen, DWORD dwUin, char debugLogA("User %u probably checks his ignore state.", dwUin); else { cookie_offline_messages *cookie; - DWORD dwRecvTime = (DWORD)time(nullptr); + DWORD dwRecvTime = (DWORD)time(0); if (!(dwRef & 0x80000000) && FindCookie(dwRef, nullptr, (void**)&cookie)) { WORD wTimeTLVType; @@ -1414,7 +1414,7 @@ void CIcqProto::handleStatusMsgReply(const char *szPrefix, MCONTACT hContact, DW // it is probably UTF-8 status reply PROTORECVEVENT pre = { 0 }; pre.szMessage = (char*)szMsg; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.lParam = wCookie; ProtoChainRecv(hContact, PSR_AWAYMSG, status, (LPARAM)&pre); } @@ -2496,7 +2496,7 @@ void CIcqProto::handleMissedMsg(BYTE *buf, size_t wLen) // Create event to notify user int bAdded; - AddEvent(HContactFromUID(dwUin, szUid, &bAdded), ICQEVENTTYPE_MISSEDMESSAGE, time(nullptr), 0, sizeof(wError), (PBYTE)&wError); + AddEvent(HContactFromUID(dwUin, szUid, &bAdded), ICQEVENTTYPE_MISSEDMESSAGE, time(0), 0, sizeof(wError), (PBYTE)&wError); } diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 55053359fb..823156c3b1 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -1398,7 +1398,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, size_t wLen) // TODO: Change for new auth system, include all known informations PROTORECVEVENT pre = { 0 }; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.lParam = blob.size(); pre.szMessage = blob; ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre); @@ -1458,7 +1458,7 @@ void CIcqProto::handleRecvAdded(unsigned char *buf, size_t wLen) *(char*)pCurBlob = 0; // TODO: Change for new auth system - AddEvent(NULL, EVENTTYPE_ADDED, time(nullptr), 0, cbBlob, pBlob); + AddEvent(NULL, EVENTTYPE_ADDED, time(0), 0, cbBlob, pBlob); } void CIcqProto::handleRecvAuthResponse(unsigned char *buf, size_t wLen) diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 3a58297543..d21d3de17f 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -910,7 +910,7 @@ void CIcqProto::parseDirectoryUserDetailsData(MCONTACT hContact, oscar_tlv_chain else if (bHasMetaToken || !hContact) writeDbInfoSettingTLVDouble(hContact, DBSETTING_METAINFO_SAVED, cDetails, 0x1CC); else - setDword(hContact, DBSETTING_METAINFO_SAVED, time(nullptr)); + setDword(hContact, DBSETTING_METAINFO_SAVED, time(0)); } if (wReplySubType == META_DIRECTORY_RESPONSE) diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index c3d6b5792f..d05ed0d772 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -875,7 +875,7 @@ void avatars_server_connection::checkRequestQueue() void avatars_server_connection::connectionThread() { // This is the "infinite" loop that receives the packets from the ICQ avatar server - DWORD dwLastKeepAlive = time(nullptr) + KEEPALIVE_INTERVAL; + DWORD dwLastKeepAlive = time(0) + KEEPALIVE_INTERVAL; hPacketRecver = Netlib_CreatePacketReceiver(hConnection, 65536); @@ -893,14 +893,14 @@ void avatars_server_connection::connectionThread() if (Miranda_IsTerminated()) break; - if (time(nullptr) >= dwLastKeepAlive) { // limit frequency (HACK: on some systems select() does not work well) + if (time(0) >= dwLastKeepAlive) { // limit frequency (HACK: on some systems select() does not work well) if (!ppro->m_bGatewayMode && ppro->getByte("KeepAlive", DEFAULT_KEEPALIVE_ENABLED)) { // send keep-alive packet icq_packet packet; packet.wLen = 0; write_flap(&packet, ICQ_PING_CHAN); sendServerPacket(&packet); } - dwLastKeepAlive = time(nullptr) + KEEPALIVE_INTERVAL; + dwLastKeepAlive = time(0) + KEEPALIVE_INTERVAL; } // check if we got something to request diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 9872dbd9d6..77f34665a0 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -190,7 +190,7 @@ void __cdecl CIcqProto::icq_directThread(directthreadstartinfo *dtsi) size_t nSkipPacketBytes = 0; DWORD dwReqMsgID1 = 0, dwReqMsgID2 = 0; - srand(time(nullptr)); + srand(time(0)); { // add to DC connection list mir_cslock l(directConnListMutex); diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp index 2b880cfb58..60c056c866 100644 --- a/protocols/IcqOscarJ/src/icq_directmsg.cpp +++ b/protocols/IcqOscarJ/src/icq_directmsg.cpp @@ -136,7 +136,7 @@ void CIcqProto::handleDirectMessage(directconnect* dc, PBYTE buf, size_t wLen) pMsgAck.wCookie = wCookie; pMsgAck.msgType = bMsgType; pMsgAck.bFlags = bMsgFlags; - handleMessageTypes(dc->dwRemoteUin, szUID, time(nullptr), 0, 0, wCookie, dc->wVersion, (int)bMsgType, (int)bMsgFlags, 0, (DWORD)wLen, wTextLen, (char*)buf, MTF_DIRECT, &pMsgAck); + handleMessageTypes(dc->dwRemoteUin, szUID, time(0), 0, 0, wCookie, dc->wVersion, (int)bMsgType, (int)bMsgFlags, 0, (DWORD)wLen, wTextLen, (char*)buf, MTF_DIRECT, &pMsgAck); break; } } @@ -148,7 +148,7 @@ void CIcqProto::handleDirectMessage(directconnect* dc, PBYTE buf, size_t wLen) buf -= wTextLen; wLen += wTextLen; - handleMessageTypes(dc->dwRemoteUin, szUID, time(nullptr), 0, 0, wCookie, dc->wVersion, (int)bMsgType, (int)bMsgFlags, 2, (DWORD)wLen, wTextLen, (char*)buf, MTF_DIRECT, nullptr); + handleMessageTypes(dc->dwRemoteUin, szUID, time(0), 0, 0, wCookie, dc->wVersion, (int)bMsgType, (int)bMsgFlags, 2, (DWORD)wLen, wTextLen, (char*)buf, MTF_DIRECT, nullptr); } else { MCONTACT hCookieContact; @@ -251,7 +251,7 @@ void CIcqProto::handleDirectGreetingMessage(directconnect* dc, PBYTE buf, size_t pMsgAck.pDC = dc; pMsgAck.wCookie = wCookie; pMsgAck.msgType = typeId; - handleMessageTypes(dc->dwRemoteUin, szUID, time(nullptr), 0, 0, wCookie, dc->wVersion, typeId, 0, 0, dwLengthToEnd, dwDataLength, (char*)buf, MTF_PLUGIN | MTF_DIRECT, &pMsgAck); + handleMessageTypes(dc->dwRemoteUin, szUID, time(0), 0, 0, wCookie, dc->wVersion, typeId, 0, 0, dwLengthToEnd, dwDataLength, (char*)buf, MTF_PLUGIN | MTF_DIRECT, &pMsgAck); } else if (typeId == MTYPE_STATUSMSGEXT && wCommand == DIRECT_ACK) { // especially for icq2003b NetLog_Direct("This is extended status reply"); @@ -261,7 +261,7 @@ void CIcqProto::handleDirectGreetingMessage(directconnect* dc, PBYTE buf, size_t szMsg[dwDataLength] = '\0'; uid_str szUID; - handleMessageTypes(dc->dwRemoteUin, szUID, time(nullptr), 0, 0, wCookie, dc->wVersion, (int)(qt + 0xE7), 3, 2, wLen, dwDataLength, szMsg, MTF_PLUGIN | MTF_DIRECT, nullptr); + handleMessageTypes(dc->dwRemoteUin, szUID, time(0), 0, 0, wCookie, dc->wVersion, (int)(qt + 0xE7), 3, 2, wLen, dwDataLength, szMsg, MTF_PLUGIN | MTF_DIRECT, nullptr); } else if (typeId && wCommand == DIRECT_ACK) { MCONTACT hCookieContact; diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index 9af0b9203c..c6452896f3 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -157,7 +157,7 @@ void CIcqProto::handleFileRequest(PBYTE buf, DWORD dwUin, DWORD dwCookie, DWORD PROTORECVFILE pre = { 0 }; pre.dwFlags = PRFF_UNICODE; pre.fileCount = 1; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.descr.w = mir_utf8decodeW(pszDescription); pre.files.w = &ptszFileName; pre.lParam = (LPARAM)ft; diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 4bfafdb33c..518e496b92 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -81,7 +81,7 @@ BOOL CIcqProto::icq_QueueUser(MCONTACT hContact) if (dwUin) { m_infoUpdateList[nFirstFree].dwUin = dwUin; m_infoUpdateList[nFirstFree].hContact = hContact; - m_infoUpdateList[nFirstFree].queued = time(nullptr); + m_infoUpdateList[nFirstFree].queued = time(0); nInfoUserCount++; debugLogA("Queued user %u, place %u, count %u", dwUin, nFirstFree, nInfoUserCount); @@ -179,7 +179,7 @@ void __cdecl CIcqProto::InfoUpdateThread( void* ) continue; // we can't send requests now if (nInfoUserCount && icqOnline()) { - time_t now = time(nullptr); + time_t now = time(0); BOOL bNotReady = FALSE, bTimeOuted = FALSE; // Check the list, take only users that were there for at least 5sec diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp index dfc42bbe7c..c34acddfc8 100644 --- a/protocols/IcqOscarJ/src/icq_rates.cpp +++ b/protocols/IcqOscarJ/src/icq_rates.cpp @@ -299,10 +299,9 @@ rates_queue::~rates_queue() cleanup(); } -static void rateDelayThread(void *param) +static void rateDelayThread(rates_queue *pQueue) { Thread_SetName("ICQ: rateDelayThread"); - rates_queue *pQueue = (rates_queue*)param; pQueue->handleDelay(); } @@ -311,7 +310,7 @@ void rates_queue::initDelay(int nDelay) ppro->debugLogA("Rates: Delay %dms", nDelay); scheduledDelay = nDelay; - mir_forkthread(rateDelayThread, this); + mir_forkThread(rateDelayThread, this); } void rates_queue::handleDelay() diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 2839d7c435..942a9e0d73 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -45,7 +45,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) // store server port info.wServerPort = infoParam->nloc.wPort; - srand(time(nullptr)); + srand(time(0)); ResetSettingsOnConnect(); diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 1720be39bb..9e9bb3ad6b 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -84,7 +84,7 @@ void __cdecl CIcqProto::servlistQueueThread(void *param) // first check if the state is calm while (*queueState) { int i; - time_t tNow = time(nullptr); + time_t tNow = time(0); int bFound = FALSE; for (i = 0; i < servlistQueueCount; i++) { // check if we do not have some expired items to handle, otherwise keep sleeping @@ -285,7 +285,7 @@ void CIcqProto::servlistQueueAddGroupItem(servlistgroupitem* pGroupItem, int dwT } if (!pItem) { // compatible item was not found, create new one, add to queue pItem = (ssiqueueditems*)SAFE_MALLOC(sizeof(ssiqueueditems)); - pItem->tAdded = time(nullptr); + pItem->tAdded = time(0); pItem->dwTimeout = dwTimeout; if (servlistQueueCount == servlistQueueSize) { // resize the queue - it is too small diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 0782eedecd..960a0baa9a 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -330,7 +330,7 @@ void CIcqProto::handleXtrazData(DWORD dwUin, char* szMsg, BOOL bThruDC) // Create message to notify user PROTORECVEVENT pre = { 0 }; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.szMessage = szWork; int bAdded; diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 3dc43813fe..1a5f54c28b 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -425,7 +425,7 @@ int CIcqProto::OnIdleChanged(WPARAM, LPARAM lParam) if (bPrivacy) return 0; - setDword("IdleTS", bIdle ? time(nullptr) : 0); + setDword("IdleTS", bIdle ? time(0) : 0); if (m_bTempVisListEnabled) // remove temporary visible users sendEntireListServ(ICQ_BOS_FAMILY, ICQ_CLI_REMOVETEMPVISIBLE, BUL_TEMPVISIBLE); diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index bf88320592..3f6a516c70 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -78,7 +78,7 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); - srand(time(nullptr)); + srand(time(0)); _tzset(); // Initialize charset conversion routines diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 22e6d6dcd1..4c1d7cc317 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -479,7 +479,7 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, size_t wLen, DWORD dwUin, char * PROTORECVFILE pre = { 0 }; pre.dwFlags = PRFF_UNICODE; pre.fileCount = 1; - pre.timestamp = time(nullptr); + pre.timestamp = time(0); pre.descr.w = mir_utf8decodeW(pszDescription); pre.files.w = &ptszFileName; pre.lParam = (LPARAM)ft; diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index b9b97b89a8..f098af95cb 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -1342,7 +1342,7 @@ DWORD CIcqProto::icq_sendSMSServ(const char *szPhoneNumber, const char *szMsg) WORD wBufferLen; char *szBuffer = nullptr; char szTime[30]; - time_t now = time(nullptr); + time_t now = time(0); strftime(szTime, sizeof(szTime), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now)); /* Sun, 00 Jan 0000 00:00:00 GMT */ @@ -1571,7 +1571,7 @@ void CIcqProto::icq_sendAuthResponseServ(DWORD dwUin, char* szUid, int auth, con void CIcqProto::icq_sendYouWereAddedServ(DWORD dwUin, DWORD dwMyUin) { - DWORD dwID1 = time(nullptr); + DWORD dwID1 = time(0); DWORD dwID2 = RandRange(0, 0x00FF); icq_packet packet; diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index cc3ce357b1..9e6c898bd1 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -946,7 +946,7 @@ int CIcqProto::IsMetaInfoChanged(MCONTACT hContact) db_free(&infoSaved); - if ((time(nullptr) - dwInfoTime) > 14 * 3600 * 24) { + if ((time(0) - dwInfoTime) > 14 * 3600 * 24) { res = 3; // threshold exceeded } } -- cgit v1.2.3