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 --- protocols/Sametime/src/conference.cpp | 30 ++++++++++++++--------------- protocols/Sametime/src/files.cpp | 16 +++++++-------- protocols/Sametime/src/messaging.cpp | 4 ++-- protocols/Sametime/src/options.cpp | 18 ++++++++--------- protocols/Sametime/src/sametime.cpp | 2 +- protocols/Sametime/src/sametime_proto.cpp | 18 ++++++++--------- protocols/Sametime/src/sametime_proto.h | 28 +++++++++++++-------------- protocols/Sametime/src/sametime_session.cpp | 14 +++++++------- protocols/Sametime/src/userlist.cpp | 16 +++++++-------- protocols/Sametime/src/utils.cpp | 10 +++++----- 10 files changed, 78 insertions(+), 78 deletions(-) (limited to 'protocols/Sametime/src') diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 46cf1bbf83..71c0528eb0 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -108,8 +108,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) CSametimeProto* proto = getProtoFromMwConference(conf); proto->debugLog(L"mwServiceConf_conf_opened() start"); - TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); - TCHAR* tszConfTitle = mir_utf8decodeT(mwConference_getTitle(conf)); + wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); + wchar_t* tszConfTitle = mir_utf8decodeT(mwConference_getTitle(conf)); // create new chat session GCSESSION gcs = { sizeof(gcs) }; @@ -141,8 +141,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) for (;user; user=user->next) { proto->debugLog(L"mwServiceConf_conf_opened() add user"); - TCHAR* tszUserName = mir_utf8decodeT(((mwLoginInfo*)user->data)->user_name); - TCHAR* tszUserId = mir_utf8decodeT(((mwLoginInfo*)user->data)->login_id); + wchar_t* tszUserName = mir_utf8decodeT(((mwLoginInfo*)user->data)->user_name); + wchar_t* tszUserId = mir_utf8decodeT(((mwLoginInfo*)user->data)->login_id); gce.ptszNick = tszUserName; gce.ptszUID = tszUserId; gce.bIsMe = (strcmp(((mwLoginInfo*)user->data)->login_id, proto->my_login_info->login_id) == 0); @@ -173,7 +173,7 @@ void mwServiceConf_conf_closed(mwConference* conf, guint32 reason) CSametimeProto* proto = getProtoFromMwConference(conf); proto->debugLog(L"mwServiceConf_conf_closed() start"); - TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); + wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); GCDEST gcd = { proto->m_szModuleName }; gcd.ptszID = tszConfId; @@ -261,7 +261,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh CSametimeProto* proto = getProtoFromMwConference(conf); proto->debugLog(L"mwServiceConf_on_text() start"); - TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); + wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf)); GCDEST gcd = { proto->m_szModuleName }; gcd.ptszID = tszConfId; @@ -270,9 +270,9 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh GCEVENT gce = { sizeof(gce), &gcd }; gce.dwFlags = GCEF_ADDTOLOG; - TCHAR* textT = mir_utf8decodeT(what); - TCHAR* tszUserName = mir_utf8decodeT(user->user_name); - TCHAR* tszUserId = mir_utf8decodeT(user->login_id); + wchar_t* textT = mir_utf8decodeT(what); + wchar_t* tszUserName = mir_utf8decodeT(user->user_name); + wchar_t* tszUserId = mir_utf8decodeT(user->login_id); gce.ptszText = textT; gce.ptszNick = tszUserName; gce.ptszUID = tszUserId; @@ -319,7 +319,7 @@ void CSametimeProto::TerminateConference(char* name) for (;conf;conf = conf->next) { if (strcmp(name, mwConference_getName((mwConference*)conf->data)) == 0) { - TCHAR* idt = mir_utf8decodeT(name); + wchar_t* idt = mir_utf8decodeT(name); GCDEST gcd = {m_szModuleName, idt, GC_EVENT_CONTROL}; GCEVENT gce = { sizeof(gce), &gcd }; @@ -341,7 +341,7 @@ int CSametimeProto::GcEventHook(WPARAM wParam, LPARAM lParam) { GList *conferences = mwServiceConference_getConferences(service_conference); for (GList *conf = conferences;conf;conf = conf->next) { - TCHAR* tszConfId = mir_utf8decodeT(mwConference_getName((mwConference*)conf->data)); + wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName((mwConference*)conf->data)); if (mir_tstrcmp(gch->pDest->ptszID, tszConfId) == 0) { switch(gch->pDest->iType) { case GC_USER_MESSAGE: @@ -405,8 +405,8 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) mwAwareIdBlock id_block; mwIdBlock idb; if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) { - TCHAR title[512]; - TCHAR* ts = mir_utf8decodeT(my_login_info->user_name); + wchar_t title[512]; + wchar_t* ts = mir_utf8decodeT(my_login_info->user_name); mir_sntprintf(title, TranslateT("%s's conference"), ts); mir_free(ts); @@ -509,13 +509,13 @@ void CSametimeProto::InitConferenceMenu() mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE; SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d); - mi.name.t = LPGENT("Leave conference"); + mi.name.w = LPGENW("Leave conference"); mi.pszService = MS_SAMETIME_MENULEAVECHAT; mi.hIcolibItem = GetIconHandle(IDI_ICON_LEAVE); hLeaveChatMenuItem = Menu_AddContactMenuItem(&mi, m_szModuleName); SET_UID(mi, 0x45501e10, 0x2914, 0x4daa, 0xb4, 0xcf, 0x83, 0x8a, 0x6a, 0x14, 0xd, 0x7); - mi.name.t = LPGENT("Start conference"); + mi.name.w = LPGENW("Start conference"); mi.pszService = MS_SAMETIME_MENUCREATECHAT; mi.hIcolibItem = GetIconHandle(IDI_ICON_INVITE); hCreateChatMenuItem = Menu_AddContactMenuItem(&mi); diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index bbc71b346b..567520469a 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -28,22 +28,22 @@ void mwFileTransfer_offered(mwFileTransfer* ft) proto->ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)ft, 0); - TCHAR* filenameT = mir_utf8decodeT(mwFileTransfer_getFileName(ft)); + wchar_t* filenameT = mir_utf8decodeT(mwFileTransfer_getFileName(ft)); const char* message = mwFileTransfer_getMessage(ft); - TCHAR descriptionT[512]; + wchar_t descriptionT[512]; if (message) { - TCHAR* messageT = mir_utf8decodeT(message); + wchar_t* messageT = mir_utf8decodeT(message); mir_sntprintf(descriptionT, L"%s - %s", filenameT, messageT); mir_free(messageT); } else - _tcsncpy_s(descriptionT, filenameT, _TRUNCATE); + wcsncpy_s(descriptionT, filenameT, _TRUNCATE); PROTORECVFILET pre = {0}; pre.dwFlags = PRFF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); - pre.descr.t = descriptionT; - pre.files.t = &filenameT; + pre.descr.w = descriptionT; + pre.files.w = &filenameT; pre.lParam = (LPARAM)ft; ProtoChainRecvFile(hContact, &pre); @@ -282,7 +282,7 @@ mwFileTransferHandler mwFileTransfer_handler = { mwFileTransfer_clear }; -HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, TCHAR** files, const TCHAR* ptszDesc) +HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, wchar_t** files, const wchar_t* ptszDesc) { debugLog(L"CSametimeProto::SendFilesToUser() start"); @@ -300,7 +300,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, TCHAR** files, const T if (hFile != INVALID_HANDLE_VALUE) { DWORD filesize = GetFileSize(hFile, 0); - TCHAR *fn = _tcsrchr(files[i], '\\'); + wchar_t *fn = wcsrchr(files[i], '\\'); if (fn) fn++; else diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index 2bde61b90e..a6092c0c21 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -95,9 +95,9 @@ void mwIm_place_invite(struct mwConversation* conv, const char* message, const c ///TODO unimplemented - TCHAR* tszMessage = mir_utf8decodeT(message); + wchar_t* tszMessage = mir_utf8decodeT(message); - TCHAR msg[512]; + wchar_t msg[512]; mir_sntprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage); proto->showPopup(msg, SAMETIME_POPUP_INFO); diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index 9f31d92ba6..aa08112856 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -6,7 +6,7 @@ #define NUM_IDS 24 -TCHAR* client_names[NUM_IDS] = { +wchar_t* client_names[NUM_IDS] = { L"Official Binary Library", L"Official Java Applet", L"Official Binary Application", @@ -65,7 +65,7 @@ int client_ids[NUM_IDS] = { #define NUM_CVS 5 -TCHAR* CV_names[NUM_CVS] = { +wchar_t* CV_names[NUM_CVS] = { L"Sametime (Use old client version)", L"Sametime (Miranda default)", L"Sametime 8", @@ -102,19 +102,19 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA WORD client_ver = proto->GetClientVersion(); if (client_ver) { - TCHAR verbuf[100]; + wchar_t verbuf[100]; mir_sntprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF); SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf); } WORD server_ver = proto->GetServerVersion(); if (server_ver) { - TCHAR verbuf[100]; + wchar_t verbuf[100]; mir_sntprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF); SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf); } - TCHAR *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s); + wchar_t *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s); s = mir_utf8decodeT(proto->options.id); SetDlgItemText(hwndDlg, IDC_ED_NAME, s); mir_free(s); s = mir_utf8decodeT(proto->options.pword); SetDlgItemText(hwndDlg, IDC_ED_PWORD, s); mir_free(s); @@ -230,7 +230,7 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case IDC_BTN_IMPORTCONTACTS: { - TCHAR import_filename[MAX_PATH]; import_filename[0] = 0; + wchar_t import_filename[MAX_PATH]; import_filename[0] = 0; OPENFILENAME ofn = { 0 }; ofn.lStructSize = sizeof(ofn); @@ -291,7 +291,7 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case WM_NOTIFY: if (((LPNMHDR)lParam)->code == PSN_APPLY) { - TCHAR ws[2048]; + wchar_t ws[2048]; GetDlgItemText(hwndDlg, IDC_ED_SNAME, ws, LSTRINGLEN); mir_strcpy(proto->options.server_name, T2Utf(ws)); @@ -350,8 +350,8 @@ int CSametimeProto::OptInit(WPARAM wParam, LPARAM) odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; odp.hInstance = hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTNET); - odp.ptszTitle = m_tszUserName; - odp.ptszGroup = LPGENT("Network"); + odp.pwszTitle = m_tszUserName; + odp.pwszGroup = LPGENW("Network"); odp.pfnDlgProc = DlgProcOptNet; odp.dwInitParam = (LPARAM)this; Options_AddPage(wParam, &odp); diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 6a9e9a3169..0a950bc123 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -248,7 +248,7 @@ void CSametimeProto::BroadcastNewStatus(int iNewStatus) ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)previous_status, m_iStatus); } -static CSametimeProto* sametime_proto_init(const char* pszProtoName, const TCHAR* tszUserName) +static CSametimeProto* sametime_proto_init(const char* pszProtoName, const wchar_t* tszUserName) { CSametimeProto* proto = new CSametimeProto(pszProtoName, tszUserName); g_Instances.insert(proto); diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 4278a309c8..ca84865901 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "sametime.h" -CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserName) : +CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserName) : PROTO(pszProtoName, tszUserName), is_idle(false), idle_status(false), first_online(true), @@ -14,7 +14,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam server_connection(0) { // Register m_hNetlibUser user - TCHAR name[128]; + wchar_t name[128]; mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { 0 }; nlu.cbSize = sizeof(nlu); @@ -83,7 +83,7 @@ MCONTACT CSametimeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddSearchedUser(sr, flags & PALF_TEMPORARY); } -HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath) +HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) { debugLog(L"CSametimeProto::FileAllow() hContact=[%x], szPath=[%s]", hContact, szPath); char* szPathA = mir_t2a(szPath); @@ -99,14 +99,14 @@ int CSametimeProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) return 0; } -int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason) +int CSametimeProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) { debugLog(L"CSametimeProto::FileDeny() hContact=[%x], szReason=[%s]", hContact, szReason); RejectFileTransfer(hTransfer); return 0; } -int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename) +int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) { debugLog(L"CSametimeProto::FileResume() action=[%d]", &action); return 0; @@ -157,7 +157,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType) return 0; } -HANDLE CSametimeProto::SearchBasic(const TCHAR* id) +HANDLE CSametimeProto::SearchBasic(const wchar_t* id) { debugLog(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_tstrlen(id)); return (HANDLE)SearchForUser(T2Utf(id), FALSE); @@ -166,7 +166,7 @@ HANDLE CSametimeProto::SearchBasic(const TCHAR* id) HWND CSametimeProto::SearchAdvanced(HWND owner) { - TCHAR buf[512]; + wchar_t buf[512]; if (GetDlgItemText(owner, IDC_EDIT1, buf, _countof(buf))) { debugLog(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_tstrlen(buf)); return (HWND)SearchForUser(T2Utf(buf), TRUE); @@ -201,7 +201,7 @@ int CSametimeProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) return Proto_RecvMessage(hContact, pre); } -HANDLE CSametimeProto::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles) +HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) { debugLog(L"CSametimeProto::SendFile() hContact=[%x]", hContact); if (m_iStatus != ID_STATUS_OFFLINE) { @@ -282,7 +282,7 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt return 0; } -int CSametimeProto::SetAwayMsg(int iStatus, const TCHAR* msg) +int CSametimeProto::SetAwayMsg(int iStatus, const wchar_t* msg) { debugLog(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_tstrlen(msg)); SetSessionAwayMessage(iStatus, msg); diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index 7b51b77476..4e652a5dd8 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -7,7 +7,7 @@ struct CSametimeProto : public PROTO { - CSametimeProto(const char*, const TCHAR* ); + CSametimeProto(const char*, const wchar_t* ); ~CSametimeProto(); //==================================================================================== @@ -17,29 +17,29 @@ struct CSametimeProto : public PROTO virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szPath); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath); virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const TCHAR* szReason); - virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason); + virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename); virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); - virtual HANDLE __cdecl SearchBasic(const TCHAR* id); + virtual HANDLE __cdecl SearchBasic(const wchar_t* id); virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILET*); virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); - virtual HANDLE __cdecl SendFile(MCONTACT hContact, const TCHAR* szDescription, TCHAR** ppszFiles); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles); virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); virtual int __cdecl SetStatus(int iNewStatus); virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); - virtual int __cdecl SetAwayMsg(int iStatus, const TCHAR* msg); + virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg); virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); @@ -73,7 +73,7 @@ struct CSametimeProto : public PROTO bool GetAwareIdFromContact(MCONTACT hContact, mwAwareIdBlock* id_block); MCONTACT FindContactByUserId(const char* id); void ImportContactsFromList(mwSametimeList* user_list, bool temporary); - void ImportContactsFromFile(TCHAR* filename); + void ImportContactsFromFile(wchar_t* filename); void ExportContactsToList(mwSametimeList* user_list); void ExportContactsToServer(); void UserListAddStored(); @@ -93,7 +93,7 @@ struct CSametimeProto : public PROTO HANDLE AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* save_path); void RejectFileTransfer(HANDLE hFt); void CancelFileTransfer(HANDLE hFt); - HANDLE SendFilesToUser(MCONTACT hContact, TCHAR** files, const TCHAR* pszDesc); + HANDLE SendFilesToUser(MCONTACT hContact, wchar_t** files, const wchar_t* pszDesc); // conference.cpp void InitConference(); @@ -117,7 +117,7 @@ struct CSametimeProto : public PROTO int SetSessionStatus(int status); void UpdateSelfStatus(); int SetIdle(bool idle); - void SetSessionAwayMessage(int status, const TCHAR* msg); + void SetSessionAwayMessage(int status, const wchar_t* msg); WORD GetClientVersion(); WORD GetServerVersion(); INT_PTR __cdecl SessionAnnounce(WPARAM wParam, LPARAM lParam); @@ -132,7 +132,7 @@ struct CSametimeProto : public PROTO void SaveOptions(); // utils.cpp - void showPopup(const TCHAR* msg, SametimePopupEnum flag); + void showPopup(const wchar_t* msg, SametimePopupEnum flag); void showPopup(guint32 code); void RegisterPopups(); void UnregisterPopups(); @@ -207,7 +207,7 @@ typedef struct tag_TFakeAckParams { struct SendAnnouncementFunc_arg { CSametimeProto* proto; - TCHAR msg[MAX_MESSAGE_SIZE]; + wchar_t msg[MAX_MESSAGE_SIZE]; GList* recipients; }; @@ -221,8 +221,8 @@ struct SessionAnnounceDialogProc_arg { struct PopupData { SametimePopupEnum flag; - TCHAR* title; - TCHAR* text; + wchar_t* title; + wchar_t* text; CSametimeProto* proto; }; diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 496b1ea95e..6fa0644c75 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -137,7 +137,7 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text) { CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR"); proto->debugLog(L"SessionAdmin()"); - TCHAR* tt = mir_utf8decodeT(text); + wchar_t* tt = mir_utf8decodeT(text); MessageBox(0, tt, TranslateT("Sametime administrator message"), MB_OK); mir_free(tt); } @@ -146,9 +146,9 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from { CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR"); proto->debugLog(L"SessionAnnounce()"); - TCHAR* stzFrom; - TCHAR* stzText; - TCHAR stzFromBuff[256]; + wchar_t* stzFrom; + wchar_t* stzText; + wchar_t stzFromBuff[256]; stzFrom = mir_utf8decodeT(from->user_name); stzText = mir_utf8decodeT(text); mir_sntprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom); @@ -208,7 +208,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) break; default: - TCHAR buff[512]; + wchar_t buff[512]; mir_sntprintf(buff, TranslateT("Unknown user status: %d"), us.status); proto->showPopup(buff, SAMETIME_POPUP_ERROR); proto->debugLog(buff); @@ -311,7 +311,7 @@ int CSametimeProto::SetIdle(bool idle) return 0; } -void CSametimeProto::SetSessionAwayMessage(int status, const TCHAR* msgT) +void CSametimeProto::SetSessionAwayMessage(int status, const wchar_t* msgT) { debugLog(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_tstrlen(msgT)); @@ -578,7 +578,7 @@ void CSametimeProto::InitSessionMenu() CMenuItem mi; mi.flags = CMIF_TCHAR; mi.position = 2000060000; - mi.name.t = LPGENT("Send announcement..."); + mi.name.w = LPGENW("Send announcement..."); mi.pszService = MS_SAMETIME_MENUANNOUNCESESSION; mi.hIcolibItem = GetIconHandle(IDI_ICON_ANNOUNCE); Menu_AddContactMenuItem(&mi, m_szModuleName); diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 3766dc73f7..4660b68c8f 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -298,7 +298,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) } } -void CSametimeProto::ImportContactsFromFile(TCHAR* filename) +void CSametimeProto::ImportContactsFromFile(wchar_t* filename) { debugLog(L"CSametimeProto::ImportContactsFromFile() start"); std::ifstream in(filename); @@ -654,8 +654,8 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code mcsr.psr.nick.a = mcsr.name; mcsr.nFieldCount = 4; - TCHAR fields[4][512]; - TCHAR *fields_addr[4]; + wchar_t fields[4][512]; + wchar_t *fields_addr[4]; mcsr.pszFields = fields_addr; mcsr.pszFields[0] = fields[0]; mcsr.pszFields[1] = fields[1]; @@ -665,10 +665,10 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code if (advanced == TRUE) { // send column names mcsr.psr.cbSize = 0; - _tcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512); - _tcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512); - _tcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512); - _tcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512); + wcsncpy(mcsr.pszFields[0], TranslateT("ID"), 512); + wcsncpy(mcsr.pszFields[1], TranslateT("Name"), 512); + wcsncpy(mcsr.pszFields[2], TranslateT("Description"), 512); + wcsncpy(mcsr.pszFields[3], TranslateT("Group?"), 512); proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr); } @@ -689,7 +689,7 @@ void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code mcsr.pszFields[2][0] = 0; mcsr.group = (((mwResolveMatch *)mri->data)->type == mwResolveMatch_GROUP); - _tcsncpy_s(mcsr.pszFields[3], 512, mcsr.group ? TranslateT("True") : TranslateT("False"), _TRUNCATE); + wcsncpy_s(mcsr.pszFields[3], 512, mcsr.group ? TranslateT("True") : TranslateT("False"), _TRUNCATE); if (advanced == TRUE) proto->ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, (HANDLE)id, (LPARAM)&mcsr); diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index 0a73ddce90..0e24204f8d 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -29,7 +29,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar void CSametimeProto::RegisterPopups() { - TCHAR szDescr[256]; + wchar_t szDescr[256]; char szName[256]; debugLog(L"CSametimeProto::RegisterPopups()"); @@ -86,8 +86,8 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) if (disp == ED_POP) { POPUPDATACLASS ppd = { sizeof(ppd) }; char szName[256]; - ppd.ptszTitle = puData->title; - ppd.ptszText = puData->text; + ppd.pwszTitle = puData->title; + ppd.pwszText = puData->text; if (puData->flag == SAMETIME_POPUP_ERROR) mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Error"); else @@ -125,7 +125,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) } } -void CSametimeProto::showPopup(const TCHAR* msg, SametimePopupEnum flag) +void CSametimeProto::showPopup(const wchar_t* msg, SametimePopupEnum flag) { if (Miranda_Terminated()) return; @@ -143,7 +143,7 @@ void CSametimeProto::showPopup(guint32 code) struct mwReturnCodeDesc *rcDesc = mwGetReturnCodeDesc(code); SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO); - TCHAR buff[512]; + wchar_t buff[512]; mir_sntprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description))); showPopup(buff, flag); -- cgit v1.2.3