From 77dc4f6080513b9ea76e12b3e0e6b8ff9d93449c Mon Sep 17 00:00:00 2001
From: Alexander Lantsev <aunsane@gmail.com>
Date: Thu, 21 Jul 2016 10:22:30 +0000
Subject: MirLua: fix redundant (char*) cast

git-svn-id: http://svn.miranda-ng.org/main/trunk@17115 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/MirLua/src/m_clist.cpp     | 2 +-
 plugins/MirLua/src/m_genmenu.cpp   | 6 +++---
 plugins/MirLua/src/m_hotkeys.cpp   | 2 +-
 plugins/MirLua/src/m_message.cpp   | 2 +-
 plugins/MirLua/src/m_options.cpp   | 6 +++---
 plugins/MirLua/src/m_protocols.cpp | 6 ++----
 6 files changed, 11 insertions(+), 13 deletions(-)

(limited to 'plugins')

diff --git a/plugins/MirLua/src/m_clist.cpp b/plugins/MirLua/src/m_clist.cpp
index 1d451250f7..70ac7ebfe3 100644
--- a/plugins/MirLua/src/m_clist.cpp
+++ b/plugins/MirLua/src/m_clist.cpp
@@ -40,7 +40,7 @@ static int clist_AddContactMenuItem(lua_State *L)
 	CMenuItem mi;
 	MakeMenuItem(L, mi);
 
-	ptrA szProto(mir_utf8decode((char*)lua_tostring(L, 2), NULL));
+	ptrA szProto(mir_utf8decodeA(lua_tostring(L, 2)));
 	HGENMENU res = Menu_AddContactMenuItem(&mi, szProto);
 	lua_pushlightuserdata(L, res);
 
diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp
index 543fefe022..64540804a0 100644
--- a/plugins/MirLua/src/m_genmenu.cpp
+++ b/plugins/MirLua/src/m_genmenu.cpp
@@ -12,13 +12,13 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
 		mi.flags |= CMIF_TCHAR;
 
 	lua_getfield(L, -1, "Uid");
-	const char* uuid = (char*)lua_tostring(L, -1);
+	const char* uuid = lua_tostring(L, -1);
 	if (UuidFromStringA((RPC_CSTR)uuid, (UUID*)&mi.uid))
 		UNSET_UID(mi);
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Name");
-	mi.name.t = mir_utf8decodeT((char*)luaL_checkstring(L, -1));
+	mi.name.t = mir_utf8decodeT(luaL_checkstring(L, -1));
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Position");
@@ -30,7 +30,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi)
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Service");
-	mi.pszService = (char*)lua_tostring(L, -1);
+	mi.pszService = lua_tostring(L, -1);
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Parent");
diff --git a/plugins/MirLua/src/m_hotkeys.cpp b/plugins/MirLua/src/m_hotkeys.cpp
index b0d1e04d49..4023904fe4 100644
--- a/plugins/MirLua/src/m_hotkeys.cpp
+++ b/plugins/MirLua/src/m_hotkeys.cpp
@@ -16,7 +16,7 @@ void MakeHotkey(lua_State *L, HOTKEYDESC &hk)
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Description");
-	hk.ptszDescription = mir_utf8decodeT((char*)lua_tostring(L, -1));
+	hk.ptszDescription = mir_utf8decodeT(lua_tostring(L, -1));
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Section");
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp
index ec5dac43bf..b907807929 100644
--- a/plugins/MirLua/src/m_message.cpp
+++ b/plugins/MirLua/src/m_message.cpp
@@ -47,7 +47,7 @@ static int message_Send(lua_State *L)
 
 		mir_free((void*)gce.ptszText);
 	}
-	else if ((res = ::ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message)) != ACKRESULT_FAILED)
+	else if ((res = ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)message)) != ACKRESULT_FAILED)
 	{
 		DBEVENTINFO dbei;
 		dbei.cbSize = sizeof(dbei);
diff --git a/plugins/MirLua/src/m_options.cpp b/plugins/MirLua/src/m_options.cpp
index 6d7ec23d2e..149403ee44 100644
--- a/plugins/MirLua/src/m_options.cpp
+++ b/plugins/MirLua/src/m_options.cpp
@@ -54,15 +54,15 @@ void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp)
 		odp.flags |= ODPF_TCHAR;
 
 	lua_getfield(L, -1, "Group");
-	odp.ptszGroup = mir_utf8decodeT((char*)lua_tostring(L, -1));
+	odp.ptszGroup = mir_utf8decodeT(lua_tostring(L, -1));
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Title");
-	odp.ptszTitle = mir_utf8decodeT((char*)luaL_checkstring(L, -1));
+	odp.ptszTitle = mir_utf8decodeT(luaL_checkstring(L, -1));
 	lua_pop(L, 1);
 
 	lua_getfield(L, -1, "Tab");
-	odp.ptszTab = mir_utf8decodeT((char*)lua_tostring(L, -1));
+	odp.ptszTab = mir_utf8decodeT(lua_tostring(L, -1));
 	lua_pop(L, 1);
 
 	int onInitDialogRef = LUA_NOREF;
diff --git a/plugins/MirLua/src/m_protocols.cpp b/plugins/MirLua/src/m_protocols.cpp
index 423d732c32..889be34a42 100644
--- a/plugins/MirLua/src/m_protocols.cpp
+++ b/plugins/MirLua/src/m_protocols.cpp
@@ -97,8 +97,7 @@ static int lua_ChainSend(lua_State *L)
 	WPARAM wParam = (WPARAM)luaM_tomparam(L, 3);
 	LPARAM lParam = (LPARAM)luaM_tomparam(L, 4);
 
-	CCSDATA ccs = { hContact, service, wParam, lParam };
-	INT_PTR res = Proto_ChainSend(0, &ccs);
+	INT_PTR res = ProtoChainSend(hContact, service, wParam, lParam);
 	lua_pushinteger(L, res);
 
 	return 1;
@@ -111,8 +110,7 @@ static int lua_ChainRecv(lua_State *L)
 	WPARAM wParam = (WPARAM)luaM_tomparam(L, 3);
 	LPARAM lParam = (LPARAM)luaM_tomparam(L, 4);
 
-	CCSDATA ccs = { hContact, service, wParam, lParam };
-	INT_PTR res = Proto_ChainRecv(0, &ccs);
+	INT_PTR res = ProtoChainRecv(hContact, service, wParam, lParam);
 	lua_pushinteger(L, res);
 
 	return 1;
-- 
cgit v1.2.3