summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
commitb2fad485cd5b41744ef0cc4a02722c021afd926c (patch)
treeaa19403cd699066600e8306be8ad33e4a17fba6f /src
parentfc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff)
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdchat/src/log.cpp4
-rw-r--r--src/core/stdchat/src/main.cpp2
-rw-r--r--src/core/stdchat/src/manager.cpp2
-rw-r--r--src/core/stdchat/src/message.cpp2
-rw-r--r--src/core/stdchat/src/richutil.cpp4
-rw-r--r--src/core/stdchat/src/window.cpp2
-rw-r--r--src/core/stdidle/idle.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
-rw-r--r--src/core/stdurl/urldialogs.cpp2
-rw-r--r--src/core/stduseronline/useronline.cpp2
-rw-r--r--src/modules/chat/manager.cpp2
-rw-r--r--src/modules/clist/clistsettings.cpp2
-rw-r--r--src/modules/clist/genmenuopt.cpp2
-rw-r--r--src/modules/fonts/FontOptions.cpp2
-rw-r--r--src/modules/metacontacts/meta_edit.cpp2
-rw-r--r--src/modules/netlib/netlibssl.cpp2
-rw-r--r--src/modules/options/descbutton.cpp2
-rw-r--r--src/modules/options/headerbar.cpp2
-rw-r--r--src/modules/options/iconheader.cpp2
-rw-r--r--src/modules/plugins/newplugins.cpp2
-rw-r--r--src/modules/skin/sounds.cpp2
-rw-r--r--src/modules/utils/imgconv.cpp2
22 files changed, 24 insertions, 24 deletions
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;
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index 628b5307e3..998698409b 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -909,7 +909,7 @@ static STATUSINFO* TM_AddStatus(STATUSINFO** ppStatusList, const TCHAR *pszStatu
if (!ci.TM_FindStatus(*ppStatusList, pszStatus)) {
STATUSINFO *node = (STATUSINFO*)mir_alloc(sizeof(STATUSINFO));
- ZeroMemory(node, sizeof(STATUSINFO));
+ memset(node, 0, sizeof(STATUSINFO));
replaceStrT(node->pszGroup, pszStatus);
node->hIcon = (HICON)(*iCount);
while ((int)node->hIcon > STATUSICONCOUNT - 1)
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp
index d981d9e97f..926163e906 100644
--- a/src/modules/clist/clistsettings.cpp
+++ b/src/modules/clist/clistsettings.cpp
@@ -113,7 +113,7 @@ TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
}
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
if (ci.hContact == NULL)
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index c20f92a82c..c424554842 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -584,7 +584,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (iod->name && _tcsstr(iod->name, STR_SEPARATOR))
break;
- ZeroMemory(buf, sizeof(buf));
+ buf[0] = 0;
GetDlgItemText(hwndDlg, IDC_GENMENU_CUSTOMNAME, buf, SIZEOF(buf));
if (iod->name)
mir_free(iod->name);
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index e2bd710ecc..97598e7674 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -377,7 +377,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const TCHAR *groupName,
hItem = TreeView_InsertItem(hwndTree, &tvis);
- ZeroMemory(&tvis.item, sizeof(tvis.item));
+ memset(&tvis.item, 0, sizeof(tvis.item));
tvis.item.hItem = hItem;
tvis.item.mask = TVIF_HANDLE|TVIF_STATE;
tvis.item.state = tvis.item.stateMask = db_get_b(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED);
diff --git a/src/modules/metacontacts/meta_edit.cpp b/src/modules/metacontacts/meta_edit.cpp
index 12f5fdd7b3..0dc9a2e6e4 100644
--- a/src/modules/metacontacts/meta_edit.cpp
+++ b/src/modules/metacontacts/meta_edit.cpp
@@ -251,7 +251,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara
int offline_contact_number = db_get_dw(lParam, META_PROTO, "OfflineSend", INVALID_CONTACT_ID);
- ZeroMemory(&g_data, sizeof(g_data));
+ memset(&g_data, 0, sizeof(g_data));
g_data.cc = cc;
g_data.hMeta = lParam;
g_data.num_contacts = cc->nSubs;
diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp
index eaf961912b..456670ae8f 100644
--- a/src/modules/netlib/netlibssl.cpp
+++ b/src/modules/netlib/netlibssl.cpp
@@ -118,7 +118,7 @@ static bool AcquireCredentials(void)
TimeStamp tsExpiry;
SECURITY_STATUS scRet;
- ZeroMemory(&SchannelCred, sizeof(SchannelCred));
+ memset(&SchannelCred, 0, sizeof(SchannelCred));
SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
SchannelCred.grbitEnabledProtocols = SP_PROT_SSL3TLS1_CLIENTS /*| 0xA00 TLS1.1 & 1.2*/;
diff --git a/src/modules/options/descbutton.cpp b/src/modules/options/descbutton.cpp
index 6bd00348aa..4abac86e91 100644
--- a/src/modules/options/descbutton.cpp
+++ b/src/modules/options/descbutton.cpp
@@ -67,7 +67,7 @@ int LoadDescButtonModule()
{
WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
+ memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.lpszClassName = MIRANDADESCBUTTONCLASS;
wc.lpfnWndProc = MDescButtonWndProc;
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp
index c643a4732d..11fce111cb 100644
--- a/src/modules/options/headerbar.cpp
+++ b/src/modules/options/headerbar.cpp
@@ -72,7 +72,7 @@ int LoadHeaderbarModule()
{
WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
+ memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.lpszClassName = _T("MHeaderbarCtrl"); //MIRANDAHEADERBARCLASS;
wc.lpfnWndProc = MHeaderbarWndProc;
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp
index 2d58d47f16..d46816367b 100644
--- a/src/modules/options/iconheader.cpp
+++ b/src/modules/options/iconheader.cpp
@@ -100,7 +100,7 @@ int LoadIcoTabsModule()
{
WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
+ memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.lpszClassName = MIRANDAICOTABCLASS;
wc.lpfnWndProc = MIcoTabWndProc;
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index a9264bcca9..2e2885033e 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -312,7 +312,7 @@ void Plugin_Uninit(pluginEntry *p)
KillModuleServices(hInst);
FreeLibrary(hInst);
- ZeroMemory(&p->bpi, sizeof(p->bpi));
+ memset(&p->bpi, 0, sizeof(p->bpi));
}
UnregisterModule(hInst);
if (p == pluginList_crshdmp)
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp
index 02b09d1127..64a257620e 100644
--- a/src/modules/skin/sounds.cpp
+++ b/src/modules/skin/sounds.cpp
@@ -302,7 +302,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
PathToAbsoluteT(strFull, strdir);
OPENFILENAME ofn;
- ZeroMemory(&ofn, sizeof(ofn));
+ memset(&ofn, 0, sizeof(ofn));
if (GetModuleHandle(_T("bass_interface.dll")))
mir_sntprintf(filter, SIZEOF(filter), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp
index 20550b12c7..287976093a 100644
--- a/src/modules/utils/imgconv.cpp
+++ b/src/modules/utils/imgconv.cpp
@@ -28,7 +28,7 @@ typedef DWORD ARGB;
void InitBitmapInfo(BITMAPINFO &bmi, const SIZE &size)
{
- ZeroMemory(&bmi, sizeof(BITMAPINFO));
+ memset(&bmi, 0, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biCompression = BI_RGB;