summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/CryptoPP/src/GPGw/tools.cpp12
-rw-r--r--plugins/FTPFileYM/src/job_upload.cpp165
-rw-r--r--plugins/Ping/src/options.cpp4
-rw-r--r--plugins/Ping/src/pinggraph.cpp11
-rw-r--r--plugins/Variables/src/parse_alias.cpp15
-rw-r--r--plugins/Variables/src/parse_metacontacts.cpp6
-rw-r--r--plugins/Variables/src/parse_miranda.cpp2
-rw-r--r--plugins/Variables/src/parse_system.cpp2
8 files changed, 89 insertions, 128 deletions
diff --git a/plugins/CryptoPP/src/GPGw/tools.cpp b/plugins/CryptoPP/src/GPGw/tools.cpp
index 6886088e4e..17d3303739 100644
--- a/plugins/CryptoPP/src/GPGw/tools.cpp
+++ b/plugins/CryptoPP/src/GPGw/tools.cpp
@@ -28,8 +28,8 @@ void replace(char *atext, const char *apattern, const char *areplacement)
long replacementsize;
pos=atext;
- patternsize=strlen(apattern);
- replacementsize=strlen(areplacement);
+ patternsize = (long)strlen(apattern);
+ replacementsize = (long)strlen(areplacement);
do
{
@@ -40,7 +40,7 @@ void replace(char *atext, const char *apattern, const char *areplacement)
if(pos==NULL) break;
// laenge des textes ermitteln
- textsize=strlen(last);
+ textsize = (long)strlen(last);
// platz schaffen
memmove(pos+replacementsize, pos+patternsize, textsize-((pos-last)+patternsize)+1);
// ersetzen
@@ -77,12 +77,12 @@ void getLastPart(char *aresult, char *atext)
void appendText(char **abuffer, const char *atext, int atextsize)
{
- int size;
+ size_t size;
if (*abuffer==NULL) size=0;
- else size=strlen(*abuffer);
+ else size = strlen(*abuffer);
size++; // abschliessende 0
- if(atextsize==0) atextsize=strlen(atext);
+ if(atextsize==0) atextsize = (int)strlen(atext);
size+=atextsize;
*abuffer=(char *)realloc(*abuffer, size);
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp
index 2d6eba3e54..f14d41f92c 100644
--- a/plugins/FTPFileYM/src/job_upload.cpp
+++ b/plugins/FTPFileYM/src/job_upload.cpp
@@ -25,22 +25,22 @@ int UploadJob::iRunningJobCount = 0;
extern UploadDialog *uDlg;
extern ServerList &ftpList;
-UploadJob::UploadJob(HANDLE _hContact, int _iFtpNum, EMode _mode)
-:GenericJob(_hContact, _iFtpNum, _mode),fp(NULL)
+UploadJob::UploadJob(HANDLE _hContact, int _iFtpNum, EMode _mode) :
+ GenericJob(_hContact, _iFtpNum, _mode),fp(NULL)
{
this->szFileLink[0] = 0;
}
-UploadJob::UploadJob(UploadJob *job)
-:GenericJob(job),fp(NULL),uiSent(0),uiTotalSent(0),uiFileSize(0)
+UploadJob::UploadJob(UploadJob *job) :
+ GenericJob(job),fp(NULL),uiSent(0),uiTotalSent(0),uiFileSize(0)
{
strcpy(this->szFileLink, job->szFileLink);
for (int i = 0; i < SIZEOF(this->lastSpeed); i++)
this->lastSpeed[i] = 0;
}
-UploadJob::UploadJob(PackerJob *job)
-:GenericJob(job),fp(NULL),uiSent(0),uiTotalSent(0),uiFileSize(0)
+UploadJob::UploadJob(PackerJob *job) :
+ GenericJob(job),fp(NULL),uiSent(0),uiTotalSent(0),uiFileSize(0)
{
for (int i = 0; i < SIZEOF(this->lastSpeed); i++)
this->lastSpeed[i] = 0;
@@ -60,8 +60,7 @@ UploadJob::~UploadJob()
void UploadJob::addToUploadDlg()
{
- for (UINT i = 0; i < this->files.size(); i++)
- {
+ for (UINT i = 0; i < this->files.size(); i++) {
UploadJob *jobCopy = new UploadJob(this);
_tcscpy(jobCopy->stzFilePath, this->files[i]);
_tcscpy(jobCopy->stzFileName, Utils::getFileNameFromPath(jobCopy->stzFilePath));
@@ -77,40 +76,37 @@ void UploadJob::addToUploadDlg()
void UploadJob::autoSend()
{
- if (this->hContact != NULL)
- {
- char *szProto = GetContactProto(this->hContact);
- if (szProto)
- {
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT;
- dbei.szModule = szProto;
- dbei.timestamp = (DWORD)time(NULL);
- dbei.cbBlob = (DWORD)strlen(this->szFileLink) + 1;
- dbei.pBlob = (PBYTE)this->szFileLink;
- db_event_add(this->hContact, &dbei);
- CallContactService(this->hContact, PSS_MESSAGE, 0, (LPARAM)this->szFileLink);
- CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)this->hContact, 0);
- }
- }
+ if (this->hContact == NULL)
+ return;
+
+ char *szProto = GetContactProto(this->hContact);
+ if (szProto == NULL)
+ return;
+
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = DBEF_SENT;
+ dbei.szModule = szProto;
+ dbei.timestamp = (DWORD)time(NULL);
+ dbei.cbBlob = (DWORD)strlen(this->szFileLink) + 1;
+ dbei.pBlob = (PBYTE)this->szFileLink;
+ db_event_add(this->hContact, &dbei);
+ CallContactService(this->hContact, PSS_MESSAGE, 0, (LPARAM)this->szFileLink);
+ CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)this->hContact, 0);
}
void UploadJob::copyLinkToML()
{
- if (this->hContact != NULL)
- {
+ if (this->hContact != NULL) {
char buff[256];
- mir_snprintf(buff, sizeof(buff), "%s\r\n", this->szFileLink);
+ mir_snprintf(buff, SIZEOF(buff), "%s\r\n", this->szFileLink);
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)this->hContact, (LPARAM)buff);
}
}
void UploadJob::pause()
{
- if (!isCompleted())
- {
+ if (!isCompleted()) {
curl_easy_pause(this->hCurl, CURLPAUSE_SEND);
this->setStatus(STATUS_PAUSED);
}
@@ -136,8 +132,7 @@ void UploadJob::resume()
{
this->uiSent = 0;
this->startTS = time(NULL);
- if (!isCompleted())
- {
+ if (!isCompleted()) {
curl_easy_pause(this->hCurl, CURLPAUSE_CONT);
this->setStatus(STATUS_UPLOADING);
}
@@ -153,11 +148,9 @@ void UploadJob::waitingThread(void *arg)
{
UploadJob *job = (UploadJob *)arg;
- while (!Miranda_Terminated())
- {
+ while (!Miranda_Terminated()) {
Lock *lock = new Lock(mutexJobCount);
- if (iRunningJobCount < MAX_RUNNING_JOBS)
- {
+ if (iRunningJobCount < MAX_RUNNING_JOBS) {
iRunningJobCount++;
delete lock;
job->upload();
@@ -249,25 +242,22 @@ bool UploadJob::fileExistsOnServer()
INT_PTR CALLBACK UploadJob::DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
{
- TranslateDialogDefault(hwndDlg);
-
TCHAR buff[256];
TCHAR *fileName = mir_a2t((char *)lParam);
mir_sntprintf(buff, SIZEOF(buff), TranslateT("File exists - %s"), fileName);
SetWindowText(hwndDlg, buff);
FREE(fileName);
- return TRUE;
- }
- case WM_COMMAND:
- {
- if (HIWORD(wParam) == BN_CLICKED)
- EndDialog(hwndDlg, LOWORD(wParam));
- break;
}
+ return TRUE;
+
+ case WM_COMMAND:
+ if (HIWORD(wParam) == BN_CLICKED)
+ EndDialog(hwndDlg, LOWORD(wParam));
+ break;
}
return FALSE;
@@ -278,8 +268,7 @@ void UploadJob::upload()
this->refreshTab(true);
this->fp = _tfopen(this->stzFilePath, _T("rb"));
- if (this->fp == NULL)
- {
+ if (this->fp == NULL) {
Utils::msgBox(TranslateT("Error occurred when opening local file.\nAborting file upload..."), MB_OK | MB_ICONERROR);
return;
}
@@ -293,27 +282,22 @@ void UploadJob::upload()
this->uiFileSize = (UINT64)fileInfo.st_size;
CURL *hCurl = this->curlInit(getUrlString(), headerList);
- if (!hCurl)
- {
+ if (!hCurl) {
Utils::msgBox(TranslateT("Error occurred when initializing libcurl.\nAborting file upload..."), MB_OK | MB_ICONERROR);
return;
}
bool uploadFile = true;
- if (fileExistsOnServer())
- {
+ if (fileExistsOnServer()) {
int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DLG_FILEEXISTS), 0, DlgProcFileExists, (LPARAM)this->szSafeFileName);
- if (res == IDC_RENAME)
- {
+ if (res == IDC_RENAME) {
if (Utils::setFileNameDlgA(this->szSafeFileName) == true)
curl_easy_setopt(hCurl, CURLOPT_URL, getUrlString());
}
- else if (res == IDC_COPYURL)
- {
+ else if (res == IDC_COPYURL) {
uploadFile = false;
}
- else if (res == IDC_CANCEL)
- {
+ else if (res == IDC_CANCEL) {
this->setStatus(STATUS_CANCELED);
delete this->tab;
return;
@@ -330,21 +314,18 @@ void UploadJob::upload()
curl_slist_free_all(headerList);
curl_easy_cleanup(hCurl);
- if (result != CURLE_OK && result != CURLE_ABORTED_BY_CALLBACK)
- {
+ if (result != CURLE_OK && result != CURLE_ABORTED_BY_CALLBACK) {
char buff[256];
mir_snprintf(buff, sizeof(buff), Translate("FTP error occurred.\n%s"), this->szError);
Utils::msgBoxA(buff, MB_OK | MB_ICONERROR);
}
- if (result > CURLE_OPERATION_TIMEDOUT)
- {
+ if (result > CURLE_OPERATION_TIMEDOUT) {
struct curl_slist *headerList = NULL;
headerList = curl_slist_append(headerList, getDelFileString());
CURL *hCurl = curl_easy_init();
- if (hCurl)
- {
+ if (hCurl) {
Utils::curlSetOpt(hCurl, this->ftp, getDelUrlString(), headerList, this->szError);
curl_easy_perform(hCurl);
curl_slist_free_all(headerList);
@@ -352,10 +333,8 @@ void UploadJob::upload()
}
}
- if (result != CURLE_OK && result != CURLE_QUOTE_ERROR)
- {
- if (!this->isCanceled())
- {
+ if (result != CURLE_OK && result != CURLE_QUOTE_ERROR) {
+ if (!this->isCanceled()) {
this->setStatus(STATUS_CANCELED);
delete this->tab;
}
@@ -376,13 +355,11 @@ void UploadJob::upload()
else if (this->tab->bOptCopyLink)
this->copyLinkToML();
- if (!this->tab->bOptCloseDlg)
- {
+ if (!this->tab->bOptCloseDlg) {
this->tab->labelCompleted();
this->tab->select();
}
- else
- this->closeTab();
+ else this->closeTab();
}
size_t UploadJob::ReadCallback(void *ptr, size_t size, size_t nmemb, void *arg)
@@ -405,12 +382,10 @@ size_t UploadJob::ReadCallback(void *ptr, size_t size, size_t nmemb, void *arg)
void UploadJob::updateStats()
{
- if (this->uiSent && (time(NULL) > this->startTS))
- {
+ if (this->uiSent && (time(NULL) > this->startTS)) {
double speed = ((double)this->uiSent / 1024)/(time(NULL) - this->startTS);
this->avgSpeed = speed;
- for (int i = 0; i < SIZEOF(this->lastSpeed); i++)
- {
+ for (int i = 0; i < SIZEOF(this->lastSpeed); i++) {
this->avgSpeed += (this->lastSpeed[i] == 0 ? speed : this->lastSpeed[i]);
if (i < SIZEOF(this->lastSpeed) - 1)
this->lastSpeed[i + 1] = this->lastSpeed[i];
@@ -441,8 +416,7 @@ void UploadJob::updateStats()
void UploadJob::refreshTab(bool bTabChanged)
{
- if (uDlg->activeTab == this->tab->index())
- {
+ if (uDlg->activeTab == this->tab->index()) {
GenericJob::refreshTab(bTabChanged);
ShowWindow(GetDlgItem(uDlg->hwnd, IDC_BTN_CLIPBOARD), this->isCompleted() ? SW_SHOW : SW_HIDE);
@@ -460,15 +434,12 @@ void UploadJob::refreshTab(bool bTabChanged)
else
SetDlgItemText(uDlg->hwnd, IDC_STATUSBAR, TranslateT("UPLOADING..."));
- if (bTabChanged)
- {
- if (this->isPaused())
- {
+ if (bTabChanged) {
+ if (this->isPaused()) {
SendDlgItemMessage(uDlg->hwnd, IDC_BTN_PAUSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("resume"));
SendDlgItemMessage(uDlg->hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Resume"), BATF_TCHAR);
}
- else
- {
+ else {
SendDlgItemMessage(uDlg->hwnd, IDC_BTN_PAUSE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Utils::loadIconEx("pause"));
SendDlgItemMessage(uDlg->hwnd, IDC_BTN_PAUSE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Pause"), BATF_TCHAR);
}
@@ -480,8 +451,7 @@ void UploadJob::refreshTab(bool bTabChanged)
SetDlgItemText(uDlg->hwnd, IDC_ST_COMPLETED, this->isCompleted() ? TranslateT("Download link:") : TranslateT("Completed:"));
}
- if (this->isCompleted())
- {
+ if (this->isCompleted()) {
SetDlgItemText(uDlg->hwnd, IDC_UP_SPEED, _T(""));
SetDlgItemText(uDlg->hwnd, IDC_UP_COMPLETED, _T(""));
SetDlgItemText(uDlg->hwnd, IDC_UP_REMAIN, _T(""));
@@ -504,11 +474,9 @@ void UploadJob::refreshTab(bool bTabChanged)
void UploadJob::closeTab()
{
- if (!this->isCompleted())
- {
+ if (!this->isCompleted()) {
this->pause();
- if (Utils::msgBox(TranslateT("Do you really want to cancel running upload?"), MB_YESNO | MB_ICONQUESTION) == IDNO)
- {
+ if (Utils::msgBox(TranslateT("Do you really want to cancel running upload?"), MB_YESNO | MB_ICONQUESTION) == IDNO) {
this->resume();
return;
}
@@ -532,17 +500,12 @@ void UploadJob::createToolTip()
TCHAR *server = mir_a2t(this->ftp->szServer);
mir_sntprintf(uDlg->stzToolTipText, SIZEOF(uDlg->stzToolTipText),
TranslateT("Status: %s\r\nFile: %s\r\nServer: %s"),
- this->getStatusString(),
- this->stzFileName,
- server);
+ this->getStatusString(), this->stzFileName, server);
if (this->tab->stzSpeed[0] && this->tab->stzComplet[0] && this->tab->stzRemain[0])
mir_sntprintf(uDlg->stzToolTipText, SIZEOF(uDlg->stzToolTipText),
- TranslateT("%s\r\nSpeed: %s\r\nCompleted: %s\r\nRemaining: %s"),
- uDlg->stzToolTipText,
- this->tab->stzSpeed,
- this->tab->stzComplet,
- this->tab->stzRemain);
+ TranslateT("%s\r\nSpeed: %s\r\nCompleted: %s\r\nRemaining: %s"),
+ uDlg->stzToolTipText, this->tab->stzSpeed, this->tab->stzComplet, this->tab->stzRemain);
FREE(server);
} \ No newline at end of file
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp
index 34e93a4c0e..1b0d6ea8dd 100644
--- a/plugins/Ping/src/options.cpp
+++ b/plugins/Ping/src/options.cpp
@@ -404,7 +404,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
add_edit_addr.get_status = ID_STATUS_OFFLINE;
add_edit_addr.status = PS_NOTRESPONDING;
add_edit_addr.item_id = 0;
- add_edit_addr.index = temp_list.size();
+ add_edit_addr.index = (int)temp_list.size();
if(DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG3), hwndDlg, DlgProcDestEdit) == IDOK)
{
@@ -421,7 +421,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, TRUE);
- sel = temp_list.size() - 1;
+ sel = (int)temp_list.size() - 1;
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, (sel > 0));
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp
index 59947ed7d9..453303fb5a 100644
--- a/plugins/Ping/src/pinggraph.cpp
+++ b/plugins/Ping/src/pinggraph.cpp
@@ -191,20 +191,19 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
if(wd->show_grid)
{
mir_snprintf(buff, SIZEOF(buff), Translate("%d ms"), MARK_TIME);
- TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, strlen(buff));
+ TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)strlen(buff));
}
if (wd->show_stat)
{
SetTextColor(hdc, RGB(255, 0, 0));
mir_snprintf(buff, SIZEOF(buff), Translate("AVG %.1lf ms"), avg);
- TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, strlen(buff));
- if (max_value != avg)
- {
+ TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)strlen(buff));
+ if (max_value != avg) {
mir_snprintf(buff, SIZEOF(buff), Translate("MAX %hd ms"), max_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, strlen(buff));
+ TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)strlen(buff));
mir_snprintf(buff, SIZEOF(buff), Translate("MIN %hd ms"), min_value);
- TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, strlen(buff));
+ TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)strlen(buff));
}
}
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp
index 3cbae2373e..87a95567ff 100644
--- a/plugins/Variables/src/parse_alias.cpp
+++ b/plugins/Variables/src/parse_alias.cpp
@@ -159,17 +159,17 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) {
int res;
int argc, i;
- TCHAR *cur, *alias, **argv, *szArgs;
+ TCHAR **argv;
char *szHelp, *szArgsA;
if (ai->argc != 3)
return NULL;
- cur = ai->targv[1];
+ TCHAR *cur = ai->targv[1];
while (isValidTokenChar(*cur))
cur++;
- alias = (TCHAR*)mir_calloc(((cur-ai->targv[1])+1)*sizeof(TCHAR));
+ TCHAR *alias = (TCHAR*)mir_calloc(((cur-ai->targv[1])+1)*sizeof(TCHAR));
if (alias == NULL)
return NULL;
@@ -177,8 +177,8 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) {
getArguments(cur, &argv, &argc);
deRegisterToken(alias);
addToAliasRegister(alias, argc, argv, ai->targv[2]);
- szArgs = NULL;
- for (i=0;i<argc;i++) {
+ TCHAR *szArgs = NULL;
+ for (i=0; i < argc; i++) {
if (i == 0)
szArgs = (TCHAR*)mir_calloc(( _tcslen(argv[i])+2)*sizeof(TCHAR));
else
@@ -192,7 +192,7 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) {
szArgsA = mir_t2a(szArgs);
- int size = 32 + strlen(szArgsA);
+ size_t size = 32 + strlen(szArgsA);
szHelp = (char *)mir_alloc(size);
memset(szHelp, '\0', 32 + strlen(szArgsA));
mir_snprintf(szHelp, size, LPGEN("Alias")"\t(%s)\t"LPGEN("user defined"), szArgsA);
@@ -207,8 +207,7 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) {
}
mir_free(szArgs);
mir_free(szHelp);
-
- return res==0?mir_tstrdup(_T("")):NULL;
+ return (res == 0) ? mir_tstrdup(_T("")) : NULL;
}
int registerAliasTokens()
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp
index 40fe04c36b..e20c2833cf 100644
--- a/plugins/Variables/src/parse_metacontacts.cpp
+++ b/plugins/Variables/src/parse_metacontacts.cpp
@@ -59,7 +59,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai)
return NULL;
}
- int size = strlen(szProto) + _tcslen(szUniqueID) + 4;
+ size_t size = strlen(szProto) + _tcslen(szUniqueID) + 4;
TCHAR *res = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (res == NULL) {
mir_free(szUniqueID);
@@ -115,7 +115,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai)
return NULL;
}
- int size = strlen(szProto) + _tcslen(szUniqueID) + 4;
+ size_t size = strlen(szProto) + _tcslen(szUniqueID) + 4;
TCHAR *res = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (res == NULL) {
mir_free(szUniqueID);
@@ -171,7 +171,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai)
return NULL;
}
- int size = strlen(szProto) + _tcslen(szUniqueID) + 4;
+ size_t size = strlen(szProto) + _tcslen(szUniqueID) + 4;
TCHAR *res = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (res == NULL) {
mir_free(szUniqueID);
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp
index c3c4eb28b0..88fc767e6c 100644
--- a/plugins/Variables/src/parse_miranda.cpp
+++ b/plugins/Variables/src/parse_miranda.cpp
@@ -486,7 +486,7 @@ static TCHAR *parseSpecialContact(ARGUMENTSINFO *ai)
return NULL;
}
- int size = strlen(szProto) + _tcslen(szUniqueID) + 4;
+ size_t size = strlen(szProto) + _tcslen(szUniqueID) + 4;
TCHAR *res = (TCHAR*)mir_alloc(size * sizeof(TCHAR));
if (res == NULL) {
mir_free(szUniqueID);
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp
index 026007a10f..69053bba1b 100644
--- a/plugins/Variables/src/parse_system.cpp
+++ b/plugins/Variables/src/parse_system.cpp
@@ -54,7 +54,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) {
if ( _tcslen(ai->targv[1]) == 0)
szCounter = mir_tstrdup(_T("\\Processor(_Total)\\% Processor Time"));
else {
- int size = _tcslen(ai->targv[1]) + 32;
+ int size = (int)_tcslen(ai->targv[1]) + 32;
szCounter = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (szCounter == NULL)
return NULL;