diff options
author | George Hazan <ghazan@miranda.im> | 2021-12-26 15:13:30 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-12-26 15:13:30 +0300 |
commit | d7e53c4d5a748d5ef8c934e90dc59ff23c667420 (patch) | |
tree | 2b0c16de953e182321a0314b6ce3b909f428731f /protocols/YAMN/src | |
parent | 129687d805025b4e292174ffb3d224a55baf24d2 (diff) |
WCHAR -> wchar_t
Diffstat (limited to 'protocols/YAMN/src')
-rw-r--r-- | protocols/YAMN/src/account.cpp | 40 | ||||
-rw-r--r-- | protocols/YAMN/src/browser/badconnect.cpp | 6 | ||||
-rw-r--r-- | protocols/YAMN/src/browser/mailbrowser.cpp | 72 | ||||
-rw-r--r-- | protocols/YAMN/src/debug.cpp | 10 | ||||
-rw-r--r-- | protocols/YAMN/src/debug.h | 4 | ||||
-rw-r--r-- | protocols/YAMN/src/mails/decode.cpp | 20 | ||||
-rw-r--r-- | protocols/YAMN/src/mails/mime.cpp | 12 | ||||
-rw-r--r-- | protocols/YAMN/src/proto/pop3/pop3opt.cpp | 8 | ||||
-rw-r--r-- | protocols/YAMN/src/proto/pop3/pop3opt.h | 2 | ||||
-rw-r--r-- | protocols/YAMN/src/services.cpp | 6 | ||||
-rw-r--r-- | protocols/YAMN/src/stdafx.h | 6 |
11 files changed, 93 insertions, 93 deletions
diff --git a/protocols/YAMN/src/account.cpp b/protocols/YAMN/src/account.cpp index 36ac6e7072..43af27579c 100644 --- a/protocols/YAMN/src/account.cpp +++ b/protocols/YAMN/src/account.cpp @@ -269,23 +269,23 @@ DWORD ReadStringFromMemory(char **Parser, char *End, char **StoreTo) } #if defined(DEBUG_FILEREAD) || defined(DEBUG_FILEREADMESSAGES) -DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *DebugString) +DWORD ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo,wchar_t *DebugString) { //This is the debug version of ReadStringFromMemoryW function. This version shows MessageBox where //read string is displayed - WCHAR *Dest,*Finder; + wchar_t *Dest,*Finder; DWORD Size; - WCHAR Debug[65536]; + wchar_t Debug[65536]; Finder=*Parser; - while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++; - mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); + while((*Finder != (wchar_t)0) && (Finder<=(wchar_t *)End)) Finder++; + mir_snwprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (wchar_t *)End-Finder); MessageBoxW(NULL,Debug,L"debug",MB_OK); - if (Finder>=(WCHAR *)End) + if (Finder>=(wchar_t *)End) return EACC_FILECOMPATIBILITY; if (Size=Finder-*Parser) { - if (NULL==(Dest=*StoreTo=new WCHAR[Size+1])) + if (NULL==(Dest=*StoreTo=new wchar_t[Size+1])) return EACC_ALLOC; for (;*Parser<=Finder;(*Parser)++,Dest++) *Dest=**Parser; @@ -299,18 +299,18 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,wchar_t *End,WCHAR **StoreTo,WCHAR *D } #endif //if defined(DEBUG...) -DWORD ReadStringFromMemoryW(WCHAR **Parser, WCHAR *End, WCHAR **StoreTo) +DWORD ReadStringFromMemoryW(wchar_t **Parser, wchar_t *End, wchar_t **StoreTo) { - WCHAR *Dest, *Finder; + wchar_t *Dest, *Finder; DWORD Size; Finder = *Parser; - while ((*Finder != (WCHAR)0) && (Finder <= (WCHAR *)End)) Finder++; - if (Finder >= (WCHAR *)End) + while ((*Finder != (wchar_t)0) && (Finder <= (wchar_t *)End)) Finder++; + if (Finder >= (wchar_t *)End) return EACC_FILECOMPATIBILITY; if (Size = Finder - *Parser) { - if (nullptr == (Dest = *StoreTo = new WCHAR[Size + 1])) + if (nullptr == (Dest = *StoreTo = new wchar_t[Size + 1])) return EACC_ALLOC; for (; *Parser <= Finder; (*Parser)++, Dest++) *Dest = **Parser; @@ -365,15 +365,15 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT #endif #ifdef DEBUG_FILEREAD - if (Stat=ReadStringFromMemoryW((WCHAR **)Parser,(WCHAR*)End,&Which->App,L"App")) + if (Stat=ReadStringFromMemoryW((wchar_t **)Parser,(wchar_t*)End,&Which->App,L"App")) #else - if (Stat = ReadStringFromMemoryW((WCHAR **)Parser, (WCHAR*)End, &Which->App)) + if (Stat = ReadStringFromMemoryW((wchar_t **)Parser, (wchar_t*)End, &Which->App)) #endif return Stat; #ifdef DEBUG_FILEREAD - if (Stat=ReadStringFromMemoryW((WCHAR **)Parser,(WCHAR*)End,&Which->AppParam,L"AppParam")) + if (Stat=ReadStringFromMemoryW((wchar_t **)Parser,(wchar_t*)End,&Which->AppParam,L"AppParam")) #else - if (Stat = ReadStringFromMemoryW((WCHAR **)Parser, (WCHAR*)End, &Which->AppParam)) + if (Stat = ReadStringFromMemoryW((wchar_t **)Parser, (wchar_t*)End, &Which->AppParam)) #endif return Stat; return 0; @@ -760,20 +760,20 @@ DWORD WriteStringToFile(HANDLE File, char *Source) return 0; } -DWORD WriteStringToFileW(HANDLE File, WCHAR *Source) +DWORD WriteStringToFileW(HANDLE File, wchar_t *Source) { DWORD Length, WrittenBytes; - WCHAR null = (WCHAR)0; + wchar_t null = (wchar_t)0; if ((Source == nullptr) || !(Length = (DWORD)mir_wstrlen(Source))) { - if (!WriteFile(File, &null, sizeof(WCHAR), &WrittenBytes, nullptr)) + if (!WriteFile(File, &null, sizeof(wchar_t), &WrittenBytes, nullptr)) { CloseHandle(File); return EACC_SYSTEM; } } - else if (!WriteFile(File, Source, (Length + 1)*sizeof(WCHAR), &WrittenBytes, nullptr)) + else if (!WriteFile(File, Source, (Length + 1)*sizeof(wchar_t), &WrittenBytes, nullptr)) return EACC_SYSTEM; return 0; } diff --git a/protocols/YAMN/src/browser/badconnect.cpp b/protocols/YAMN/src/browser/badconnect.cpp index 86e202d2e6..04e50b0675 100644 --- a/protocols/YAMN/src/browser/badconnect.cpp +++ b/protocols/YAMN/src/browser/badconnect.cpp @@ -30,11 +30,11 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM DebugLog(SynchroFile, "PopupProc:LEFTCLICK:ActualAccountSO-read enter\n"); #endif if (ActualAccount->BadConnectN.App != nullptr) { - WCHAR *Command; + wchar_t *Command; if (ActualAccount->BadConnectN.AppParam != nullptr) - Command = new WCHAR[mir_wstrlen(ActualAccount->BadConnectN.App) + mir_wstrlen(ActualAccount->BadConnectN.AppParam) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->BadConnectN.App) + mir_wstrlen(ActualAccount->BadConnectN.AppParam) + 6]; else - Command = new WCHAR[mir_wstrlen(ActualAccount->BadConnectN.App) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->BadConnectN.App) + 6]; if (Command != nullptr) { mir_wstrcpy(Command, L"\""); diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp index dc25d78161..4c0b3c285f 100644 --- a/protocols/YAMN/src/browser/mailbrowser.cpp +++ b/protocols/YAMN/src/browser/mailbrowser.cpp @@ -402,7 +402,7 @@ int UpdateMails(HWND hDlg, CAccount *ActualAccount, DWORD nflags, DWORD nnflags) if (RunMailBrowser) { size_t len = mir_strlen(ActualAccount->Name) + mir_strlen(Translate(MAILBROWSERTITLE)) + 10; //+10 chars for numbers char *TitleStrA = new char[len]; - WCHAR *TitleStrW = new WCHAR[len]; + wchar_t *TitleStrW = new wchar_t[len]; mir_snprintf(TitleStrA, len, Translate(MAILBROWSERTITLE), ActualAccount->Name, MN.Real.DisplayUC + MN.Virtual.DisplayUC, MN.Real.Display + MN.Virtual.Display); MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, TitleStrA, -1, TitleStrW, (int)mir_strlen(TitleStrA) + 1); @@ -470,12 +470,12 @@ int ChangeExistingMailStatus(HWND hListView, CAccount *ActualAccount) return TRUE; } -void MimeDateToLocalizedDateTime(char *datein, WCHAR *dateout, int lendateout); +void MimeDateToLocalizedDateTime(char *datein, wchar_t *dateout, int lendateout); int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags) { - WCHAR *FromStr; - WCHAR SizeStr[20]; - WCHAR LocalDateStr[128]; + wchar_t *FromStr; + wchar_t SizeStr[20]; + wchar_t LocalDateStr[128]; LVITEMW item; LVFINDINFO fi; @@ -542,7 +542,7 @@ int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags) if ((UnicodeHeader.From != nullptr) && (UnicodeHeader.FromNick != nullptr)) { size_t size = mir_wstrlen(UnicodeHeader.From) + mir_wstrlen(UnicodeHeader.FromNick) + 4; - FromStr = new WCHAR[size]; + FromStr = new wchar_t[size]; mir_snwprintf(FromStr, size, L"%s <%s>", UnicodeHeader.FromNick, UnicodeHeader.From); FromStrNew = TRUE; } @@ -565,7 +565,7 @@ int AddNewMailsToListView(HWND hListView, CAccount *ActualAccount, DWORD nflags) item.iItem = SendMessage(hListView, LVM_INSERTITEM, 0, (LPARAM)&item); item.iSubItem = 1; - item.pszText = (nullptr != UnicodeHeader.Subject ? UnicodeHeader.Subject : (WCHAR*)L""); + item.pszText = (nullptr != UnicodeHeader.Subject ? UnicodeHeader.Subject : (wchar_t*)L""); SendMessage(hListView, LVM_SETITEMTEXT, (WPARAM)item.iItem, (LPARAM)&item); item.iSubItem = 2; @@ -720,11 +720,11 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, si.cb = sizeof(si); if (ActualAccount->NewMailN.App != nullptr) { - WCHAR *Command; + wchar_t *Command; if (ActualAccount->NewMailN.AppParam != nullptr) - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; else - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; if (Command != nullptr) { mir_wstrcpy(Command, L"\""); @@ -1073,7 +1073,7 @@ ULONGLONG MimeDateToFileTime(char *datein) return res; } -void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateout) +void FileTimeToLocalizedDateTime(LONGLONG filetime, wchar_t *dateout, int lendateout) { int localeID = Langpack_GetDefaultLocale(); //int localeID = MAKELCID(LANG_URDU, SORT_DEFAULT); @@ -1120,7 +1120,7 @@ void FileTimeToLocalizedDateTime(LONGLONG filetime, WCHAR *dateout, int lendateo } } -void MimeDateToLocalizedDateTime(char *datein, WCHAR *dateout, int lendateout) +void MimeDateToLocalizedDateTime(char *datein, wchar_t *dateout, int lendateout) { ULONGLONG ft = MimeDateToFileTime(datein); FileTimeToLocalizedDateTime(ft, dateout, lendateout); @@ -1246,8 +1246,8 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, return mir_callNextSubclass(hwnd, SplitterSubclassProc, msg, wParam, lParam); } -void ConvertCodedStringToUnicode(char *stream, WCHAR **storeto, DWORD cp, int mode); -int ConvertStringToUnicode(char *stream, unsigned int cp, WCHAR **out); +void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, DWORD cp, int mode); +int ConvertStringToUnicode(char *stream, unsigned int cp, wchar_t **out); INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -1255,8 +1255,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR case WM_INITDIALOG: { PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)lParam; - WCHAR *iHeaderW = nullptr; - WCHAR *iValueW = nullptr; + wchar_t *iHeaderW = nullptr; + wchar_t *iValueW = nullptr; int StrLen; HWND hListView = GetDlgItem(hDlg, IDC_LISTHEADERS); mir_subclassWindow(GetDlgItem(hDlg, IDC_SPLITTER), SplitterSubclassProc); @@ -1267,11 +1267,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR ListView_SetExtendedListViewStyle(hListView, LVS_EX_FULLROWSELECT); StrLen = MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, Translate("Header"), -1, nullptr, 0); - iHeaderW = new WCHAR[StrLen + 1]; + iHeaderW = new wchar_t[StrLen + 1]; MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, Translate("Header"), -1, iHeaderW, StrLen); StrLen = MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, Translate("Value"), -1, nullptr, 0); - iValueW = new WCHAR[StrLen + 1]; + iValueW = new wchar_t[StrLen + 1]; MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, Translate("Value"), -1, iValueW, StrLen); LVCOLUMN lvc0 = { LVCF_FMT | LVCF_TEXT | LVCF_WIDTH, LVCFMT_LEFT, 130, iHeaderW, 0, 0 }; @@ -1301,40 +1301,40 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR struct CMimeItem *Header; LVITEMW item; item.mask = LVIF_TEXT | LVIF_PARAM; - WCHAR *From = nullptr, *Subj = nullptr; + wchar_t *From = nullptr, *Subj = nullptr; char *contentType = nullptr, *transEncoding = nullptr, *body = nullptr; //should not be delete[]-ed for (Header = MailParam->mail->MailData->TranslatedHeader; Header != nullptr; Header = Header->Next) { - WCHAR *str1 = nullptr; - WCHAR *str2 = nullptr; - WCHAR str_nul[2] = { 0 }; + wchar_t *str1 = nullptr; + wchar_t *str2 = nullptr; + wchar_t str_nul[2] = { 0 }; if (!body) if (!_stricmp(Header->name, "Body")) { body = Header->value; continue; } if (!contentType) if (!_stricmp(Header->name, "Content-Type")) contentType = Header->value; if (!transEncoding) if (!_stricmp(Header->name, "Content-Transfer-Encoding")) transEncoding = Header->value; //ConvertCodedStringToUnicode(Header->name,&str1,MailParam->mail->MailData->CP,1); { int streamsize = MultiByteToWideChar(20127, 0, Header->name, -1, nullptr, 0); - str1 = (WCHAR *)malloc(sizeof(WCHAR) * (streamsize + 1)); + str1 = (wchar_t *)malloc(sizeof(wchar_t) * (streamsize + 1)); MultiByteToWideChar(20127, 0, Header->name, -1, str1, streamsize);//US-ASCII } ConvertCodedStringToUnicode(Header->value, &str2, MailParam->mail->MailData->CP, 1); - if (!str2) { str2 = (WCHAR *)str_nul; }// the header value may be NULL + if (!str2) { str2 = (wchar_t *)str_nul; }// the header value may be NULL if (!From) if (!_stricmp(Header->name, "From")) { - From = new WCHAR[mir_wstrlen(str2) + 1]; + From = new wchar_t[mir_wstrlen(str2) + 1]; mir_wstrcpy(From, str2); } if (!Subj) if (!_stricmp(Header->name, "Subject")) { - Subj = new WCHAR[mir_wstrlen(str2) + 1]; + Subj = new wchar_t[mir_wstrlen(str2) + 1]; mir_wstrcpy(Subj, str2); } //if (!hasBody) if (!mir_strcmp(Header->name,"Body")) hasBody = true; - int count = 0; WCHAR **split = nullptr; + int count = 0; wchar_t **split = nullptr; int ofs = 0; while (str2[ofs]) { if ((str2[ofs] == 0x266A) || (str2[ofs] == 0x25D9) || (str2[ofs] == 0x25CB) || (str2[ofs] == 0x09) || (str2[ofs] == 0x0A) || (str2[ofs] == 0x0D))count++; ofs++; } - split = new WCHAR*[count + 1]; + split = new wchar_t*[count + 1]; count = 0; ofs = 0; split[0] = str2; while (str2[ofs]) { @@ -1343,7 +1343,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (str2[ofs - 1]) { count++; } - split[count] = (WCHAR *)(str2 + ofs + 1); + split[count] = (wchar_t *)(str2 + ofs + 1); str2[ofs] = 0; } ofs++; @@ -1370,11 +1370,11 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (str1) free(str1); - if (str2 != (WCHAR *)str_nul) + if (str2 != (wchar_t *)str_nul) free(str2); } if (body) { - WCHAR *bodyDecoded = nullptr; + wchar_t *bodyDecoded = nullptr; char *localBody = nullptr; if (contentType) { if (!_strnicmp(contentType, "text", 4)) { @@ -1422,9 +1422,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR } ShowWindow(GetDlgItem(hDlg, IDC_SPLITTER), (MailParam->mail->Flags & YAMN_MSG_BODYRECEIVED) ? SW_SHOW : SW_HIDE); ShowWindow(hEdit, (MailParam->mail->Flags & YAMN_MSG_BODYRECEIVED) ? SW_SHOW : SW_HIDE); - WCHAR *title = nullptr; + wchar_t *title = nullptr; size_t size = (From ? mir_wstrlen(From) : 0) + (Subj ? mir_wstrlen(Subj) : 0) + 4; - title = new WCHAR[size]; + title = new wchar_t[size]; if (From && Subj) mir_snwprintf(title, size, L"%s (%s)", Subj, From); else if (From) @@ -1955,11 +1955,11 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (WAIT_OBJECT_0 == WaitToReadFcn(ActualAccount->AccountAccessSO)) { if (ActualAccount->NewMailN.App != nullptr) { - WCHAR *Command; + wchar_t *Command; if (ActualAccount->NewMailN.AppParam != nullptr) - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; else - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; if (Command != nullptr) { mir_wstrcpy(Command, L"\""); diff --git a/protocols/YAMN/src/debug.cpp b/protocols/YAMN/src/debug.cpp index 971b3dcbce..2f5c1d4761 100644 --- a/protocols/YAMN/src/debug.cpp +++ b/protocols/YAMN/src/debug.cpp @@ -103,23 +103,23 @@ void DebugLog(HANDLE File,const char *fmt,...) free(str); } -void DebugLogW(HANDLE File,const WCHAR *fmt,...) +void DebugLogW(HANDLE File,const wchar_t *fmt,...) { - WCHAR *str; + wchar_t *str; char tids[32]; va_list vararg; int strsize; DWORD Written; va_start(vararg,fmt); - str=(WCHAR *)malloc((strsize=65536)*sizeof(WCHAR)); + str=(wchar_t *)malloc((strsize=65536)*sizeof(wchar_t)); mir_snprintf(tids, "[%x]",GetCurrentThreadId()); while(mir_vsnwprintf(str, strsize, fmt, vararg)==-1) - str=(WCHAR *)realloc(str,(strsize+=65536)*sizeof(WCHAR)); + str=(wchar_t *)realloc(str,(strsize+=65536)*sizeof(wchar_t)); va_end(vararg); EnterCriticalSection(&FileAccessCS); WriteFile(File,tids,(DWORD)mir_strlen(tids),&Written,nullptr); - WriteFile(File,str,(DWORD)mir_wstrlen(str)*sizeof(WCHAR),&Written,nullptr); + WriteFile(File,str,(DWORD)mir_wstrlen(str)*sizeof(wchar_t),&Written,nullptr); LeaveCriticalSection(&FileAccessCS); free(str); } diff --git a/protocols/YAMN/src/debug.h b/protocols/YAMN/src/debug.h index a28add5662..f0405d7453 100644 --- a/protocols/YAMN/src/debug.h +++ b/protocols/YAMN/src/debug.h @@ -13,7 +13,7 @@ //#define DEBUG_FILEREADMESSAGES //debug file reading messages to message boxes void DebugLog(HANDLE,const char *fmt,...); -void DebugLogW(HANDLE File,const WCHAR *fmt,...); +void DebugLogW(HANDLE File,const wchar_t *fmt,...); #ifdef DEBUG_SYNCHRO // Used for synchronization debug @@ -38,7 +38,7 @@ DWORD ReadStringFromMemoryW(char **Parser,wchar_t *End,char **StoreTo,wchar_t *D #else DWORD ReadStringFromMemory(char **Parser,char *End,char **StoreTo); -DWORD ReadStringFromMemoryW(WCHAR **Parser,WCHAR *End,WCHAR **StoreTo); +DWORD ReadStringFromMemoryW(wchar_t **Parser,wchar_t *End,wchar_t **StoreTo); #endif diff --git a/protocols/YAMN/src/mails/decode.cpp b/protocols/YAMN/src/mails/decode.cpp index 5ac1346c7c..39e04a0ba9 100644 --- a/protocols/YAMN/src/mails/decode.cpp +++ b/protocols/YAMN/src/mails/decode.cpp @@ -191,14 +191,14 @@ int DecodeBase64(char *Src,char *Dst,int DstLen); // stream- input string // cp- codepage of input string // out- pointer to new allocated memory that contains unicode string -int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out); +int ConvertStringToUnicode(char *stream,unsigned int cp,wchar_t **out); //Converts string from MIME header to unicode // stream- input string // cp- codepage of input string // storeto- pointer to memory that contains unicode string // mode- MIME_PLAIN or MIME_MAIL (MIME_MAIL deletes '"' from start and end of string) -void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode); +void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,DWORD cp,int mode); //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- @@ -382,10 +382,10 @@ end: -int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out) +int ConvertStringToUnicode(char *stream,unsigned int cp,wchar_t **out) { CPINFO CPInfo; - WCHAR *temp,*src=*out,*dest; + wchar_t *temp,*src=*out,*dest; size_t outlen; int streamlen,Index; @@ -413,11 +413,11 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out) outlen=mir_wstrlen(*out); else outlen=0; - temp=new WCHAR[streamlen+outlen+1]; + temp=new wchar_t[streamlen+outlen+1]; if (*out != nullptr) { - for (dest=temp;*src != (WCHAR)0;src++,dest++) //copy old string from *out to temp + for (dest=temp;*src != (wchar_t)0;src++,dest++) //copy old string from *out to temp *dest=*src; // *dest++=L' '; //add space? delete[] *out; @@ -439,7 +439,7 @@ int ConvertStringToUnicode(char *stream,unsigned int cp,WCHAR **out) return 1; } -void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode) +void ConvertCodedStringToUnicode(char *stream,wchar_t **storeto,DWORD cp,int mode) { char *start=stream,*finder,*finderend; char Encoding=0; @@ -448,7 +448,7 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode) return; while(WS(start)) start++; - WCHAR *tempstore=nullptr; + wchar_t *tempstore=nullptr; if (!ConvertStringToUnicode(stream,cp,&tempstore))return; size_t tempstoreLength = mir_wstrlen(tempstore); @@ -530,10 +530,10 @@ void ConvertCodedStringToUnicode(char *stream,WCHAR **storeto,DWORD cp,int mode) DecodedResult[len+1]=0; finderend++; } - WCHAR *oneWord=nullptr; + wchar_t *oneWord=nullptr; if (ConvertStringToUnicode(DecodedResult,cp,&oneWord)) { size_t len = mir_wstrlen(oneWord); - memcpy(&tempstore[outind],oneWord,len*sizeof(WCHAR)); + memcpy(&tempstore[outind],oneWord,len*sizeof(wchar_t)); outind += len; } delete oneWord; diff --git a/protocols/YAMN/src/mails/mime.cpp b/protocols/YAMN/src/mails/mime.cpp index 8db0b045d9..37afafc2d7 100644 --- a/protocols/YAMN/src/mails/mime.cpp +++ b/protocols/YAMN/src/mails/mime.cpp @@ -481,7 +481,7 @@ struct APartDataType BYTE TransEncType; //TE_something char *body; int bodyLen; - WCHAR *wBody; + wchar_t *wBody; }; @@ -567,16 +567,16 @@ void ParseAPart(APartDataType *data) //from decode.cpp int DecodeQuotedPrintable(char *Src, char *Dst, int DstLen, BOOL isQ); int DecodeBase64(char *Src, char *Dst, int DstLen); -int ConvertStringToUnicode(char *stream, unsigned int cp, WCHAR **out); +int ConvertStringToUnicode(char *stream, unsigned int cp, wchar_t **out); -WCHAR *ParseMultipartBody(char *src, char *bond) +wchar_t *ParseMultipartBody(char *src, char *bond) { char *srcback = _strdup(src); size_t sizebond = mir_strlen(bond); int numparts = 1; int i; char *courbond = srcback; - WCHAR *dest; + wchar_t *dest; for (; (courbond = strstr(courbond, bond)); numparts++, courbond += sizebond); APartDataType *partData = new APartDataType[numparts]; memset(partData, 0, sizeof(APartDataType)*numparts); @@ -637,7 +637,7 @@ FailBackRaw: }// if (partData[i].body) resultSize += 100 + 4 + 3; //cr+nl+100+ 3*bullet } - dest = new WCHAR[resultSize + 1]; + dest = new wchar_t[resultSize + 1]; size_t destpos = 0; for (i = 0; i < numparts; i++) { if (i) { // part before first boudary should not have headers @@ -673,7 +673,7 @@ FailBackRaw: } mir_snprintf(infoline + linesize, _countof(infoline) - linesize, ".\r\n"); { - WCHAR *temp = nullptr; + wchar_t *temp = nullptr; dest[destpos] = dest[destpos + 1] = dest[destpos + 2] = 0x2022; // bullet; destpos += 3; ConvertStringToUnicode(infoline, CP_ACP, &temp); diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp index fc111ef7c7..a24eba24e2 100644 --- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp @@ -508,7 +508,7 @@ BOOL DlgSetItemText(HWND hDlg, WPARAM wParam, const char* str) return TRUE; } -BOOL DlgSetItemTextW(HWND hDlg, WPARAM wParam, const WCHAR* str) +BOOL DlgSetItemTextW(HWND hDlg, WPARAM wParam, const wchar_t* str) { if (str == nullptr) SetDlgItemTextW(hDlg, wParam, L""); @@ -846,7 +846,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_NOTIFY: if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) { char Text[MAX_PATH]; - WCHAR TextW[MAX_PATH]; + wchar_t TextW[MAX_PATH]; BOOL Translated, NewAcc = FALSE, Check, CheckMsg, CheckSnd, CheckIco, CheckApp, CheckAPOP; BOOL CheckNMsgP, CheckFMsg, CheckFSnd, CheckFIco; BOOL CheckKBN, CheckContact, CheckContactNick, CheckContactNoEvent; @@ -981,13 +981,13 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP GetDlgItemTextW(hDlg, IDC_EDITAPP, TextW, _countof(TextW)); if (nullptr != ActualAccount->NewMailN.App) delete[] ActualAccount->NewMailN.App; - ActualAccount->NewMailN.App = new WCHAR[mir_wstrlen(TextW) + 1]; + ActualAccount->NewMailN.App = new wchar_t[mir_wstrlen(TextW) + 1]; mir_wstrcpy(ActualAccount->NewMailN.App, TextW); GetDlgItemTextW(hDlg, IDC_EDITAPPPARAM, TextW, _countof(TextW)); if (nullptr != ActualAccount->NewMailN.AppParam) delete[] ActualAccount->NewMailN.AppParam; - ActualAccount->NewMailN.AppParam = new WCHAR[mir_wstrlen(TextW) + 1]; + ActualAccount->NewMailN.AppParam = new wchar_t[mir_wstrlen(TextW) + 1]; mir_wstrcpy(ActualAccount->NewMailN.AppParam, TextW); ActualAccount->Server->Port = Port; diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.h b/protocols/YAMN/src/proto/pop3/pop3opt.h index 245f7679a4..d6a49c59a8 100644 --- a/protocols/YAMN/src/proto/pop3/pop3opt.h +++ b/protocols/YAMN/src/proto/pop3/pop3opt.h @@ -31,7 +31,7 @@ int POP3OptInit(WPARAM wParam,LPARAM lParam); //Sets dialog item text BOOL DlgSetItemText(HWND hDlg,WPARAM wParam,const char*); -BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const WCHAR*); +BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const wchar_t*); #define DlgSetItemTextT DlgSetItemTextW diff --git a/protocols/YAMN/src/services.cpp b/protocols/YAMN/src/services.cpp index 5126aba275..98fd18f24d 100644 --- a/protocols/YAMN/src/services.cpp +++ b/protocols/YAMN/src/services.cpp @@ -84,11 +84,11 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM) DebugLog(SynchroFile, "ContactApplication:ualAccountSO-read enter\n"); #endif if (ActualAccount->NewMailN.App != nullptr) { - WCHAR *Command; + wchar_t *Command; if (ActualAccount->NewMailN.AppParam != nullptr) - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + mir_wstrlen(ActualAccount->NewMailN.AppParam) + 6]; else - Command = new WCHAR[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; + Command = new wchar_t[mir_wstrlen(ActualAccount->NewMailN.App) + 6]; if (Command != nullptr) { mir_wstrcpy(Command, L"\""); diff --git a/protocols/YAMN/src/stdafx.h b/protocols/YAMN/src/stdafx.h index 2858640d6b..3c9f07cd79 100644 --- a/protocols/YAMN/src/stdafx.h +++ b/protocols/YAMN/src/stdafx.h @@ -94,7 +94,7 @@ DWORD ReadAccountFromMemory(CAccount *Which, char **Parser, wchar_t *End); INT_PTR AddAccountsFromFileSvc(WPARAM wParam, LPARAM lParam); DWORD WriteStringToFile(HANDLE File, char *Source); -DWORD WriteStringToFileW(HANDLE File, WCHAR *Source); +DWORD WriteStringToFileW(HANDLE File, wchar_t *Source); DWORD WriteMessagesToFile(HANDLE File, CAccount *Which); @@ -203,7 +203,7 @@ void ExtractShortHeader(struct CMimeItem *items, struct CShortHeader *head); void DeleteHeaderContent(struct CHeader *head); void DeleteShortHeaderContent(struct CShortHeader *head); char *ExtractFromContentType(char *ContentType, char *value); -WCHAR *ParseMultipartBody(char *src, char *bond); +wchar_t *ParseMultipartBody(char *src, char *bond); //From account.cpp void WINAPI GetStatusFcn(CAccount *Which, wchar_t *Value); @@ -246,7 +246,7 @@ extern struct WndHandles *MessageWnd; extern int GetCharsetFromString(char *input, size_t size); extern void SendMsgToRecepients(struct WndHandles *FirstWin, UINT msg, WPARAM wParam, LPARAM lParam); -extern void ConvertCodedStringToUnicode(char *stream, WCHAR **storeto, DWORD cp, int mode); +extern void ConvertCodedStringToUnicode(char *stream, wchar_t **storeto, DWORD cp, int mode); extern void __cdecl MailBrowser(void *Param); extern DWORD WINAPI NoNewMailProc(LPVOID Param); extern void __cdecl BadConnection(void *Param); |