From b2fad485cd5b41744ef0cc4a02722c021afd926c Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 1 Dec 2014 00:07:01 +0000 Subject: ZeroMemory -> memset, few bugs fised git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/log.cpp | 4 ++-- src/core/stdchat/src/main.cpp | 2 +- src/core/stdchat/src/manager.cpp | 2 +- src/core/stdchat/src/message.cpp | 2 +- src/core/stdchat/src/richutil.cpp | 4 ++-- src/core/stdchat/src/window.cpp | 2 +- src/core/stdidle/idle.cpp | 2 +- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdurl/urldialogs.cpp | 2 +- src/core/stduseronline/useronline.cpp | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/core') diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp index 94c59430c6..2ba54448ac 100644 --- a/src/core/stdchat/src/log.cpp +++ b/src/core/stdchat/src/log.cpp @@ -61,7 +61,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedr HWND hwndRich = GetDlgItem(hwndDlg, IDC_LOG); LOGSTREAMDATA streamData; - ZeroMemory(&streamData, sizeof(streamData)); + memset(&streamData, 0, sizeof(streamData)); streamData.hwnd = hwndRich; streamData.si = si; streamData.lin = lin; @@ -125,7 +125,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedr newsel.cpMin = sel.cpMin; if (newsel.cpMin < 0) newsel.cpMin = 0; - ZeroMemory(&sm, sizeof(sm)); + memset(&sm, 0, sizeof(sm)); sm.cbSize = sizeof(sm); sm.hwndRichEditControl = hwndRich; sm.Protocolname = si->pszModule; diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 63fd05a2f4..9437b3a034 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -317,7 +317,7 @@ static void RegisterFonts() static void TabsInit() { - ZeroMemory(&g_TabSession, sizeof(SESSION_INFO)); + memset(&g_TabSession, 0, sizeof(SESSION_INFO)); g_TabSession.iType = GCW_TABROOM; g_TabSession.iSplitterX = g_Settings.iSplitterX; g_TabSession.iSplitterY = g_Settings.iSplitterY; diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp index a16e6a02d8..d9f0d2c61a 100644 --- a/src/core/stdchat/src/manager.cpp +++ b/src/core/stdchat/src/manager.cpp @@ -85,7 +85,7 @@ BOOL TabM_AddTab(const TCHAR *pszID, const char* pszModule) return FALSE; node = (TABLIST*)mir_alloc(sizeof(TABLIST)); - ZeroMemory(node, sizeof(TABLIST)); + memset(node, 0, sizeof(TABLIST)); node->pszID = mir_tstrdup(pszID); node->pszModule = mir_strdup(pszModule); diff --git a/src/core/stdchat/src/message.cpp b/src/core/stdchat/src/message.cpp index bcd066e4a9..c7d96fa2a5 100644 --- a/src/core/stdchat/src/message.cpp +++ b/src/core/stdchat/src/message.cpp @@ -342,7 +342,7 @@ char* Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si) if (hwndDlg == 0 || si == 0) return NULL; - ZeroMemory(&stream, sizeof(stream)); + memset(&stream, 0, sizeof(stream)); stream.pfnCallback = Message_StreamCallback; stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer diff --git a/src/core/stdchat/src/richutil.cpp b/src/core/stdchat/src/richutil.cpp index 8bcc79b509..bc9a22aac5 100644 --- a/src/core/stdchat/src/richutil.cpp +++ b/src/core/stdchat/src/richutil.cpp @@ -137,7 +137,7 @@ int RichUtil_SubClass(HWND hwndEdit) { if (IsWindow(hwndEdit)) { TRichUtil *ru = (TRichUtil*)malloc(sizeof(TRichUtil)); - ZeroMemory(ru, sizeof(TRichUtil)); + memset(ru, 0, sizeof(TRichUtil)); ru->hwnd = hwndEdit; ru->hasUglyBorder = 0; EnterCriticalSection(&csRich); @@ -212,7 +212,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rcClient; HDC hdc = GetDC(GetParent(hwnd)); - ZeroMemory(&rcClient, sizeof(RECT)); + memset(&rcClient, 0, sizeof(RECT)); if(GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK) { ru->rect.left = rcClient.left-ncsParam->rgrc[0].left; ru->rect.top = rcClient.top-ncsParam->rgrc[0].top; diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 15d1e0e6d8..2d9b797540 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -2127,7 +2127,7 @@ LABEL_SHOWWINDOW: if (end - start > 0) { TEXTRANGE tr; - ZeroMemory(&tr, sizeof(TEXTRANGE)); + memset(&tr, 0, sizeof(TEXTRANGE)); CHARRANGE cr; cr.cpMin = start; diff --git a/src/core/stdidle/idle.cpp b/src/core/stdidle/idle.cpp index 92a53a5deb..2a6429a578 100644 --- a/src/core/stdidle/idle.cpp +++ b/src/core/stdidle/idle.cpp @@ -165,7 +165,7 @@ static void IdleObject_ReadSettings(IdleObject * obj) static void IdleObject_Create(IdleObject * obj) { - ZeroMemory(obj, sizeof(IdleObject)); + memset(obj, 0, sizeof(IdleObject)); obj->hTimer = SetTimer(NULL, 0, 2000, IdleTimer); IdleObject_ReadSettings(obj); } diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 50e3f35dc7..d7e9870415 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1078,7 +1078,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // configure message history for proper RTL formatting { PARAFORMAT2 pf2; - ZeroMemory((void *)&pf2, sizeof(pf2)); + memset(&pf2, 0, sizeof(pf2)); pf2.cbSize = sizeof(pf2); pf2.wEffects = PFE_RTLPARA; diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp index 779055f238..9911a05f83 100644 --- a/src/core/stdurl/urldialogs.cpp +++ b/src/core/stdurl/urldialogs.cpp @@ -40,7 +40,7 @@ static void sttUpdateTitle(HWND hwndDlg, MCONTACT hContact) CONTACTINFO ci; int hasName = 0; char buf[128]; - ZeroMemory(&ci, sizeof(ci)); + memset(&ci, 0, sizeof(ci)); ci.cbSize = sizeof(ci); ci.hContact = hContact; diff --git a/src/core/stduseronline/useronline.cpp b/src/core/stduseronline/useronline.cpp index 6c81c97084..f8a58124da 100644 --- a/src/core/stduseronline/useronline.cpp +++ b/src/core/stduseronline/useronline.cpp @@ -60,7 +60,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) CLISTEVENT cle; TCHAR tooltip[256]; - ZeroMemory(&cle, sizeof(cle)); + memset(&cle, 0, sizeof(cle)); cle.cbSize = sizeof(cle); cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hContact = hContact; -- cgit v1.2.3