From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ListeningTo/src/listeningto.cpp | 24 +++++++++---------- plugins/ListeningTo/src/music.cpp | 36 ++++++++++++++--------------- plugins/ListeningTo/src/options.cpp | 6 ++--- plugins/ListeningTo/src/players/generic.cpp | 12 +++++----- plugins/ListeningTo/src/players/itunes.cpp | 10 ++++---- plugins/ListeningTo/src/players/mradio.cpp | 6 ++--- plugins/ListeningTo/src/players/watrack.cpp | 8 +++---- plugins/ListeningTo/src/players/wmp.cpp | 2 +- plugins/ListeningTo/src/stdafx.h | 8 +++---- 9 files changed, 56 insertions(+), 56 deletions(-) (limited to 'plugins/ListeningTo') diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 6292695560..8f7dfe7465 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -170,7 +170,7 @@ struct compareFunc : std::binary_functionhMenu); wchar_t text[512]; - mir_sntprintf(text, TranslateT("Send to %s"), info->account); + mir_snwprintf(text, TranslateT("Send to %s"), info->account); CMenuItem mi; mi.position = 100000 + i; @@ -216,7 +216,7 @@ void RegisterProtocol(char *proto, wchar_t *account) strncpy(proto_items[id].proto, proto, _countof(proto_items[id].proto)); proto_items[id].proto[_countof(proto_items[id].proto) - 1] = 0; - mir_tstrncpy(proto_items[id].account, account, _countof(proto_items[id].account)); + mir_wstrncpy(proto_items[id].account, account, _countof(proto_items[id].account)); proto_items[id].hMenu = NULL; proto_items[id].old_xstatus = 0; @@ -234,10 +234,10 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) ProtocolInfo *info = GetProtoInfo(proto->szModuleName); if (info != NULL) { if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED) { - mir_tstrncpy(info->account, proto->tszAccountName, _countof(info->account)); + mir_wstrncpy(info->account, proto->tszAccountName, _countof(info->account)); wchar_t text[512]; - mir_sntprintf(text, TranslateT("Send to %s"), info->account); + mir_snwprintf(text, TranslateT("Send to %s"), info->account); Menu_ModifyItem(info->hMenu, text); } else if (wParam == PRAC_REMOVED || (wParam == PRAC_CHECKED && !proto->bIsEnabled)) { @@ -644,7 +644,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) if (lti == NULL) CallProtoService(proto, PS_SETAWAYMSG, status, 0); else { - ptrT fr(GetParsedFormat(lti)); + ptrW fr(GetParsedFormat(lti)); CallProtoService(proto, PS_SETAWAYMSG, status, fr); } } @@ -713,7 +713,7 @@ INT_PTR GetTextFormat(WPARAM, LPARAM) if (!loaded) return NULL; - return (INT_PTR)mir_tstrdup(opts.templ); + return (INT_PTR)mir_wstrdup(opts.templ); } wchar_t *GetParsedFormat(LISTENINGTOINFO *lti) @@ -764,7 +764,7 @@ void SetListeningInfos(LISTENINGTOINFO *lti) if (lti) { fr = GetParsedFormat(lti); - if (fr) info = mir_t2a(fr); + if (fr) info = mir_u2a(fr); } NotifyEventHooks(hListeningInfoChangedEvent, (WPARAM)info, 0); @@ -910,7 +910,7 @@ wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai) LISTENINGTOINFO *lti = GetListeningInfo(); if (lti == NULL) { ai->flags = AIF_FALSE; - return mir_tstrdup(L""); + return mir_wstrdup(L""); } wchar_t *fr[] = { @@ -938,17 +938,17 @@ wchar_t* VariablesParseInfo(ARGUMENTSINFO *ai) if (lti == NULL) \ { \ ai->flags = AIF_FALSE; \ - return mir_tstrdup(L""); \ + return mir_wstrdup(L""); \ } \ else if (IsEmpty(lti->__field__)) \ { \ ai->flags = AIF_FALSE; \ - return mir_tstrdup(opts.unknown); \ + return mir_wstrdup(opts.unknown); \ } \ else \ { \ ai->flags = AIF_DONTPARSE; \ - wchar_t *ret = mir_tstrdup(lti->__field__); \ + wchar_t *ret = mir_wstrdup(lti->__field__); \ return ret; \ } diff --git a/plugins/ListeningTo/src/music.cpp b/plugins/ListeningTo/src/music.cpp index 2cc709e025..3ded9a24d2 100644 --- a/plugins/ListeningTo/src/music.cpp +++ b/plugins/ListeningTo/src/music.cpp @@ -68,15 +68,15 @@ void CopyListeningInfo(LISTENINGTOINFO *dest, const LISTENINGTOINFO * const src) dest->cbSize = src->cbSize; dest->dwFlags = src->dwFlags; - dest->ptszArtist = mir_tstrdup(src->ptszArtist); - dest->ptszAlbum = mir_tstrdup(src->ptszAlbum); - dest->ptszTitle = mir_tstrdup(src->ptszTitle); - dest->ptszTrack = mir_tstrdup(src->ptszTrack); - dest->ptszYear = mir_tstrdup(src->ptszYear); - dest->ptszGenre = mir_tstrdup(src->ptszGenre); - dest->ptszLength = mir_tstrdup(src->ptszLength); - dest->ptszPlayer = mir_tstrdup(src->ptszPlayer); - dest->ptszType = mir_tstrdup(src->ptszType); + dest->ptszArtist = mir_wstrdup(src->ptszArtist); + dest->ptszAlbum = mir_wstrdup(src->ptszAlbum); + dest->ptszTitle = mir_wstrdup(src->ptszTitle); + dest->ptszTrack = mir_wstrdup(src->ptszTrack); + dest->ptszYear = mir_wstrdup(src->ptszYear); + dest->ptszGenre = mir_wstrdup(src->ptszGenre); + dest->ptszLength = mir_wstrdup(src->ptszLength); + dest->ptszPlayer = mir_wstrdup(src->ptszPlayer); + dest->ptszType = mir_wstrdup(src->ptszType); } BOOL Equals(const LISTENINGTOINFO *lti1, const LISTENINGTOINFO *lti2) @@ -84,15 +84,15 @@ BOOL Equals(const LISTENINGTOINFO *lti1, const LISTENINGTOINFO *lti2) if (lti1->cbSize != lti2->cbSize) return FALSE; - return mir_tstrcmpi(lti1->ptszArtist, lti2->ptszArtist) == 0 - && mir_tstrcmpi(lti1->ptszAlbum, lti2->ptszAlbum) == 0 - && mir_tstrcmpi(lti1->ptszTitle, lti2->ptszTitle) == 0 - && mir_tstrcmpi(lti1->ptszTrack, lti2->ptszTrack) == 0 - && mir_tstrcmpi(lti1->ptszYear, lti2->ptszYear) == 0 - && mir_tstrcmpi(lti1->ptszGenre, lti2->ptszGenre) == 0 - && mir_tstrcmpi(lti1->ptszLength, lti2->ptszLength) == 0 - && mir_tstrcmpi(lti1->ptszPlayer, lti2->ptszPlayer) == 0 - && mir_tstrcmpi(lti1->ptszType, lti2->ptszType) == 0; + return mir_wstrcmpi(lti1->ptszArtist, lti2->ptszArtist) == 0 + && mir_wstrcmpi(lti1->ptszAlbum, lti2->ptszAlbum) == 0 + && mir_wstrcmpi(lti1->ptszTitle, lti2->ptszTitle) == 0 + && mir_wstrcmpi(lti1->ptszTrack, lti2->ptszTrack) == 0 + && mir_wstrcmpi(lti1->ptszYear, lti2->ptszYear) == 0 + && mir_wstrcmpi(lti1->ptszGenre, lti2->ptszGenre) == 0 + && mir_wstrcmpi(lti1->ptszLength, lti2->ptszLength) == 0 + && mir_wstrcmpi(lti1->ptszPlayer, lti2->ptszPlayer) == 0 + && mir_wstrcmpi(lti1->ptszType, lti2->ptszType) == 0; } diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 121a5e5869..26667de180 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -131,11 +131,11 @@ BOOL IsTypeEnabled(LISTENINGTOINFO *lti) return TRUE; if (lti->dwFlags & LTI_UNICODE) { - if (mir_tstrcmpi(lti->ptszType, LPGENW("Music")) == 0) + if (mir_wstrcmpi(lti->ptszType, LPGENW("Music")) == 0) return opts.enable_music; - if (mir_tstrcmpi(lti->ptszType, LPGENW("Radio")) == 0) + if (mir_wstrcmpi(lti->ptszType, LPGENW("Radio")) == 0) return opts.enable_radio; - if (mir_tstrcmpi(lti->ptszType, LPGENW("Video")) == 0) + if (mir_wstrcmpi(lti->ptszType, LPGENW("Video")) == 0) return opts.enable_video; return opts.enable_others; } diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index 551d0d2a5e..e6a7a77c7b 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -32,11 +32,11 @@ void m_log(const wchar_t *function, const wchar_t *fmt, ...) return; } - mir_writeLogT(hLog, L"%s: ", function); + mir_writeLogW(hLog, L"%s: ", function); va_list args; va_start(args, fmt); - mir_writeLogVT(hLog, fmt, args); + mir_writeLogVW(hLog, fmt, args); } static LRESULT CALLBACK ReceiverWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -163,9 +163,9 @@ void GenericPlayer::ProcessReceived() li->ptszGenre = U2T(parts[8]); if (player == this) - li->ptszPlayer = mir_u2t(parts[1]); + li->ptszPlayer = mir_wstrdup(parts[1]); else - li->ptszPlayer = mir_tstrdup(player->name); + li->ptszPlayer = mir_wstrdup(player->name); if (parts[9] != NULL) { long length = _wtoi(parts[9]); @@ -177,9 +177,9 @@ void GenericPlayer::ProcessReceived() int h = (length / 60) / 60; if (h > 0) - mir_sntprintf(li->ptszLength, 9, L"%d:%02d:%02d", h, m, s); + mir_snwprintf(li->ptszLength, 9, L"%d:%02d:%02d", h, m, s); else - mir_sntprintf(li->ptszLength, 9, L"%d:%02d", m, s); + mir_snwprintf(li->ptszLength, 9, L"%d:%02d", m, s); } } } diff --git a/plugins/ListeningTo/src/players/itunes.cpp b/plugins/ListeningTo/src/players/itunes.cpp index fa6f2478e6..167779db76 100644 --- a/plugins/ListeningTo/src/players/itunes.cpp +++ b/plugins/ListeningTo/src/players/itunes.cpp @@ -125,12 +125,12 @@ BOOL ITunes::FillCache() int h = (lret / 60) / 60; if (h > 0) - mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s); + mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s); else - mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s); + mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s); } - listening_info.ptszType = mir_tstrdup(L"Music"); + listening_info.ptszType = mir_wstrdup(L"Music"); if (listening_info.ptszTitle == NULL) { // Get from filename @@ -140,14 +140,14 @@ BOOL ITunes::FillCache() else p = filename; - listening_info.ptszTitle = mir_u2t(p); + listening_info.ptszTitle = mir_wstrdup(p); wchar_t *pt = wcsrchr(listening_info.ptszTitle, '.'); if (pt != NULL) *p = '\0'; } - listening_info.ptszPlayer = mir_tstrdup(name); + listening_info.ptszPlayer = mir_wstrdup(name); listening_info.cbSize = sizeof(listening_info); listening_info.dwFlags = LTI_TCHAR; diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp index 5654325be2..60a88ec252 100644 --- a/plugins/ListeningTo/src/players/mradio.cpp +++ b/plugins/ListeningTo/src/players/mradio.cpp @@ -43,9 +43,9 @@ int MRadio::GetData() if (!db_get_s(hContact, "mRadio", "Nick", &dbv)) { listening_info.cbSize = sizeof(listening_info); listening_info.dwFlags = LTI_TCHAR; - listening_info.ptszArtist = mir_tstrdup(L"Radio"); - listening_info.ptszType = mir_tstrdup(L"Radio"); - listening_info.ptszTitle = mir_a2t(dbv.pszVal); + listening_info.ptszArtist = mir_wstrdup(L"Radio"); + listening_info.ptszType = mir_wstrdup(L"Radio"); + listening_info.ptszTitle = mir_a2u(dbv.pszVal); db_free(&dbv); return 1; diff --git a/plugins/ListeningTo/src/players/watrack.cpp b/plugins/ListeningTo/src/players/watrack.cpp index d76b79571b..895c555b91 100644 --- a/plugins/ListeningTo/src/players/watrack.cpp +++ b/plugins/ListeningTo/src/players/watrack.cpp @@ -102,15 +102,15 @@ void WATrack::GetData() int h = (si->total / 60) / 60; if (h > 0) - mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s); + mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d:%02d", h, m, s); else - mir_sntprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s); + mir_snwprintf(listening_info.ptszLength, 9, L"%d:%02d", m, s); } if (si->width > 0) - listening_info.ptszType = mir_tstrdup(L"Video"); + listening_info.ptszType = mir_wstrdup(L"Video"); else - listening_info.ptszType = mir_tstrdup(L"Music"); + listening_info.ptszType = mir_wstrdup(L"Music"); listening_info.ptszPlayer = DUPD(si->player, name); diff --git a/plugins/ListeningTo/src/players/wmp.cpp b/plugins/ListeningTo/src/players/wmp.cpp index c3131e8718..f7d2ab6df2 100644 --- a/plugins/ListeningTo/src/players/wmp.cpp +++ b/plugins/ListeningTo/src/players/wmp.cpp @@ -100,7 +100,7 @@ void WindowsMediaPlayer::ProcessReceived() listening_info.ptszArtist = U2T(parts[5]); listening_info.ptszAlbum = U2T(parts[6]); - listening_info.ptszPlayer = mir_tstrdup(name); + listening_info.ptszPlayer = mir_wstrdup(name); } // Put back the '\\'s diff --git a/plugins/ListeningTo/src/stdafx.h b/plugins/ListeningTo/src/stdafx.h index 535d581660..9bf16d8c66 100644 --- a/plugins/ListeningTo/src/stdafx.h +++ b/plugins/ListeningTo/src/stdafx.h @@ -107,10 +107,10 @@ static bool IsEmpty(const WCHAR *str) return str == NULL || str[0] == 0; } -#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_tstrdup(_X_)) -#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_tstrdup(_DEF_) : mir_tstrdup(_X_)) -#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_u2t(_X_)) -#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_u2t(_DEF_) : mir_u2t(_X_)) +#define DUP(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_)) +#define DUPD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_)) +#define U2T(_X_) ( IsEmpty(_X_) ? NULL : mir_wstrdup(_X_)) +#define U2TD(_X_, _DEF_) ( IsEmpty(_X_) ? mir_wstrdup(_DEF_) : mir_wstrdup(_X_)) #endif // __COMMONS_H__ -- cgit v1.2.3