summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Gadu-Gadu')
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp30
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp20
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp14
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp22
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp66
-rw-r--r--protocols/Gadu-Gadu/src/import.cpp38
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/ownerinfo.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/popups.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/userutils.cpp8
14 files changed, 126 insertions, 126 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index 0bb2a380fc..0ecdd36433 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -28,14 +28,14 @@
//
void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen)
{
- int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName);
+ int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST( L"%miranda_avatarcache%"), m_szModuleName);
if (_taccess(pszDest, 0)) {
int ret = CreateDirectoryTreeT(pszDest);
if (ret == 0)
- debugLog(_T("getAvatarFilename(): Created new directory for avatar cache: %s."), pszDest);
+ debugLog(L"getAvatarFilename(): Created new directory for avatar cache: %s.", pszDest);
else {
- debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), pszDest, errno, ws_strerror(errno));
+ debugLog(L"getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s", pszDest, errno, ws_strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), pszDest);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
@@ -48,12 +48,12 @@ void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen)
DBVARIANT dbv;
if (!getString(hContact, GG_KEY_AVATARHASH, &dbv)) {
TCHAR* avatarHashT = mir_a2t(dbv.pszVal);
- mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s%s"), avatarHashT, avatartype);
+ mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s%s", avatarHashT, avatartype);
mir_free(avatarHashT);
db_free(&dbv);
}
}
- else mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%S avatar%s"), m_szModuleName, avatartype);
+ else mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%S avatar%s", m_szModuleName, avatartype);
}
bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
@@ -84,16 +84,16 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
//if this url returned xml data (before and after 11.2013 gg convention)
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
- HXML node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar"), 0);
- const TCHAR *blank = (node != NULL) ? xmlGetAttrValue(node, _T("blank")) : NULL;
- if (blank != NULL && mir_tstrcmp(blank, _T("1"))) {
- node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/timestamp"), 0);
+ HXML node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar", 0);
+ const TCHAR *blank = (node != NULL) ? xmlGetAttrValue(node, L"blank") : NULL;
+ if (blank != NULL && mir_tstrcmp(blank, L"1")) {
+ node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar/timestamp", 0);
*avatarts = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/bigavatar"), 0); //new gg convention
+ node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar/bigavatar", 0); //new gg convention
if (node == NULL){
- node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/originBigAvatar"), 0); //old gg convention
+ node = xmlGetChildByPath(hXml, L"users/user/avatars/avatar/originBigAvatar", 0); //old gg convention
}
*avatarurl = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
}
@@ -267,9 +267,9 @@ void __cdecl GGPROTO::avatarrequestthread(void*)
_write(file_fd, resp->pData, resp->dataLength);
_close(file_fd);
result = 1;
- debugLog(_T("avatarrequestthread() new avatar_transfers item. Saved data to file=%s."), ai.filename);
+ debugLog(L"avatarrequestthread() new avatar_transfers item. Saved data to file=%s.", ai.filename);
} else {
- debugLog(_T("avatarrequestthread(): _topen file %s error. errno=%d: %s"), ai.filename, errno, ws_strerror(errno));
+ debugLog(L"avatarrequestthread(): _topen file %s error. errno=%d: %s", ai.filename, errno, ws_strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), ai.filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -361,7 +361,7 @@ void __cdecl GGPROTO::setavatarthread(void *param)
TCHAR *szFilename = (TCHAR*)param;
int file_fd = _topen(szFilename, _O_RDONLY | _O_BINARY, _S_IREAD);
if (file_fd == -1) {
- debugLog(_T("setavatarthread(): Failed to open avatar file errno=%d: %s"), errno, ws_strerror(errno));
+ debugLog(L"setavatarthread(): Failed to open avatar file errno=%d: %s", errno, ws_strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, ws_strerror(errno), szFilename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index d7ad598eef..2632b89d75 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -381,8 +381,8 @@ retry:
p.status_descr = mir_utf8encodeT(getstatusmsg(m_iDesiredStatus));
p.status = status_m2gg(m_iDesiredStatus, p.status_descr != NULL);
- debugLog(_T("mainthread() (%x): Connecting with number %d, status %d and description \"%s\"."), this, p.uin, m_iDesiredStatus,
- p.status_descr ? getstatusmsg(m_iDesiredStatus) : _T("<none>"));
+ debugLog(L"mainthread() (%x): Connecting with number %d, status %d and description \"%s\".", this, p.uin, m_iDesiredStatus,
+ p.status_descr ? getstatusmsg(m_iDesiredStatus) : L"<none>");
gg_LeaveCriticalSection(&modemsg_mutex, "mainthread", 13, 1, "modemsg_mutex", 1);
// Check manual hosts
@@ -426,7 +426,7 @@ retry:
mir_sntprintf(error, TranslateT("Connection cannot be established. errno=%d: %s"), errno, ws_strerror(errno));
perror = error;
}
- debugLog(_T("mainthread() (%x): %s"), this, perror);
+ debugLog(L"mainthread() (%x): %s", this, perror);
if (getByte(GG_KEY_SHOWCERRORS, GG_KEYDEF_SHOWCERRORS))
showpopup(m_tszUserName, perror, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
@@ -637,7 +637,7 @@ retry:
_tcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
if (__city) {
- mir_sntprintf(strFmt1, _T(", %s %s"), TranslateT("City:"), __city);
+ mir_sntprintf(strFmt1, L", %s %s", TranslateT("City:"), __city);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
if (__birthyear) {
@@ -646,7 +646,7 @@ retry:
int br = atoi(__birthyear);
if (br < (lt->tm_year + 1900) && br > 1900) {
- mir_sntprintf(strFmt1, _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
+ mir_sntprintf(strFmt1, L", %s %d", TranslateT("Age:"), (lt->tm_year + 1900) - br);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
}
@@ -837,7 +837,7 @@ retry:
gce.ptszNick = (TCHAR*) pcli->pfnGetContactDisplayName( getcontact(e->event.msg.sender, 1, 0, NULL), 0);
gce.time = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(_T("mainthread() (%x): Conference message to room %s & id %s."), this, chat, id);
+ debugLog(L"mainthread() (%x): Conference message to room %s & id %s.", this, chat, id);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(messageT);
}
@@ -907,7 +907,7 @@ retry:
gce.time = e->event.multilogon_msg.time;
gce.bIsMe = 1;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(_T("mainthread() (%x): Sent conference message to room %s."), this, chat);
+ debugLog(L"mainthread() (%x): Sent conference message to room %s.", this, chat);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(messageT);
mir_free(nickT);
@@ -974,7 +974,7 @@ retry:
if (iIndexes && iIndexes[i])
continue;
- mir_sntprintf(szMsg, _T("%s (%s)"), szText,
+ mir_sntprintf(szMsg, L"%s (%s)", szText,
*e->event.multilogon_info.sessions[i].name != '\0' ?
_A2T(e->event.multilogon_info.sessions[i].name) : TranslateT("Unknown client"));
showpopup(m_tszUserName, szMsg, GG_POPUP_MULTILOGON);
@@ -1538,7 +1538,7 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick)
MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!hContact) {
- debugLog(_T("getcontact(): Failed to create Gadu-Gadu contact %s"), szNick);
+ debugLog(L"getcontact(): Failed to create Gadu-Gadu contact %s", szNick);
return NULL;
}
@@ -1701,7 +1701,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in
// Check if there's description and if it's not empty
if (idescr && *idescr)
{
- debugLog(_T("changecontactstatus(): Saving for %d status descr \"%s\"."), uin, idescr);
+ debugLog(L"changecontactstatus(): Saving for %d status descr \"%s\".", uin, idescr);
db_set_ts(hContact, "CList", GG_KEY_STATUSDESCR, idescr);
} else {
// Remove status if there's nothing
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index 6fb87d7bca..f3c500cc79 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -65,7 +65,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
if (dbv.cVal == -100) unspecified = 1;
else {
ptstr = str;
- mir_sntprintf(str, dbv.cVal ? _T("GMT%+d:%02d") : _T("GMT"), -dbv.cVal / 2, (dbv.cVal & 1) * 30);
+ mir_sntprintf(str, dbv.cVal ? L"GMT%+d:%02d" : L"GMT", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
}
} else {
unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0);
@@ -79,7 +79,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
unspecified = 1;
} else {
ptstr = str;
- mir_sntprintf(str, _T("%S"), pstr);
+ mir_sntprintf(str, L"%S", pstr);
}
}
else {
@@ -97,12 +97,12 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
unspecified = 1;
} else {
ptstr = str;
- mir_sntprintf(str, _T("%S"), pstr);
+ mir_sntprintf(str, L"%S", pstr);
}
if (dbv.dVal == 0) unspecified = 1;
} else if (special == SVS_GGVERSION) {
ptstr = str;
- mir_sntprintf(str, _T("%S"), (char *)gg_version2string(dbv.dVal));
+ mir_sntprintf(str, L"%S", (char *)gg_version2string(dbv.dVal));
} else {
ptstr = _itot(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10);
}
@@ -110,7 +110,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
case DBVT_ASCIIZ:
unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0');
ptstr = str;
- mir_sntprintf(str, _T("%S"), dbv.pszVal);
+ mir_sntprintf(str, L"%S", dbv.pszVal);
break;
case DBVT_TCHAR:
unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0');
@@ -125,7 +125,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
break;
default:
ptstr = str;
- mir_tstrcpy(str, _T("???"));
+ mir_tstrcpy(str, L"???");
break;
}
}
@@ -682,7 +682,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
// Add genders
if (!dat->hContact)
{
- SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)_T("")); // 0
+ SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)L""); // 0
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); // 1
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); // 2
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index feb65aa5d9..62b12b934b 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -65,9 +65,9 @@ TCHAR* ws_strerror(int code)
TCHAR buff[128];
int len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), 0, buff, _countof(buff), NULL);
if (len == 0)
- mir_sntprintf(err_desc, _T("WinSock %u: Unknown error."), WSAGetLastError());
+ mir_sntprintf(err_desc, L"WinSock %u: Unknown error.", WSAGetLastError());
else
- mir_sntprintf(err_desc, _T("WinSock %d: %s"), WSAGetLastError(), buff);
+ mir_sntprintf(err_desc, L"WinSock %d: %s", WSAGetLastError(), buff);
return err_desc;
}
@@ -174,20 +174,20 @@ void GGPROTO::cleanuplastplugin(DWORD version)
debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
TCHAR avatarsPath[MAX_PATH];
- mir_sntprintf(avatarsPath, _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(avatarsPath, L"%s\\%s", VARST( L"%miranda_avatarcache%"), m_tszUserName);
- debugLog(_T("cleanuplastplugin() 1: miranda_avatarcache = %s"), avatarsPath);
+ debugLog(L"cleanuplastplugin() 1: miranda_avatarcache = %s", avatarsPath);
TCHAR spec[MAX_PATH + 10];
- mir_sntprintf(spec, _T("%s\\*.(null)"), avatarsPath);
+ mir_sntprintf(spec, L"%s\\*.(null)", avatarsPath);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(spec, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
TCHAR filePathT [2*MAX_PATH + 10];
- mir_sntprintf(filePathT, _T("%s\\%s"), avatarsPath, ffd.cFileName);
+ mir_sntprintf(filePathT, L"%s\\%s", avatarsPath, ffd.cFileName);
if (!_taccess(filePathT, 0)){
- debugLog(_T("cleanuplastplugin() 1: remove file = %s"), filePathT);
+ debugLog(L"cleanuplastplugin() 1: remove file = %s", filePathT);
_tremove(filePathT);
}
} while (FindNextFile(hFind, &ffd) != 0);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index b089305de3..81eb4f0bf6 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) :
db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST(_T("%miranda_userdata%")), m_tszUserName);
+ mir_sntprintf(szPath, L"%s\\%s\\ImageCache", (TCHAR*)VARST(L"%miranda_userdata%"), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -431,7 +431,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
yearFrom = 0;
else
yearFrom = ay - yearFrom;
- mir_sntprintf(text, _T("%d %d"), yearFrom, yearTo);
+ mir_sntprintf(text, L"%d %d", yearFrom, yearTo);
T2Utf age_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_BIRTHYEAR, age_utf8);
@@ -499,7 +499,7 @@ static INT_PTR CALLBACK gg_advancedsearchdlgproc(HWND hwndDlg, UINT message, WPA
switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)_T("")); // 0
+ SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)L""); // 0
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); // 1
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); // 2
return TRUE;
@@ -597,7 +597,7 @@ void __cdecl GGPROTO::getawaymsgthread(void *arg)
gg_sleep(100, FALSE, "getawaymsgthread", 106, 1);
if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
- debugLog(_T("getawaymsgthread(): Reading away msg <%s>."), dbv.ptszVal);
+ debugLog(L"getawaymsgthread(): Reading away msg <%s>.", dbv.ptszVal);
db_free(&dbv);
}
else {
@@ -627,7 +627,7 @@ int GGPROTO::SetAwayMsg(int iStatus, const TCHAR *newMsg)
int status = gg_normalizestatus(iStatus);
TCHAR **msgPtr;
- debugLog(_T("SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\")."), iStatus, newMsg);
+ debugLog(L"SetAwayMsg(): PS_SETAWAYMSG(%d, \"%s\".)", iStatus, newMsg);
gg_EnterCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, "modemsg_mutex", 1);
// Select proper our msg ptr
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 305e398548..5bf54545b1 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -128,7 +128,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
// Window terminated (Miranda exit)
if (gch->pDest->iType == SESSION_TERMINATE)
{
- debugLog(_T("gc_event(): Terminating chat %x, id %s from chat window..."), chat, gch->pDest->ptszID);
+ debugLog(L"gc_event(): Terminating chat %x, id %s from chat window...", chat, gch->pDest->ptszID);
// Destroy chat entry
free(chat->recipients);
list_remove(&chats, chat, 1);
@@ -173,7 +173,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
gce.time = time(NULL);
gce.bIsMe = 1;
gce.dwFlags = GCEF_ADDTOLOG;
- debugLog(_T("gc_event(): Sending conference message to room %s, \"%s\"."), gch->pDest->ptszID, gch->ptszText);
+ debugLog(L"gc_event(): Sending conference message to room %s, \"%s\".", gch->pDest->ptszID, gch->ptszText);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(nickT);
@@ -191,7 +191,7 @@ int GGPROTO::gc_event(WPARAM, LPARAM lParam)
if ((uin = _ttoi(gch->ptszUID)) && (hContact = getcontact(uin, 1, 0, NULL)))
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
- debugLog(_T("gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\"."), gch->pDest->iType, chat, uin, gch->ptszText);
+ debugLog(L"gc_event(): Unhandled event %d, chat %x, uin %d, text \"%s\".", gch->pDest->iType, chat, uin, gch->ptszText);
return 0;
}
@@ -246,9 +246,9 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
if (found == recipients_count)
{
if (chat->ignore)
- debugLog(_T("gc_getchat(): Ignoring existing id %s, size %d."), chat->id, chat->recipients_count);
+ debugLog(L"gc_getchat(): Ignoring existing id %s, size %d.", chat->id, chat->recipients_count);
else
- debugLog(_T("gc_getchat(): Returning existing id %s, size %d."), chat->id, chat->recipients_count);
+ debugLog(L"gc_getchat(): Returning existing id %s, size %d.", chat->id, chat->recipients_count);
return !(chat->ignore) ? chat->id : NULL;
}
}
@@ -295,7 +295,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
for(; i < recipients_count; i++)
chat->recipients[i] = recipients[i];
if (sender) chat->recipients[i] = sender;
- debugLog(_T("gc_getchat(): Ignoring new chat %s, count %d."), chat->id, chat->recipients_count);
+ debugLog(L"gc_getchat(): Ignoring new chat %s, count %d.", chat->id, chat->recipients_count);
list_add(&chats, chat, 0);
return NULL;
}
@@ -330,7 +330,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
// Create new room
if (CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM) &gcwindow)) {
- debugLog(_T("gc_getchat(): Cannot create new chat window %s."), chat->id);
+ debugLog(L"gc_getchat(): Cannot create new chat window %s.", chat->id);
free(name);
free(chat);
return NULL;
@@ -364,7 +364,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
gce.bIsMe = 1;
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free(nickT);
- debugLog(_T("gc_getchat(): Myself %s: %s (%s) to the list..."), gce.ptszUID, gce.ptszNick, gce.ptszStatus);
+ debugLog(L"gc_getchat(): Myself %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
}
else debugLogA("gc_getchat(): Myself adding failed with uin %d !!!", uin);
@@ -386,14 +386,14 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
gce.ptszNick = TranslateT("'Unknown'");
gce.bIsMe = 0;
gce.dwFlags = 0;
- debugLog(_T("gc_getchat(): Added %s: %s (%s) to the list..."), gce.ptszUID, gce.ptszNick, gce.ptszStatus);
+ debugLog(L"gc_getchat(): Added %s: %s (%s) to the list...", gce.ptszUID, gce.ptszNick, gce.ptszStatus);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
}
gcd.iType = GC_EVENT_CONTROL;
CallServiceSync(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
- debugLog(_T("gc_getchat(): Returning new chat window %s, count %d."), chat->id, chat->recipients_count);
+ debugLog(L"gc_getchat(): Returning new chat window %s, count %d.", chat->id, chat->recipients_count);
list_add(&chats, chat, 0);
return chat->id;
}
@@ -641,7 +641,7 @@ int GGPROTO::gc_changenick(MCONTACT hContact, TCHAR *ptszNick)
gce.ptszUID = id;
gce.ptszText = ptszNick;
- debugLog(_T("gc_changenick(): Found room %s with uin %d, sending nick change %s."), chat->id, uin, id);
+ debugLog(L"gc_changenick(): Found room %s with uin %d, sending nick change %s.", chat->id, uin, id);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
break;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 87ccaa2a54..bd6313b5b0 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -219,7 +219,7 @@ TCHAR *gg_img_getfilter(TCHAR *szFilter, int nSize)
// Match relative to ImgDecoder presence
szFilterName = TranslateT("Image files (*.bmp,*.gif,*.jpeg,*.jpg,*.png)");
- szFilterMask = _T("*.bmp;*.gif;*.jpeg;*.jpg;*.png");
+ szFilterMask = L"*.bmp;*.gif;*.jpeg;*.jpg;*.png";
// Make up filter
_tcsncpy(pFilter, szFilterName, nSize);
@@ -259,16 +259,16 @@ int gg_img_saveimage(HWND hwnd, GGIMAGEENTRY *dat)
ofn.Flags = OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR | OFN_OVERWRITEPROMPT;
if (GetSaveFileName(&ofn))
{
- FILE *fp = _tfopen(szFileName, _T("w+b"));
+ FILE *fp = _tfopen(szFileName, L"w+b");
if (fp)
{
fwrite(dat->lpData, dat->nSize, 1, fp);
fclose(fp);
- gg->debugLog(_T("gg_img_saveimage(): Image saved to %s."), szFileName);
+ gg->debugLog(L"gg_img_saveimage(): Image saved to %s.", szFileName);
}
else
{
- gg->debugLog(_T("gg_img_saveimage(): Cannot save image to %s."), szFileName);
+ gg->debugLog(L"gg_img_saveimage(): Cannot save image to %s.", szFileName);
MessageBox(hwnd, TranslateT("Image cannot be written to disk."), gg->m_tszUserName, MB_OK | MB_ICONERROR);
}
}
@@ -495,7 +495,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dat->bReceiving)
{
TCHAR szTitle[128];
- mir_sntprintf(szTitle, _T("%s (%d / %d)"), img->lpszFileName, dat->nImg, dat->nImgTotal);
+ mir_sntprintf(szTitle, L"%s (%d / %d)", img->lpszFileName, dat->nImg, dat->nImgTotal);
SetDlgItemText(hwndDlg, IDC_IMG_NAME, szTitle);
}
else
@@ -747,7 +747,7 @@ int gg_img_isexists(TCHAR *szPath, GGIMAGEENTRY *dat)
if (st.st_size == dat->nSize)
{
- FILE *fp = _tfopen(szPath, _T("rb"));
+ FILE *fp = _tfopen(szPath, L"rb");
if (!fp) return 0;
char *lpData = (char*)mir_alloc(dat->nSize);
if (fread(lpData, 1, dat->nSize, fp) == dat->nSize)
@@ -779,12 +779,12 @@ TCHAR *gg_img_hasextension(TCHAR *filename)
{
size_t len = mir_tstrlen(imgtype);
imgtype++;
- if (len == 4 && (mir_tstrcmpi(imgtype, _T("bmp")) == 0 ||
- mir_tstrcmpi(imgtype, _T("gif")) == 0 ||
- mir_tstrcmpi(imgtype, _T("jpg")) == 0 ||
- mir_tstrcmpi(imgtype, _T("png")) == 0))
+ if (len == 4 && (mir_tstrcmpi(imgtype, L"bmp") == 0 ||
+ mir_tstrcmpi(imgtype, L"gif") == 0 ||
+ mir_tstrcmpi(imgtype, L"jpg") == 0 ||
+ mir_tstrcmpi(imgtype, L"png") == 0))
return --imgtype;
- if (len == 5 && mir_tstrcmpi(imgtype, _T("jpeg")) == 0)
+ if (len == 5 && mir_tstrcmpi(imgtype, L"jpeg") == 0)
return --imgtype;
}
}
@@ -801,9 +801,9 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
size_t tPathLen;
int i, res;
- if (hImagesFolder == NULL || FoldersGetCustomPathT(hImagesFolder, path, MAX_PATH, _T(""))) {
- TCHAR *tmpPath = Utils_ReplaceVarsT( _T("%miranda_userdata%"));
- tPathLen = mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
+ if (hImagesFolder == NULL || FoldersGetCustomPathT(hImagesFolder, path, MAX_PATH, L"")) {
+ TCHAR *tmpPath = Utils_ReplaceVarsT( L"%miranda_userdata%");
+ tPathLen = mir_sntprintf(szPath, L"%s\\%s\\ImageCache", tmpPath, m_tszUserName);
mir_free(tmpPath);
}
else {
@@ -814,33 +814,33 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
if ( _taccess(szPath, 0)){
int ret = CreateDirectoryTreeT(szPath);
if (ret == 0){
- debugLog(_T("img_displayasmsg(): Created new directory for image cache: %s."), szPath);
+ debugLog(L"img_displayasmsg(): Created new directory for image cache: %s.", szPath);
} else {
- debugLog(_T("img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s"), szPath, errno, strerror(errno));
+ debugLog(L"img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s", szPath, errno, strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
- mir_sntprintf(szPath + tPathLen, MAX_PATH - tPathLen, _T("\\%s"), dat->lpszFileName);
+ mir_sntprintf(szPath + tPathLen, MAX_PATH - tPathLen, L"\\%s", dat->lpszFileName);
if ((pImgext = gg_img_hasextension(szPath)) == NULL)
pImgext = szPath + mir_tstrlen(szPath);
_tcsncpy_s(imgext, pImgext, _TRUNCATE);
for (i = 1; ; ++i)
{
if ((res = gg_img_isexists(szPath, dat)) != -1) break;
- mir_sntprintf(szPath, _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
+ mir_sntprintf(szPath, L"%.*s (%u)%s", pImgext - szPath, szPath, i, imgext);
}
if (res == 0) {
// Image file not found, thus create it
- FILE *fp = _tfopen(szPath, _T("w+b"));
+ FILE *fp = _tfopen(szPath, L"w+b");
if (fp) {
res = fwrite(dat->lpData, dat->nSize, 1, fp) > 0;
fclose(fp);
} else {
- debugLog(_T("img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s"), szPath, errno, strerror(errno));
+ debugLog(L"img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s", szPath, errno, strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -850,16 +850,16 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
if (res != 0) {
TCHAR image_msg[MAX_PATH + 11];
- mir_sntprintf(image_msg, _T("[img]%s[/img]"), szPath);
+ mir_sntprintf(image_msg, L"[img]%s[/img]", szPath);
T2Utf szMessage(image_msg);
PROTORECVEVENT pre = {0};
pre.timestamp = time(NULL);
pre.szMessage = szMessage;
ProtoChainRecvMsg(hContact, &pre);
- debugLog(_T("img_displayasmsg(): Image saved to %s."), szPath);
+ debugLog(L"img_displayasmsg(): Image saved to %s.", szPath);
}
- else debugLog(_T("img_displayasmsg(): Cannot save image to %s."), szPath);
+ else debugLog(L"img_displayasmsg(): Cannot save image to %s.", szPath);
return 0;
}
@@ -931,15 +931,15 @@ const TCHAR *gg_img_guessfileextension(const char *lpData)
if (lpData != NULL)
{
if (memcmp(lpData, "BM", 2) == 0)
- return _T(".bmp");
+ return L".bmp";
if (memcmp(lpData, "GIF8", 4) == 0)
- return _T(".gif");
+ return L".gif";
if (memcmp(lpData, "\xFF\xD8", 2) == 0)
- return _T(".jpg");
+ return L".jpg";
if (memcmp(lpData, "\x89PNG", 4) == 0)
- return _T(".png");
+ return L".png";
}
- return _T("");
+ return L"";
}
////////////////////////////////////////////////////////////////////////////
@@ -958,10 +958,10 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
// Copy the file name
if (szFileName)
{
- FILE *fp = _tfopen(szFileName, _T("rb"));
+ FILE *fp = _tfopen(szFileName, L"rb");
if (!fp) {
free(dat);
- debugLog(_T("img_loadpicture(): fopen(\"%s\", \"rb\") failed. errno=%d: %s"), szFileName, errno, strerror(errno));
+ debugLog(L"img_loadpicture(): fopen(\"%s\", \"rb\" failed. errno=%d: %s)", szFileName, errno, strerror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -973,7 +973,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
{
fclose(fp);
free(dat);
- debugLog(_T("img_loadpicture(): Zero file size \"%s\" failed."), szFileName);
+ debugLog(L"img_loadpicture(): Zero file size \"%s\" failed.", szFileName);
return NULL;
}
// Maximum acceptable image size
@@ -981,7 +981,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
{
fclose(fp);
free(dat);
- debugLog(_T("img_loadpicture(): Image size of \"%s\" exceeds 255 KB."), szFileName);
+ debugLog(L"img_loadpicture(): Image size of \"%s\" exceeds 255 KB.", szFileName);
MessageBox(NULL, TranslateT("Image exceeds maximum allowed size of 255 KB."), m_tszUserName, MB_OK | MB_ICONEXCLAMATION);
return NULL;
}
@@ -992,7 +992,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName)
free(dat->lpData);
fclose(fp);
free(dat);
- debugLog(_T("img_loadpicture(): Reading file \"%s\" failed."), szFileName);
+ debugLog(L"img_loadpicture(): Reading file \"%s\" failed.", szFileName);
return NULL;
}
fclose(fp);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp
index 190270ceac..9b5a0cde73 100644
--- a/protocols/Gadu-Gadu/src/import.cpp
+++ b/protocols/Gadu-Gadu/src/import.cpp
@@ -280,7 +280,7 @@ INT_PTR GGPROTO::import_server(WPARAM, LPARAM)
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("import_server(): Cannot import list. errno:%d: %s"), errno, ws_strerror(errno));
+ debugLog(L"import_server(): Cannot import list. errno:%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 2, "sess_mutex", 1);
@@ -318,7 +318,7 @@ INT_PTR GGPROTO::remove_server(WPARAM, LPARAM)
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("remove_server(): Cannot remove list. errno=%d: %s"), errno, ws_strerror(errno));
+ debugLog(L"remove_server(): Cannot remove list. errno=%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 2, "sess_mutex", 1);
@@ -337,23 +337,23 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
_tcsncpy(filter, TranslateT("Text files"), _countof(filter));
- mir_tstrncat(filter, _T(" (*.txt)"), _countof(filter) - mir_tstrlen(filter));
+ mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, _T("*.TXT"), _countof(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
_tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
- mir_tstrncat(pfilter, _T(" (*)"), _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
+ mir_tstrncat(pfilter, L" (*)", _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, _T("*"), _countof(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
@@ -366,14 +366,14 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.nMaxFile = _countof(str);
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T("txt");
+ ofn.lpstrDefExt = L"txt";
#ifdef DEBUGMODE
debugLogA("import_text()");
#endif
if (!GetOpenFileName(&ofn)) return 0;
- FILE *f = _tfopen(str, _T("r"));
+ FILE *f = _tfopen(str, L"r");
_tstat(str, &st);
if (f && st.st_size)
@@ -392,7 +392,7 @@ INT_PTR GGPROTO::import_text(WPARAM, LPARAM)
TCHAR error[256];
mir_sntprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("import_text(): Cannot import list from file \"%s\". errno=%d: %s"), str, errno, _tcserror(errno));
+ debugLog(L"import_text(): Cannot import list from file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
if (f)
fclose(f);
return 0;
@@ -406,24 +406,24 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
TCHAR filter[512], *pfilter;
_tcsncpy(str, TranslateT("contacts"), _countof(str));
- mir_tstrncat(str, _T(".txt"), _countof(str) - mir_tstrlen(str));
+ mir_tstrncat(str, L".txt", _countof(str) - mir_tstrlen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
_tcsncpy(filter, TranslateT("Text files"), _countof(filter));
- mir_tstrncat(filter, _T(" (*.txt)"), _countof(filter) - mir_tstrlen(filter));
+ mir_tstrncat(filter, L" (*.txt)", _countof(filter) - mir_tstrlen(filter));
pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, _T("*.TXT"), _countof(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, L"*.TXT", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
_tcsncpy(pfilter, TranslateT("All Files"), _countof(filter) - (pfilter - filter));
- mir_tstrncat(pfilter, _T(" (*)"), _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
+ mir_tstrncat(pfilter, L" (*)", _countof(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
- _tcsncpy(pfilter, _T("*"), _countof(filter) - (pfilter - filter));
+ _tcsncpy(pfilter, L"*", _countof(filter) - (pfilter - filter));
pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + _countof(filter))
return 0;
@@ -433,14 +433,14 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
ofn.nMaxFile = _countof(str);
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T("txt");
+ ofn.lpstrDefExt = L"txt";
#ifdef DEBUGMODE
- debugLog(_T("export_text(%s)."), str);
+ debugLog(L"export_text(%s).", str);
#endif
if (!GetSaveFileName(&ofn)) return 0;
- FILE *f = _tfopen(str, _T("w"));
+ FILE *f = _tfopen(str, L"w");
if (f) {
char *contacts = gg_makecontacts(this, 0);
fwrite(contacts, sizeof(char), mir_strlen(contacts), f);
@@ -454,7 +454,7 @@ INT_PTR GGPROTO::export_text(WPARAM, LPARAM)
TCHAR error[128];
mir_sntprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("export_text(): Cannot export list to file \"%s\". errno=%d: %s"), str, errno, _tcserror(errno));
+ debugLog(L"export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, _tcserror(errno));
}
return 0;
@@ -498,7 +498,7 @@ INT_PTR GGPROTO::export_server(WPARAM, LPARAM)
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1);
mir_sntprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("export_server(): Cannot export list. errno=%d: %s"), errno, ws_strerror(errno));
+ debugLog(L"export_server(): Cannot export list. errno=%d: %s", errno, ws_strerror(errno));
}
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 2, "sess_mutex", 1);
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index be19ab681c..2bcff16f9e 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -316,12 +316,12 @@ int GGPROTO::oauth_receivetoken()
nlc = resp->nlc;
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
- HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ HXML node = xmlGetChildByPath(hXml, L"oauth_token", 0);
token = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ node = xmlGetChildByPath(hXml, L"oauth_token_secret", 0);
token_secret = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
xmlDestroyNode(hXml);
@@ -385,12 +385,12 @@ int GGPROTO::oauth_receivetoken()
if (resp) {
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, L"result");
if (hXml != NULL) {
- HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ HXML node = xmlGetChildByPath(hXml, L"oauth_token", 0);
token = mir_t2a(xmlGetText(node));
- node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ node = xmlGetChildByPath(hXml, L"oauth_token_secret", 0);
token_secret = mir_t2a(xmlGetText(node));
xmlDestroyNode(hXml);
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp
index b51fd7caba..125c0da27d 100644
--- a/protocols/Gadu-Gadu/src/ownerinfo.cpp
+++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp
@@ -59,7 +59,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param)
TCHAR error[128];
mir_sntprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), ws_strerror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
- debugLog(_T("remindpasswordthread(): Password could not be reminded. errno=%d: %s"), errno, ws_strerror(errno));
+ debugLog(L"remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp
index 451b3aac5d..e8ca28f164 100644
--- a/protocols/Gadu-Gadu/src/popups.cpp
+++ b/protocols/Gadu-Gadu/src/popups.cpp
@@ -87,7 +87,7 @@ void GGPROTO::initpopups()
puc.hIcon = CopyIcon(LoadIconEx("main", FALSE));
ReleaseIconEx("main", FALSE);
puc.iSeconds = 4;
- mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
+ mir_sntprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notify"));
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
hPopupNotify = Popup_RegisterClass(&puc);
@@ -95,7 +95,7 @@ void GGPROTO::initpopups()
puc.colorText = RGB(255, 245, 225); // Yellow
puc.iSeconds = 60;
puc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
- mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_sntprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Error"));
mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
hPopupError = Popup_RegisterClass(&puc);
}
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp
index 2dae64d0ff..d5c5c99217 100644
--- a/protocols/Gadu-Gadu/src/services.cpp
+++ b/protocols/Gadu-Gadu/src/services.cpp
@@ -235,12 +235,12 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
}
requestAvatarTransfer(pai->hContact, AvatarURL);
- debugLog(_T("getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR"), uin, pai->filename, errno, ws_strerror(errno));
+ debugLog(L"getavatarinfo(): Incoming request for avatar information. uin=%d. Avatar hash unchanged but file %s does not exist. errno=%d: %s. requestAvatarTransfer() fired. return GAIR_WAITFOR", uin, pai->filename, errno, ws_strerror(errno));
return GAIR_WAITFOR;
}
if ((wParam & GAIF_FORCE) != 0) {
if (_tremove(pai->filename) != 0){
- debugLog(_T("getavatarinfo(): refresh. _tremove 1 file %s error. errno=%d: %s"), pai->filename, errno, _tcserror(errno));
+ debugLog(L"getavatarinfo(): refresh. _tremove 1 file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -255,7 +255,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
if (AvatarHash == NULL && AvatarSavedHash != NULL) {
getAvatarFilename(pai->hContact, pai->filename, _countof(pai->filename));
if (_tremove(pai->filename) != 0){
- debugLog(_T("getavatarinfo(): delete. _tremove file %s error. errno=%d: %s"), pai->filename, errno, _tcserror(errno));
+ debugLog(L"getavatarinfo(): delete. _tremove file %s error. errno=%d: %s", pai->filename, errno, _tcserror(errno));
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
@@ -302,7 +302,7 @@ INT_PTR GGPROTO::getmyavatar(WPARAM wParam, LPARAM lParam)
debugLogA("getmyavatar(): Incoming request for self avatar information. returned ok.");
return 0;
} else {
- debugLog(_T("getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)"), szFilename);
+ debugLog(L"getmyavatar(): Incoming request for self avatar information. saved avatar file %s does not exist. return -1 (error)", szFilename);
return -1;
}
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index ba881c9d3a..bd68343587 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -330,7 +330,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
ListView_GetItemText(hList, lvhti.iItem, 0, szClientName, _countof(szClientName));
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, _countof(szIP));
ListView_GetItemText(hList, lvhti.iItem, 2, szLoginTime, _countof(szLoginTime));
- mir_sntprintf(szText, _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
+ mir_sntprintf(szText, L"%s\t%s\t%s", szClientName, szIP, szLoginTime);
if ((hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(szText) + 1)) != NULL)
{
mir_tstrcpy((TCHAR*)GlobalLock(hData), szText);
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
TCHAR szUrl[256], szIP[64];
szIP[0] = 0;
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, _countof(szIP));
- mir_sntprintf(szUrl, _T("http://whois.domaintools.com/%s"), szIP);
+ mir_sntprintf(szUrl, L"http://whois.domaintools.com/%s", szIP);
Utils_OpenUrlT(szUrl);
break;
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp
index 03bb478ac5..4f40b99e37 100644
--- a/protocols/Gadu-Gadu/src/userutils.cpp
+++ b/protocols/Gadu-Gadu/src/userutils.cpp
@@ -44,7 +44,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail)
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Registration rejected") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(_T("gg_doregister(): Cannot register. errno=%d: %s"), errno, ws_strerror(errno));
+ gg->debugLog(L"gg_doregister(): Cannot register. errno=%d: %s", errno, ws_strerror(errno));
}
else {
gg->setDword(GG_KEY_UIN, s->uin);
@@ -90,7 +90,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password)
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Bad number or password") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(_T("gg_dounregister(): Cannot remove account. errno=%d: %s"), errno, ws_strerror(errno));
+ gg->debugLog(L"gg_dounregister(): Cannot remove account. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
@@ -142,7 +142,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass)
(h && !s) ? http_error_string(h->error) :
(s ? TranslateT("Invalid data entered") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(_T("gg_dochpass(): Cannot change password. errno=%d: %s"), errno, ws_strerror(errno));
+ gg->debugLog(L"gg_dochpass(): Cannot change password. errno=%d: %s", errno, ws_strerror(errno));
}
else
{
@@ -183,7 +183,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne
mir_sntprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h->error) : (s ? TranslateT("Bad old e-mail or password") : ws_strerror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
- gg->debugLog(_T("gg_dochemail(): Cannot change e-mail. errno=%d: %s"), errno, ws_strerror(errno));
+ gg->debugLog(L"gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, ws_strerror(errno));
}
else
{