diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/BuddyPounce/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/SMS/src/functions.cpp | 4 | ||||
-rw-r--r-- | plugins/SMS/src/receive.cpp | 22 | ||||
-rw-r--r-- | plugins/Spamotron/src/utils.cpp | 12 |
4 files changed, 20 insertions, 20 deletions
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 21ede36856..7f6d1a9c9a 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -76,7 +76,7 @@ int MsgAck(WPARAM, LPARAM lParam) dbei.flags = DBEF_UTF | DBEF_SENT;
dbei.szModule = (char*)ack->szModule;
dbei.timestamp = time(NULL);
- dbei.cbBlob = mir_strlen(pszUtf) + 1;
+ dbei.cbBlob = (int)mir_strlen(pszUtf) + 1;
dbei.pBlob = (PBYTE)(char*)pszUtf;
db_event_add(ack->hContact, &dbei);
}
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index a1fc8f68e4..e407e26228 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -207,7 +207,7 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy LPSTR lpsz = (LPSTR)strstr(lpszMessage+10, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+10),min((size_t)(lpsz-(lpszMessage+10)),dwPhoneSize),lpwszPhone,dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+10),(int)min((size_t)(lpsz-(lpszMessage+10)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
}
@@ -219,7 +219,7 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy LPSTR lpsz = (LPSTR)strstr(lpszMessage+23, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+23),min((size_t)(lpsz-(lpszMessage+23)),dwPhoneSize),lpwszPhone,dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+23),(int)min((size_t)(lpsz-(lpszMessage+23)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 813cd77ffd..8c4f040b79 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -58,13 +58,13 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) LPWSTR lpwszMessageXMLDecoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded)
{
- dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszData,dwDataSize,lpwszMessageXMLEncoded,dwBuffLen);
+ dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszData,(int)dwDataSize,lpwszMessageXMLEncoded,(int)dwBuffLen);
DecodeXML(lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpwszMessageXMLDecoded,dwBuffLen,&dwMessageXMLDecodedSize);
lpszMessageUTF=(LPSTR)lpwszMessageXMLEncoded;
- WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLDecoded,dwMessageXMLDecodedSize,lpszMessageUTF,dwBuffLen,NULL,NULL);
+ WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLDecoded,(int)dwMessageXMLDecodedSize,lpszMessageUTF,(int)dwBuffLen,NULL,NULL);
dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,dwPhoneSize,tszPhone,MAX_PHONE_LEN);
+ dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
dbei.szModule=GetModuleName(hContact);
@@ -92,7 +92,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszPhone,&dwPhoneSize,"sms_delivery_receipt","destination",NULL))
{
dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,dwPhoneSize,tszPhone,MAX_PHONE_LEN);
+ dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
DBEVENTINFO dbei={0};
@@ -101,7 +101,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) dbei.timestamp=time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,dwDataSize,"yes",3)==CSTR_EQUAL)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL)
{
dbei.cbBlob=(MAX_PHONE_LEN+MAX_PATH);
dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
@@ -112,13 +112,13 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) lpszData="";
dwDataSize=0;
}
- dbei.cbBlob=(MAX_PHONE_LEN+MAX_PATH+dwDataSize);
+ dbei.cbBlob=(int)(MAX_PHONE_LEN+MAX_PATH+dwDataSize);
dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
if (dbei.pBlob)
{
dbei.cbBlob=mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ",szPhone);
memcpy((dbei.pBlob+dbei.cbBlob),lpszData,dwDataSize);
- dbei.cbBlob+=(dwDataSize+sizeof(DWORD));
+ dbei.cbBlob += (int)(dwDataSize+sizeof(DWORD));
(*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
}
}
@@ -142,7 +142,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) KillTimer(hWndDlg, wParam);
GetXMLFieldExBuff(lpszXML,dwXMLSize,szNetwork,sizeof(szNetwork),NULL,"sms_response","network",NULL);
- if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,dwDataSize,"no",2)==CSTR_EQUAL) {
+ if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"no",2)==CSTR_EQUAL) {
char szBuff[1024];
TCHAR tszErrorMessage[1028];
LPSTR lpszErrorDescription;
@@ -181,13 +181,13 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) else SendSMSWindowRemove(hWndDlg);
}
else {
- if ( CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,dwDataSize,"yes",3)==CSTR_EQUAL ||
- CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,dwDataSize,"smtp",4)==CSTR_EQUAL) {
+ if ( CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL ||
+ CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"smtp",4)==CSTR_EQUAL) {
char szSource[MAX_PATH],szMessageID[MAX_PATH];
if (DB_SMS_GetByte(NULL,"ShowACK",SMS_DEFAULT_SHOWACK)) {
HWND hwndAccepted=CreateDialog(ssSMSSettings.hInstance,MAKEINTRESOURCE(IDD_SENDSMSACCEPT),hWndDlg,SMSAcceptedDlgProc);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,dwDataSize,"yes",3)==CSTR_EQUAL) {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL) {
GetXMLFieldExBuff(lpszXML,dwXMLSize,szSource,sizeof(szSource),NULL,"sms_response","source",NULL);
GetXMLFieldExBuff(lpszXML,dwXMLSize,szMessageID,sizeof(szMessageID),NULL,"sms_response","message_id",NULL);
}
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 345f3316ce..22ca8df42b 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -42,7 +42,7 @@ BOOL _isregex(TCHAR* strSearch) regex = mir_tstrdup(strSearch); if (regex == NULL) goto err_out; - rc = pcre16_exec(re, NULL, regex, _tcslen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9); if (rc == 3) ret = TRUE; mir_free(regex); @@ -73,7 +73,7 @@ BOOL _isvalidregex(TCHAR* strSearch) pcre16_free(re); return FALSE; } - rc = pcre16_exec(re, NULL, regex, _tcslen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9); pcre16_free(re); if (rc != 3) goto err_out; @@ -121,7 +121,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch) pcre16_free(re); return FALSE; } - rc = pcre16_exec(re, NULL, regex, _tcslen(regex), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9); pcre16_free(re); if (rc != 3) goto err_out; // [TODO] and log some error (better check for valid regex on options save) @@ -143,7 +143,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch) re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL); if (re == NULL) goto err_out; - rc = pcre16_exec(re, NULL, data, _tcslen(data), 0, 0, NULL, 0); + rc = pcre16_exec(re, NULL, data, (int)_tcslen(data), 0, 0, NULL, 0); pcre16_free(re); if (rc >= 0) ret = TRUE; @@ -175,7 +175,7 @@ int get_response_id(const TCHAR* strvar) pcre16_free(re); return 0; } - rc = pcre16_exec(re, NULL, _strvar, _tcslen(_strvar), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, _strvar, (int)_tcslen(_strvar), 0, 0, ovector, 9); pcre16_free(re); if (rc < 0) { ret = -1; @@ -390,7 +390,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num) mir_free(dstcopy); goto err_out; } - rc = pcre16_exec(re, NULL, _str, _tcslen(_str), 0, 0, ovector, 9); + rc = pcre16_exec(re, NULL, _str, (int)_tcslen(_str), 0, 0, ovector, 9); if (rc < 0) { ret = -1; } else if (rc == 3) { |