From 18448e7014c32235db05465f1bf76b30f9954029 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Jan 2014 23:33:35 +0000 Subject: GCDEST::pszModule and GCDEST::ptszID must be constant git-svn-id: http://svn.miranda-ng.org/main/trunk@7586 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/chat/services.cpp | 4 ++-- plugins/Scriver/src/chat/tools.cpp | 6 +++--- plugins/Scriver/src/chat/window.cpp | 4 ++-- plugins/TabSRMM/src/chat/tools.cpp | 12 ++++++------ plugins/TabSRMM/src/chat/window.cpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/src/chat/services.cpp b/plugins/Scriver/src/chat/services.cpp index 7bdc353d4b..0da545b939 100644 --- a/plugins/Scriver/src/chat/services.cpp +++ b/plugins/Scriver/src/chat/services.cpp @@ -367,8 +367,6 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) { GCEVENT *gce = (GCEVENT*)lParam; SESSION_INFO *si; - TCHAR* pWnd = NULL; - char* pMod = NULL; BOOL bIsHighlighted = FALSE; BOOL bRemoveFlag = FALSE; @@ -455,6 +453,8 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) } // Decide which window (log) should have the event + LPCTSTR pWnd = NULL; + LPCSTR pMod = NULL; if (gcd->ptszID) { pWnd = gcd->ptszID; pMod = gcd->pszModule; diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 7fe38bb5e5..62679fbe0f 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -748,8 +748,8 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char* pszModule, int return FALSE; GCDEST *gcd = (GCDEST*)mir_calloc(sizeof(GCDEST)); - replaceStr(gcd->pszModule, pszModule); - replaceStrT(gcd->ptszID, pszID); + gcd->pszModule = mir_strdup(pszModule); + gcd->ptszID = mir_tstrdup(pszID); gcd->iType = iType; GCHOOK *gch = (GCHOOK*)mir_calloc(sizeof(GCHOOK)); @@ -767,7 +767,7 @@ BOOL DoEventHook(const TCHAR *pszID, const char* pszModule, int iType, const TCH if (si == NULL) return FALSE; - GCDEST gcd = { (char*)pszModule, (LPTSTR)pszID, iType }; + GCDEST gcd = { pszModule, pszID, iType }; GCHOOK gch = { 0 }; gch.ptszUID = (LPTSTR)pszUID; gch.ptszText = (LPTSTR)pszText; diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 5b0c23519a..50930e362e 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1576,8 +1576,8 @@ LABEL_SHOWWINDOW: GCHOOK *gch = (GCHOOK *)lParam; NotifyEventHooks(hSendEvent, 0, (WPARAM)gch); if (gch->pDest) { - mir_free(gch->pDest->ptszID); - mir_free(gch->pDest->pszModule); + mir_free((void*)gch->pDest->ptszID); + mir_free((void*)gch->pDest->pszModule); mir_free(gch->pDest); } mir_free(gch->ptszText); diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index b22c898352..7230a6298f 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -1018,10 +1018,10 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char* pszModule, int GCHOOK *gch = (GCHOOK*)mir_calloc(sizeof(GCHOOK)); GCDEST *gcd = (GCDEST*)mir_calloc(sizeof(GCDEST)); - replaceStr(gcd->pszModule, pszModule); - replaceStrT(gcd->ptszID, pszID); - replaceStrT(gch->ptszUID, pszUID); - replaceStrT(gch->ptszText, pszText); + gcd->pszModule = mir_strdup(pszModule); + gcd->ptszID = mir_tstrdup(pszID); + gch->ptszUID = mir_tstrdup(pszUID); + gch->ptszText = mir_tstrdup(pszText); gcd->iType = iType; gch->dwData = dwItem; gch->pDest = gcd; @@ -1035,8 +1035,8 @@ BOOL DoEventHook(const TCHAR *pszID, const char* pszModule, int iType, const TCH if (si == NULL) return FALSE; - GCHOOK gch = {0}; - GCDEST gcd = { (char*)pszModule, (LPTSTR)pszID, iType }; + GCDEST gcd = { pszModule, pszID, iType }; + GCHOOK gch = { 0 }; gch.ptszUID = (LPTSTR)pszUID; gch.ptszText = (LPTSTR)pszText; gch.dwData = dwItem; diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 61b1dcd604..69a21e790f 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -2480,8 +2480,8 @@ LABEL_SHOWWINDOW: GCHOOK* gch = (GCHOOK*) lParam; NotifyEventHooks(hSendEvent, 0, (WPARAM)gch); if (gch->pDest) { - mir_free(gch->pDest->ptszID); - mir_free(gch->pDest->pszModule); + mir_free((void*)gch->pDest->ptszID); + mir_free((void*)gch->pDest->pszModule); mir_free(gch->pDest); } mir_free(gch->ptszText); -- cgit v1.2.3