summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-14 15:37:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-14 15:37:05 +0000
commit505322a5252f6ecffe3ee99ddc41df71db13fd06 (patch)
tree62609f33551fedff785990280374f029016c47db
parent91e5a751986714b7123aa902b1d50ac4bffce939 (diff)
duplicated macro removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12813 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/core/miranda.h24
-rw-r--r--src/modules/icolib/skin2icons.cpp2
-rw-r--r--src/modules/netlib/netlibsecurity.cpp4
-rw-r--r--src/modules/protocols/protoaccs.cpp14
-rw-r--r--src/modules/protocols/protocols.cpp18
-rw-r--r--src/modules/protocols/protoopts.cpp2
-rw-r--r--src/modules/utils/bmpfilter.cpp4
7 files changed, 25 insertions, 43 deletions
diff --git a/src/core/miranda.h b/src/core/miranda.h
index 5f0d7e2ddc..2609052789 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -172,39 +172,21 @@ int AssertInsideScreen(RECT &rc);
HBITMAP ConvertIconToBitmap(HICON hIcon, HIMAGELIST hIml, int iconId);
-class StrConvUT
-{
-private:
- wchar_t* m_body;
-
-public:
- StrConvUT(const char* pSrc) :
- m_body(mir_a2u(pSrc)) {}
-
- ~StrConvUT() { mir_free(m_body); }
- operator const wchar_t* () const { return m_body; }
-};
-
-class StrConvAT
+class StrConvA
{
private:
char* m_body;
public:
- StrConvAT(const wchar_t* pSrc) :
+ StrConvA(const wchar_t* pSrc) :
m_body(mir_u2a(pSrc)) {}
- ~StrConvAT() { mir_free(m_body); }
+ ~StrConvA() { mir_free(m_body); }
operator const char* () const { return m_body; }
operator const wchar_t* () const { return (wchar_t*)m_body; } // type cast to fake the interface definition
operator const LPARAM () const { return (LPARAM)m_body; }
};
-#define StrConvT(x) StrConvUT(x)
-#define StrConvTu(x) x
-#define StrConvA(x) StrConvAT(x)
-#define StrConvU(x) x
-
///////////////////////////////////////////////////////////////////////////////
extern "C"
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index 101196705b..7739b14085 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -540,7 +540,7 @@ HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid)
if (utf_path)
PathToAbsoluteT(sid->pwszDefaultFile, fileFull);
else
- PathToAbsoluteT( StrConvT(sid->pszDefaultFile), fileFull);
+ PathToAbsoluteT(_A2T(sid->pszDefaultFile), fileFull);
item->default_file = mir_wstrdup(fileFull);
}
item->default_indx = sid->iDefaultIndex;
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp
index 151b6d6d6c..4f47cbf2d8 100644
--- a/src/modules/netlib/netlibsecurity.cpp
+++ b/src/modules/netlib/netlibsecurity.cpp
@@ -150,7 +150,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci
HANDLE NetlibInitSecurityProvider(const char* szProvider, const char* szPrincipal)
{
- return NetlibInitSecurityProvider(StrConvT(szProvider), StrConvT(szPrincipal));
+ return NetlibInitSecurityProvider(_A2T(szProvider), _A2T(szPrincipal));
}
void NetlibDestroySecurityProvider(HANDLE hSecurity)
@@ -440,7 +440,7 @@ static INT_PTR NtlmCreateResponseService(WPARAM wParam, LPARAM lParam)
return 0;
unsigned complete = 0;
- char *response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, StrConvT(req->userName), StrConvT(req->password), false, complete);
+ char *response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, _A2T(req->userName), _A2T(req->password), false, complete);
return (INT_PTR)response;
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 393fb3aae4..1977816cf3 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -308,7 +308,7 @@ static INT_PTR stub3(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
static INT_PTR stub4(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, StrConvT((const char*)lParam));
+ return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, _A2T((const char*)lParam));
}
static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
@@ -329,19 +329,19 @@ static INT_PTR stub13(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
static INT_PTR stub15(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
{
- return (INT_PTR)ppi->SearchBasic(StrConvT((char*)lParam));
+ return (INT_PTR)ppi->SearchBasic(_A2T((char*)lParam));
}
static INT_PTR stub16(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
{
- return (INT_PTR)ppi->SearchByEmail(StrConvT((char*)lParam));
+ return (INT_PTR)ppi->SearchByEmail(_A2T((char*)lParam));
}
static INT_PTR stub17(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
{
PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
- return (INT_PTR)ppi->SearchByName(StrConvT((char*)psbn->pszNick),
- StrConvT((char*)psbn->pszFirstName), StrConvT((char*)psbn->pszLastName));
+ return (INT_PTR)ppi->SearchByName(_A2T((char*)psbn->pszNick),
+ _A2T((char*)psbn->pszFirstName), _A2T((char*)psbn->pszLastName));
}
static INT_PTR stub18(PROTO_INTERFACE* ppi, WPARAM, LPARAM lParam)
@@ -368,7 +368,7 @@ static INT_PTR stub29(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
static INT_PTR stub33(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((const char*)lParam));
+ return (INT_PTR)ppi->SetAwayMsg(wParam, _A2T((const char*)lParam));
}
static INT_PTR stub41(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
@@ -418,7 +418,7 @@ static INT_PTR stub44(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- return CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_SETMYAVATARW, wParam, (LPARAM)(LPCTSTR)StrConvT((char*)lParam));
+ return CallProtoServiceInt(NULL, ppi->m_szModuleName, PS_SETMYAVATARW, wParam, (LPARAM)(LPCTSTR)_A2T((char*)lParam));
}
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index 688c2f5428..2a0c2b9b2a 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -387,21 +387,21 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 3: return (INT_PTR)ppi->Authorize((MEVENT)wParam);
case 4:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, StrConvT((char*)lParam));
+ return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, _A2T((char*)lParam));
return (INT_PTR)ppi->AuthDeny((MEVENT)wParam, (PROTOCHAR*)lParam);
case 5: return (INT_PTR)ppi->AuthRecv(hContact, (PROTORECVEVENT*)lParam);
case 6:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->AuthRequest(hContact, StrConvT((char*)lParam));
+ return (INT_PTR)ppi->AuthRequest(hContact, _A2T((char*)lParam));
return (INT_PTR)ppi->AuthRequest(hContact, (PROTOCHAR*)lParam);
case 8:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, StrConvT((char*)lParam));
+ return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, _A2T((char*)lParam));
return (INT_PTR)ppi->FileAllow(hContact, (HANDLE)wParam, (PROTOCHAR*)lParam);
case 9: return (INT_PTR)ppi->FileCancel(hContact, (HANDLE)wParam);
case 10:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, StrConvT((char*)lParam));
+ return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, _A2T((char*)lParam));
return (INT_PTR)ppi->FileDeny(hContact, (HANDLE)wParam, (PROTOCHAR*)lParam);
case 11: {
PROTOFILERESUME* pfr = (PROTOFILERESUME*)lParam;
@@ -419,16 +419,16 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam);
case 15:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->SearchBasic(StrConvT((char*)lParam));
+ return (INT_PTR)ppi->SearchBasic(_A2T((char*)lParam));
return (INT_PTR)ppi->SearchBasic((TCHAR*)lParam);
case 16:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->SearchByEmail(StrConvT((char*)lParam));
+ return (INT_PTR)ppi->SearchByEmail(_A2T((char*)lParam));
return (INT_PTR)ppi->SearchByEmail((TCHAR*)lParam);
case 17: {
PROTOSEARCHBYNAME* psbn = (PROTOSEARCHBYNAME*)lParam;
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->SearchByName(StrConvT((char*)psbn->pszNick), StrConvT((char*)psbn->pszFirstName), StrConvT((char*)psbn->pszLastName));
+ return (INT_PTR)ppi->SearchByName(_A2T((char*)psbn->pszNick), _A2T((char*)psbn->pszFirstName), _A2T((char*)psbn->pszLastName));
else
return (INT_PTR)ppi->SearchByName(psbn->pszNick, psbn->pszFirstName, psbn->pszLastName);
}
@@ -442,7 +442,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 25:
if (ppi->m_iVersion > 1) {
TCHAR** files = Proto_FilesMatrixU((char**)lParam);
- INT_PTR res = (INT_PTR)ppi->SendFile(hContact, StrConvT((char*)wParam), (TCHAR**)files);
+ INT_PTR res = (INT_PTR)ppi->SendFile(hContact, _A2T((char*)wParam), (TCHAR**)files);
if (res == 0) FreeFilesMatrix(&files);
return res;
}
@@ -456,7 +456,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 31: return (INT_PTR)ppi->RecvAwayMsg(hContact, wParam, (PROTORECVEVENT*)lParam);
case 33:
if (ppi->m_iVersion > 1)
- return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((char*)lParam));
+ return (INT_PTR)ppi->SetAwayMsg(wParam, _A2T((char*)lParam));
return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
case 34: return (INT_PTR)ppi->UserIsTyping(wParam, lParam);
case 35: mir_strncpy((char*)lParam, ppi->m_szModuleName, wParam); return 0;
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index f5d6a7a04d..7e1c34b770 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -143,7 +143,7 @@ static bool OnCreateAccount(HWND hwndDlg)
if (param->action == PRAC_UPGRADED) {
BOOL oldProto = pa->bOldProto;
TCHAR szPlugin[MAX_PATH];
- mir_sntprintf(szPlugin, SIZEOF(szPlugin), _T("%s.dll"), StrConvT(pa->szProtoName));
+ mir_sntprintf(szPlugin, SIZEOF(szPlugin), _T("%s.dll"), _A2T(pa->szProtoName));
int idx = accounts.getIndex(pa);
UnloadAccount(pa, false, false);
accounts.remove(idx);
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp
index 982b4cd8d7..b97b2699b6 100644
--- a/src/modules/utils/bmpfilter.cpp
+++ b/src/modules/utils/bmpfilter.cpp
@@ -94,7 +94,7 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName)
return (INT_PTR)cbFileSize;
} }
- if (S_OK != OleLoadPicturePath(LPOLESTR((const wchar_t*)StrConvU(szFilename)), NULL, 0, 0, IID_IPicture, (PVOID*)&pic))
+ if (S_OK != OleLoadPicturePath(LPOLESTR(szFilename), NULL, 0, 0, IID_IPicture, (PVOID*)&pic))
return 0;
pic->get_Type(&picType);
@@ -128,7 +128,7 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName)
static INT_PTR BmpFilterLoadBitmap(WPARAM, LPARAM lParam)
{
- return sttBitmapLoader(StrConvT((const char*)lParam));
+ return sttBitmapLoader(_A2T((const char*)lParam));
}
static INT_PTR BmpFilterLoadBitmapW(WPARAM, LPARAM lParam)