diff options
-rw-r--r-- | plugins/StatusManager/src/advancedautoaway.cpp | 8 | ||||
-rw-r--r-- | plugins/StatusManager/src/commonstatus.cpp | 22 | ||||
-rw-r--r-- | plugins/StatusManager/src/keepstatus.cpp | 64 | ||||
-rw-r--r-- | plugins/StatusManager/src/startupstatus.cpp | 14 | ||||
-rw-r--r-- | plugins/Variables/src/help.cpp | 6 | ||||
-rw-r--r-- | plugins/Variables/src/parse_inet.cpp | 4 | ||||
-rw-r--r-- | plugins/Variables/src/parse_logic.cpp | 8 | ||||
-rw-r--r-- | plugins/Variables/src/parse_math.cpp | 56 | ||||
-rw-r--r-- | plugins/Variables/src/parse_miranda.cpp | 14 | ||||
-rw-r--r-- | plugins/Variables/src/parse_str.cpp | 57 | ||||
-rw-r--r-- | plugins/Variables/src/parse_system.cpp | 10 | ||||
-rw-r--r-- | plugins/Variables/src/stdafx.h | 3 | ||||
-rw-r--r-- | plugins/Variables/src/tokenregister.cpp | 2 | ||||
-rw-r--r-- | plugins/Variables/src/variables.cpp | 6 | ||||
-rw-r--r-- | plugins/helpers/gen_helpers.cpp | 50 | ||||
-rw-r--r-- | plugins/helpers/gen_helpers.h | 24 |
16 files changed, 144 insertions, 204 deletions
diff --git a/plugins/StatusManager/src/advancedautoaway.cpp b/plugins/StatusManager/src/advancedautoaway.cpp index b3a9d10c75..2d42c89007 100644 --- a/plugins/StatusManager/src/advancedautoaway.cpp +++ b/plugins/StatusManager/src/advancedautoaway.cpp @@ -63,11 +63,11 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) if (ack->type != ACKTYPE_STATUS || ack->result != ACKRESULT_SUCCESS) return 0; - log_debugA("ProcessProtoAck: ack->szModule: %s", ack->szModule); + log_debug(0, "ProcessProtoAck: ack->szModule: %s", ack->szModule); for (auto &it : protoList) { - log_debugA("chk: %s", it->m_szName); + log_debug(0, "chk: %s", it->m_szName); if (!mir_strcmp(it->m_szName, ack->szModule)) { - log_debugA("ack->szModule: %s p.statusChanged: %d", ack->szModule, it->bStatusChanged); + log_debug(0, "ack->szModule: %s p.statusChanged: %d", ack->szModule, it->bStatusChanged); if (!it->bStatusChanged) it->bManualStatus = true; @@ -101,7 +101,7 @@ static int changeState(SMProto &setting, int mode, STATES newState) setting.oldState = setting.curState; setting.curState = newState; - log_debugA("%s state change: %s -> %s", setting.m_szName, status2descr(setting.oldState), status2descr(setting.curState)); + log_debug(0, "%s state change: %s -> %s", setting.m_szName, status2descr(setting.oldState), status2descr(setting.curState)); if (setting.curState != SET_ORGSTATUS && setting.curState != ACTIVE && setting.bStatusChanged) { /* change the awaymessage */ diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp index ac86edbddf..d513d87208 100644 --- a/plugins/StatusManager/src/commonstatus.cpp +++ b/plugins/StatusManager/src/commonstatus.cpp @@ -133,7 +133,7 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) return Proto_GetStatus(protoSetting->m_szName); if ((protoSetting->m_status < ID_STATUS_OFFLINE) || (protoSetting->m_status > ID_STATUS_OUTTOLUNCH)) { - log_debugA("invalid status detected: %d", protoSetting->m_status); + log_debug(0, "invalid status detected: %d", protoSetting->m_status); return 0; } return protoSetting->m_status; @@ -142,12 +142,12 @@ int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) { if (ps->m_szMsg != nullptr) {// custom message set - log_infoA("CommonStatus: Status message set by calling plugin"); + log_info(0, "CommonStatus: Status message set by calling plugin"); return mir_wstrdup(ps->m_szMsg); } wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, newstatus, (LPARAM)ps->m_szName); - log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg); + log_debug(0, "CommonStatus: Status message retrieved from general awaysys: %S", tMsg); return tMsg; } @@ -217,7 +217,7 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) tszMsg = szFormattedMsg; } } - log_debugA("CommonStatus sets status message for %s directly", ps->m_szName); + log_debug(0, "CommonStatus sets status message for %s directly", ps->m_szName); CallProtoService(ps->m_szName, PS_SETAWAYMSG, newstatus, (LPARAM)tszMsg); mir_free(tszMsg); } @@ -237,13 +237,13 @@ int SetStatusEx(TProtoSettings &ps) continue; if (!Proto_GetAccount(p->m_szName)) { - log_debugA("CommonStatus: %s is not loaded", p->m_szName); + log_debug(0, "CommonStatus: %s is not loaded", p->m_szName); continue; } // some checks int newstatus = GetActualStatus(p); if (newstatus == 0) { - log_debugA("CommonStatus: incorrect status for %s (%d)", p->m_szName, p->m_status); + log_debug(0, "CommonStatus: incorrect status for %s (%d)", p->m_szName, p->m_status); continue; } int oldstatus = Proto_GetStatus(p->m_szName); @@ -251,7 +251,7 @@ int SetStatusEx(TProtoSettings &ps) p->m_lastStatus = oldstatus; if (IsStatusConnecting(oldstatus)) { // ignore if connecting, but it didn't came this far if it did - log_debugA("CommonStatus: %s is already connecting", p->m_szName); + log_debug(0, "CommonStatus: %s is already connecting", p->m_szName); continue; } @@ -261,7 +261,7 @@ int SetStatusEx(TProtoSettings &ps) int b_Caps5 = CallProtoService(p->m_szName, PS_GETCAPS, PFLAGNUM_5, 0) & protoFlag; if (newstatus != ID_STATUS_OFFLINE && (!b_Caps2 || b_Caps5)) { // status and status message for this status not supported - //log_debug("CommonStatus: status not supported %s", szProto); + log_debug(0, "CommonStatus: status not supported %s", p->m_szName); continue; } @@ -269,7 +269,7 @@ int SetStatusEx(TProtoSettings &ps) int b_Caps3 = CallProtoService(p->m_szName, PS_GETCAPS, PFLAGNUM_3, 0) & protoFlag; if (newstatus == oldstatus && (!b_Caps1 || !b_Caps3)) { // no status change and status messages are not supported - //log_debug("CommonStatus: no change, %s (%d %d)", szProto, oldstatus, newstatus); + log_debug(0, "CommonStatus: no change, %s (%d %d)", p->m_szName, oldstatus, newstatus); continue; } @@ -279,13 +279,13 @@ int SetStatusEx(TProtoSettings &ps) // set the status if (newstatus != oldstatus /*&& !(b_Caps1 && b_Caps3 && ServiceExists(MS_NAS_SETSTATE))*/) { - log_debugA("CommonStatus sets status for %s to %d", p->m_szName, newstatus); + log_debug(0, "CommonStatus sets status for %s to %d", p->m_szName, newstatus); CallProtoService(p->m_szName, PS_SETSTATUS, newstatus, 0); } } if (globStatus != 0) { - log_debugA("CommonStatus: setting global status %u", globStatus); + log_debug(0, "CommonStatus: setting global status %u", globStatus); Clist_SetStatusMode(globStatus); } diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/keepstatus.cpp index 2356f77711..70d94d14cd 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/keepstatus.cpp @@ -147,7 +147,7 @@ int SMProto::AssignStatus(int iStatus, int iLastStatus, wchar_t *pwszMsg) else m_status = iStatus; - log_infoA("KeepStatus: assigning status %d (%d, %d) to %s", m_status, m_lastStatus, iLastStatus, m_szName); + log_info(0, "KeepStatus: assigning status %d (%d, %d) to %s", m_status, m_lastStatus, iLastStatus, m_szName); if (pwszMsg != nullptr && mir_wstrcmp(pwszMsg, m_szMsg)) { if (m_szMsg != nullptr) @@ -189,11 +189,11 @@ static int SetCurrentStatus() continue; } - log_infoA("KeepStatus: status for %s differs: stored = %d, real = %d", p->m_szName, curStatus, realStatus); + log_info(0, "KeepStatus: status for %s differs: stored = %d, real = %d", p->m_szName, curStatus, realStatus); // force offline before reconnecting? if (realStatus != ID_STATUS_OFFLINE && KSPlugin.getByte(SETTING_FIRSTOFFLINE, FALSE)) { - log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", p->m_szName); + log_info(0, "KeepStatus: Setting %S offline before making a new connection attempt", p->m_szName); CallProtoService(p->m_szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); } } @@ -282,8 +282,8 @@ static INT_PTR CALLBACK StartTimerApcProc(void *param) int res = 0; mir_cslock lck(GenTimerCS); - log_debugA("StartTimer: %d, %d, %d", ti->timer, ti->timeout, ti->restart); - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debug(0, "StartTimer: %d, %d, %d", ti->timer, ti->timeout, ti->restart); + log_debug(0, "ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); if (ti->timer & IDT_PROCESSACK) { res = (processAckTimerId == 0) ? 0 : 1; if (((processAckTimerId == 0) && (checkConnectionTimerId == 0)) || (ti->restart)) { @@ -352,8 +352,8 @@ static INT_PTR CALLBACK StartTimerApcProc(void *param) } } - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - log_debugA("StartTimer done %d", res); + log_debug(0, "ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debug(0, "StartTimer done %d", res); return res; } @@ -368,8 +368,8 @@ static int StopTimer(int timer) int res = 0; mir_cslock lck(GenTimerCS); - log_debugA("StopTimer %d", timer); - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debug(0, "StopTimer %d", timer); + log_debug(0, "ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); if (timer & IDT_PROCESSACK) { if (processAckTimerId == 0) @@ -421,8 +421,8 @@ static int StopTimer(int timer) } } - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - log_debugA("StopTimer done %d", res); + log_debug(0, "ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debug(0, "StopTimer done %d", res); return res; } @@ -468,7 +468,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) switch (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING)) { case LOGINERR_CANCEL: - log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule); + log_info(0, "KeepStatus: cancel on login error (%s)", ack->szModule); for (auto &it : protoList) if (!mir_strcmp(ack->szModule, it->m_szName)) it->AssignStatus(ID_STATUS_OFFLINE); @@ -480,7 +480,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) case LOGINERR_SETDELAY: { int newDelay = 1000 * KSPlugin.getDword(SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); - log_infoA("KeepStatus: set delay to %d ms on login error (%s)", newDelay, ack->szModule); + log_info(0, "KeepStatus: set delay to %d ms on login error (%s)", newDelay, ack->szModule); StartTimer(IDT_CHECKCONN, newDelay, TRUE); } ProcessPopup(KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); @@ -508,7 +508,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) if (maxConnectingTime > 0) { if ((unsigned int)maxConnectingTime <= ((GetTickCount() - it->lastStatusAckTime) / 1000)) { // set offline - log_infoA("KeepStatus: %s is too long connecting; setting offline", it->m_szName); + log_info(0, "KeepStatus: %s is too long connecting; setting offline", it->m_szName); CallProtoService(it->m_szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); } } @@ -541,7 +541,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) else if (newStatus == ID_STATUS_OFFLINE) {// start checking connection if (!StartTimer(IDT_CHECKCONN, -1, FALSE)) { /* check if not already checking */ needChecking = true; - log_infoA("KeepStatus: connection lost! (%s)", it->m_szName); + log_info(0, "KeepStatus: connection lost! (%s)", it->m_szName); NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, (LPARAM)it->m_szName); ProcessPopup(KS_CONN_STATE_LOST, (LPARAM)it->m_szName); } @@ -554,7 +554,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) { - log_debugA("CheckConnectionTimer"); + log_debug(0, "CheckConnectionTimer"); bool setStatus = false; for (auto &it : protoList) { @@ -591,7 +591,7 @@ static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) else // all status set ok already, or stop checking StopChecking(); - log_debugA("CheckConnectionTimer done"); + log_debug(0, "CheckConnectionTimer done"); } static int StopChecking() @@ -611,7 +611,7 @@ static int StopChecking() NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); ProcessPopup(KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); - log_infoA("KeepStatus: stop checking (%s)", isOk ? "success" : "failure"); + log_info(0, "KeepStatus: stop checking (%s)", isOk ? "success" : "failure"); retryCount = 0; currentDelay = initDelay; @@ -660,13 +660,13 @@ static void CheckContinuouslyFunction(void *) continue; if (shouldBeStatus != ID_STATUS_OFFLINE) { - log_debugA("CheckContinuouslyFunction: %s should be %d", it->m_szName, shouldBeStatus); + log_debug(0, "CheckContinuouslyFunction: %s should be %d", it->m_szName, shouldBeStatus); doPing = true; } } if (!doPing) { - log_debugA("CheckContinuouslyFunction: All protocols should be offline, no need to check connection"); + log_debug(0, "CheckContinuouslyFunction: All protocols should be offline, no need to check connection"); return; } @@ -686,7 +686,7 @@ static void CheckContinuouslyFunction(void *) HANDLE hICMPFile = (HANDLE)IcmpCreateFile(); if (hICMPFile == INVALID_HANDLE_VALUE) { bLastPingResult = TRUE; - log_infoA("KeepStatus: icmp.dll error (2)"); + log_info(0, "KeepStatus: icmp.dll error (2)"); } if (bLastPingResult == FALSE) { start = dbv.pszVal; @@ -706,9 +706,9 @@ static void CheckContinuouslyFunction(void *) else pingFailures++; - log_debugA("CheckContinuouslyFunction: pinging %s (result: %d/%d)", host, bLastPingResult, pingFailures); + log_debug(0, "CheckContinuouslyFunction: pinging %s (result: %d/%d)", host, bLastPingResult, pingFailures); } - else log_debugA("CheckContinuouslyFunction: unable to resolve %s", host); + else log_debug(0, "CheckContinuouslyFunction: unable to resolve %s", host); start = end; while (*start == ' ') @@ -731,21 +731,21 @@ static void CheckContinuouslyFunction(void *) continue; if (IsStatusConnecting(pa->iRealStatus)) { - log_debugA("CheckContinuouslyFunction: %s is connecting", pa->szModuleName); + log_debug(0, "CheckContinuouslyFunction: %s is connecting", pa->szModuleName); continue; // connecting, leave alone } if (IsProtocolEnabledService(0, (LPARAM)pa->szModuleName)) { - log_debugA("CheckContinuouslyFunction: forcing %s offline", pa->szModuleName); + log_debug(0, "CheckContinuouslyFunction: forcing %s offline", pa->szModuleName); CallProtoService(pa->szModuleName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); } } if (StartTimer(IDT_CHECKCONN | IDT_PROCESSACK, -1, FALSE)) {// are our 'set offlines' noticed? - log_debugA("CheckContinuouslyFunction: currently checking"); + log_debug(0, "CheckContinuouslyFunction: currently checking"); return; } - log_infoA("KeepStatus: connection lost! (continuesly check)"); + log_info(0, "KeepStatus: connection lost! (continuesly check)"); NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0); ProcessPopup(KS_CONN_STATE_LOST, 0); maxRetries = KSPlugin.getByte(SETTING_MAXRETRIES, 0); @@ -798,7 +798,7 @@ static INT_PTR ShowPopup(const wchar_t *msg, HICON hIcon) ppd.iSeconds = 0; break; } - return (int)PUAddPopupW(&ppd); + return (INT_PTR)PUAddPopupW(&ppd); } static wchar_t* GetHumanName(LPARAM lParam) @@ -899,7 +899,7 @@ static int ProcessPopup(int reason, LPARAM lParam) if (hIcon == nullptr) hIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); - log_info(L"KeepStatus: %s", wszText.c_str()); + Netlib_Logf(0, "KeepStatus: %s", wszText.c_str()); return ShowPopup(wszText, hIcon); } @@ -983,7 +983,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) INT_PTR AnnounceStatusChangeService(WPARAM, LPARAM lParam) { PROTOCOLSETTINGEX *newSituation = (PROTOCOLSETTINGEX *)lParam; - log_infoA("Another plugin announced a status change to %d for %s", newSituation->m_status, newSituation->m_szName == nullptr ? "all" : newSituation->m_szName); + log_info(0, "Another plugin announced a status change to %d for %s", newSituation->m_status, newSituation->m_szName == nullptr ? "all" : newSituation->m_szName); for (auto &it : protoList) if (!mir_strcmp(it->m_szName, newSituation->m_szName)) @@ -1003,7 +1003,7 @@ static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM lPara case WM_POWERBROADCAST: switch (wParam) { case PBT_APMSUSPEND: - log_infoA("KeepStatus: suspend state detected: %08X %08X", wParam, lParam); + log_info(0, "KeepStatus: suspend state detected: %08X %08X", wParam, lParam); if (ps == nullptr) { ps = new TProtoSettings(protoList); for (auto &it : *ps) @@ -1017,7 +1017,7 @@ static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM lPara case PBT_APMRESUMESUSPEND: case PBT_APMRESUMECRITICAL: // case PBT_APMRESUMEAUTOMATIC: ? - log_infoA("KeepStatus: resume from suspend state"); + log_info(0, "KeepStatus: resume from suspend state"); if (ps != nullptr) { for (auto &it : *ps) { SMProto *p = protoList.find(it); diff --git a/plugins/StatusManager/src/startupstatus.cpp b/plugins/StatusManager/src/startupstatus.cpp index f6c539f902..0a9ad2b585 100644 --- a/plugins/StatusManager/src/startupstatus.cpp +++ b/plugins/StatusManager/src/startupstatus.cpp @@ -144,7 +144,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) for (auto &it : protoList) { if (!mir_strcmp(ack->szModule, it->m_szName)) { it->ssDisabled = true; - log_debugA("StartupStatus: %s overridden by ME_PROTO_ACK, status will not be set", ack->szModule); + log_debug(0, "StartupStatus: %s overridden by ME_PROTO_ACK, status will not be set", ack->szModule); } } @@ -161,14 +161,14 @@ static int StatusChange(WPARAM, LPARAM lParam) if (szProto == nullptr) { // global status change for (auto &it : protoList) { it->ssDisabled = true; - log_debugA("StartupStatus: all protos overridden by ME_CLIST_STATUSMODECHANGE, status will not be set"); + log_debug(0, "StartupStatus: all protos overridden by ME_CLIST_STATUSMODECHANGE, status will not be set"); } } else { for (auto &it : protoList) { if (!mir_strcmp(it->m_szName, szProto)) { it->ssDisabled = true; - log_debugA("StartupStatus: %s overridden by ME_CLIST_STATUSMODECHANGE, status will not be set", szProto); + log_debug(0, "StartupStatus: %s overridden by ME_CLIST_STATUSMODECHANGE, status will not be set", szProto); } } } @@ -193,7 +193,7 @@ static int CSStatusChangeEx(WPARAM wParam, LPARAM) continue; if (!mir_strcmp(ps[i]->m_szName, it->m_szName)) { - log_debugA("StartupStatus: %s overridden by MS_CS_SETSTATUSEX, status will not be set", ps[i]->m_szName); + log_debug(0, "StartupStatus: %s overridden by MS_CS_SETSTATUSEX, status will not be set", ps[i]->m_szName); it->ssDisabled = true; } } @@ -311,11 +311,11 @@ static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) { switch (msg) { case WM_ENDSESSION: - log_debugA("WM_ENDSESSION"); + log_debug(0, "WM_ENDSESSION"); if (wParam) { - log_debugA("WM_ENDSESSION: calling exit"); + log_debug(0, "WM_ENDSESSION: calling exit"); OnShutdown(0, 0); - log_debugA("WM_ENDSESSION: exit called"); + log_debug(0, "WM_ENDSESSION: exit called"); } break; } diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index d36f6bdfaf..d2cf8fb869 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -125,13 +125,13 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM { LPARAM res = 0; MCONTACT hItem, hContact = wParam; - log_debugA("VARM_SETSUBJECT: %u", hContact); + log_debug(0, "VARM_SETSUBJECT: %u", hContact); if (hContact == INVALID_CONTACT_ID) { wchar_t *tszContact = g_plugin.getWStringA(SETTING_SUBJECT); - log_debugA("VARM_SETSUBJECT: %s", tszContact); + log_debug(0, "VARM_SETSUBJECT: %s", tszContact); if (tszContact != nullptr) { hContact = getContactFromString(tszContact, CI_PROTOID); - log_debugA("VARM_SETSUBJECT decoded: %u", hContact); + log_debug(0, "VARM_SETSUBJECT decoded: %u", hContact); mir_free(tszContact); } } diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index 080932fc12..0f1e35b6f7 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -83,7 +83,7 @@ static wchar_t* parseNToA(ARGUMENTSINFO *ai) return nullptr;
struct in_addr in;
- in.s_addr = ttoi(ai->argv.w[1]);
+ in.s_addr = _wtoi(ai->argv.w[1]);
return mir_a2u(inet_ntoa(in));
}
@@ -93,7 +93,7 @@ static wchar_t* parseHToA(ARGUMENTSINFO *ai) return nullptr;
struct in_addr in;
- in.s_addr = htonl(ttoi(ai->argv.w[1]));
+ in.s_addr = htonl(_wtoi(ai->argv.w[1]));
return mir_a2u(inet_ntoa(in));
}
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index 5c623f64e2..34174979ee 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -110,7 +110,7 @@ static wchar_t* parseIfequal(ARGUMENTSINFO *ai) if (tszFirst == NULL || tszSecond == NULL)
return nullptr;
- if (ttoi(tszFirst) == ttoi(tszSecond))
+ if (_wtoi(tszFirst) == _wtoi(tszSecond))
return mir_wstrdup(ai->argv.w[3]);
return mir_wstrdup(ai->argv.w[4]);
@@ -130,7 +130,7 @@ static wchar_t* parseIfgreater(ARGUMENTSINFO *ai) if (tszFirst == NULL || tszSecond == NULL)
return nullptr;
- if (ttoi(tszFirst) > ttoi(tszSecond))
+ if (_wtoi(tszFirst) > _wtoi(tszSecond))
return mir_wstrdup(ai->argv.w[3]);
return mir_wstrdup(ai->argv.w[4]);
@@ -206,7 +206,7 @@ static wchar_t* parseEqual(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- if (ttoi(ai->argv.w[1]) != ttoi(ai->argv.w[2]))
+ if (_wtoi(ai->argv.w[1]) != _wtoi(ai->argv.w[2]))
ai->flags |= AIF_FALSE;
return mir_wstrdup(L"");
@@ -217,7 +217,7 @@ static wchar_t* parseGreater(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- if (ttoi(ai->argv.w[1]) <= ttoi(ai->argv.w[2]))
+ if (_wtoi(ai->argv.w[1]) <= _wtoi(ai->argv.w[2]))
ai->flags |= AIF_FALSE;
return mir_wstrdup(L"");
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index c6aedf013b..182b89b754 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -26,9 +26,9 @@ static wchar_t* parseAdd(ARGUMENTSINFO *ai) int result = 0;
for (unsigned int i = 1; i < ai->argc; i++)
- result += ttoi(ai->argv.w[i]);
+ result += _wtoi(ai->argv.w[i]);
- return itot(result);
+ return _itow(result);
}
static wchar_t* parseDiv(ARGUMENTSINFO *ai)
@@ -36,12 +36,12 @@ static wchar_t* parseDiv(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int val1 = ttoi(ai->argv.w[1]);
- int val2 = ttoi(ai->argv.w[2]);
+ int val1 = _wtoi(ai->argv.w[1]);
+ int val2 = _wtoi(ai->argv.w[2]);
if (val2 == 0)
return nullptr;
- return itot(val1 / val2);
+ return _itow(val1 / val2);
}
static wchar_t* parseHex(ARGUMENTSINFO *ai)
@@ -52,8 +52,8 @@ static wchar_t* parseHex(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int val = ttoi(ai->argv.w[1]);
- int padding = ttoi(ai->argv.w[2]);
+ int val = _wtoi(ai->argv.w[1]);
+ int padding = _wtoi(ai->argv.w[2]);
mir_snwprintf(szVal, L"%x", val);
unsigned int zeros = max(padding - (signed int)mir_wstrlen(szVal), 0);
wchar_t *res = (wchar_t*)mir_alloc((zeros + mir_wstrlen(szVal) + 3)*sizeof(wchar_t));
@@ -74,12 +74,12 @@ static wchar_t* parseMod(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int val1 = ttoi(ai->argv.w[1]);
- int val2 = ttoi(ai->argv.w[2]);
+ int val1 = _wtoi(ai->argv.w[1]);
+ int val2 = _wtoi(ai->argv.w[2]);
if (val2 == 0)
return nullptr;
- return itot(val1 % val2);
+ return _itow(val1 % val2);
}
static wchar_t* parseMul(ARGUMENTSINFO *ai)
@@ -87,11 +87,11 @@ static wchar_t* parseMul(ARGUMENTSINFO *ai) if (ai->argc < 3)
return nullptr;
- int result = ttoi(ai->argv.w[1]);
+ int result = _wtoi(ai->argv.w[1]);
for (unsigned i = 2; i < ai->argc; i++)
- result *= ttoi(ai->argv.w[i]);
+ result *= _wtoi(ai->argv.w[i]);
- return itot(result);
+ return _itow(result);
}
static wchar_t* parseMuldiv(ARGUMENTSINFO *ai)
@@ -99,10 +99,10 @@ static wchar_t* parseMuldiv(ARGUMENTSINFO *ai) if (ai->argc != 4)
return nullptr;
- if (ttoi(ai->argv.w[3]) == 0)
+ if (_wtoi(ai->argv.w[3]) == 0)
return nullptr;
- return itot((ttoi(ai->argv.w[1])*ttoi(ai->argv.w[2])) / ttoi(ai->argv.w[3]));
+ return _itow((_wtoi(ai->argv.w[1])*_wtoi(ai->argv.w[2])) / _wtoi(ai->argv.w[3]));
}
static wchar_t* parseMin(ARGUMENTSINFO *ai)
@@ -110,11 +110,11 @@ static wchar_t* parseMin(ARGUMENTSINFO *ai) if (ai->argc < 2)
return nullptr;
- int minVal = ttoi(ai->argv.w[1]);
+ int minVal = _wtoi(ai->argv.w[1]);
for (unsigned i = 2; i < ai->argc; i++)
- minVal = min(ttoi(ai->argv.w[i]), minVal);
+ minVal = min(_wtoi(ai->argv.w[i]), minVal);
- return itot(minVal);
+ return _itow(minVal);
}
static wchar_t* parseMax(ARGUMENTSINFO *ai)
@@ -122,11 +122,11 @@ static wchar_t* parseMax(ARGUMENTSINFO *ai) if (ai->argc < 2)
return nullptr;
- int maxVal = ttoi(ai->argv.w[1]);
+ int maxVal = _wtoi(ai->argv.w[1]);
for (unsigned i = 2; i < ai->argc; i++)
- maxVal = max(ttoi(ai->argv.w[i]), maxVal);
+ maxVal = max(_wtoi(ai->argv.w[i]), maxVal);
- return itot(maxVal);
+ return _itow(maxVal);
}
static wchar_t* parseNum(ARGUMENTSINFO *ai)
@@ -134,9 +134,9 @@ static wchar_t* parseNum(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int val = ttoi(ai->argv.w[1]);
- int padding = ttoi(ai->argv.w[2]);
- wchar_t *szVal = itot(val);
+ int val = _wtoi(ai->argv.w[1]);
+ int padding = _wtoi(ai->argv.w[2]);
+ wchar_t *szVal = _itow(val);
if (szVal == nullptr)
return nullptr;
@@ -160,7 +160,7 @@ static wchar_t* parseNum(ARGUMENTSINFO *ai) static wchar_t* parseRand(ARGUMENTSINFO *)
{
- return itot(rand());
+ return _itow(rand());
}
static wchar_t* parseSub(ARGUMENTSINFO *ai)
@@ -168,11 +168,11 @@ static wchar_t* parseSub(ARGUMENTSINFO *ai) if (ai->argc < 3)
return nullptr;
- int result = ttoi(ai->argv.w[1]);
+ int result = _wtoi(ai->argv.w[1]);
for (unsigned i = 2; i < ai->argc; i++)
- result -= ttoi(ai->argv.w[i]);
+ result -= _wtoi(ai->argv.w[i]);
- return itot(result);
+ return _itow(result);
}
void registerMathTokens()
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 037cfd327e..2bd57f5804 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -24,7 +24,7 @@ static wchar_t* parseCodeToStatus(ARGUMENTSINFO *ai) if (ai->argc != 2)
return nullptr;
- unsigned int status = ttoi(ai->argv.w[1]);
+ unsigned int status = _wtoi(ai->argv.w[1]);
wchar_t *szStatus = Clist_GetStatusModeDescription(status, 0);
if (szStatus != nullptr)
return mir_wstrdup(szStatus);
@@ -84,14 +84,14 @@ static wchar_t* parseContact(ARGUMENTSINFO *ai) if (*ai->argv.w[3] != 'r') // random contact
n = -1;
else
- n = ttoi(ai->argv.w[3]) - 1;
+ n = _wtoi(ai->argv.w[3]) - 1;
}
MCONTACT hContact = getContactFromString(ai->argv.w[1], getContactInfoFlags(ai->argv.w[2]), n);
if (hContact == INVALID_CONTACT_ID)
return nullptr;
- log_debugA("contact: %x", hContact);
+ log_debug(0, "contact: %x", hContact);
return encodeContactToString(hContact);
}
@@ -101,7 +101,7 @@ static wchar_t* parseContactCount(ARGUMENTSINFO *ai) return nullptr;
int count = getContactFromString(ai->argv.w[1], CI_NEEDCOUNT | getContactInfoFlags(ai->argv.w[2]));
- return itot(count);
+ return _itow(count);
}
static wchar_t* parseContactInfo(ARGUMENTSINFO *ai)
@@ -151,13 +151,13 @@ static wchar_t* getDBSetting(MCONTACT hContact, char* module, char* setting, wch wchar_t *var = nullptr;
switch (dbv.type) {
case DBVT_BYTE:
- var = itot(dbv.bVal);
+ var = _itow(dbv.bVal);
break;
case DBVT_WORD:
- var = itot(dbv.wVal);
+ var = _itow(dbv.wVal);
break;
case DBVT_DWORD:
- var = itot(dbv.dVal);
+ var = _itow(dbv.dVal);
break;
case DBVT_ASCIIZ:
var = mir_a2u(dbv.pszVal);
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index f7c2f9681c..ddb849396e 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -27,18 +27,18 @@ static wchar_t* parseCaps(ARGUMENTSINFO *ai) wchar_t *res = mir_wstrdup(ai->argv.w[1]);
wchar_t *cur = res;
CharLower(res);
- *cur = (wchar_t)CharUpper((LPTSTR)*cur);
+ *cur = (UINT_PTR)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (wchar_t)CharUpper((LPTSTR)*cur);
+ *cur = (UINT_PTR)CharUpper((LPTSTR)*cur);
}
else {
cur++;
if (IsCharUpper(*cur))
- *cur = (wchar_t)CharLower((LPTSTR)*cur);
+ *cur = (UINT_PTR)CharLower((LPTSTR)*cur);
}
}
return res;
@@ -51,13 +51,13 @@ static wchar_t* parseCaps2(ARGUMENTSINFO *ai) wchar_t *res = mir_wstrdup(ai->argv.w[1]);
wchar_t *cur = res;
- *cur = (wchar_t)CharUpper((LPTSTR)*cur);
+ *cur = (UINT_PTR)CharUpper((LPTSTR)*cur);
cur++;
while (*cur != 0) {
if ((*cur == ' ') && (*(cur + 1) != 0)) {
cur++;
if (IsCharLower(*cur))
- *cur = (wchar_t)CharUpper((LPTSTR)*cur);
+ *cur = (UINT_PTR)CharUpper((LPTSTR)*cur);
}
else cur++;
}
@@ -82,7 +82,6 @@ static wchar_t* parseEolToCrlf(ARGUMENTSINFO *ai) if ((cur == nullptr) || ((cur > res) && (*(cur - 1) == '\r')))
continue;
- log_debug(cur);
int loc = cur - res;
res = (wchar_t*)mir_realloc(res, (mir_wstrlen(res) + 2)*sizeof(wchar_t));
cur = res + loc;
@@ -160,7 +159,7 @@ static wchar_t* parseInsert(ARGUMENTSINFO *ai) if (ai->argc != 4)
return nullptr;
- unsigned int pos = ttoi(ai->argv.w[3]);
+ unsigned int pos = _wtoi(ai->argv.w[3]);
if (pos > mir_wstrlen(ai->argv.w[1]))
return nullptr;
@@ -180,7 +179,7 @@ static wchar_t* parseLeft(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int len = ttoi(ai->argv.w[2]);
+ int len = _wtoi(ai->argv.w[2]);
if (len < 0)
return nullptr;
@@ -199,7 +198,7 @@ static wchar_t* parseLen(ARGUMENTSINFO *ai) if (ai->argc != 2)
return nullptr;
- return itot((int)mir_wstrlen(ai->argv.w[1]));
+ return _itow((int)mir_wstrlen(ai->argv.w[1]));
}
static wchar_t* parseLineCount(ARGUMENTSINFO *ai)
@@ -220,7 +219,7 @@ static wchar_t* parseLineCount(ARGUMENTSINFO *ai) cur++;
}
- return itot(count);
+ return _itow(count);
}
static wchar_t* parseLower(ARGUMENTSINFO *ai)
@@ -265,7 +264,7 @@ static wchar_t* parsePad(ARGUMENTSINFO *ai) default: return nullptr;
}
- int padding = ttoi(ai->argv.w[2]);
+ int padding = _wtoi(ai->argv.w[2]);
if (padding < 0)
return nullptr;
@@ -292,7 +291,7 @@ static wchar_t* parsePadright(ARGUMENTSINFO *ai) default: return nullptr;
}
- int padding = ttoi(ai->argv.w[2]);
+ int padding = _wtoi(ai->argv.w[2]);
if (padding < 0)
return nullptr;
@@ -319,7 +318,7 @@ static wchar_t* parsePadcut(ARGUMENTSINFO *ai) default: return nullptr;
}
- int padding = ttoi(ai->argv.w[2]);
+ int padding = _wtoi(ai->argv.w[2]);
if (padding < 0)
return nullptr;
@@ -348,7 +347,7 @@ static wchar_t* parsePadcutright(ARGUMENTSINFO *ai) default: return nullptr;
}
- int padding = ttoi(ai->argv.w[2]);
+ int padding = _wtoi(ai->argv.w[2]);
if (padding < 0)
return nullptr;
@@ -373,7 +372,7 @@ static wchar_t* parseRepeat(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int count = ttoi(ai->argv.w[2]);
+ int count = _wtoi(ai->argv.w[2]);
if (count < 0)
return nullptr;
@@ -424,7 +423,7 @@ static wchar_t* parseRight(ARGUMENTSINFO *ai) if (ai->argc != 3)
return nullptr;
- int len = ttoi(ai->argv.w[2]);
+ int len = _wtoi(ai->argv.w[2]);
if (len < 0)
return nullptr;
@@ -449,8 +448,8 @@ static wchar_t* parseScroll(ARGUMENTSINFO *ai) if (mir_wstrlen(ai->argv.w[1]) == 0)
return mir_wstrdup(ai->argv.w[1]);
- size_t move = ttoi(ai->argv.w[3]) % mir_wstrlen(ai->argv.w[1]);
- size_t display = ttoi(ai->argv.w[2]);
+ size_t move = _wtoi(ai->argv.w[3]) % mir_wstrlen(ai->argv.w[1]);
+ size_t display = _wtoi(ai->argv.w[2]);
if (display > mir_wstrlen(ai->argv.w[1]))
display = (unsigned)mir_wstrlen(ai->argv.w[1]);
@@ -490,7 +489,7 @@ static wchar_t* parseStrchr(ARGUMENTSINFO *ai) if (c == nullptr || *c == 0)
return mir_wstrdup(L"0");
- return itot(c - ai->argv.w[1] + 1);
+ return _itow(c - ai->argv.w[1] + 1);
}
static wchar_t* parseStrcmp(ARGUMENTSINFO *ai)
@@ -525,7 +524,7 @@ static wchar_t* parseStrncmp(ARGUMENTSINFO *ai) if (ai->argc != 4)
return nullptr;
- int n = ttoi(ai->argv.w[3]);
+ int n = _wtoi(ai->argv.w[3]);
if (n <= 0)
return nullptr;
@@ -551,7 +550,7 @@ static wchar_t* parseStrnicmp(ARGUMENTSINFO *ai) if (ai->argc != 4)
return nullptr;
- int n = ttoi(ai->argv.w[3]);
+ int n = _wtoi(ai->argv.w[3]);
if (n <= 0)
return nullptr;
@@ -570,7 +569,7 @@ static wchar_t* parseStrrchr(ARGUMENTSINFO *ai) if ((c == nullptr) || (*c == 0))
return mir_wstrdup(L"0");
- return itot(c - ai->argv.w[1] + 1);
+ return _itow(c - ai->argv.w[1] + 1);
}
static wchar_t* parseStrstr(ARGUMENTSINFO *ai)
@@ -582,7 +581,7 @@ static wchar_t* parseStrstr(ARGUMENTSINFO *ai) if ((c == nullptr) || (*c == 0))
return mir_wstrdup(L"0");
- return itot(c - ai->argv.w[1] + 1);
+ return _itow(c - ai->argv.w[1] + 1);
}
static wchar_t* parseSubstr(ARGUMENTSINFO *ai)
@@ -590,9 +589,9 @@ static wchar_t* parseSubstr(ARGUMENTSINFO *ai) if (ai->argc < 3)
return nullptr;
- int to, from = max(ttoi(ai->argv.w[2]) - 1, 0);
+ int to, from = max(_wtoi(ai->argv.w[2]) - 1, 0);
if (ai->argc > 3)
- to = min(ttoi(ai->argv.w[3]), (int)mir_wstrlen(ai->argv.w[1]));
+ to = min(_wtoi(ai->argv.w[3]), (int)mir_wstrlen(ai->argv.w[1]));
else
to = (int)mir_wstrlen(ai->argv.w[1]);
@@ -610,7 +609,7 @@ static wchar_t* parseSelect(ARGUMENTSINFO *ai) if (ai->argc <= 1)
return nullptr;
- int n = ttoi(ai->argv.w[1]);
+ int n = _wtoi(ai->argv.w[1]);
if ((n > (signed int)ai->argc - 2) || n <= 0)
return nullptr;
@@ -659,7 +658,7 @@ static wchar_t* parseTab(ARGUMENTSINFO *ai) {
int count = 1;
if ((ai->argc == 2) && (mir_wstrlen(ai->argv.w[1]) > 0))
- count = ttoi(ai->argv.w[1]);
+ count = _wtoi(ai->argv.w[1]);
if (count < 0)
return nullptr;
@@ -731,10 +730,10 @@ static wchar_t* parseWord(ARGUMENTSINFO *ai) return nullptr;
wchar_t *res = nullptr;
- int to, from = ttoi(ai->argv.w[2]);
+ int to, from = _wtoi(ai->argv.w[2]);
if (ai->argc == 4) {
if (mir_wstrlen(ai->argv.w[3]) > 0)
- to = ttoi(ai->argv.w[3]);
+ to = _wtoi(ai->argv.w[3]);
else
to = 100000; // rework
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index e3d7d63ab9..38a00e8d83 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -156,7 +156,7 @@ static wchar_t* parseDirectory(ARGUMENTSINFO *ai) int depth = 0;
if (ai->argc == 3)
- depth = ttoi(ai->argv.w[2]);
+ depth = _wtoi(ai->argv.w[2]);
if (depth <= 0)
return mir_wstrdup(ai->argv.w[1]);
@@ -192,7 +192,7 @@ static wchar_t* parseDirectory2(ARGUMENTSINFO *ai) int depth = 1;
if (ai->argc == 3)
- depth = ttoi(ai->argv.w[2]);
+ depth = _wtoi(ai->argv.w[2]);
if (depth <= 0)
return nullptr;
@@ -520,7 +520,7 @@ static wchar_t* parseTimestamp2Date(ARGUMENTSINFO *ai) SYSTEMTIME sysTime;
wchar_t *szFormat;
- time_t timestamp = ttoi(ai->argv.w[1]);
+ time_t timestamp = _wtoi(ai->argv.w[1]);
if (timestamp == 0)
return nullptr;
@@ -551,7 +551,7 @@ static wchar_t* parseTimestamp2Time(ARGUMENTSINFO *ai) return nullptr;
SYSTEMTIME sysTime;
- time_t timestamp = ttoi(ai->argv.w[1]);
+ time_t timestamp = _wtoi(ai->argv.w[1]);
if (timestamp == 0)
return nullptr;
@@ -592,7 +592,7 @@ static wchar_t* parseTextFile(ARGUMENTSINFO *ai) return nullptr;
}
- int lineNo = ttoi(ai->argv.w[2]);
+ int lineNo = _wtoi(ai->argv.w[2]);
int lineCount, csz;
unsigned int icur, bufSz;
DWORD readSz, totalReadSz;
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h index 14e7d17c04..fe34079aa6 100644 --- a/plugins/Variables/src/stdafx.h +++ b/plugins/Variables/src/stdafx.h @@ -202,5 +202,4 @@ INT_PTR showHelpExService(WPARAM wParam, LPARAM lParam); INT_PTR getSkinItemService(WPARAM wParam, LPARAM lParam);
int iconsChanged(WPARAM wParam, LPARAM lParam);
-int ttoi(wchar_t *string);
-wchar_t *itot(int num);
+wchar_t* _itow(int);
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp index 236389a4b6..8a197815eb 100644 --- a/plugins/Variables/src/tokenregister.cpp +++ b/plugins/Variables/src/tokenregister.cpp @@ -115,7 +115,7 @@ INT_PTR registerToken(WPARAM, LPARAM lParam) memcpy(&tre->tr, newVr, newVr->cbSize);
tre->nameHash = hash;
if (!mir_wstrcmp(newVr->szTokenString.w, L"alias"))
- log_debugA("alias");
+ log_debug(0, "alias");
if (!(newVr->flags & TRF_PARSEFUNC) && newVr->szService != nullptr)
tre->tr.szService = mir_strdup(newVr->szService);
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 479f18d34b..ddad427cd9 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -355,7 +355,7 @@ wchar_t* formatString(FORMATINFO *fi) if ((fi->eCount + fi->pCount) > 5000) { fi->eCount++; fi->pCount++; - log_debugA("Variables: Overflow protection; %d parses", (fi->eCount + fi->pCount)); + log_debug(0, "Variables: Overflow protection; %d parses", (fi->eCount + fi->pCount)); return nullptr; } @@ -416,7 +416,7 @@ int LoadVarModule() registerAliasTokens(); registerMetaContactsTokens(); - log_debugA("Variables: Internal tokens registered"); + log_debug(0, "Variables: Internal tokens registered"); if (g_plugin.getByte(SETTING_PARSEATSTARTUP, 0)) { FORMATINFO fi = { 0 }; @@ -427,7 +427,7 @@ int LoadVarModule() mir_free(fi.szFormat.w); } } - log_debugA("Variables: Init done"); + log_debug(0, "Variables: Init done"); return 0; } diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 9dd8b0fffe..3bf6e4976f 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -53,55 +53,7 @@ wchar_t* Hlp_GetWindowText(HWND hwndDlg) return res;
}
-/**
- * Modified from Miranda CList, clistsettings.c
- **/
-
- // Logging
-static int WriteToDebugLogA(const char *szMsg)
-{
- return Netlib_Log(nullptr, szMsg);
-}
-
-int AddDebugLogMessageA(const char* fmt, ...)
-{
- char szText[MAX_DEBUG], szFinal[MAX_DEBUG];
-
- va_list va;
- va_start(va, fmt);
- mir_vsnprintf(szText, _countof(szText), fmt, va);
- va_end(va);
-#ifdef MODULENAME
- mir_snprintf(szFinal, "%s: %s", MODULENAME, szText);
-#else
- strncpy(szFinal, szText, _countof(szFinal));
-#endif
- return WriteToDebugLogA(szFinal);
-}
-
-int AddDebugLogMessage(const wchar_t* fmt, ...)
-{
- wchar_t tszText[MAX_DEBUG], tszFinal[MAX_DEBUG];
-
- va_list va;
- va_start(va, fmt);
- mir_vsnwprintf(tszText, _countof(tszText), fmt, va);
- va_end(va);
-#ifdef MODULENAME
- mir_snwprintf(tszFinal, L"%s: %s", MODULENAME, tszText);
-#else
- wcsncpy(tszFinal, tszText, _countof(tszFinal));
-#endif
-
- return WriteToDebugLogA(_T2A(tszFinal));
-}
-
-int ttoi(wchar_t *string)
-{
- return (string == nullptr) ? 0 : _wtoi(string);
-}
-
-wchar_t *itot(int num)
+wchar_t* _itow(int num)
{
wchar_t tRes[32];
// check this
diff --git a/plugins/helpers/gen_helpers.h b/plugins/helpers/gen_helpers.h index f084929244..2cb4901829 100644 --- a/plugins/helpers/gen_helpers.h +++ b/plugins/helpers/gen_helpers.h @@ -19,12 +19,9 @@ #ifndef __GEN_HELPERS_H
#define __GEN_HELPERS_H
-TCHAR *Hlp_GetProtocolName(const char *proto);
-TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem);
-TCHAR *Hlp_GetWindowText(HWND hwndDlg);
-
-int ttoi(TCHAR *string);
-TCHAR *itot(int num);
+TCHAR* Hlp_GetProtocolName(const char *proto);
+TCHAR* Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem);
+TCHAR* Hlp_GetWindowText(HWND hwndDlg);
#define MAX_DEBUG 1024
@@ -39,23 +36,16 @@ TCHAR *itot(int num); #endif
#endif
-int AddDebugLogMessageA(const char* fmt, ...);
-int AddDebugLogMessage(const TCHAR* fmt, ...);
-
#if LOGLEVEL >= __LOGLEVEL_DEBUG
-#define log_debugA AddDebugLogMessageA
-#define log_debug AddDebugLogMessage
+#define log_debug Netlib_Logf
#else
-static __inline int log_debugA(const char*, ...) { return 0; }
-static __inline int log_debug(const TCHAR*, ...) { return 0; }
+static __inline int log_debug(int, const char*, ...) { return 0; }
#endif
#if LOGLEVEL >= __LOGLEVEL_INFO
-#define log_infoA AddDebugLogMessageA
-#define log_info AddDebugLogMessage
+#define log_info Netlib_Logf
#else
-static __inline int log_infoA(const char*, ...) { return 0; }
-static __inline int log_info(const TCHAR*, ...) { return 0; }
+static __inline int log_info(int, const char*, ...) { return 0; }
#endif
#endif
|