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 --- src/core/stduserinfo/src/contactinfo.cpp | 14 ++++++------- src/core/stduserinfo/src/stdafx.h | 1 - src/core/stduserinfo/src/stdinfo.cpp | 8 +++---- src/core/stduserinfo/src/userinfo.cpp | 36 ++++++++++++++++---------------- 4 files changed, 29 insertions(+), 30 deletions(-) (limited to 'src/core/stduserinfo') diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 1fc523b3ea..a125be13ef 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -171,7 +171,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar return FALSE; } -static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail) +static int IsOverEmail(HWND hwndDlg, wchar_t* szEmail, int cchEmail) { HWND hwndEmails = GetDlgItem(hwndDlg, IDC_EMAILS); @@ -190,7 +190,7 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail) ListView_GetSubItemRect(hwndEmails, hti.iItem, 1, LVIR_LABEL, &rc); - TCHAR szText[256]; szText[0] = 0; + wchar_t szText[256]; szText[0] = 0; ListView_GetItemText(hwndEmails, hti.iItem, 1, szText, _countof(szText)); HDC hdc = GetDC(hwndEmails); @@ -264,7 +264,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_EMAILS)); char idstr[33]; - TCHAR idstr2[33]; + wchar_t idstr2[33]; DBVARIANT dbv; LVITEM lvi; @@ -400,7 +400,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc); if (nm->iSubItem == 1 && nm->nmcd.hdr.idFrom == IDC_EMAILS) { HFONT hoFont; - TCHAR szText[256] = { 0 }; + wchar_t szText[256] = { 0 }; ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText)); hoFont = (HFONT)SelectObject(nm->nmcd.hdc, hEmailFont); SetTextColor(nm->nmcd.hdc, RGB(0, 0, 255)); @@ -416,7 +416,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else if (nm->iSubItem > 1 && nm->nmcd.lItemlParam != -1 && nm->nmcd.lItemlParam != -2) { static int iconResources[3] = { SKINICON_OTHER_RENAME, SKINICON_OTHER_DELETE }; if (nm->iSubItem == 2 && nm->nmcd.hdr.idFrom == IDC_PHONES) { - TCHAR szText[2]; + wchar_t szText[2]; ListView_GetItemText(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, szText, _countof(szText)); if (szText[0]) hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS); } @@ -436,9 +436,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); char *szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "MyPhone%d" : "Mye-mail%d"; - TCHAR szEmail[256]; + wchar_t szEmail[256]; if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) { - TCHAR szExec[264]; + wchar_t szExec[264]; mir_sntprintf(szExec, L"mailto:%s", szEmail); ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW); break; diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h index 9136d69408..4a07eca120 100644 --- a/src/core/stduserinfo/src/stdafx.h +++ b/src/core/stduserinfo/src/stdafx.h @@ -22,7 +22,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 4b93ab8cd1..100ea132d8 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -44,7 +44,7 @@ static int Proto_GetContactInfoSetting(MCONTACT hContact, const char *szProto, c return CallProtoService(szProto, PS_GETINFOSETTING, hContact, (LPARAM)&cgs); } -static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting) +static wchar_t* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hContact, const char *szModule, const char *szSetting) { if (!proto_service) return db_get_tsa(hContact, szModule, szSetting); @@ -61,7 +61,7 @@ static TCHAR* Proto_GetContactInfoSettingStr(bool proto_service, MCONTACT hConta static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule, char *szSetting, int special) { char str[80], *pstr = NULL; - TCHAR *ptstr = NULL; + wchar_t *ptstr = NULL; char *szProto = GetContactProto(hContact); bool proto_service = szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC); @@ -253,7 +253,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case IDC_EMAIL: if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) { - TCHAR szExec[264], szEmail[256]; + wchar_t szExec[264], szEmail[256]; GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail)); mir_sntprintf(szExec, L"mailto:%s", szEmail); ShellExecute(hwndDlg, L"open", szExec, NULL, NULL, SW_SHOW); @@ -282,7 +282,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L { MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); if (hContact != NULL) { - TCHAR szTime[80]; + wchar_t szTime[80]; if (printDateTimeByContact(hContact, L"s", szTime, _countof(szTime), TZF_KNOWNONLY)) { EnableWindow(GetDlgItem(hwndDlg, IDC_LOCALTIME), FALSE); SetDlgItemText(hwndDlg, IDC_LOCALTIME, TranslateT("")); diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 9e3d50ddda..0de846052e 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -46,7 +46,7 @@ struct DetailsPageData HWND hwnd; HTREEITEM hItem; int changed, hLangpack; - TCHAR *ptszTitle, *ptszTab; + wchar_t *ptszTitle, *ptszTab; }; struct DetailsData @@ -60,24 +60,24 @@ struct DetailsData DetailsPageData *opd; RECT rcDisplay, rcDisplayTab; int updateAnimFrame; - TCHAR szUpdating[64]; + wchar_t szUpdating[64]; int *infosUpdated; }; -TCHAR* getTitle(OPTIONSDIALOGPAGE *p) +wchar_t* getTitle(OPTIONSDIALOGPAGE *p) { - return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTitle : TranslateTH(p->hLangpack, p->ptszTitle); + return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTitle : TranslateTH(p->hLangpack, p->pwszTitle); } -TCHAR* getTab(OPTIONSDIALOGPAGE *p) +wchar_t* getTab(OPTIONSDIALOGPAGE *p) { - return (p->flags & ODPF_DONTTRANSLATE) ? p->ptszTab : TranslateTH(p->hLangpack, p->ptszTab); + return (p->flags & ODPF_DONTTRANSLATE) ? p->pwszTab : TranslateTH(p->hLangpack, p->pwszTab); } static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2) { int res; - TCHAR *s1 = getTitle(item1), *s2 = getTitle(item2); + wchar_t *s1 = getTitle(item1), *s2 = getTitle(item2); if (!mir_tstrcmp(s1, TranslateT("Summary"))) return -1; if (!mir_tstrcmp(s2, TranslateT("Summary"))) return 1; if (res = mir_tstrcmp(s1, s2)) return res; @@ -115,7 +115,7 @@ static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM) psh.hwndParent = NULL; psh.nPages = opi.pageCount; psh.pStartPage = 0; - psh.pszCaption = (TCHAR*)wParam; //more abuses of structure: this is hContact + psh.pszCaption = (wchar_t*)wParam; //more abuses of structure: this is hContact psh.ppsp = (PROPSHEETPAGE*)opi.odp; //blatent misuse of the structure, but what the hell CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DETAILS), NULL, DlgProcDetails, (LPARAM)&psh); @@ -147,12 +147,12 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) dst->pszTemplate = ((DWORD_PTR)odp->pszTemplate & 0xFFFF0000) ? mir_strdup(odp->pszTemplate) : odp->pszTemplate; if (odp->flags & ODPF_UNICODE) { - dst->ptszTitle = (odp->ptszTitle == 0) ? NULL : mir_wstrdup(odp->ptszTitle); - dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->ptszTab) ? NULL : mir_wstrdup(odp->ptszTab); + dst->pwszTitle = (odp->pwszTitle == 0) ? NULL : mir_wstrdup(odp->pwszTitle); + dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pwszTab) ? NULL : mir_wstrdup(odp->pwszTab); } else { - dst->ptszTitle = mir_a2t(odp->pszTitle); - dst->ptszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab); + dst->pwszTitle = mir_a2t(odp->pszTitle); + dst->pwszTab = (!(odp->flags & ODPF_USERINFOTAB) || !odp->pszTab) ? NULL : mir_a2t(odp->pszTab); } dst->hLangpack = odp->hLangpack; @@ -248,7 +248,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP WindowList_Add(hWindowList, hwndDlg, dat->hContact); ////////////////////////////////////////////////////////////////////// - TCHAR *name, oldTitle[256], newTitle[256]; + wchar_t *name, oldTitle[256], newTitle[256]; if (dat->hContact == NULL) name = TranslateT("Owner"); else @@ -269,7 +269,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab; DBVARIANT dbv; if (!db_get_ts(NULL, "UserInfo", "LastTab", &dbv)) { - ptszLastTab = NEWTSTR_ALLOCA(dbv.ptszVal); + ptszLastTab = NEWWSTR_ALLOCA(dbv.ptszVal); db_free(&dbv); } else ptszLastTab = NULL; @@ -289,8 +289,8 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP p.dlgParam = odp[i].dwInitParam; p.hInst = odp[i].hInstance; - p.ptszTitle = odp[i].ptszTitle; - p.ptszTab = odp[i].ptszTab; + p.ptszTitle = odp[i].pwszTitle; + p.ptszTab = odp[i].pwszTab; p.hLangpack = odp[i].hLangpack; if (i && p.ptszTab && !mir_tstrcmp(dat->opd[i - 1].ptszTitle, p.ptszTitle)) { @@ -354,7 +354,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP return TRUE; case WM_TIMER: - TCHAR str[128]; + wchar_t str[128]; mir_sntprintf(str, L"%.*s%s%.*s", dat->updateAnimFrame % 10, L".........", dat->szUpdating, dat->updateAnimFrame % 10, L"........."); SetDlgItemText(hwndDlg, IDC_UPDATING, str); if (++dat->updateAnimFrame == UPDATEANIMFRAMES) @@ -580,7 +580,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP break; case WM_DESTROY: - TCHAR name[128]; + wchar_t name[128]; TVITEM tvi; tvi.mask = TVIF_TEXT; tvi.hItem = dat->opd[dat->currentPage].hItem; -- cgit v1.2.3