From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/YAMN/src/proto/pop3/pop3comm.cpp | 76 ++++++++++++++++---------------- plugins/YAMN/src/proto/pop3/pop3opt.cpp | 14 +++--- 2 files changed, 45 insertions(+), 45 deletions(-) (limited to 'plugins/YAMN/src/proto') diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index d4f06bed62..cd8c3121db 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -61,7 +61,7 @@ void __cdecl DeleteMailsPOP3(void *param); //Function makes readable message about error. It sends it back to YAMN, so YAMN then //can show it to the message window -TCHAR* WINAPI GetErrorString(DWORD Code); +wchar_t* WINAPI GetErrorString(DWORD Code); //Function deletes string allocated in GetErrorString void WINAPI DeleteErrorString(LPVOID String); @@ -130,7 +130,7 @@ YAMN_PROTOREGISTRATION POP3ProtocolRegistration = __AUTHORWEB, }; -static TCHAR *FileName = NULL; +static wchar_t *FileName = NULL; HANDLE RegisterNLClient(const char *name); @@ -247,7 +247,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) //You must first register account, before using this function as YAMN must use CreatePOP3Account function to add new accounts //But if CreatePOP3Account is not implemented (equals to NULL), YAMN creates account as YAMN's standard HACCOUNT if (FileName) CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); //shoud not happen (only for secure) - FileName = (TCHAR *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0); + FileName = (wchar_t *)CallService(MS_YAMN_GETFILENAME, (WPARAM)L"pop3", 0); switch (CallService(MS_YAMN_READACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName)) { case EACC_FILEVERSION: @@ -268,7 +268,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) case EACC_SYSTEM: if (ERROR_FILE_NOT_FOUND != GetLastError()) { - TCHAR temp[1024] = { 0 }; + wchar_t temp[1024] = { 0 }; mir_sntprintf(temp, L"%s\n%s", TranslateT("Reading file error. File already in use?"), FileName); MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK); CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0); @@ -343,7 +343,7 @@ DWORD WINAPI WritePOP3Accounts() { DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName); if (ReturnValue == EACC_SYSTEM) { - TCHAR temp[1024] = { 0 }; + wchar_t temp[1024] = { 0 }; mir_sntprintf(temp, L"%s\n%s", TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName); MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK); } @@ -366,7 +366,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End) { DWORD Ver; #ifdef DEBUG_FILEREAD - TCHAR Debug[256]; + wchar_t Debug[256]; #endif Ver = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); @@ -712,7 +712,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) HYAMNMAIL NewMsgsPtr = NULL; for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) { if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) { - TCHAR accstatus[512]; + wchar_t accstatus[512]; mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID); SetAccountStatus(ActualAccount, accstatus); DataRX = MyClient->Top(MsgQueuePtr->Number, 100); @@ -780,7 +780,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) try { - TCHAR accstatus[512]; + wchar_t accstatus[512]; for (i = 0, MsgQueuePtr = NewMails; MsgQueuePtr != NULL; i++) { @@ -1500,46 +1500,46 @@ void ExtractList(char *stream, int len, HYAMNMAIL queue) } } -TCHAR* WINAPI GetErrorString(DWORD Code) +wchar_t* WINAPI GetErrorString(DWORD Code) { - static TCHAR *POP3Errors[] = + static wchar_t *POP3Errors[] = { - LPGENT("Memory allocation error."), //memory allocation - LPGENT("Account is about to be stopped."), //stop account - LPGENT("Cannot connect to POP3 server."), - LPGENT("Cannot allocate memory for received data."), - LPGENT("Cannot login to POP3 server."), - LPGENT("Bad user or password."), - LPGENT("Server does not support APOP authorization."), - LPGENT("Error while executing POP3 command."), - LPGENT("Error while executing POP3 command."), - LPGENT("Error while executing POP3 command."), + LPGENW("Memory allocation error."), //memory allocation + LPGENW("Account is about to be stopped."), //stop account + LPGENW("Cannot connect to POP3 server."), + LPGENW("Cannot allocate memory for received data."), + LPGENW("Cannot login to POP3 server."), + LPGENW("Bad user or password."), + LPGENW("Server does not support APOP authorization."), + LPGENW("Error while executing POP3 command."), + LPGENW("Error while executing POP3 command."), + LPGENW("Error while executing POP3 command."), }; - static TCHAR *NetlibErrors[] = + static wchar_t *NetlibErrors[] = { - LPGENT("Cannot connect to server with NetLib."), - LPGENT("Cannot send data."), - LPGENT("Cannot receive data."), - LPGENT("Cannot allocate memory for received data."), + LPGENW("Cannot connect to server with NetLib."), + LPGENW("Cannot send data."), + LPGENW("Cannot receive data."), + LPGENW("Cannot allocate memory for received data."), }; - static TCHAR *SSLErrors[] = + static wchar_t *SSLErrors[] = { - LPGENT("OpenSSL not loaded."), - LPGENT("Windows socket 2.0 init failed."), - LPGENT("DNS lookup error."), - LPGENT("Error while creating base socket."), - LPGENT("Error connecting to server with socket."), - LPGENT("Error while creating SSL structure."), - LPGENT("Error connecting socket with SSL."), - LPGENT("Server rejected connection with SSL."), - LPGENT("Cannot write SSL data."), - LPGENT("Cannot read SSL data."), - LPGENT("Cannot allocate memory for received data."), + LPGENW("OpenSSL not loaded."), + LPGENW("Windows socket 2.0 init failed."), + LPGENW("DNS lookup error."), + LPGENW("Error while creating base socket."), + LPGENW("Error connecting to server with socket."), + LPGENW("Error while creating SSL structure."), + LPGENW("Error connecting socket with SSL."), + LPGENW("Server rejected connection with SSL."), + LPGENW("Cannot write SSL data."), + LPGENW("Cannot read SSL data."), + LPGENW("Cannot allocate memory for received data."), }; - TCHAR *ErrorString = new TCHAR[ERRORSTR_MAXLEN]; + wchar_t *ErrorString = new wchar_t[ERRORSTR_MAXLEN]; POP3_ERRORCODE *ErrorCode = (POP3_ERRORCODE *)(UINT_PTR)Code; mir_sntprintf(ErrorString, ERRORSTR_MAXLEN, TranslateT("Error %d-%d-%d-%d:"), ErrorCode->AppError, ErrorCode->POP3Error, ErrorCode->NetError, ErrorCode->SystemError); diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 20ae0c8eac..4e083211fd 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -365,7 +365,7 @@ BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam) int i; if ((DWORD)wParam == M_SHOWACTUAL) { - TCHAR accstatus[256]; + wchar_t accstatus[256]; #ifdef DEBUG_SYNCHRO DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n"); #endif @@ -672,7 +672,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_YAMN_CHANGESTATUS: if ((HPOP3ACCOUNT)wParam == ActualAccount) { - TCHAR accstatus[256]; + wchar_t accstatus[256]; GetAccountStatus(ActualAccount, accstatus); SetDlgItemText(hDlg, IDC_STSTATUS, accstatus); return TRUE; @@ -686,7 +686,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_YAMN_CHANGETIME: if ((HPOP3ACCOUNT)wParam == ActualAccount) { - TCHAR Text[256]; + wchar_t Text[256]; mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam); SetDlgItemText(hDlg, IDC_STTIMELEFT, Text); } @@ -829,7 +829,7 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP case IDC_BTNAPP: { - TCHAR filter[MAX_PATH]; + wchar_t filter[MAX_PATH]; mir_sntprintf(filter, L"%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c", TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0); @@ -839,8 +839,8 @@ INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP OFNStruct.lpstrFilter = filter; OFNStruct.nFilterIndex = 1; OFNStruct.nMaxFile = MAX_PATH; - OFNStruct.lpstrFile = new TCHAR[MAX_PATH]; - OFNStruct.lpstrFile[0] = (TCHAR)0; + OFNStruct.lpstrFile = new wchar_t[MAX_PATH]; + OFNStruct.lpstrFile[0] = (wchar_t)0; OFNStruct.lpstrTitle = TranslateT("Select executable used for notification"); OFNStruct.Flags = OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR; if (!GetOpenFileName(&OFNStruct)) { @@ -1373,7 +1373,7 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: { - TCHAR Text[MAX_PATH]; + wchar_t Text[MAX_PATH]; BOOL Translated, CheckPopup, CheckPopupW; BOOL CheckNPopup, CheckNPopupW, CheckFPopup, CheckFPopupW; BOOL CheckPopN; -- cgit v1.2.3