summaryrefslogtreecommitdiff
path: root/plugins/Variables
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-11 17:12:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-11 17:12:17 +0300
commit1f0b0e7a2047320d6808ac565eb35d66905252fd (patch)
tree127467c2414340ff442a517103f7937bfe3958e0 /plugins/Variables
parent5bbeb86b16369c9978d006b445b61a941895ccf3 (diff)
code cleaning for old shitty helper
Diffstat (limited to 'plugins/Variables')
-rw-r--r--plugins/Variables/src/help.cpp6
-rw-r--r--plugins/Variables/src/parse_inet.cpp4
-rw-r--r--plugins/Variables/src/parse_logic.cpp8
-rw-r--r--plugins/Variables/src/parse_math.cpp56
-rw-r--r--plugins/Variables/src/parse_miranda.cpp14
-rw-r--r--plugins/Variables/src/parse_str.cpp57
-rw-r--r--plugins/Variables/src/parse_system.cpp10
-rw-r--r--plugins/Variables/src/stdafx.h3
-rw-r--r--plugins/Variables/src/tokenregister.cpp2
-rw-r--r--plugins/Variables/src/variables.cpp6
10 files changed, 82 insertions, 84 deletions
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;
}