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/Yahoo/src/avatar.cpp | 32 ++++++++++++++++---------------- protocols/Yahoo/src/chat.cpp | 32 ++++++++++++++++---------------- protocols/Yahoo/src/file_transfer.cpp | 26 +++++++++++++------------- protocols/Yahoo/src/links.cpp | 32 ++++++++++++++++---------------- protocols/Yahoo/src/main.cpp | 2 +- protocols/Yahoo/src/options.cpp | 10 +++++----- protocols/Yahoo/src/proto.cpp | 14 +++++++------- protocols/Yahoo/src/proto.h | 32 ++++++++++++++++---------------- protocols/Yahoo/src/search.cpp | 22 +++++++++++----------- protocols/Yahoo/src/services.cpp | 2 +- protocols/Yahoo/src/user_info.cpp | 2 +- protocols/Yahoo/src/util.cpp | 10 +++++----- protocols/Yahoo/src/yahoo.cpp | 30 +++++++++++++++--------------- 13 files changed, 123 insertions(+), 123 deletions(-) (limited to 'protocols/Yahoo/src') diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index ec1696c65d..34f68acc0a 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -112,10 +112,10 @@ void __cdecl CYahooProto::send_avt_thread(void *psf) setByte("AvatarUL", 0); } -void CYahooProto::SendAvatar(const TCHAR *szFile) +void CYahooProto::SendAvatar(const wchar_t *szFile) { struct _stat statbuf; - if (_tstat(szFile, &statbuf) != 0) { + if (_wstat(szFile, &statbuf) != 0) { LOG(("[YAHOO_SendAvatar] Error reading File information?!")); return; } @@ -146,7 +146,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) { avatar_info *avt = (avatar_info*)pavt; int error = 0; - TCHAR buf[4096]; + wchar_t buf[4096]; if (avt == NULL) { debugLogA("AVT IS NULL!!!"); @@ -241,7 +241,7 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) PROTO_AVATAR_INFORMATION ai; ai.format = PA_FORMAT_PNG; ai.hContact = hContact; - _tcsncpy_s(ai.filename, buf, _TRUNCATE); + wcsncpy_s(ai.filename, buf, _TRUNCATE); if (error) setDword(hContact, "PictCK", 0); @@ -295,7 +295,7 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_ // NO avatar URL?? if (!getTString("AvatarFile", &dbv)) { struct _stat statbuf; - if (_tstat(dbv.ptszVal, &statbuf) != 0) { + if (_wstat(dbv.ptszVal, &statbuf) != 0) { LOG(("[ext_yahoo_got_picture] Avatar File Missing? Can't find file: %s", dbv.ptszVal)); } else { @@ -342,10 +342,10 @@ void CYahooProto::ext_got_picture(const char*, const char *who, const char *pic_ return; } - TCHAR z[1024]; + wchar_t z[1024]; GetAvatarFileName(hContact, z, 1024, getByte(hContact, "AvatarType", 0)); - if (getDword(hContact, "PictCK", 0) != cksum || _taccess(z, 0) != 0) { + if (getDword(hContact, "PictCK", 0) != cksum || _waccess(z, 0) != 0) { debugLogA("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d", getDword(hContact, "PictCK", 0), cksum); @@ -460,7 +460,7 @@ void CYahooProto::ext_got_picture_checksum(const char*, const char *who, int cks setDword(hContact, "PictCK", cksum); // Need to delete the Avatar File!! - TCHAR szFile[MAX_PATH]; + wchar_t szFile[MAX_PATH]; GetAvatarFileName(hContact, szFile, _countof(szFile) - 1, 0); DeleteFile(szFile); @@ -594,11 +594,11 @@ void CYahooProto::request_avatar(const char* who) else LOG(("Avatar Not Available for: %s Last Check: %ld Current: %ld (Flood Check in Effect)", who, last_chk, cur_time)); } -void CYahooProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen, int type) +void CYahooProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, int cbLen, int type) { int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName); - if (_taccess(pszDest, 0)) + if (_waccess(pszDest, 0)) CreateDirectoryTreeT(pszDest); if (hContact != NULL) { @@ -608,7 +608,7 @@ void CYahooProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen else tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%S avatar", m_szModuleName); - _tcsncpy_s((pszDest + tPathLen), (cbLen - tPathLen), (type == 1 ? L".swf" : L".png"), _TRUNCATE); + wcsncpy_s((pszDest + tPathLen), (cbLen - tPathLen), (type == 1 ? L".swf" : L".png"), _TRUNCATE); } INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) @@ -648,7 +648,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) pai->format = PA_FORMAT_PNG; debugLogA("[YAHOO_GETAVATARINFO] filename: %s", pai->filename); - if (_taccess(pai->filename, 0) == 0) + if (_waccess(pai->filename, 0) == 0) return GAIR_SUCCESS; if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL) { @@ -733,7 +733,7 @@ return=0 on success, else on error */ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) { - TCHAR *buffer = (TCHAR*)wParam; + wchar_t *buffer = (wchar_t*)wParam; int size = (int)lParam; debugLogA("[YahooGetMyAvatar]"); @@ -749,7 +749,7 @@ INT_PTR __cdecl CYahooProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) if (getDword("AvatarHash", 0)) { if (!getTString("AvatarFile", &dbv)) { - if (_taccess(dbv.ptszVal, 0) == 0) { + if (_waccess(dbv.ptszVal, 0) == 0) { mir_tstrncpy(buffer, dbv.ptszVal, size - 1); buffer[size - 1] = '\0'; @@ -771,8 +771,8 @@ return=0 for sucess INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM, LPARAM lParam) { - TCHAR* tszFile = (TCHAR*)lParam; - TCHAR tszMyFile[MAX_PATH + 1]; + wchar_t* tszFile = (wchar_t*)lParam; + wchar_t tszMyFile[MAX_PATH + 1]; GetAvatarFileName(NULL, tszMyFile, MAX_PATH, 2); diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp index 105f86f19e..ce59ae92f6 100644 --- a/protocols/Yahoo/src/chat.cpp +++ b/protocols/Yahoo/src/chat.cpp @@ -37,7 +37,7 @@ struct InviteChatReqParam { char* room; char* who; - TCHAR* msg; + wchar_t* msg; CYahooProto* ppro; InviteChatReqParam(const char* room, const char* who, const char* msg, CYahooProto* ppro) @@ -51,9 +51,9 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA void ext_yahoo_conf_userdecline(int id, const char*, const char *who, const char *room, const char *msg) { - TCHAR info[1024]; - TCHAR *whot = mir_utf8decodeT(who); - TCHAR *msgt = mir_utf8decodeT(msg); + wchar_t info[1024]; + wchar_t *whot = mir_utf8decodeT(who); + wchar_t *msgt = mir_utf8decodeT(msg); mir_sntprintf(info, TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : L""); GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_INFORMATION, info); mir_free(msgt); @@ -98,7 +98,7 @@ void ext_yahoo_conf_userleave(int id, const char*, const char *who, const char * void ext_yahoo_conf_message(int id, const char*, const char *who, const char *room, const char *msg, int utf8) { - TCHAR *msgt = utf8 ? mir_utf8decodeT(msg) : mir_a2t(msg); + wchar_t *msgt = utf8 ? mir_utf8decodeT(msg) : mir_a2t(msg); GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_MESSAGE, msgt); mir_free(msgt); } @@ -150,7 +150,7 @@ void CYahooProto::ChatRegister(void) void CYahooProto::ChatStart(const char* room) { - TCHAR* idt = mir_a2t(room); + wchar_t* idt = mir_a2t(room); GCSESSION gcw = { sizeof(gcw) }; gcw.iType = GCW_CHATROOM; @@ -178,7 +178,7 @@ void CYahooProto::ChatStart(const char* room) void CYahooProto::ChatLeave(const char* room) { - TCHAR* idt = mir_a2t(room); + wchar_t* idt = mir_a2t(room); GCDEST gcd = { m_szModuleName, idt, GC_EVENT_CONTROL }; GCEVENT gce = { sizeof(gce), &gcd }; @@ -195,13 +195,13 @@ void CYahooProto::ChatLeaveAll(void) ChatLeave(m_chatrooms[i].name); } -void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const TCHAR* msg) +void CYahooProto::ChatEvent(const char* room, const char* who, int evt, const wchar_t* msg) { - TCHAR* idt = mir_a2t(room); - TCHAR* snt = mir_a2t(who); + wchar_t* idt = mir_a2t(room); + wchar_t* snt = mir_a2t(who); MCONTACT hContact = getbuddyH(who); - TCHAR* nick = hContact ? (TCHAR*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0) : snt; + wchar_t* nick = hContact ? (wchar_t*)pcli->pfnGetContactDisplayName(WPARAM(hContact), 0) : snt; GCDEST gcd = { m_szModuleName, idt, evt }; GCEVENT gce = { sizeof(gce), &gcd }; @@ -340,7 +340,7 @@ int __cdecl CYahooProto::OnGCMenuHook(WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // Invite to chat dialog -static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, TCHAR *msg) +static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, char* room, CYahooProto* ppro, wchar_t *msg) { bool root = !hItem; if (root) @@ -356,7 +356,7 @@ static void clist_chat_invite_send(MCONTACT hItem, HWND hwndList, YList* &who, c int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0); if (chk) { if (IsHContactInfo(hItem)) { - TCHAR buf[128] = L""; + wchar_t buf[128] = L""; SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf); who = y_list_append(who, mir_t2a(buf)); @@ -462,7 +462,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR switch (LOWORD(wParam)) { case IDC_ADDSCR: if (param->ppro->m_bLoggedIn) { - TCHAR sn[64]; + wchar_t sn[64]; GetDlgItemText(hwndDlg, IDC_EDITSCR, sn, _countof(sn)); CLCINFOITEM cii = { 0 }; @@ -477,7 +477,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR case IDOK: { - TCHAR msg[1024]; + wchar_t msg[1024]; GetDlgItemText(hwndDlg, IDC_MSG, msg, _countof(msg)); HWND hwndList = GetDlgItem(hwndDlg, IDC_CCLIST); @@ -548,7 +548,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA case IDCANCEL: if (cm) { - TCHAR msg[1024]; + wchar_t msg[1024]; GetDlgItemText(hwndDlg, IDC_MSG2, msg, _countof(msg)); yahoo_conference_decline(param->ppro->m_id, NULL, cm->members, param->room, T2Utf(msg)); diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index d5549b571c..c0620894dd 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -53,7 +53,7 @@ static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT hContact, cons ft->pfts.totalFiles = y_list_length(fs); - ft->pfts.ptszFiles = (TCHAR**)mir_calloc(ft->pfts.totalFiles * sizeof(TCHAR *)); + ft->pfts.ptszFiles = (wchar_t**)mir_calloc(ft->pfts.totalFiles * sizeof(wchar_t *)); ft->pfts.totalBytes = 0; int i = 0; @@ -67,7 +67,7 @@ static y_filetransfer* new_ft(CYahooProto* ppro, int id, MCONTACT hContact, cons ft->pfts.currentFileNumber = 0; yahoo_file_info *fi = (yahoo_file_info*)fs->data; - ft->pfts.tszCurrentFile = _tcsdup(ft->pfts.ptszFiles[ft->pfts.currentFileNumber]); + ft->pfts.tszCurrentFile = wcsdup(ft->pfts.ptszFiles[ft->pfts.currentFileNumber]); ft->pfts.currentFileSize = fi->filesize; file_transfers = y_list_prepend(file_transfers, ft); @@ -258,7 +258,7 @@ static void upload_file(int, INT_PTR fd, int error, void *data) // need to move to the next file on the list and fill the file information fi = (yahoo_file_info*)sf->files->data; - sf->pfts.tszCurrentFile = _tcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]); + sf->pfts.tszCurrentFile = wcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]); sf->pfts.currentFileSize = fi->filesize; sf->pfts.currentFileProgress = 0; @@ -290,7 +290,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si if (!error) { HANDLE myhFile; - TCHAR filefull[MAX_PATH]; + wchar_t filefull[MAX_PATH]; /* * We need FULL Path for File Resume to work properly!!! @@ -299,7 +299,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si */ mir_sntprintf(filefull, L"%s\\%s", sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile); FREE(sf->pfts.tszCurrentFile); - sf->pfts.tszCurrentFile = _tcsdup(filefull); + sf->pfts.tszCurrentFile = wcsdup(filefull); ResetEvent(sf->hWaitEvent); @@ -428,7 +428,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si // need to move to the next file on the list and fill the file information fi = (yahoo_file_info*)sf->files->data; - sf->pfts.tszCurrentFile = _tcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]); + sf->pfts.tszCurrentFile = wcsdup(sf->pfts.ptszFiles[sf->pfts.currentFileNumber]); sf->pfts.currentFileSize = fi->filesize; sf->pfts.currentFileProgress = 0; @@ -659,7 +659,7 @@ void __cdecl CYahooProto::send_filethread(void *psf) //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file -HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescription, TCHAR **ppszFiles) +HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) { LOG(("[YahooSendFile]")); @@ -674,7 +674,7 @@ HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescripti int i = 0; for (; ppszFiles[i] != NULL; i++) { - if (_tstat(ppszFiles[i], &statbuf) == 0) + if (_wstat(ppszFiles[i], &statbuf) == 0) tFileSize = statbuf.st_size; yahoo_file_info *fi = y_new(yahoo_file_info, 1); @@ -712,14 +712,14 @@ HANDLE __cdecl CYahooProto::SendFile(MCONTACT hContact, const TCHAR *szDescripti //////////////////////////////////////////////////////////////////////////////////////// // FileAllow - starts a file transfer -HANDLE __cdecl CYahooProto::FileAllow(MCONTACT, HANDLE hTransfer, const TCHAR* szPath) +HANDLE __cdecl CYahooProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath) { y_filetransfer *ft = (y_filetransfer *)hTransfer; debugLogA("[YahooFileAllow]"); //LOG(LOG_INFO, "[%s] Requesting file from %s", ft->cookie, ft->user); - ft->pfts.tszWorkingDir = _tcsdup(szPath); + ft->pfts.tszWorkingDir = wcsdup(szPath); size_t len = mir_tstrlen(ft->pfts.tszWorkingDir) - 1; if (ft->pfts.tszWorkingDir[len] == '\\') @@ -763,7 +763,7 @@ int __cdecl CYahooProto::FileCancel(MCONTACT, HANDLE hTransfer) //////////////////////////////////////////////////////////////////////////////////////// // FileDeny - denies a file transfer -int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*) +int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*) { /* deny file receive request.. just ignore it! */ y_filetransfer *ft = (y_filetransfer *)hTransfer; @@ -794,7 +794,7 @@ int __cdecl CYahooProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR*) //////////////////////////////////////////////////////////////////////////////////////// // FileResume - processes file renaming etc -int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename) +int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) { y_filetransfer *ft = (y_filetransfer *)hTransfer; @@ -813,7 +813,7 @@ int __cdecl CYahooProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** debugLogA("[YahooFileResume] Renamed file!"); FREE(ft->pfts.tszCurrentFile); - ft->pfts.tszCurrentFile = _tcsdup(*szFilename); + ft->pfts.tszCurrentFile = wcsdup(*szFilename); } SetEvent(ft->hWaitEvent); diff --git a/protocols/Yahoo/src/links.cpp b/protocols/Yahoo/src/links.cpp index 18be749700..c42f3ce9ad 100644 --- a/protocols/Yahoo/src/links.cpp +++ b/protocols/Yahoo/src/links.cpp @@ -21,7 +21,7 @@ static HANDLE hServiceParseLink; -static int SingleHexToDecimal(TCHAR c) +static int SingleHexToDecimal(wchar_t c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; @@ -29,9 +29,9 @@ static int SingleHexToDecimal(TCHAR c) return -1; } -static void url_decode(TCHAR* str) +static void url_decode(wchar_t* str) { - TCHAR* s = str, *d = str; + wchar_t* s = str, *d = str; while (*s) { if (*s == '%') { @@ -40,7 +40,7 @@ static void url_decode(TCHAR* str) int digit2 = SingleHexToDecimal(s[2]); if (digit2 != -1) { s += 3; - *d++ = (TCHAR)((digit1 << 4) | digit2); + *d++ = (wchar_t)((digit1 << 4) | digit2); continue; } } @@ -51,11 +51,11 @@ static void url_decode(TCHAR* str) *d = 0; } -static char* get_buddy(TCHAR ** arg) +static char* get_buddy(wchar_t ** arg) { - TCHAR *buf = *arg; + wchar_t *buf = *arg; - TCHAR *tok = _tcschr(buf, '&'); /* first token */ + wchar_t *tok = wcschr(buf, '&'); /* first token */ if (tok) *tok = 0; if (!buf[0]) return NULL; @@ -74,11 +74,11 @@ static char* get_buddy(TCHAR ** arg) */ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) { - TCHAR *arg = (TCHAR*)lParam; + wchar_t *arg = (wchar_t*)lParam; if (arg == NULL) return 1; /* sanity check */ /* skip leading prefix */ - arg = _tcschr(arg, ':'); + arg = wcschr(arg, ':'); if (arg == NULL) return 1; /* parse failed */ for (++arg; *arg == '/'; ++arg) {} @@ -95,7 +95,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) if (!proto) return 1; /* add a contact to the list */ - if (!_tcsnicmp(arg, L"addfriend?", 10)) { + if (!wcsnicmp(arg, L"addfriend?", 10)) { arg += 10; char *id = get_buddy(&arg); @@ -111,7 +111,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) acs.psr = &psr; psr.cbSize = sizeof(PROTOSEARCHRESULT); - psr.id.t = (TCHAR*)id; + psr.id.w = (wchar_t*)id; CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs); } @@ -119,22 +119,22 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) return 0; } /* send a message to a contact */ - else if (!_tcsnicmp(arg, L"sendim?", 7)) { + else if (!wcsnicmp(arg, L"sendim?", 7)) { arg += 7; char *id = get_buddy(&arg); if (!id) return 1; - TCHAR *msg = NULL; + wchar_t *msg = NULL; while (arg) { - if (!_tcsnicmp(arg, L"m=", 2)) { + if (!wcsnicmp(arg, L"m=", 2)) { msg = arg + 2; url_decode(msg); break; } - arg = _tcschr(arg + 1, '&'); /* first token */ + arg = wcschr(arg + 1, '&'); /* first token */ if (arg) *arg = 0; } @@ -146,7 +146,7 @@ static INT_PTR ServiceParseYmsgrLink(WPARAM, LPARAM lParam) return 0; } /* open a chatroom */ - else if (!_tcsnicmp(arg, L"chat?", 5)) { + else if (!wcsnicmp(arg, L"chat?", 5)) { arg += 5; // char *id = get_buddy(&arg); diff --git a/protocols/Yahoo/src/main.cpp b/protocols/Yahoo/src/main.cpp index 18c7f1cdd4..87d254bace 100644 --- a/protocols/Yahoo/src/main.cpp +++ b/protocols/Yahoo/src/main.cpp @@ -77,7 +77,7 @@ static int CompareProtos(const CYahooProto* p1, const CYahooProto* p2) LIST g_instances(1, CompareProtos); -static CYahooProto* yahooProtoInit(const char* pszProtoName, const TCHAR* tszUserName) +static CYahooProto* yahooProtoInit(const char* pszProtoName, const wchar_t* tszUserName) { CYahooProto* ppro = new CYahooProto(pszProtoName, tszUserName); diff --git a/protocols/Yahoo/src/options.cpp b/protocols/Yahoo/src/options.cpp index 592f0a455e..321851d965 100644 --- a/protocols/Yahoo/src/options.cpp +++ b/protocols/Yahoo/src/options.cpp @@ -360,20 +360,20 @@ int __cdecl CYahooProto::OnOptionsInit(WPARAM wParam, LPARAM) odp.position = -790000000; odp.hInstance = hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO); - odp.ptszTitle = m_tszUserName; + odp.pwszTitle = m_tszUserName; odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; - odp.ptszGroup = LPGENT("Network"); - odp.ptszTab = LPGENT("Account"); + odp.pwszGroup = LPGENW("Network"); + odp.pwszTab = LPGENW("Account"); odp.pfnDlgProc = DlgProcYahooOpts; odp.dwInitParam = LPARAM(this); Options_AddPage(wParam, &odp); - odp.ptszTab = LPGENT("Connection"); + odp.pwszTab = LPGENW("Connection"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO_CONNECTION); odp.pfnDlgProc = DlgProcYahooOptsConn; Options_AddPage(wParam, &odp); - odp.ptszTab = LPGENT("Ignore List"); + odp.pwszTab = LPGENW("Ignore List"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_YAHOO_IGNORE); odp.pfnDlgProc = DlgProcYahooOptsIgnore; Options_AddPage(wParam, &odp); diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index c3682e5696..a2610c5f7b 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -24,7 +24,7 @@ #pragma warning(disable:4355) -CYahooProto::CYahooProto(const char *aProtoName, const TCHAR *aUserName) +CYahooProto::CYahooProto(const char *aProtoName, const wchar_t *aUserName) : PROTO(aProtoName, aUserName), m_bLoggedIn(FALSE), poll_loop(0), @@ -35,7 +35,7 @@ CYahooProto::CYahooProto(const char *aProtoName, const TCHAR *aUserName) logoff_buddies(); - SkinAddNewSoundExT("mail", m_tszUserName, LPGENT("New E-mail available in Inbox")); + SkinAddNewSoundExT("mail", m_tszUserName, LPGENW("New E-mail available in Inbox")); LoadYahooServices(); } @@ -66,7 +66,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) HookProtoEvent(ME_IDLE_CHANGED, &CYahooProto::OnIdleEvent); HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu); - TCHAR tModuleDescr[100]; + wchar_t tModuleDescr[100]; mir_sntprintf(tModuleDescr, TranslateT("%s plugin connections"), m_tszUserName); NETLIBUSER nlu = { 0 }; @@ -113,7 +113,7 @@ MCONTACT CYahooProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return 0; } - char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id.t) : mir_utf8encode((char*)psr->id.t); + char *id = psr->flags & PSR_UNICODE ? mir_utf8encodeW((wchar_t*)psr->id.w) : mir_utf8encode((char*)psr->id.w); MCONTACT hContact = getbuddyH(id); if (hContact != NULL) { if (db_get_b(hContact, "CList", "NotOnList")) { @@ -217,7 +217,7 @@ int CYahooProto::Authorize(MEVENT hdbe) //////////////////////////////////////////////////////////////////////////////////////// // AuthDeny - handles the unsuccessful authorization -int CYahooProto::AuthDeny(MEVENT hdbe, const TCHAR *reason) +int CYahooProto::AuthDeny(MEVENT hdbe, const wchar_t *reason) { debugLogA("[YahooAuthDeny]"); if (!m_bLoggedIn) @@ -276,7 +276,7 @@ int __cdecl CYahooProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) //////////////////////////////////////////////////////////////////////////////////////// // PSS_AUTHREQUEST -int __cdecl CYahooProto::AuthRequest(MCONTACT hContact, const TCHAR* msg) +int __cdecl CYahooProto::AuthRequest(MCONTACT hContact, const wchar_t* msg) { debugLogA("[YahooSendAuthRequest]"); @@ -539,7 +539,7 @@ HANDLE __cdecl CYahooProto::GetAwayMsg(MCONTACT hContact) //////////////////////////////////////////////////////////////////////////////////////// // SetAwayMsg - sets the away status message -int __cdecl CYahooProto::SetAwayMsg(int status, const TCHAR* msg) +int __cdecl CYahooProto::SetAwayMsg(int status, const wchar_t* msg) { char *c = msg && msg[0] ? mir_utf8encodeT(msg) : NULL; diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 0f2324ec75..2cfed5b305 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -18,7 +18,7 @@ struct CYahooProto : public PROTO { - CYahooProto(const char*, const TCHAR*); + CYahooProto(const char*, const wchar_t*); virtual ~CYahooProto(); //==================================================================================== @@ -29,33 +29,33 @@ struct CYahooProto : public PROTO virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent); virtual int __cdecl Authorize(MEVENT hDbEvent); - virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason); + virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason); virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage ); + virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage ); - 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 SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); - virtual int __cdecl SetAwayMsg( int m_iStatus, const TCHAR *msg); + virtual int __cdecl SetAwayMsg( int m_iStatus, const wchar_t *msg); virtual INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam); virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); @@ -146,13 +146,13 @@ struct CYahooProto : public PROTO void reset_avatar(MCONTACT hContact); void request_avatar(const char* who); - void SendAvatar(const TCHAR *szFile); - void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, int cbLen, int type); + void SendAvatar(const wchar_t *szFile); + void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, int cbLen, int type); //====| chat.cpp |==================================================================== void ChatRegister(void); void ChatStart(const char* room); - void ChatEvent(const char* room, const char* who, int evt, const TCHAR* msg = NULL); + void ChatEvent(const char* room, const char* who, int evt, const wchar_t* msg = NULL); void ChatLeave(const char* room); void ChatLeaveAll(void); @@ -213,9 +213,9 @@ struct CYahooProto : public PROTO DWORD Set_Protocol(MCONTACT hContact, int protocol ); - int ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags); - void ShowError(const TCHAR *title, const TCHAR *buff); - int ShowPopup( const TCHAR* nickname, const TCHAR* msg, const char *szURL ); + int ShowNotification(const wchar_t *title, const wchar_t *info, DWORD flags); + void ShowError(const wchar_t *title, const wchar_t *buff); + int ShowPopup( const wchar_t* nickname, const wchar_t* msg, const char *szURL ); bool IsMyContact(MCONTACT hContact); //====| yahoo.cpp |=================================================================== @@ -257,7 +257,7 @@ struct CYahooProto : public PROTO void ext_login_response(int succ, const char *url); void ext_login(enum yahoo_status login_mode); - void AddBuddy(MCONTACT hContact, const char *group, const TCHAR *msg); + void AddBuddy(MCONTACT hContact, const char *group, const wchar_t *msg); void YAHOO_utils_logversion(); diff --git a/protocols/Yahoo/src/search.cpp b/protocols/Yahoo/src/search.cpp index 9a606c4245..d08a08df66 100644 --- a/protocols/Yahoo/src/search.cpp +++ b/protocols/Yahoo/src/search.cpp @@ -22,7 +22,7 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch) { - TCHAR *id = (TCHAR *)snsearch; + wchar_t *id = (wchar_t *)snsearch; if (mir_tstrlen(id) < 4) { ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0); @@ -30,14 +30,14 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch) return; } - TCHAR *c = _tcschr(id, '@'); + wchar_t *c = wcschr(id, '@'); if (c) *c = 0; YAHOO_SEARCH_RESULT psr; memset(&psr, 0, sizeof(psr)); psr.cbSize = sizeof(psr); psr.flags = PSR_TCHAR; - psr.id.t = (TCHAR*)_tcslwr(id); + psr.id.w = (wchar_t*)wcslwr(id); psr.protocol = YAHOO_IM_YAHOO; ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)& psr); @@ -47,14 +47,14 @@ void __cdecl CYahooProto::search_simplethread(void *snsearch) ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)1, 0); } -HANDLE __cdecl CYahooProto::SearchBasic(const TCHAR* nick) +HANDLE __cdecl CYahooProto::SearchBasic(const wchar_t* nick) { LOG(("[YahooBasicSearch] Searching for: %S", nick)); if (!m_bLoggedIn) return 0; - ForkThread(&CYahooProto::search_simplethread, _tcsdup(nick)); + ForkThread(&CYahooProto::search_simplethread, wcsdup(nick)); return (HANDLE)1; } @@ -158,7 +158,7 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND) { HWND hwndDlg = (HWND)pHWND; - TCHAR searchid[128]; + wchar_t searchid[128]; GetDlgItemText(hwndDlg, IDC_SEARCH_ID, searchid, _countof(searchid)); if (mir_tstrlen(searchid) == 0) { @@ -171,13 +171,13 @@ void __cdecl CYahooProto::searchadv_thread(void *pHWND) memset(&psr, 0, sizeof(psr)); psr.cbSize = sizeof(psr); psr.flags = PSR_UNICODE; - psr.id.t = _tcslwr(searchid); + psr.id.w = wcslwr(searchid); switch (SendDlgItemMessage(hwndDlg, IDC_SEARCH_PROTOCOL, CB_GETCURSEL, 0, 0)) { - case 0: psr.firstName.t = L""; psr.protocol = YAHOO_IM_YAHOO; break; - case 1: psr.firstName.t = L""; psr.protocol = YAHOO_IM_SAMETIME; break; - case 2: psr.firstName.t = L""; psr.protocol = YAHOO_IM_LCS; break; - case 3: psr.firstName.t = L""; psr.protocol = YAHOO_IM_MSN; break; + case 0: psr.firstName.w = L""; psr.protocol = YAHOO_IM_YAHOO; break; + case 1: psr.firstName.w = L""; psr.protocol = YAHOO_IM_SAMETIME; break; + case 2: psr.firstName.w = L""; psr.protocol = YAHOO_IM_LCS; break; + case 3: psr.firstName.w = L""; psr.protocol = YAHOO_IM_MSN; break; } /* diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index bd171957f6..f5f602139c 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -220,7 +220,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) t = yahoo_urlencode(yahoo_get_cookie(m_id, "t")); u = yahoo_urlencode(url); mir_snprintf(tUrl, - "http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s", + "http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.w=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s", y, t, u); FREE(y); diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp index 016053a9ad..4b90a00e41 100644 --- a/protocols/Yahoo/src/user_info.cpp +++ b/protocols/Yahoo/src/user_info.cpp @@ -124,7 +124,7 @@ int __cdecl CYahooProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) odp.pfnDlgProc = YahooUserInfoDlgProc; odp.position = -1900000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_USER_INFO); - odp.ptszTitle = m_tszUserName; + odp.pwszTitle = m_tszUserName; UserInfo_AddPage(wParam, &odp); } return 0; diff --git a/protocols/Yahoo/src/util.cpp b/protocols/Yahoo/src/util.cpp index c4c5e692a2..44584763b6 100644 --- a/protocols/Yahoo/src/util.cpp +++ b/protocols/Yahoo/src/util.cpp @@ -105,7 +105,7 @@ static LRESULT CALLBACK PopupWindowProc(HWND hWnd, UINT message, WPARAM wParam, return DefWindowProc(hWnd, message, wParam, lParam); } -int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char *szURL) +int CYahooProto::ShowPopup(const wchar_t* nickname, const wchar_t* msg, const char *szURL) { if (!ServiceExists(MS_POPUP_ADDPOPUPT)) return 0; @@ -127,14 +127,14 @@ int CYahooProto::ShowPopup(const TCHAR* nickname, const TCHAR* msg, const char * return 1; } -int CYahooProto::ShowNotification(const TCHAR *title, const TCHAR *info, DWORD flags) +int CYahooProto::ShowNotification(const wchar_t *title, const wchar_t *info, DWORD flags) { if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { MIRANDASYSTRAYNOTIFY err; err.szProto = m_szModuleName; err.cbSize = sizeof(err); - err.tszInfoTitle = (TCHAR*)title; - err.tszInfo = (TCHAR*)info; + err.tszInfoTitle = (wchar_t*)title; + err.tszInfo = (wchar_t*)info; err.dwInfoFlags = flags | NIIF_INTERN_UNICODE; err.uTimeout = 1000 * 3; INT_PTR ret = CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& err); @@ -146,7 +146,7 @@ int CYahooProto::ShowNotification(const TCHAR *title, const TCHAR *info, DWORD f return 0; } -void CYahooProto::ShowError(const TCHAR *title, const TCHAR *buff) +void CYahooProto::ShowError(const wchar_t *title, const wchar_t *buff) { if (getByte("ShowErrors", 1)) if (!ShowPopup(title, buff, NULL)) diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 7cb6c76f34..b9aca199e2 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -200,7 +200,7 @@ void CYahooProto::logout() poll_loop = 0; } -void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const TCHAR *msg) +void CYahooProto::AddBuddy(MCONTACT hContact, const char *group, const wchar_t *msg) { /* We adding a buddy to our list. 2 Stages. @@ -675,8 +675,8 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) ptrT tszWho(mir_utf8decodeT(who)); ptrT tszMsg(mir_utf8decodeT(msg)); - TCHAR buff[1024]; - mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho); + wchar_t buff[1024]; + mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (wchar_t*)tszWho); MessageBox(NULL, tszMsg, buff, MB_OK | MB_ICONINFORMATION); } @@ -923,7 +923,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) SkinPlaySound("mail"); if (!getByte("DisableYahoomail", 0)) { - TCHAR z[MAX_SECONDLINE], title[MAX_CONTACTNAME]; + wchar_t z[MAX_SECONDLINE], title[MAX_CONTACTNAME]; if (from == NULL) { mir_sntprintf(title, L"%s: %s", m_tszUserName, TranslateT("New Mail")); @@ -934,7 +934,7 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) ptrT tszFrom(mir_utf8decodeT(from)); ptrT tszSubj(mir_utf8decodeT(subj)); - mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj); + mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (wchar_t*)tszFrom, (wchar_t*)tszSubj); } if (!ShowPopup(title, z, "http://mail.yahoo.com")) @@ -1046,7 +1046,7 @@ void CYahooProto::ext_got_ping(const char *errormsg) void CYahooProto::ext_login_response(int succ, const char *url) { - TCHAR buff[1024]; + wchar_t buff[1024]; LOG(("[ext_login_response] succ: %d, url: %s", succ, url)); @@ -1111,34 +1111,34 @@ void CYahooProto::ext_login_response(int succ, const char *url) void CYahooProto::ext_error(const char *err, int fatal, int num) { ptrT tszErr(mir_utf8decodeT(err)); - TCHAR buff[1024]; + wchar_t buff[1024]; LOG(("[ext_error] Error: fatal: %d, num: %d, err: %s", fatal, num, err)); switch (num) { case E_UNKNOWN: - mir_sntprintf(buff, TranslateT("Unknown error %s"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("Unknown error %s"), (wchar_t*)tszErr); break; case E_CUSTOM: - mir_sntprintf(buff, TranslateT("Custom error %s"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("Custom error %s"), (wchar_t*)tszErr); break; case E_CONFNOTAVAIL: - mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (wchar_t*)tszErr); break; case E_IGNOREDUP: - mir_sntprintf(buff, TranslateT("%s is already ignored"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("%s is already ignored"), (wchar_t*)tszErr); break; case E_IGNORENONE: - mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (wchar_t*)tszErr); break; case E_IGNORECONF: - mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (wchar_t*)tszErr); break; case E_SYSTEM: - mir_sntprintf(buff, TranslateT("System Error: %s"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("System Error: %s"), (wchar_t*)tszErr); break; case E_CONNECTION: - mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr); + mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (wchar_t*)tszErr); debugLogA("Error: %S", buff); return; } -- cgit v1.2.3