summaryrefslogtreecommitdiff
path: root/protocols/Tlen
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /protocols/Tlen
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen')
-rw-r--r--protocols/Tlen/src/tlen_avatar.cpp10
-rw-r--r--protocols/Tlen/src/tlen_file.cpp2
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp18
-rw-r--r--protocols/Tlen/src/tlen_muc.cpp4
-rw-r--r--protocols/Tlen/src/tlen_opt.cpp2
-rw-r--r--protocols/Tlen/src/tlen_p2p_new.cpp2
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp24
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp2
-rw-r--r--protocols/Tlen/src/tlen_ws.cpp4
9 files changed, 34 insertions, 34 deletions
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp
index 78024a40d4..83bd751010 100644
--- a/protocols/Tlen/src/tlen_avatar.cpp
+++ b/protocols/Tlen/src/tlen_avatar.cpp
@@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* ptszDest, int cbLen)
{
- int tPathLen = mir_sntprintf(ptszDest, cbLen, TEXT("%s\\%S"), VARST(TEXT("%miranda_avatarcache%")), proto->m_szModuleName);
+ int tPathLen = mir_snwprintf(ptszDest, cbLen, TEXT("%s\\%S"), VARST(TEXT("%miranda_avatarcache%")), proto->m_szModuleName);
if (_waccess(ptszDest, 0)) {
int ret = CreateDirectoryTreeT(ptszDest);
if (ret == 0)
@@ -41,7 +41,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* p
else {
proto->debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", ptszDest, errno, strerror(errno));
wchar_t buffer[512];
- mir_sntprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _wcserror(errno), ptszDest);
+ mir_snwprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _wcserror(errno), ptszDest);
PUShowMessageT(buffer, SM_WARNING);
}
}
@@ -58,9 +58,9 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, wchar_t* p
const wchar_t *tszFileType = ProtoGetAvatarExtension(format);
if (item != NULL)
- mir_sntprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S%s"), ptrA(TlenSha1(item->jid)), tszFileType);
+ mir_snwprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S%s"), ptrA(TlenSha1(item->jid)), tszFileType);
else
- mir_sntprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S_avatar%s"), proto->m_szModuleName, tszFileType);
+ mir_snwprintf(ptszDest + tPathLen, MAX_PATH - tPathLen, TEXT("%S_avatar%s"), proto->m_szModuleName, tszFileType);
}
static void RemoveAvatar(TlenProtocol *proto, MCONTACT hContact)
@@ -114,7 +114,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it
}
else {
wchar_t buffer[128];
- mir_sntprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _wcserror(errno), errno);
+ mir_snwprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _wcserror(errno), errno);
PUShowMessageT(buffer, SM_WARNING);
proto->debugLog(buffer);
return;
diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp
index 48baafe6d1..dadf79e4b3 100644
--- a/protocols/Tlen/src/tlen_file.cpp
+++ b/protocols/Tlen/src/tlen_file.cpp
@@ -583,7 +583,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info)
}
if (szFilename[0] != '\0' && ft->iqId != NULL) {
- wchar_t* filenameT = mir_utf8decodeT((char*)szFilename);
+ wchar_t* filenameT = mir_utf8decodeW((char*)szFilename);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index 364bca28c2..50d77a3c3b 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -429,38 +429,38 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode)
mir_snprintf(jsr.jid, "%s@%s", jid, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid) - 1] = '\0';
- jsr.hdr.id.w = mir_a2t(jid);
+ jsr.hdr.id.w = mir_a2u(jid);
if ((n = TlenXmlGetChild(itemNode, "nick")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.nick.w = mir_a2t(buf);
+ jsr.hdr.nick.w = mir_a2u(buf);
mir_free(buf);
}
else {
- jsr.hdr.nick.w = mir_tstrdup(TEXT(""));
+ jsr.hdr.nick.w = mir_wstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "first")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.firstName.w = mir_a2t(buf);
+ jsr.hdr.firstName.w = mir_a2u(buf);
mir_free(buf);
}
else {
- jsr.hdr.firstName.w = mir_tstrdup(TEXT(""));
+ jsr.hdr.firstName.w = mir_wstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "last")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.lastName.w = mir_a2t(buf);
+ jsr.hdr.lastName.w = mir_a2u(buf);
mir_free(buf);
}
else {
- jsr.hdr.lastName.w = mir_tstrdup(TEXT(""));
+ jsr.hdr.lastName.w = mir_wstrdup(TEXT(""));
}
if ((n = TlenXmlGetChild(itemNode, "email")) != NULL && n->text != NULL) {
char* buf = TlenTextDecode(n->text);
- jsr.hdr.email.w = mir_a2t(buf);
+ jsr.hdr.email.w = mir_a2u(buf);
mir_free(buf);
}
else {
- jsr.hdr.email.w = mir_tstrdup(TEXT(""));
+ jsr.hdr.email.w = mir_wstrdup(TEXT(""));
}
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&jsr);
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp
index 24ab3ec60b..a2a0469ff6 100644
--- a/protocols/Tlen/src/tlen_muc.cpp
+++ b/protocols/Tlen/src/tlen_muc.cpp
@@ -73,9 +73,9 @@ static char *getDisplayName(TlenProtocol *proto, const char *id)
mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if (((hContact = TlenHContactFromJID(proto, jid)) != NULL) || !mir_strcmp(id, proto->threadData->username)) {
- ptrT szName(Contact_GetInfo(CNF_DISPLAY, hContact, proto->m_szModuleName));
+ ptrW szName(Contact_GetInfo(CNF_DISPLAY, hContact, proto->m_szModuleName));
if (szName)
- return mir_t2a(szName);
+ return mir_u2a(szName);
}
}
return mir_strdup(id);
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp
index abaaa4e584..2a855116dd 100644
--- a/protocols/Tlen/src/tlen_opt.cpp
+++ b/protocols/Tlen/src/tlen_opt.cpp
@@ -656,7 +656,7 @@ static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
} else {
delay=GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE);
}
- mir_sntprintf(title, TranslateT("%S mail"), proto->m_szModuleName);
+ mir_snwprintf(title, TranslateT("%S mail"), proto->m_szModuleName);
MailPopupPreview((DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0),
(DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0),
title,
diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp
index 5cc872a3bb..d091aaa825 100644
--- a/protocols/Tlen/src/tlen_p2p_new.cpp
+++ b/protocols/Tlen/src/tlen_p2p_new.cpp
@@ -260,7 +260,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) {
char fileInfo[128];
item->ft = ft;
mir_snprintf(fileInfo, "%s file(s), %s bytes", c, s);
- wchar_t* filenameT = mir_utf8decodeT((char*)fileInfo);
+ wchar_t* filenameT = mir_utf8decodeW((char*)fileInfo);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 91d4d18ee4..ee3759740c 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -91,7 +91,7 @@ HANDLE TlenProtocol::SearchBasic(const wchar_t* id)
int iqId = 0;
if (!isOnline) return 0;
if (id == NULL) return 0;
- char* id_A = mir_t2a(id);
+ char* id_A = mir_u2a(id);
char *jid = TlenTextEncode(id_A);
if (jid != NULL) {
searchJID = mir_strdup(id_A);
@@ -111,7 +111,7 @@ HANDLE TlenProtocol::SearchByEmail(const wchar_t* email)
if (!isOnline) return 0;
if (email == NULL) return 0;
- char* email_A = mir_t2a(email);
+ char* email_A = mir_u2a(email);
char *emailEnc = TlenTextEncode(email_A);
if (emailEnc != NULL) {
TlenResetSearchQuery(this);
@@ -127,9 +127,9 @@ HANDLE TlenProtocol::SearchByName(const wchar_t* nickT, const wchar_t* firstName
{
if (!isOnline) return 0;
- char *nick = mir_t2a(nickT);
- char *firstName = mir_t2a(firstNameT);
- char *lastName = mir_t2a(lastNameT);
+ char *nick = mir_u2a(nickT);
+ char *firstName = mir_u2a(firstNameT);
+ char *lastName = mir_u2a(lastNameT);
char *p;
int iqId = 0;
@@ -418,7 +418,7 @@ int TlenProtocol::SetAwayMsg(int iStatus, const wchar_t* msg)
char **szMsg;
char *newModeMsg;
- newModeMsg = mir_t2a(msg);
+ newModeMsg = mir_u2a(msg);
debugLogA("SetAwayMsg called, wParam=%d lParam=%s", iStatus, newModeMsg);
@@ -721,7 +721,7 @@ HANDLE TlenProtocol::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath
if (!isOnline) return 0;
TLEN_FILE_TRANSFER *ft = (TLEN_FILE_TRANSFER *)hTransfer;
- ft->szSavePath = mir_strdup(mir_t2a(szPath)); //TODO convert to wchar_t*
+ ft->szSavePath = mir_strdup(mir_u2a(szPath)); //TODO convert to wchar_t*
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_FILE, ft->iqId);
if (item != NULL) {
item->ft = ft;
@@ -795,7 +795,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const wchar_t* szDescription, w
ft->filesSize = (long *)mir_alloc(sizeof(long) * ft->fileCount);
ft->allFileTotalSize = 0;
for (i = j = 0; i < ft->fileCount; i++) {
- char* ppszFiles_i_A = mir_t2a(ppszFiles[i]);
+ char* ppszFiles_i_A = mir_u2a(ppszFiles[i]);
if (_stat(ppszFiles_i_A, &statbuf))
debugLogA("'%s' is an invalid filename", ppszFiles[i]);
else {
@@ -806,7 +806,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const wchar_t* szDescription, w
mir_free(ppszFiles_i_A);
}
ft->fileCount = j;
- ft->szDescription = mir_t2a(szDescription);
+ ft->szDescription = mir_u2a(szDescription);
ft->hContact = hContact;
ft->currentFile = 0;
db_free(&dbv);
@@ -826,7 +826,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const wchar_t* szDescription, w
}
else {
if (ft->fileCount == 1) {
- char* ppszFiles_0_A = mir_t2a(ppszFiles[0]);
+ char* ppszFiles_0_A = mir_u2a(ppszFiles[0]);
if ((p = strrchr(ppszFiles_0_A, '\\')) != NULL) {
p++;
}
@@ -926,7 +926,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam)
jid = dbv.pszVal;
if ((item = TlenListGetItemPtr(this, LIST_ROSTER, dbv.pszVal)) != NULL) {
if (cws->value.type == DBVT_DELETED) {
- newNick = mir_t2a(pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE));
+ newNick = mir_u2a(pcli->pfnGetContactDisplayName(hContact, GCDNF_NOMYHANDLE));
}
else if (cws->value.pszVal != NULL) {
newNick = settingToChar(cws);
@@ -1092,7 +1092,7 @@ INT_PTR TlenProtocol::SetMyAvatar(WPARAM, LPARAM lParam)
if (CopyFile(szFileName, tFileName, FALSE) == FALSE)
return 1;
- char* tFileNameA = mir_t2a(tFileName); //TODO - drop io.h
+ char* tFileNameA = mir_u2a(tFileName); //TODO - drop io.h
int fileIn = open(tFileNameA, O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
if (fileIn != -1) {
long dwPngSize = filelength(fileIn);
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index 0002d8c9c4..6dfb47e3f8 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -936,7 +936,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id)
mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if ((hContact = TlenHContactFromJID(proto, jid)) != NULL)
- return mir_t2a(pcli->pfnGetContactDisplayName(hContact, 0));
+ return mir_u2a(pcli->pfnGetContactDisplayName(hContact, 0));
}
return mir_strdup(id);
}
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp
index 88fbf0681e..ec0a691917 100644
--- a/protocols/Tlen/src/tlen_ws.cpp
+++ b/protocols/Tlen/src/tlen_ws.cpp
@@ -32,13 +32,13 @@ BOOL TlenWsInit(TlenProtocol *proto)
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
- mir_sntprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
+ mir_snwprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = proto->m_szModuleName;
proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_TCHAR;
- mir_sntprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
+ mir_snwprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
proto->hFileNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlus.cbSize = sizeof(nlus);