diff options
-rw-r--r-- | plugins/CryptoPP/src/base64.cpp | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/base64.h | 2 | ||||
-rw-r--r-- | plugins/CryptoPP/src/cpp_gpgw.cpp | 4 | ||||
-rw-r--r-- | plugins/CryptoPP/src/cpp_pgpw.cpp | 2 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/miscutils.cpp | 2 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/reminders.cpp | 37 | ||||
-rw-r--r-- | plugins/SecureIM/src/loadicons.cpp | 2 |
8 files changed, 22 insertions, 33 deletions
diff --git a/plugins/CryptoPP/src/base64.cpp b/plugins/CryptoPP/src/base64.cpp index 7495dd234f..92f23ba64b 100644 --- a/plugins/CryptoPP/src/base64.cpp +++ b/plugins/CryptoPP/src/base64.cpp @@ -11,7 +11,7 @@ string base64encode(const string buf) }
-char *base64encode(const char *inBuffer, const int count) {
+char *base64encode(const char *inBuffer, const size_t count) {
int srcIndex = 0, destIndex = 0, remainder = count % 3;
char *outBuffer = (char *) malloc(count*2+1);
diff --git a/plugins/CryptoPP/src/base64.h b/plugins/CryptoPP/src/base64.h index 1024ecbbd7..8be9cbc4fa 100644 --- a/plugins/CryptoPP/src/base64.h +++ b/plugins/CryptoPP/src/base64.h @@ -44,7 +44,7 @@ static const byte asciiToBin64[] = static const byte binToAscii64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-char *base64encode(const char *, const int);
+char *base64encode(const char *, const size_t);
char *base64decode(const char *, size_t *);
string base64encode(const string);
diff --git a/plugins/CryptoPP/src/cpp_gpgw.cpp b/plugins/CryptoPP/src/cpp_gpgw.cpp index 0ef3d77626..e6a5899fc2 100644 --- a/plugins/CryptoPP/src/cpp_gpgw.cpp +++ b/plugins/CryptoPP/src/cpp_gpgw.cpp @@ -240,7 +240,7 @@ LPSTR __cdecl gpg_encode(HANDLE context, LPCSTR szPlainMsg) LPSTR szUtfMsg;
if ( ptr->mode & MODE_GPG_ANSI ) {
LPWSTR wszMsg = utf8decode(szPlainMsg);
- size_t wlen = wcslen(wszMsg)+1;
+ int wlen = (int)wcslen(wszMsg)+1;
szUtfMsg = (LPSTR) alloca(wlen);
WideCharToMultiByte(CP_ACP, 0, wszMsg, -1, szUtfMsg, wlen, 0, 0);
}
@@ -261,7 +261,7 @@ LPSTR __cdecl gpg_decode(HANDLE context, LPCSTR szEncMsg) if (szOldMsg) {
if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
- size_t slen = strlen(szOldMsg)+1;
+ int slen = (int)strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
szNewMsg = _strdup(utf8encode(wszMsg));
diff --git a/plugins/CryptoPP/src/cpp_pgpw.cpp b/plugins/CryptoPP/src/cpp_pgpw.cpp index 8633690009..7a70a99607 100644 --- a/plugins/CryptoPP/src/cpp_pgpw.cpp +++ b/plugins/CryptoPP/src/cpp_pgpw.cpp @@ -258,7 +258,7 @@ LPSTR __cdecl pgp_decode(HANDLE context, LPCSTR szEncMsg) if (szOldMsg) {
if ( !is_7bit_string(szOldMsg) && !is_utf8_string(szOldMsg) ) {
- size_t slen = strlen(szOldMsg)+1;
+ int slen = (int)strlen(szOldMsg)+1;
LPWSTR wszMsg = (LPWSTR) alloca(slen*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, szOldMsg, -1, wszMsg, slen*sizeof(WCHAR));
szNewMsg = _strdup(utf8encode(wszMsg));
diff --git a/plugins/NotesAndReminders/src/miscutils.cpp b/plugins/NotesAndReminders/src/miscutils.cpp index e592b94699..1ea10305c9 100644 --- a/plugins/NotesAndReminders/src/miscutils.cpp +++ b/plugins/NotesAndReminders/src/miscutils.cpp @@ -101,7 +101,7 @@ void ReadSettingBlob(HANDLE hContact, char *ModuleName, char *SettingName, WORD void WriteSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,const int *Value, int Size)
{
- WriteSettingBlob(hContact,ModuleName,SettingName,sizeof(int)*Size,(void*)Value);
+ WriteSettingBlob(hContact, ModuleName, SettingName, WORD(sizeof(int)*Size), (void*)Value);
}
bool ReadSettingIntArray(HANDLE hContact,char *ModuleName,char *SettingName,int *Value, int Size)
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 62bad6bcd3..a9a1884c9b 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -303,12 +303,10 @@ void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour) static void TrimString(TCHAR *s)
{
if (!s || !*s)
- {
return;
- }
TCHAR *start = s;
- UINT n = _tcslen(s) - 1;
+ UINT n = UINT(_tcslen(s) - 1);
TCHAR *end = s + n;
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index d991757090..08d40c1f44 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -784,35 +784,26 @@ void ListReminders(void) void GetTriggerTimeString(const ULARGE_INTEGER *When, char *s, UINT strSize, BOOL bUtc)
{
- SYSTEMTIME tm;
+ SYSTEMTIME tm = { 0 };
LCID lc = GetUserDefaultLCID();
*s = 0;
- memset(&tm, 0, sizeof(tm));
if (bUtc)
FileTimeToTzLocalST((const FILETIME*)When, &tm);
else
FILETIMEtoSYSTEMTIME((FILETIME*)When, &tm);
- if ( GetDateFormat(lc, DATE_LONGDATE, &tm, NULL, s, strSize) )
- {
+ if ( GetDateFormat(lc, DATE_LONGDATE, &tm, NULL, s, strSize)) {
// append time
- {
- int n = strlen(s);
- s[n++] = ' ';
- s[n] = 0;
+ int n = (int)strlen(s);
+ s[n++] = ' ';
+ s[n] = 0;
- if ( !GetTimeFormat(lc, LOCALE_NOUSEROVERRIDE|TIME_NOSECONDS, &tm, NULL, s+n, strSize-n) )
- {
- mir_snprintf(s+n, strSize-n, "%02d:%02d", tm.wHour, tm.wMinute);
- }
- }
- }
- else
- {
- mir_snprintf(s, strSize, "%d-%02d-%02d %02d:%02d", tm.wYear, tm.wMonth, tm.wDay, tm.wHour, tm.wMinute);
+ if ( !GetTimeFormat(lc, LOCALE_NOUSEROVERRIDE|TIME_NOSECONDS, &tm, NULL, s+n, strSize-n) )
+ mir_snprintf(s+n, strSize-n, "%02d:%02d", tm.wHour, tm.wMinute);
}
+ else mir_snprintf(s, strSize, "%d-%02d-%02d %02d:%02d", tm.wYear, tm.wMonth, tm.wDay, tm.wHour, tm.wMinute);
}
@@ -2488,14 +2479,14 @@ static void InitListView(HWND AHLV) lvTIt.iItem = I;
lvTIt.iSubItem = 0;
lvTIt.pszText = S1;
- lvTIt.cchTextMax = strlen(S1);
+ lvTIt.cchTextMax = (int)strlen(S1);
ListView_InsertItem(AHLV,&lvTIt);
lvTIt.mask = LVIF_TEXT;
S = GetPreviewString(pReminder->Reminder);
lvTIt.iItem = I;
lvTIt.iSubItem = 1;
lvTIt.pszText = S;
- lvTIt.cchTextMax = strlen(S);
+ lvTIt.cchTextMax = (int)strlen(S);
ListView_SetItem(AHLV,&lvTIt);
I++;
@@ -2666,13 +2657,13 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
S = Translate("Reminder text");
lvCol.pszText = S;
- lvCol.cchTextMax = strlen(S);
+ lvCol.cchTextMax = (int)strlen(S);
lvCol.cx = g_reminderListColGeom[1];
ListView_InsertColumn(H,0,&lvCol);
lvCol.mask = LVCF_TEXT | LVCF_WIDTH;
S = Translate("Date of activation");
lvCol.pszText = S;
- lvCol.cchTextMax = strlen(S);
+ lvCol.cchTextMax = (int)strlen(S);
lvCol.cx = g_reminderListColGeom[0];
ListView_InsertColumn(H,0,&lvCol);
InitListView(H);
@@ -2870,10 +2861,10 @@ void Send(char *user, char *host, char *Msg, char *server) ch = (char*)malloc(strlen(user) + strlen(host) + 16);
ch = (char*)realloc(ch,sprintf(ch,"rcpt to:%s@%s\r\n",user,host));
WS_Send(S,"mail from: \r\n",13);
- WS_Send(S,ch,strlen(ch));
+ WS_Send(S,ch,(int)strlen(ch));
WS_Send(S,"data\r\n",6);
WS_Send(S,"From:<REM>\r\n\r\n",14);
- WS_Send(S,Msg,strlen(Msg));
+ WS_Send(S,Msg,(int)strlen(Msg));
WS_Send(S,"\r\n.\r\n",5);
WS_Send(S,"quit\r\n",6);
SAFE_FREE((void**)&ch);
diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp index 9939bd1a7c..1febb8376c 100644 --- a/plugins/SecureIM/src/loadicons.cpp +++ b/plugins/SecureIM/src/loadicons.cpp @@ -2,7 +2,7 @@ struct
{
- UINT key; // Resource ID
+ int key; // Resource ID
BYTE tbl; // Table NUM
BYTE idx; // Table IDX
char *section;
|