From 95c0985670fefbe446908ebaef98dc2559f8d9fc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Mar 2013 12:37:59 +0000 Subject: rest of TCHAR_STR_PARAM replaced git-svn-id: http://svn.miranda-ng.org/main/trunk@3831 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_utils.h | 8 +- plugins/AddContactPlus/src/addcontact.cpp | 4 +- plugins/AssocMgr/src/dde.cpp | 8 +- plugins/Popup/src/opt_class.cpp | 2 +- plugins/Popup/src/opt_skins.cpp | 2 +- plugins/Popup/src/popup_wnd2.cpp | 4 +- plugins/Scriver/src/chat/log.cpp | 6 +- plugins/Scriver/src/chat/tools.cpp | 2 +- plugins/Scriver/src/msglog.cpp | 2 +- plugins/SimpleStatusMsg/src/main.cpp | 24 ++-- plugins/SpellChecker/src/spellchecker.cpp | 4 +- plugins/TabSRMM/src/chat/log.cpp | 2 +- plugins/TabSRMM/src/chat/tools.cpp | 2 +- plugins/UserInfoEx/src/dlg_propsheet.cpp | 2 +- .../src/ex_import/classExImContactXML.cpp | 2 +- plugins/Utils/mir_options.cpp | 4 +- protocols/AimOscar/src/avatars.cpp | 5 +- protocols/FacebookRM/src/proto.cpp | 2 +- protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/IRCG/src/irclib.cpp | 4 +- protocols/IRCG/src/ircproto.cpp | 4 +- protocols/IRCG/src/options.cpp | 2 +- protocols/IRCG/src/services.cpp | 6 +- protocols/IcqOscarJ/src/icq_avatar.cpp | 4 +- protocols/MRA/src/MraAvatars.cpp | 2 +- protocols/MSN/src/msn_misc.cpp | 4 +- protocols/Skype/src/skype_utils.cpp | 4 +- protocols/Twitter/src/proto.cpp | 6 +- protocols/Yahoo/src/avatar.cpp | 146 ++++++++++----------- src/core/stdchat/src/log.cpp | 2 +- src/core/stdchat/src/tools.cpp | 2 +- src/modules/netlib/netlibhttp.cpp | 2 +- src/modules/protocols/protoopts.cpp | 2 +- src/modules/skin/skinicons.cpp | 22 ++-- 34 files changed, 144 insertions(+), 155 deletions(-) diff --git a/include/m_utils.h b/include/m_utils.h index bd9f21d887..6e418fdc6c 100644 --- a/include/m_utils.h +++ b/include/m_utils.h @@ -1,3 +1,4 @@ + /* Miranda IM: the free IM client for Microsoft* Windows* @@ -459,11 +460,4 @@ __forceinline TCHAR* Utils_ReplaceVarsT(const TCHAR *szData) { #define MS_UTILS_GETBITMAPFILTERSTRINGST MS_UTILS_GETBITMAPFILTERSTRINGS #endif -// allows to include TCHAR* strings into mir_snprintf and NetLib_Logf calls -#if defined(_UNICODE) - #define TCHAR_STR_PARAM "%S" -#else - #define TCHAR_STR_PARAM "%s" -#endif - #endif // M_UTILS_H__ diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 44af0befa5..814e5658ef 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -85,7 +85,7 @@ void AddContactDlgOpts(HWND hdlg, const char* szProto, BOOL bAuthOptsOnly = FALS { size_t cbLen = strlen(szUniqueId) + 2; TCHAR* pszUniqueId = (TCHAR*)mir_alloc(cbLen * sizeof(TCHAR)); - mir_sntprintf(pszUniqueId, cbLen, _T(TCHAR_STR_PARAM) _T(":"), szUniqueId); + mir_sntprintf(pszUniqueId, cbLen, _T("%S:"), szUniqueId); SetDlgItemText(hdlg, IDC_IDLABEL, pszUniqueId); mir_free(pszUniqueId); } @@ -324,7 +324,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp } psr = (PROTOSEARCHRESULT*)mir_calloc(sizeof(TLEN_SEARCH_RESULT)); psr->cbSize = sizeof(TLEN_SEARCH_RESULT); - mir_snprintf(((TLEN_SEARCH_RESULT*)psr)->jid, SIZEOF(((TLEN_SEARCH_RESULT*)psr)->jid), TCHAR_STR_PARAM, szUserId); + mir_snprintf(((TLEN_SEARCH_RESULT*)psr)->jid, SIZEOF(((TLEN_SEARCH_RESULT*)psr)->jid), "%S", szUserId); } else { diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index 285b575bb8..f93fe1998e 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -37,10 +37,10 @@ static void __stdcall FileActionAsync(void *param) switch(InvokeFileHandler(pszFilePath)) { /* pszFilePath is always a long path name */ case 0: /* success */ break; case CALLSERVICE_NOTFOUND: - ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open file"),Translate("Miranda NG was not able to open \""TCHAR_STR_PARAM"\".\n\nThere is no registered handler for this file type."),pszFilePath); + ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open file"),Translate("Miranda NG was not able to open \"%S\".\n\nThere is no registered handler for this file type."),pszFilePath); break; default: - ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open file"),Translate("Miranda NG was not able to open \""TCHAR_STR_PARAM"\".\n\nThe file could not be processed."),pszFilePath); + ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open file"),Translate("Miranda NG was not able to open \"%S\".\n\nThe file could not be processed."),pszFilePath); } mir_free(pszFilePath); /* async param */ } @@ -53,10 +53,10 @@ static void __stdcall UrlActionAsync(void *param) switch(InvokeUrlHandler(pszUrl)) { case 0: /* success */ break; case CALLSERVICE_NOTFOUND: - ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open URL"),Translate("Miranda NG was not able to open \""TCHAR_STR_PARAM"\".\n\nThere is no registered handler for this URL type."),pszUrl); + ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open URL"),Translate("Miranda NG was not able to open \"%S\".\n\nThere is no registered handler for this URL type."),pszUrl); break; default: - ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open URL"),Translate("Miranda NG was not able to open \""TCHAR_STR_PARAM"\".\n\nThe given URL is invalid and can not be parsed."),pszUrl); + ShowInfoMessage(NIIF_ERROR,Translate("Miranda NG could not open URL"),Translate("Miranda NG was not able to open \"%S\".\n\nThe given URL is invalid and can not be parsed."),pszUrl); } mir_free(pszUrl); /* async param */ } diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 1069fe2628..c1f628869f 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -192,7 +192,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l for (i = 0; i < gTreeData.getCount(); ++i) { switch (gTreeData[i]->typ) { case 1: //Treeview part for typ 1 (notification) - mir_snprintf(iconName, sizeof(iconName), "%s_"TCHAR_STR_PARAM"_"TCHAR_STR_PARAM, MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription); + mir_snprintf(iconName, sizeof(iconName), "%s_%S_%S", MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription); iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(iconName)); wsprintf(itemName, _T("%s/%s"), gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription); break; diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 8d91d6c1aa..62996597e2 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -290,7 +290,7 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw //check "Skin options" state char prefix[128]; - mir_snprintf(prefix, sizeof(prefix),"skin."TCHAR_STR_PARAM, PopUpOptions.SkinPack); + mir_snprintf(prefix, sizeof(prefix),"skin.%S", PopUpOptions.SkinPack); OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount, DBGetContactSettingDword(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options")); diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 33e5094e6b..d862b88d2b 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -373,7 +373,7 @@ void PopupWnd2::show() if (*PopUpOptions.Effect) { char vfxService[128]; - mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/"TCHAR_STR_PARAM, PopUpOptions.Effect); + mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/%S", PopUpOptions.Effect); if (ServiceExists(vfxService)) if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) { @@ -471,7 +471,7 @@ void PopupWnd2::hide() if (*PopUpOptions.Effect) { char vfxService[128]; - mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/"TCHAR_STR_PARAM, PopUpOptions.Effect); + mir_snprintf(vfxService, sizeof(vfxService), "PopUp/Vfx/%S", PopUpOptions.Effect); if (ServiceExists(vfxService)) if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) { diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index 7b886c0ee3..24983d2c4b 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -882,9 +882,9 @@ char * Log_CreateRtfHeader(MODULEINFO * mi, SESSION_INFO* si) // font table AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\rtf1\\ansi\\deff0{\\fonttbl"); - for (i = 0; i < OPTIONS_FONTCOUNT; i++) { - AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u" TCHAR_STR_PARAM ";}", i, (!forceCharset) ? aFonts[i].lf.lfCharSet : charset, aFonts[i].lf.lfFaceName); - } + for (i = 0; i < OPTIONS_FONTCOUNT; i++) + AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u%S;}", i, (!forceCharset) ? aFonts[i].lf.lfCharSet : charset, aFonts[i].lf.lfFaceName); + // colour table AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "}{\\colortbl ;"); diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 0eda0e0b52..6fa6592bcc 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -129,7 +129,7 @@ static int ShowPopup (HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* psz else pd.lchIcon = GetCachedIcon("chat_window"); - mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME-1, _T(TCHAR_STR_PARAM) _T(" - %s"), + mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME-1, _T("%S - %s"), pszProtoName, CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR )); lstrcpyn( pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE-1); pd.iSeconds = g_Settings.iPopupTimeout; diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 8e2051761f..6bd33e9264 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -386,7 +386,7 @@ static char *CreateRTFHeader(struct SrmmWindowData *dat, struct GlobalMessageDat AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\rtf1\\ansi\\deff0{\\fonttbl"); for (i = 0; i < fontOptionsListSize; i++) { LoadMsgDlgFont(i, &lf, NULL, FALSE); - AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u " TCHAR_STR_PARAM ";}", i, + AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u %S;}", i, (!forceCharset) ? lf.lfCharSet : charset, lf.lfFaceName); } AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "}{\\colortbl "); diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 712b8a6b40..95213ff9c3 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -576,9 +576,9 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) DBWriteMessage(szSetting, tszMsg); #ifdef _DEBUG if (bIsFormat) - log2file("SaveMessageToDB(): Set \"" TCHAR_STR_PARAM "\" status message (without inserted vars) for %s.", tszMsg, accounts->pa[i]->szModuleName); + log2file("SaveMessageToDB(): Set \"%S\" status message (without inserted vars) for %s.", tszMsg, accounts->pa[i]->szModuleName); else - log2file("SaveMessageToDB(): Set \"" TCHAR_STR_PARAM "\" status message for %s.", tszMsg, accounts->pa[i]->szModuleName); + log2file("SaveMessageToDB(): Set \"%S\" status message for %s.", tszMsg, accounts->pa[i]->szModuleName); #endif } } @@ -591,9 +591,9 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) DBWriteMessage(szSetting, tszMsg); #ifdef _DEBUG if (bIsFormat) - log2file("SaveMessageToDB(): Set \"" TCHAR_STR_PARAM "\" status message (without inserted vars) for %s.", tszMsg, szProto); + log2file("SaveMessageToDB(): Set \"%S\" status message (without inserted vars) for %s.", tszMsg, szProto); else - log2file("SaveMessageToDB(): Set \"" TCHAR_STR_PARAM "\" status message for %s.", tszMsg, szProto); + log2file("SaveMessageToDB(): Set \"%S\" status message for %s.", tszMsg, szProto); #endif } } @@ -668,7 +668,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, format = GetAwayMessageFormat(iStatus, szProto); } #ifdef _DEBUG - log2file("GetAwayMessage(): %s has %s status and \"" TCHAR_STR_PARAM "\" status message.", szProto, StatusModeToDbSetting(iStatus, ""), format); + log2file("GetAwayMessage(): %s has %s status and \"%S\" status message.", szProto, StatusModeToDbSetting(iStatus, ""), format); #endif if (bInsertVars && format != NULL) @@ -845,7 +845,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA { TCHAR *msg = NULL; #ifdef _DEBUG - log2file("SetStatusMessage(\"%s\", %d, %d, \"" TCHAR_STR_PARAM "\", %d)", szProto, iInitialStatus, iStatus, message, bOnStartup); + log2file("SetStatusMessage(\"%s\", %d, %d, \"%S\", %d)", szProto, iInitialStatus, iStatus, message, bOnStartup); #endif if (szProto) { @@ -1172,7 +1172,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) //else // msg = mir_tstrdup(_T("")); #ifdef _DEBUG - log2file("ChangeStatusMessage(): Set %s status and \"" TCHAR_STR_PARAM "\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto); + log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto); #endif SetStatusMessage(szProto, iStatus, iStatus, msg, FALSE); if (msg) mir_free(msg); @@ -1183,7 +1183,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) { TCHAR *msg = GetAwayMessageFormat(iStatus, szProto); #ifdef _DEBUG - log2file("ChangeStatusMessage(): Set %s status and \"" TCHAR_STR_PARAM "\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto); + log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, szProto); #endif SetStatusMessage(szProto, iStatus, iStatus, msg, FALSE); if (msg) mir_free(msg); @@ -1253,7 +1253,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) else msg = GetAwayMessageFormat(iStatus, NULL); #ifdef _DEBUG - log2file("ChangeStatusMessage(): Set %s status and \"" TCHAR_STR_PARAM "\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, accounts->pa[i]->szModuleName); + log2file("ChangeStatusMessage(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), msg, accounts->pa[i]->szModuleName); #endif SetStatusMessage(accounts->pa[i]->szModuleName, iStatus, iStatus, msg, FALSE); if (msg) { mir_free(msg); msg = NULL; } @@ -1360,7 +1360,7 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) } #ifdef _DEBUG - log2file("ProcessProtoAck(): Send away message \"" TCHAR_STR_PARAM "\" reply.", tszMsg); + log2file("ProcessProtoAck(): Send away message \"%S\" reply.", tszMsg); #endif if (tszMsg) mir_free(tszMsg); return 0; @@ -1420,7 +1420,7 @@ int SetStartupStatus(int i) fmsg = GetAwayMessageFormat(iStatus, accounts->pa[i]->szModuleName); #ifdef _DEBUG - log2file("SetStartupStatus(): Set %s status and \"" TCHAR_STR_PARAM "\" status message for %s.", StatusModeToDbSetting(iStatus, ""), fmsg, accounts->pa[i]->szModuleName); + log2file("SetStartupStatus(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iStatus, ""), fmsg, accounts->pa[i]->szModuleName); #endif if (fmsg) @@ -1581,7 +1581,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d if (tszMsg && lstrlen(tszMsg)) { #ifdef _DEBUG - log2file("UpdateMsgTimerProc(): Set %s status and \"" TCHAR_STR_PARAM "\" status message for %s.", StatusModeToDbSetting(iCurrentStatus, ""), tszMsg, accounts->pa[i]->szModuleName); + log2file("UpdateMsgTimerProc(): Set %s status and \"%S\" status message for %s.", StatusModeToDbSetting(iCurrentStatus, ""), tszMsg, accounts->pa[i]->szModuleName); #endif Proto_SetStatus(accounts->pa[i]->szModuleName, iCurrentStatus, iCurrentStatus, tszMsg); SaveMessageToDB(accounts->pa[i]->szModuleName, tszMsg, FALSE); diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 2b554dfe69..d7dfd16406 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -81,7 +81,7 @@ static int IconsChanged(WPARAM wParam, LPARAM lParam) sid.dwId = i; char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "%s - " TCHAR_STR_PARAM, + mir_snprintf(tmp, SIZEOF(tmp), "%s - %S", Translate("Spell Checker"), languages[i]->full_name); sid.szTooltip = tmp; @@ -221,7 +221,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) sid.dwId = i; char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "%s - " TCHAR_STR_PARAM, + mir_snprintf(tmp, SIZEOF(tmp), "%s - %S", Translate("Spell Checker"), languages[i]->full_name); sid.szTooltip = tmp; diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index a6cfde546c..57b6fadff8 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -1200,7 +1200,7 @@ char * Log_CreateRtfHeader(MODULEINFO * mi) // font table Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\rtf1\\ansi\\deff0{\\fonttbl"); for (i=0; i < OPTIONS_FONTCOUNT ; i++) - Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u" TCHAR_STR_PARAM ";}", i, aFonts[i].lf.lfCharSet, aFonts[i].lf.lfFaceName); + Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u%S;}", i, aFonts[i].lf.lfCharSet, aFonts[i].lf.lfFaceName); // colour table Log_Append(&buffer, &bufferEnd, &bufferAlloced, "}{\\colortbl ;"); diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index c2e0644c95..dfe7071225 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -217,7 +217,7 @@ static int ShowPopup(HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* pszP else pd.lchIcon = LoadIconEx(IDI_CHANMGR, "window", 0, 0); - mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME - 1, _T(TCHAR_STR_PARAM) _T(" - %s"), + mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME - 1, _T("%S - %s"), pszProtoName, CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)); lstrcpyn(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE - 1); pd.iSeconds = g_Settings.iPopupTimeout; diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 1819dcafd2..0e964e1775 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -459,7 +459,7 @@ static INT OnShutdown(WPARAM wParam, LPARAM lParam) static INT AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProto = NULL) { TCHAR szTitle[MAX_PATH]; - const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, SIZEOF(szTitle), _T(TCHAR_STR_PARAM) _T("\\"), pszProto) : 0; + const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%S\\"), pszProto) : 0; odp.ptszTitle = szTitle; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index e06782b756..e26d636b6c 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -806,7 +806,7 @@ INT CExImContactXML::Import(BOOLEAN keepMetaSubContact) do { // update progressbar and abort if user clicked cancel pszNick = mir_utf8decodeT(xContact->Attribute("nick")); - result = _pXmlFile->_progress.UpdateContact(_T("Sub Contact: %s (") _T(TCHAR_STR_PARAM) _T(")"), pszNick, xContact->Attribute("proto")); + result = _pXmlFile->_progress.UpdateContact(_T("Sub Contact: %s (%S)"), pszNick, xContact->Attribute("proto")); if (pszNick) mir_free(pszNick); // user clicked abort button if (!result) break; diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index b6ccd76eda..a32ea2fe91 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -77,7 +77,7 @@ static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc) if (dbPath[0] == _T('\0')) { char tmp[1024]; CallService(MS_DB_GETPROFILEPATH, SIZEOF(tmp), (LPARAM) tmp); - mir_sntprintf(dbPath, SIZEOF(dbPath), _T(TCHAR_STR_PARAM) _T("\\"), tmp); + mir_sntprintf(dbPath, SIZEOF(dbPath), _T("%S\\"), tmp); } size_t len = lstrlen(dbPath); @@ -97,7 +97,7 @@ static void PathToAbsolute(TCHAR *pOut, size_t outSize, const TCHAR *pSrc) { char tmp[1024]; CallService(MS_DB_GETPROFILEPATH, SIZEOF(tmp), (LPARAM) tmp); - mir_sntprintf(dbPath, SIZEOF(dbPath), _T(TCHAR_STR_PARAM) _T("\\"), tmp); + mir_sntprintf(dbPath, SIZEOF(dbPath), _T("%S\\"), tmp); } mir_sntprintf(pOut, outSize, _T("%s%s"), dbPath, pSrc); diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index 91b5ccec23..f8017684a7 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -171,11 +171,8 @@ void CAimProto::init_custom_folders(void) TCHAR AvatarsFolder[MAX_PATH]; - TCHAR *tszModuleName = mir_a2t(m_szModuleName); - mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%s"), tszModuleName); + mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName); hAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder); - mir_free(tszModuleName); - init_cst_fld_ran = true; } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 776fe875fc..7b91d554a7 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -71,7 +71,7 @@ FacebookProto::FacebookProto(const char* proto_name,const TCHAR* username) SkinAddNewSoundExT( "OtherEvent", m_tszUserName, LPGENT( "Other Event" )); def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName; - hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_tszUserName, def_avatar_folder_.c_str()); + hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, def_avatar_folder_.c_str()); // Set all contacts offline -- in case we crashed SetAllContactStatuses( ID_STATUS_OFFLINE, true ); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 35e5159510..6db86eca5a 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -684,7 +684,7 @@ void __cdecl GGPROTO::getawaymsgthread(void *hContact) if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) { ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) dbv.ptszVal); - netlog("getawaymsgthread(): Reading away msg <" TCHAR_STR_PARAM ">.", dbv.ptszVal); + netlog("getawaymsgthread(): Reading away msg <%S>.", dbv.ptszVal); DBFreeVariant(&dbv); } else { ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE) 1, (LPARAM) NULL); diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 217861ba90..1f13b5159f 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -197,7 +197,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) con = (HANDLE) CallService( MS_NETLIB_OPENCONNECTION, (WPARAM) hNetlib, (LPARAM) & ncon); if (con == NULL) { TCHAR szTemp[300]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u)."), + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (%S: %u)."), TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort); DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false); return false; @@ -1471,7 +1471,7 @@ LBL_Parse: { if (PeerPortNrRcvd == g_Instances[i]->m_info.iPort && LocalPortNrRcvd == g_Instances[i]->m_myLocalPort) { - cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : " TCHAR_STR_PARAM " : " TCHAR_STR_PARAM "\r\n", + cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : %S : %S\r\n", szBuf, g_Instances[i]->m_info.sIdentServerType.c_str() , g_Instances[i]->m_info.sUserID.c_str()); break; } diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 0f8aa6e1bb..42aeddb16e 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -268,7 +268,7 @@ int CIrcProto::OnModulesLoaded( WPARAM, LPARAM ) } TCHAR szTemp[MAX_PATH]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\") _T(TCHAR_STR_PARAM) _T("_perform.ini"), m_szModuleName); + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName); TCHAR *szLoadFileName = Utils_ReplaceVarsT( szTemp ); char* pszPerformData = IrcLoadFile( szLoadFileName ); if ( pszPerformData != NULL ) { @@ -782,7 +782,7 @@ HANDLE __cdecl CIrcProto::SendFile( HANDLE hContact, const TCHAR*, TCHAR** ppszF index++; while( ppszFiles[index] ) { if ( _taccess(ppszFiles[index], 0) == 0 ) { - PostIrcMessage( _T("/DCC SEND %s ") _T(TCHAR_STR_PARAM), dci->sContactName.c_str(), ppszFiles[index]); + PostIrcMessage( _T("/DCC SEND %s %S"), dci->sContactName.c_str(), ppszFiles[index]); } index++; } diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index a01e34822b..db56f9aded 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1362,7 +1362,7 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, void CIrcProto::InitIgnore( void ) { TCHAR szTemp[ MAX_PATH ]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\") _T(TCHAR_STR_PARAM) _T("_ignore.ini"), m_szModuleName); + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName); TCHAR *szLoadFileName = Utils_ReplaceVarsT( szTemp ); char* pszIgnoreData = IrcLoadFile(szLoadFileName); if ( pszIgnoreData != NULL ) { diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index e1987e9e0f..d0e6814dd8 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -353,7 +353,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM) S = "+qnidcm"; else S = "+qnidc"; - PostIrcMessage( _T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@") _T(TCHAR_STR_PARAM) _T("\" %s"), + PostIrcMessage( _T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@%S\" %s"), TranslateT("Please enter the hostmask (nick!user@host) \nNOTE! Contacts on your contact list are never ignored"), TranslateT("Ignore"), host, S.c_str()); DBFreeVariant(&dbv1); @@ -1170,7 +1170,7 @@ void CIrcProto::ConnectToServer(void) InterlockedIncrement((long *) &m_bConnectRequested); TCHAR szTemp[300]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u)"), + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (%S: %u)"), TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort); DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false); } @@ -1222,7 +1222,7 @@ VOID CALLBACK RetryTimerProc( HWND, UINT, UINT_PTR idEvent, DWORD ) ppro->si.iPort = ppro->m_portCount; TCHAR szTemp[300]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (") _T(TCHAR_STR_PARAM) _T(": %u, try %u)"), + mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0033%s \002%s\002 (%S: %u, try %u)"), TranslateT("Reconnecting to"), ppro->si.sNetwork.c_str(), ppro->si.sServer.c_str(), ppro->si.iPort, ppro->m_iRetryCount); ppro->DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false); diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 53f7ee59c4..f302d3df81 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -92,7 +92,7 @@ void CIcqProto::InitAvatars() // check if it does make sense TCHAR tszPath[MAX_PATH * 2]; - null_snprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM) _T("\\"), m_szModuleName); + null_snprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\%S\\"), m_szModuleName); hAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, tszPath); } @@ -134,7 +134,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, if (CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) { TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%")); - null_snprintf(szPath, MAX_PATH * 2, _T("%s\\") _T(TCHAR_STR_PARAM) _T("\\"), tmpPath, m_szModuleName); + null_snprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), tmpPath, m_szModuleName); mir_free(tmpPath); } else diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index bf287cea67..30d1ee6d35 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -90,7 +90,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) if (pmraaqAvatarsQueue->hNetlibUser) { TCHAR tszPath[ MAX_PATH ]; mir_sntprintf( tszPath, SIZEOF(tszPath), _T("%%miranda_avatarcache%%\\%s"), m_tszUserName); - pmraaqAvatarsQueue->hAvatarsPath = FoldersRegisterCustomPathT("Avatars", m_tszUserName, tszPath); + pmraaqAvatarsQueue->hAvatarsPath = FoldersRegisterCustomPathT("Avatars", m_szModuleName, tszPath); InterlockedExchange((volatile LONG*)&pmraaqAvatarsQueue->bIsRunning, TRUE); pmraaqAvatarsQueue->hThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index feaea0851c..2b5860dadc 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -142,10 +142,10 @@ void CMsnProto::InitCustomFolders(void) TCHAR *tszModuleName = mir_a2t(m_szModuleName); mir_sntprintf(folder, SIZEOF(folder), _T("%%miranda_userdata%%\\Avatars\\%s"), tszModuleName); - hMSNAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_tszUserName, folder); + hMSNAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, folder); mir_sntprintf(folder, SIZEOF(folder), _T("%%miranda_userdata%%\\Avatars\\%s"), tszModuleName); - hCustomSmileyFolder = FoldersRegisterCustomPathT(m_szModuleName, "Custom Smiley", folder); + hCustomSmileyFolder = FoldersRegisterCustomPathT("Custom Smileys", m_szModuleName, folder); mir_free(tszModuleName); InitCstFldRan = true; diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index ed8f920abc..534f4b2087 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -330,7 +330,7 @@ void CSkypeProto::InitCustomFolders() m_bInitDone = true; TCHAR AvatarsFolder[MAX_PATH]; - mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM), this->m_szModuleName); + mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), this->m_szModuleName); m_hAvatarsFolder = ::FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder); } @@ -343,7 +343,7 @@ wchar_t* CSkypeProto::GetContactAvatarFilePath(HANDLE hContact) if (m_hAvatarsFolder == NULL || FoldersGetCustomPathT(m_hAvatarsFolder, path, MAX_PATH, _T(""))) { wchar_t *tmpPath = ::Utils_ReplaceVarsT(L"%miranda_avatarcache%"); - ::mir_sntprintf(path, MAX_PATH, _T("%s\\") _T(TCHAR_STR_PARAM), tmpPath, this->m_szModuleName); + ::mir_sntprintf(path, MAX_PATH, _T("%s\\%S"), tmpPath, this->m_szModuleName); mir_free(tmpPath); } diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 86d958f82d..373662c543 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -48,10 +48,8 @@ TwitterProto::TwitterProto(const char *proto_name,const TCHAR *username) HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &TwitterProto::OnBuildStatusMenu, this); HookProtoEvent(ME_OPT_INITIALISE, &TwitterProto::OnOptionsInit, this); - TCHAR *profile = Utils_ReplaceVarsT( _T("%miranda_avatarcache%")); - def_avatar_folder_ = std::tstring(profile) + _T("\\") + m_tszUserName; - mir_free(profile); - hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_tszUserName, def_avatar_folder_.c_str()); + def_avatar_folder_ = std::tstring( VARST( _T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName; + hAvatarFolder_ = FoldersRegisterCustomPathT("Avatars", m_szModuleName, def_avatar_folder_.c_str()); // Initialize hotkeys char text[512]; diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 3af58910f5..7386810eb1 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -1,9 +1,9 @@ /* * $Id: avatar.cpp 14178 2012-03-11 15:02:54Z borkra $ * - * myYahoo Miranda Plugin + * myYahoo Miranda Plugin * - * Authors: Gennady Feldman (aka Gena01) + * Authors: Gennady Feldman (aka Gena01) * Laurent Marechal (aka Peorth) * * This code is under GPL and is based on AIM, MSN and Miranda source code. @@ -26,9 +26,9 @@ int YAHOO_avt_hash(const char *key, DWORD len) { - /* + /* Thank you Pidgin and Kopete devs. It seems that both clients are using this code now. - + */ const unsigned char *p = (const unsigned char *)key; @@ -42,7 +42,7 @@ int YAHOO_avt_hash(const char *key, DWORD len) checksum &= ~g; } - + return checksum; } @@ -103,7 +103,7 @@ void upload_avt(int id, int fd, int error, void *data) LOG(("File send complete!")); } -void __cdecl CYahooProto::send_avt_thread(void *psf) +void __cdecl CYahooProto::send_avt_thread(void *psf) { struct yahoo_file_info *sf = ( yahoo_file_info* )psf; if (sf == NULL) { @@ -150,7 +150,7 @@ struct avatar_info{ int cksum; }; -void __cdecl CYahooProto::recv_avatarthread(void *pavt) +void __cdecl CYahooProto::recv_avatarthread(void *pavt) { PROTO_AVATAR_INFORMATIONT AI; struct avatar_info *avt = ( avatar_info* )pavt; @@ -234,12 +234,12 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) if (GetDword(hContact, "PictCK", 0) != avt->cksum) { LOG(("WARNING: Checksum updated during download?!")); error = 1; /* don't use this one? */ - } + } SetDword(hContact, "PictLoading", 0); LOG(("File download complete!?")); - if (error) + if (error) buf[0]='\0'; free(avt->who); @@ -250,8 +250,8 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) AI.format = PA_FORMAT_PNG; AI.hContact = hContact; _tcsncpy(AI.filename, buf, SIZEOF(AI.filename)); - - if (error) + + if (error) SetDword(hContact, "PictCK", 0); ProtoBroadcastAck(m_szModuleName, hContact, ACKTYPE_AVATAR, !error ? ACKRESULT_SUCCESS:ACKRESULT_FAILED,(HANDLE) &AI, 0); @@ -260,29 +260,29 @@ void __cdecl CYahooProto::recv_avatarthread(void *pavt) void CYahooProto::ext_got_picture(const char *me, const char *who, const char *pic_url, int cksum, int type) { HANDLE hContact = 0; - + LOG(("[ext_yahoo_got_picture] for %s with url %s (checksum: %d) type: %d", who, pic_url, cksum, type)); - + /* Type: - + 1 - Send Avatar Info 2 - Got Avatar Info 3 - YIM6 didn't like my avatar? Expired? We need to invalidate and re-load */ switch (type) { - case 1: + case 1: { int cksum=0; DBVARIANT dbv; - + /* need to send avatar info */ if (!GetByte("ShowAvatars", 1 )) { LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!")); yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled) return; } - + LOG(("[ext_yahoo_got_picture] Getting ready to send info!")); /* need to read CheckSum */ cksum = GetDword("AvatarHash", 0); @@ -295,7 +295,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p break; } else LOG(("No AvatarURL???")); - + /* * Try to re-upload the avatar */ @@ -303,39 +303,39 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p // NO avatar URL?? if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv)) { struct _stat statbuf; - + if (_tstat( dbv.ptszVal, &statbuf ) != 0) { LOG(("[ext_yahoo_got_picture] Avatar File Missing? Can't find file: %s", dbv.ptszVal)); } else { db_set_s(NULL, m_szModuleName, "AvatarInv", who); SendAvatar(dbv.ptszVal); } - + DBFreeVariant(&dbv); } else { LOG(("[ext_yahoo_got_picture] No Local Avatar File??? ")); } - } else + } else LOG(("[ext_yahoo_got_picture] Another avatar upload in progress?")); } } break; case 2: /* - * We got Avatar Info for our buddy. + * We got Avatar Info for our buddy. */ if (!GetByte("ShowAvatars", 1 )) { LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!")); return; } - + /* got avatar info, so set miranda up */ hContact = getbuddyH(who); - + if (!hContact) { LOG(("[ext_yahoo_got_picture] Buddy not on my buddy list?.")); return; } - + if (!cksum && pic_url) { const char *chk = strstr(pic_url, "chksum="); if (chk) @@ -345,19 +345,19 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p if (!cksum || cksum == -1) { LOG(("[ext_yahoo_got_picture] Resetting avatar.")); db_set_dw(hContact, m_szModuleName, "PictCK", 0); - + reset_avatar(hContact); } else { if (pic_url == NULL) { LOG(("[ext_yahoo_got_picture] WARNING: Empty URL for avatar?")); return; } - + TCHAR z[1024]; GetAvatarFileName(hContact, z, 1024, db_get_b(hContact, m_szModuleName,"AvatarType", 0)); - + if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) != cksum || _taccess( z, 0) != 0) { - + DebugLog("[ext_yahoo_got_picture] Checksums don't match or avatar file is missing. Current: %d, New: %d",(int)db_get_dw(hContact, m_szModuleName,"PictCK", 0), cksum); struct avatar_info *avt = ( avatar_info* )malloc(sizeof(struct avatar_info)); @@ -370,7 +370,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p } break; - case 3: + case 3: /* * Our Avatar is not good anymore? Need to re-upload?? */ @@ -378,14 +378,14 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p { int mcksum=0; DBVARIANT dbv; - + /* need to send avatar info */ if (!GetByte("ShowAvatars", 1 )) { LOG(("[ext_yahoo_got_picture] We are not using/showing avatars!")); yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled) return; } - + LOG(("[ext_yahoo_got_picture] Getting ready to send info!")); /* need to read CheckSum */ mcksum = GetDword("AvatarHash", 0); @@ -395,34 +395,34 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p yahoo_send_picture_update(m_id, who, 0); // no avatar (disabled) return; } - + LOG(("[ext_yahoo_got_picture] My Checksum: %d", mcksum)); - + if (!GetString("AvatarURL", &dbv)) { if (lstrcmpiA(pic_url, dbv.pszVal) == 0) { DBVARIANT dbv2; /*time_t ts; DWORD ae;*/ - + if (mcksum != cksum) - LOG(("[ext_yahoo_got_picture] WARNING: Checksums don't match!")); - + LOG(("[ext_yahoo_got_picture] WARNING: Checksums don't match!")); + /*time(&ts); ae = GetDword("AvatarExpires", 0); - + if (ae != 0 && ae > (ts - 300)) { LOG(("[ext_yahoo_got_picture] Current Time: %lu Expires: %lu ", ts, ae)); LOG(("[ext_yahoo_got_picture] We just reuploaded! Stop screwing with Yahoo FT. ")); - + // don't leak stuff DBFreeVariant(&dbv); break; }*/ - + LOG(("[ext_yahoo_got_picture] Buddy: %s told us this is bad??Expired??. Re-uploading", who)); db_unset(NULL, m_szModuleName, "AvatarURL"); - + if (!DBGetContactSettingTString(NULL, m_szModuleName, "AvatarFile", &dbv2)) { db_set_s(NULL, m_szModuleName, "AvatarInv", who); SendAvatar(dbv2.ptszVal); @@ -444,7 +444,7 @@ void CYahooProto::ext_got_picture(const char *me, const char *who, const char *p default: LOG(("[ext_yahoo_got_picture] Unknown request/packet type exiting!")); } - + LOG(("ext_yahoo_got_picture exiting")); } @@ -526,7 +526,7 @@ void CYahooProto::ext_got_picture_status(const char *me, const char *who, int bu void CYahooProto::ext_got_picture_upload(const char *me, const char *url,unsigned int ts) { int cksum = 0; - DBVARIANT dbv; + DBVARIANT dbv; LOG(("[ext_yahoo_got_picture_upload] url: %s timestamp: %d", url, ts)); @@ -605,7 +605,7 @@ void CYahooProto::request_avatar(const char* who) /* * time() - in seconds ( 60*60 = 1 hour) */ - if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) == 0 || + if (db_get_dw(hContact, m_szModuleName,"PictCK", 0) == 0 || last_chk == 0 || (cur_time - last_chk) > 60) { db_set_dw(hContact, m_szModuleName, "PictLastCheck", (DWORD)cur_time); @@ -620,12 +620,12 @@ void CYahooProto::request_avatar(const char* who) void CYahooProto::InitCustomFolders(void) { if (InitCstFldRan) - return; + return; InitCstFldRan = true; TCHAR AvatarsFolder[MAX_PATH]; - mir_sntprintf(AvatarsFolder, MAX_PATH, _T("%%miranda_avatarcache%%\\") _T(TCHAR_STR_PARAM), m_szModuleName); + mir_sntprintf(AvatarsFolder, MAX_PATH, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName); hYahooAvatarsFolder = FoldersRegisterCustomPathT("Avatars", m_szModuleName, AvatarsFolder); } @@ -642,7 +642,7 @@ void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, tPathLen = _tcslen( pszDest ); } else { TCHAR *tmpPath = Utils_ReplaceVarsT( _T("%miranda_avatarcache%")); - tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\") _T(TCHAR_STR_PARAM), tmpPath, m_szModuleName); + tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), tmpPath, m_szModuleName); mir_free(tmpPath); } @@ -653,9 +653,9 @@ void CYahooProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, int cbLen, int ck_sum = db_get_dw(hContact, m_szModuleName,"PictCK", 0); tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%lX"), ck_sum); } else { - tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\") _T(TCHAR_STR_PARAM) _T(" avatar"), m_szModuleName); + tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%S avatar"), m_szModuleName); } - + mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("%s"), type == 1 ? _T(".swf") : _T(".png")); } @@ -688,17 +688,17 @@ INT_PTR __cdecl CYahooProto::GetAvatarInfo(WPARAM wParam,LPARAM lParam) return GAIR_NOAVATAR; } - if (db_get_dw(AI->hContact, m_szModuleName,"PictCK", 0) == 0) + if (db_get_dw(AI->hContact, m_szModuleName,"PictCK", 0) == 0) return GAIR_NOAVATAR; GetAvatarFileName(AI->hContact, AI->filename, SIZEOF(AI->filename), db_get_b(AI->hContact, m_szModuleName,"AvatarType", 0)); AI->format = PA_FORMAT_PNG; DebugLog("[YAHOO_GETAVATARINFO] filename: %s", AI->filename); - if (_taccess( AI->filename, 0) == 0) + if (_taccess( AI->filename, 0) == 0) return GAIR_SUCCESS; - if (( wParam & GAIF_FORCE ) != 0 && AI->hContact != NULL) { + if (( wParam & GAIF_FORCE ) != 0 && AI->hContact != NULL) { /* need to request it again? */ if (GetDword(AI->hContact, "PictLoading", 0) != 0 && (time(NULL) - GetDword(AI->hContact, "PictLastCheck", 0) < 500)) { @@ -732,7 +732,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) int res = 0; switch (wParam) { - case AF_MAXSIZE: + case AF_MAXSIZE: LOG(("[YahooGetAvatarCaps] AF_MAXSIZE")); ((POINT*)lParam)->x = 96; @@ -740,7 +740,7 @@ INT_PTR __cdecl CYahooProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) break; - case AF_PROPORTION: + case AF_PROPORTION: LOG(("[YahooGetAvatarCaps] AF_PROPORTION")); res = PIP_NONE; @@ -828,13 +828,13 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) GetAvatarFileName(NULL, tszMyFile, MAX_PATH, 2); if (tszFile == NULL) { - DebugLog("[Deleting Avatar Info]"); + DebugLog("[Deleting Avatar Info]"); /* remove ALL our Avatar Info Keys */ - db_unset(NULL, m_szModuleName, "AvatarFile"); + db_unset(NULL, m_szModuleName, "AvatarFile"); db_unset(NULL, m_szModuleName, "AvatarHash"); - db_unset(NULL, m_szModuleName, "AvatarURL"); - db_unset(NULL, m_szModuleName, "AvatarTS"); + db_unset(NULL, m_szModuleName, "AvatarURL"); + db_unset(NULL, m_szModuleName, "AvatarTS"); /* Send a Yahoo packet saying we don't got an avatar anymore */ yahoo_send_picture_status(m_id, 0); @@ -848,12 +848,12 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) unsigned int hash; HANDLE hFile; - hFile = CreateFile(tszFile, - GENERIC_READ, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, + hFile = CreateFile(tszFile, + GENERIC_READ, + FILE_SHARE_READ|FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); if ( hFile == INVALID_HANDLE_VALUE ) @@ -866,13 +866,13 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) ReadFile( hFile, pResult, dwPngSize, &dw, NULL); CloseHandle( hFile ); - hFile = CreateFile(tszMyFile, - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - OPEN_ALWAYS, + hFile = CreateFile(tszMyFile, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - if ( hFile == INVALID_HANDLE_VALUE ) + if ( hFile == INVALID_HANDLE_VALUE ) return 1; WriteFile( hFile, pResult, dwPngSize, &dw, NULL); @@ -883,7 +883,7 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) free( pResult ); if ( hash ) { - LOG(("[YAHOO_SetAvatar] File: '%s' CK: %d", tszMyFile, hash)); + LOG(("[YAHOO_SetAvatar] File: '%s' CK: %d", tszMyFile, hash)); /* now check and make sure we don't reupload same thing over again */ if (hash != GetDword("AvatarHash", 0)) { @@ -897,8 +897,8 @@ INT_PTR __cdecl CYahooProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) } SendAvatar(tszMyFile); - } - else LOG(("[YAHOO_SetAvatar] Same checksum and avatar on YahooFT. Not Reuploading.")); + } + else LOG(("[YAHOO_SetAvatar] Same checksum and avatar on YahooFT. Not Reuploading.")); } } return 0; diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp index 193c9bb719..7720d1dddf 100644 --- a/src/core/stdchat/src/log.cpp +++ b/src/core/stdchat/src/log.cpp @@ -607,7 +607,7 @@ char * Log_CreateRtfHeader(MODULEINFO * mi) // font table Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\rtf1\\ansi\\deff0{\\fonttbl"); for (i = 0; i < OPTIONS_FONTCOUNT; i++) - Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u" TCHAR_STR_PARAM ";}", i, aFonts[i].lf.lfCharSet, aFonts[i].lf.lfFaceName); + Log_Append(&buffer, &bufferEnd, &bufferAlloced, "{\\f%u\\fnil\\fcharset%u%S;}", i, aFonts[i].lf.lfCharSet, aFonts[i].lf.lfFaceName); // colour table Log_Append(&buffer, &bufferEnd, &bufferAlloced, "}{\\colortbl ;"); diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index d89e1725dd..d27c147617 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -143,7 +143,7 @@ static int ShowPopup (HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* psz else pd.lchIcon = LoadIconEx( "window", FALSE ); - mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME-1, _T(TCHAR_STR_PARAM) _T(" - %s"), + mir_sntprintf(pd.lptzContactName, MAX_CONTACTNAME-1, _T("%S - %s"), pszProtoName, CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR )); lstrcpyn( pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE-1); pd.iSeconds = g_Settings.iPopupTimeout; diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index f675ba8c0f..a2ff6e94d3 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -301,7 +301,7 @@ struct HttpSecurityContext szChallenge, szLogin, szPassw, true, complete); if ( !szAuthHdr) { - NetlibLogf(NULL, "Security login %s failed, user: " TCHAR_STR_PARAM " pssw: " TCHAR_STR_PARAM, + NetlibLogf(NULL, "Security login %s failed, user: %S pssw: %S", szProvider, szLogin ? szLogin : _T("(no user)"), szPassw ? _T("(exist)") : _T("(no psw)")); } else if (justCreated) diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index e94abb718b..7b128dcea7 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -611,7 +611,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (lps->itemID == (unsigned)dat->iSelected) { SelectObject(lps->hDC, dat->hfntText); - mir_sntprintf(text, size, _T("%s: ") _T(TCHAR_STR_PARAM), TranslateT("Protocol"), acc->szProtoName); + mir_sntprintf(text, size, _T("%s: %S"), TranslateT("Protocol"), acc->szProtoName); length = lstrlen(text); DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_END_ELLIPSIS); GetTextExtentPoint32(lps->hDC, text, length, &sz); diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index b9400eeedf..fae9cc9d7c 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -277,11 +277,11 @@ HICON LoadSkinProtoIcon(const char* szProto, int status, bool big) str = _tcsrchr(szPath, '\\'); if (str != NULL) *str = 0; - mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Icons\\proto_") _T(TCHAR_STR_PARAM) _T(".dll"), szPath, pa->szProtoName); + mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName); if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES) sid.ptszDefaultFile = szFullPath; else { - mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Plugins\\") _T(TCHAR_STR_PARAM) _T(".dll"), szPath, szProto); + mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Plugins\\%S.dll"), szPath, szProto); if ((int)ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1) > 0) { DestroyIcon(hIcon); sid.ptszDefaultFile = szFullPath; @@ -444,9 +444,9 @@ int LoadSkinIcons(void) DBDeleteContactSetting(NULL, "Icons", moduleName); // make old skinicons' prefix - mir_snprintf(moduleName, SIZEOF(moduleName), TCHAR_STR_PARAM, dbv.ptszVal); + mir_snprintf(moduleName, SIZEOF(moduleName), "%S", dbv.ptszVal); // make IcoLib's prefix - mir_snprintf(iconName, SIZEOF(iconName), "%s" TCHAR_STR_PARAM, statusIconsFmt, dbv.ptszVal); + mir_snprintf(iconName, SIZEOF(iconName), "%s%S", statusIconsFmt, dbv.ptszVal); convertOneProtocol(moduleName, iconName); db_free(&dbv); @@ -469,13 +469,13 @@ int LoadSkinIcons(void) // // Add main icons to list - // - for (i=0; i < SIZEOF(mainIcons); i++) { - mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i); - sid.pszSection = mainIcons[i].section == NULL ? LPGEN("Main Icons") : (char*)mainIcons[i].section; - sid.pszDescription = (char*)mainIcons[i].description; - sid.iDefaultIndex = mainIcons[i].resource_id; - mainIcons[i].hIcolib = IcoLib_AddNewIcon(0, &sid); + // + for (i=0; i < SIZEOF(mainIcons); i++) { + mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i); + sid.pszSection = mainIcons[i].section == NULL ? LPGEN("Main Icons") : (char*)mainIcons[i].section; + sid.pszDescription = (char*)mainIcons[i].description; + sid.iDefaultIndex = mainIcons[i].resource_id; + mainIcons[i].hIcolib = IcoLib_AddNewIcon(0, &sid); } // // Add global icons to list -- cgit v1.2.3