diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
commit | b2fad485cd5b41744ef0cc4a02722c021afd926c (patch) | |
tree | aa19403cd699066600e8306be8ad33e4a17fba6f | |
parent | fc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff) |
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
258 files changed, 667 insertions, 668 deletions
diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index 5930bd8dfb..9a85388ef7 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -386,7 +386,7 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP return FALSE;
SetWindowLongPtr(hwnd, 0, (LONG_PTR)data);
- ZeroMemory(data, sizeof(ACCData));
+ memset(data, 0, sizeof(ACCData));
data->hHook = HookEventMessage(ME_AV_AVATARCHANGED, hwnd, DM_AVATARCHANGED);
data->hHookMy = HookEventMessage(ME_AV_MYAVATARCHANGED, hwnd, DM_MYAVATARCHANGED);
data->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index 849396a4e7..f73793a44d 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -36,7 +36,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) // Create bitmap
BITMAPINFO RGB32BitsBITMAPINFO;
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = bmp.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = bmp.bmHeight;
@@ -77,7 +77,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) HBITMAP CreateBitmap32(int cx, int cy)
{
BITMAPINFO RGB32BitsBITMAPINFO;
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = cx;//bm.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = cy;//bm.bmHeight;
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 6a10d7c842..b844c5de33 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -167,7 +167,7 @@ static void SetProtoPic(char *szProto) if (!strcmp(p.szProtoname, szProto) && mir_strlen(p.szProtoname) == mir_strlen(szProto)) { if (p.hbmPic != 0) DeleteObject(p.hbmPic); - ZeroMemory(&p, sizeof(avatarCacheEntry)); + memset(&p, 0, sizeof(avatarCacheEntry)); CreateAvatarInCache(0, &p, szProto); NotifyEventHooks(hEventChanged, 0, (LPARAM)&p); break; diff --git a/plugins/AssocMgr/src/dde.cpp b/plugins/AssocMgr/src/dde.cpp index e66cfe8892..f7ede6c5e7 100644 --- a/plugins/AssocMgr/src/dde.cpp +++ b/plugins/AssocMgr/src/dde.cpp @@ -108,7 +108,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM HGLOBAL hCommand;
TCHAR *pszCommand;
DDEACK ack;
- ZeroMemory(&ack,sizeof(ack));
+ memset(&ack, 0, sizeof(ack));
if(UnpackDDElParam(msg,lParam,NULL,(PUINT_PTR)&hCommand)) {
/* ANSI execute command can't happen for shell */
if(IsWindowUnicode((HWND)wParam)) {
@@ -149,7 +149,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
ATOM hSzItem;
DDEACK ack;
- ZeroMemory(&ack,sizeof(ack));
+ memset(&ack, 0, sizeof(ack));
if(UnpackDDElParam(msg,lParam,NULL,(PUINT_PTR)&hSzItem)) {
lParam=ReuseDDElParam(lParam,msg,WM_DDE_ACK,*(PUINT)&ack,(UINT)hSzItem);
if (!PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,lParam)) {
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 29a9f5d8d0..7618ba9f04 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -115,7 +115,7 @@ static int ServiceParseAimLink(WPARAM,LPARAM lParam) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=AIM_PROTOCOL_NAME;
acs.psr=&psr;
- ZeroMemory(&psr,sizeof(PROTOSEARCHRESULT));
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize=sizeof(PROTOSEARCHRESULT);
psr.nick=sn;
CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
@@ -282,7 +282,7 @@ static void AddIcqUser(ICQFILEINFO *info) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=gpszICQProtoName;
acs.psr=(PROTOSEARCHRESULT*)&psr;
- ZeroMemory(&psr,sizeof(ICQSEARCHRESULT));
+ memset(&psr, 0, sizeof(ICQSEARCHRESULT));
psr.hdr.cbSize=sizeof(ICQSEARCHRESULT);
if(info->nick[0]) psr.hdr.nick=info->nick;
else psr.hdr.nick=info->uin;
@@ -337,7 +337,7 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam) TrimString(line);
if(IsEmpty(line)) continue;
if(line[0]=='[') {
- ZeroMemory(&info,sizeof(info));
+ memset(&info, 0, sizeof(info));
if (!mir_strcmpi(line,"[ICQ Message User]"))
info.type=ICQFILE_MESSAGEUSER;
else if (!mir_strcmpi(line,"[ICQ User]"))
@@ -434,7 +434,7 @@ static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=yahooProtocolName;
acs.psr=&psr;
- ZeroMemory(&psr,sizeof(PROTOSEARCHRESULT));
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize=sizeof(PROTOSEARCHRESULT);
psr.nick=id;
CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
@@ -549,7 +549,7 @@ static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=AIM_PROTOCOL_NAME;
acs.psr=&psr;
- ZeroMemory(&psr,sizeof(PROTOSEARCHRESULT));
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize=sizeof(PROTOSEARCHRESULT);
psr.nick=email;
psr.email=email;
@@ -744,7 +744,7 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) acs.handleType=HANDLE_SEARCHRESULT;
acs.szProto=jabberProtoName;
acs.psr=&psr;
- ZeroMemory(&psr,sizeof(PROTOSEARCHRESULT));
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
psr.cbSize=sizeof(PROTOSEARCHRESULT);
psr.nick=jid;
CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index b77aba262b..d53134bc50 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -49,7 +49,7 @@ static COLORREF GetDefaultColor(BYTE id) static LOGFONT* GetDefaultFont(LOGFONT *lf)
{
NONCLIENTMETRICS ncm;
- ZeroMemory(&ncm,sizeof(ncm));
+ memset(&ncm, 0, sizeof(ncm));
ncm.cbSize=sizeof(ncm);
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,ncm.cbSize,&ncm,0)) {
*lf=ncm.lfStatusFont;
@@ -193,7 +193,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA NULL);
if (dat->hwndToolTip != NULL) {
SetWindowPos(dat->hwndToolTip,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
- ZeroMemory(&ti,sizeof(ti));
+ memset(&ti, 0, sizeof(ti));
ti.cbSize=sizeof(ti);
ti.hwnd=hwndFrame;
ti.uFlags=TTF_IDISHWND|TTF_SUBCLASS|TTF_TRANSPARENT;
@@ -603,7 +603,7 @@ static int FrameModulesLoaded(WPARAM wParam,LPARAM lParam) int InitFrame(void)
{
WNDCLASSEX wcx;
- ZeroMemory(&wcx,sizeof(wcx));
+ memset(&wcx, 0, sizeof(wcx));
wcx.cbSize =sizeof(wcx);
wcx.style =CS_DBLCLKS|CS_PARENTDC;
wcx.lpfnWndProc =FrameWndProc;
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 7f1ab8b818..fa4d2e576e 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -185,7 +185,7 @@ static DWORD ShutdownNow(BYTE shutdownType) dwErrCode=ERROR_NOT_ENOUGH_MEMORY;
if (paConn != NULL) {
for(dwRetries=5; dwRetries != 0; dwRetries--) { /* prevent infinite loop (rare) */
- ZeroMemory(paConn, dwConnSize);
+ memset(paConn, 0, dwConnSize);
paConn[0].dwSize = sizeof(RASCONN);
dwErrCode = RasEnumConnections(paConn, &dwConnSize, &dwConnItems);
if (dwErrCode != ERROR_BUFFER_TOO_SMALL) break;
@@ -211,7 +211,7 @@ static DWORD ShutdownNow(BYTE shutdownType) }
/* RAS does not allow to quit directly after HangUp (see docs) */
dwLastTickCount = GetTickCount();
- ZeroMemory(&rcs,sizeof(RASCONNSTATUS));
+ memset(&rcs, 0, sizeof(RASCONNSTATUS));
rcs.dwSize = sizeof(RASCONNSTATUS);
for(dw=0; dw < dwConnItems; ++dw) {
if (paConn[dw].hrasconn != NULL) {
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 5c537fa06c..7eeab7d78f 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -207,7 +207,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDate int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,const TCHAR* pszBackgroundGroup,const TCHAR* pszBackgroundName,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault)
{
FontIDT fid;
- ZeroMemory(&fid,sizeof(fid));
+ memset(&fid, 0, sizeof(fid));
fid.cbSize=sizeof(fid);
mir_strncpy(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
@@ -246,7 +246,7 @@ int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLO int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault)
{
ColourIDT cid;
- ZeroMemory(&cid,sizeof(cid));
+ memset(&cid, 0, sizeof(cid));
cid.cbSize=sizeof(cid);
cid.defcolour=clrDefault;
mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
@@ -260,7 +260,7 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr)
{
ColourIDT cid;
- ZeroMemory(&cid,sizeof(cid));
+ memset(&cid, 0, sizeof(cid));
cid.cbSize=sizeof(cid);
mir_tstrncpy(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
mir_tstrncpy(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 997df7b244..3c8eb75463 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -77,7 +77,7 @@ int OpenAvatarDialog(MCONTACT hContact, char* fn) DWORD dwId;
struct AvatarDialogData *avdlg = (struct AvatarDialogData*)malloc(sizeof(struct AvatarDialogData));
- ZeroMemory(avdlg, sizeof(struct AvatarDialogData));
+ memset(avdlg, 0, sizeof(struct AvatarDialogData));
avdlg->hContact = hContact;
if (fn == NULL)
{
@@ -544,7 +544,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) TCHAR filter[MAX_PATH];
TCHAR file[MAX_PATH];
OPENFILENAME ofn;
- ZeroMemory(&ofn, sizeof(OPENFILENAME));
+ memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd;
ofn.hInstance = hInst;
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index d114f3eae6..2e4056c843 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -420,7 +420,7 @@ std::wstring EventList::GetMyName() {
std::wstring myName;
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.szProto = GetContactProto(hContact);
ci.hContact = 0;
@@ -463,7 +463,7 @@ std::wstring EventList::GetMyId() {
std::wstring myId;
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.szProto = GetContactProto(hContact);
ci.hContact = 0;
@@ -476,7 +476,7 @@ inline std::wstring GetContactId(MCONTACT hContact) {
std::wstring id;
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.szProto = GetContactProto(hContact);
ci.hContact = hContact;
diff --git a/plugins/BasicHistory/src/ImageDataObject.cpp b/plugins/BasicHistory/src/ImageDataObject.cpp index 15cb67f6ce..8e6c1b9b55 100644 --- a/plugins/BasicHistory/src/ImageDataObject.cpp +++ b/plugins/BasicHistory/src/ImageDataObject.cpp @@ -104,7 +104,7 @@ bool ImageDataObject::InsertBitmap(IRichEditOle* pRichEditOle, HBITMAP hBitmap) // Now Add the object to the RichEdit
//
REOBJECT reobject;
- ZeroMemory(&reobject, sizeof(REOBJECT));
+ memset(&reobject, 0, sizeof(REOBJECT));
reobject.cbStruct = sizeof(REOBJECT);
CLSID clsid;
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index 3dfb86402a..c32523b4af 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -97,7 +97,7 @@ static void TimerAnswer(MCONTACT hContact, const TalkBot::MessageInfo* info) CallContactService(hContact, PSS_MESSAGE, PREF_TCHAR, (LPARAM)msg);
- ZeroMemory(&ldbei, sizeof(ldbei));
+ memset(&ldbei, 0, sizeof(ldbei));
ldbei.cbSize = sizeof(ldbei);
//FIXME: Error may happen
ldbei.cbBlob = bufsize;
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 143d452177..4364533bf7 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -216,7 +216,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0;
DBEVENTINFO dbei;
- ZeroMemory(&dbei, sizeof(dbei));
+ memset(&dbei, 0, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = 0;
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP if (fullname != Config.MindFileName)
delete[] fullname;
- ZeroMemory(&ofn, sizeof(ofn));
+ memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = GetParent(hwndDlg);
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index e2915071ca..9ed3b0c67e 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -314,7 +314,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP case WM_COMMAND:
if (LOWORD(wParam) == IDC_PREVIEW) {
POPUPDATAT ppd;
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
//iPopupDelay
options.iPopupDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
diff --git a/plugins/ChangeKeyboardLayout/src/main.cpp b/plugins/ChangeKeyboardLayout/src/main.cpp index ae2c9e9a88..6cb7f6bc6e 100644 --- a/plugins/ChangeKeyboardLayout/src/main.cpp +++ b/plugins/ChangeKeyboardLayout/src/main.cpp @@ -52,8 +52,8 @@ static IconItem iconList[] = extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
- ZeroMemory(hklLayouts, 20 * sizeof(HKL));
- bLayNum = GetKeyboardLayoutList(20,hklLayouts);
+ memset(hklLayouts, 0, sizeof(hklLayouts));
+ bLayNum = GetKeyboardLayoutList(20, hklLayouts);
if (bLayNum < 2)
return 1;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 441afca9d5..2149b965d5 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -1888,12 +1888,12 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT // Store pos
Drawing->pos_indent = free_row_rc.left;
- ZeroMemory( &Drawing->pos_check, sizeof( Drawing->pos_check ));
- ZeroMemory( &Drawing->pos_avatar, sizeof( Drawing->pos_avatar ));
- ZeroMemory( &Drawing->pos_icon, sizeof( Drawing->pos_icon ));
- ZeroMemory( &Drawing->pos_label, sizeof( Drawing->pos_label ));
- ZeroMemory( &Drawing->pos_rename_rect, sizeof( Drawing->pos_rename_rect ));
- ZeroMemory( &Drawing->pos_extra, sizeof( Drawing->pos_extra ));
+ memset(&Drawing->pos_check, 0, sizeof(Drawing->pos_check));
+ memset(&Drawing->pos_avatar, 0, sizeof(Drawing->pos_avatar));
+ memset(&Drawing->pos_icon, 0, sizeof(Drawing->pos_icon));
+ memset(&Drawing->pos_label, 0, sizeof(Drawing->pos_label));
+ memset(&Drawing->pos_rename_rect, 0, sizeof(Drawing->pos_rename_rect));
+ memset(&Drawing->pos_extra, 0, sizeof(Drawing->pos_extra));
//**** Draw Background
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index 32aac83df5..5f61fb4cd4 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -74,7 +74,7 @@ static void Docking_AdjustPosition(HWND hwnd,RECT *rcDisplay,RECT *rc) {
APPBARDATA abd;
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = hwnd;
abd.uEdge = g_CluiData.fDocked == DOCKED_LEFT?ABE_LEFT:ABE_RIGHT;
@@ -124,7 +124,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) g_CluiData.fDocked = (BOOL)db_get_b(NULL,"CList","Docked",0);
if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
RECT rc, rcMonitor;
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
abd.lParam = 0;
@@ -144,7 +144,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW,NULL);
return 0;
case WM_ACTIVATE:
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_ACTIVATE,&abd);
@@ -155,9 +155,10 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) case WM_WINDOWPOSCHANGED:
{
- if (g_CluiData.fDocked) ModernSkinButton_ReposButtons( msg->hwnd,SBRF_DO_NOT_DRAW, NULL );
- return 0;
- ZeroMemory(&abd,sizeof(abd));
+ if (g_CluiData.fDocked)
+ ModernSkinButton_ReposButtons( msg->hwnd,SBRF_DO_NOT_DRAW, NULL );
+ return 0; // XXX: check me!!!
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_WINDOWPOSCHANGED,&abd);
@@ -186,7 +187,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) || (ptCursor.x >= rcMonitor.right-EDGESENSITIVITY))
&& db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
{
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
abd.lParam = 0;
@@ -255,10 +256,12 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) }
case WM_SHOWWINDOW:
{
- if (msg->lParam) return 0;
+ if (msg->lParam)
+ return 0;
BOOL toBeDocked = (BOOL)db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT);
- if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked = -g_CluiData.fDocked;
- ZeroMemory(&abd,sizeof(abd));
+ if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0))
+ g_CluiData.fDocked = -g_CluiData.fDocked;
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
if (msg->wParam) {
@@ -306,7 +309,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) ((g_CluiData.fDocked == DOCKED_RIGHT || g_CluiData.fDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
ReleaseCapture();
draggingTitle = 0;
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE,&abd);
@@ -345,7 +348,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) return TRUE;
case WM_DESTROY:
if (g_CluiData.fDocked>0) {
- ZeroMemory(&abd,sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE,&abd);
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp index 5854bcdf0b..8f26cf3c77 100644 --- a/plugins/Clist_modern/src/modern_image_array.cpp +++ b/plugins/Clist_modern/src/modern_image_array.cpp @@ -72,7 +72,7 @@ static BOOL ImageArray_Alloc(LP_IMAGE_ARRAY_DATA iad, int size) return FALSE;
}
- ZeroMemory(iad->nodes, sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
+ memset(iad->nodes, 0, (sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow));
}
iad->nodes_allocated_size = size_grow;
diff --git a/plugins/Clist_modern/src/modern_row.cpp b/plugins/Clist_modern/src/modern_row.cpp index a6bac28ed0..cbcb0265ef 100644 --- a/plugins/Clist_modern/src/modern_row.cpp +++ b/plugins/Clist_modern/src/modern_row.cpp @@ -79,7 +79,7 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess) { fsize = _filelength(_fileno(hFile)); tmplbuf = (char*)malloc(fsize+1); - ZeroMemory(tmplbuf, fsize+1); + memset(tmplbuf, 0, (fsize + 1)); for (i=0; i < fsize; i++) tmplbuf[i] = getc(hFile); tmplbuf[i] = 0; @@ -126,7 +126,7 @@ void cppCalculateRowItemsPos(ROWCELL *RowRoot, int width) const ROWCELL * rowAddCell(ROWCELL* &link, int cont) { link = (ROWCELL*)malloc(sizeof(ROWCELL)); - ZeroMemory(link, sizeof(ROWCELL)); + memset(link, 0, sizeof(ROWCELL)); link->cont = cont; return link; } @@ -165,7 +165,7 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) int j = -1; - ZeroMemory(buf, 256); + memset(buf, 0, sizeof(buf)); while(tbuf[hbuf] != 0) { diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 5d5f3740ad..97be36e25a 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -225,7 +225,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) TreeView_SetItem(htree, &tviparent);
int i=0;
- ZeroMemory( rowOptTA, sizeof( rowOptTA ));
+ memset(rowOptTA, 0, sizeof(rowOptTA));
rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &i);
}
@@ -273,7 +273,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) {
int i=0;
- ZeroMemory( rowOptTA, sizeof( rowOptTA ));
+ memset(rowOptTA, 0, sizeof(rowOptTA));
rowOptBuildTA((pROWCELL)tvpi.lParam, (pROWCELL*)&rowOptTA, &i );
}
@@ -383,7 +383,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM rowOptTmplRoot = NULL;
rowParse(rowOptTmplRoot, rowOptTmplRoot, rowOptTmplStr, hbuf, seq, rowOptTA);
seq = 0;
- ZeroMemory( rowOptTA, sizeof( rowOptTA ));
+ memset(rowOptTA, 0, sizeof(rowOptTA));
rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &seq);
rowOptFillRowTree(htree);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index a340a544e2..51d9b64ef7 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -72,7 +72,7 @@ static HWND hwndToolTips = NULL; int ModernSkinButtonLoadModule() { WNDCLASSEX wc; - ZeroMemory(&wc, sizeof(wc)); + memset(&wc, 0, sizeof(wc)); wc.cbSize = sizeof(wc); wc.lpszClassName = _T(MODERNSKINBUTTONCLASS); wc.lpfnWndProc = ModernSkinButtonWndProc; @@ -384,7 +384,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM EnterCriticalSection(&csTips); if (hwndToolTips) { TOOLINFO ti; - ZeroMemory(&ti, sizeof(ti)); + memset(&ti, 0, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; @@ -505,7 +505,7 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip) SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } - ZeroMemory(&ti, sizeof(ti)); + memset(&ti, 0, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND; ti.hwnd = hwnd; diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp index 9eca756415..a4d5593ab5 100644 --- a/plugins/Clist_nicer/skineditor/src/main.cpp +++ b/plugins/Clist_nicer/skineditor/src/main.cpp @@ -650,7 +650,7 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa psd = (SKINDESCRIPTION *)malloc(sizeof(SKINDESCRIPTION)); if (psd == NULL) return FALSE; - ZeroMemory(psd, sizeof(SKINDESCRIPTION)); + memset(psd, 0, sizeof(SKINDESCRIPTION)); CopyMemory(psd, (void *)lParam, sizeof(SKINDESCRIPTION)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)psd); diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index bc80f1ea3c..dfdce7c9a9 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -1551,7 +1551,7 @@ static int UpdateTBToolTip(int framepos) { TOOLINFO ti; - ZeroMemory(&ti, sizeof(ti)); + memset(&ti, 0, sizeof(ti)); ti.cbSize = sizeof(ti); ti.lpszText = Frames[framepos].TitleBar.tooltip; ti.hinst = g_hInst; @@ -1736,7 +1736,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM lParam) if (Frames == NULL) { Frames = (FRAMEWND*)malloc(sizeof(FRAMEWND) * (MAX_FRAMES + 2)); - ZeroMemory(Frames, sizeof(FRAMEWND) * (MAX_FRAMES + 2)); + memset(Frames, 0, (sizeof(FRAMEWND) * (MAX_FRAMES + 2))); } memset(&Frames[nFramescount], 0, sizeof(FRAMEWND)); diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp index c96e13b1e0..62e92dd013 100644 --- a/plugins/Clist_nicer/src/Docking.cpp +++ b/plugins/Clist_nicer/src/Docking.cpp @@ -66,7 +66,7 @@ static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc) {
APPBARDATA abd;
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = hwnd;
abd.uEdge = docked == DOCKED_LEFT ? ABE_LEFT : ABE_RIGHT;
@@ -111,7 +111,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) docked = (int) (char) cfg::getByte("CList", "Docked", 0);
if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
RECT rc, rcMonitor;
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
abd.lParam = 0;
@@ -124,13 +124,13 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) }
break;
case WM_ACTIVATE:
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_ACTIVATE, &abd);
return 0;
case WM_WINDOWPOSCHANGED:
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd);
@@ -155,7 +155,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) TranslateT("Contact list docking"), MB_OK);
return 0;
}
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
abd.lParam = 0;
@@ -198,7 +198,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) return 0;
if ((msg->wParam && docked < 0) || (!msg->wParam && docked > 0))
docked = -docked;
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
if (msg->wParam) {
@@ -246,7 +246,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if (((docked == DOCKED_LEFT || docked == -DOCKED_LEFT) && (short) LOWORD(msg->lParam) > rc.right) || ((docked == DOCKED_RIGHT || docked == -DOCKED_RIGHT) && (short) LOWORD(msg->lParam) < 0)) {
ReleaseCapture();
draggingTitle = 0;
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE, &abd);
@@ -272,7 +272,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) return TRUE;
case WM_DESTROY:
if (docked > 0) {
- ZeroMemory(&abd, sizeof(abd));
+ memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE, &abd);
diff --git a/plugins/Clist_nicer/src/alphablend.cpp b/plugins/Clist_nicer/src/alphablend.cpp index 3be597cf6c..b7e9d2e304 100644 --- a/plugins/Clist_nicer/src/alphablend.cpp +++ b/plugins/Clist_nicer/src/alphablend.cpp @@ -210,7 +210,7 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor if ( !hdc)
return;
- ZeroMemory(&bmi, sizeof(BITMAPINFO));
+ memset(&bmi, 0, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 94de708bef..2edc82614f 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -32,7 +32,7 @@ ClcContact* CreateClcContact( void ) {
ClcContact* p = (ClcContact*)mir_alloc( sizeof( ClcContact ));
if ( p != NULL ) {
- ZeroMemory(p, sizeof(ClcContact));
+ memset(p, 0, sizeof(ClcContact));
p->avatarLeft = p->extraIconRightBegin = p->xStatusIcon = -1;
}
return p;
@@ -160,7 +160,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (style & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(hContact, NULL, dat)) {
- ZeroMemory((void *)&dbv, sizeof(dbv));
+ memset(&dbv, 0, sizeof(dbv));
if (cfg::getTString(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
@@ -290,7 +290,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
- ZeroMemory(infoTypeC2, sizeof(WORD) * 12);
+ memset(infoTypeC2, 0, sizeof(infoTypeC2));
int iLen = min(mir_wstrlen(p->statusMsg), 10);
GetStringTypeW(CT_CTYPE2, p->statusMsg, iLen, infoTypeC2);
p->dwCFlags &= ~ECF_RTLSTATUSMSG;
@@ -350,7 +350,7 @@ void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact) DWORD iLen;
TExtraCache *p;
- ZeroMemory(infoTypeC2, sizeof(WORD) * 12);
+ memset(infoTypeC2, 0, sizeof(infoTypeC2));
if (contact == NULL) {
szText = pcli->pfnGetContactDisplayName(hContact, 0);
@@ -425,7 +425,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry, const char *szProto) if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
if (cEntry->status_item == NULL)
cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
- ZeroMemory(cEntry->status_item, sizeof(StatusItems_t));
+ memset(cEntry->status_item, 0, sizeof(StatusItems_t));
strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
cEntry->status_item->IGNORED = 0;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index cbbc46ce79..3b0019626c 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -523,7 +523,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) {
if ((contact->type == CLCIT_CONTACT && contact->pExtra->dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
PARAFORMAT2 pf2;
- ZeroMemory((void *)&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
pf2.wEffects = PFE_RTLPARA;
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index a06278dd20..bc6d99a40c 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -59,7 +59,7 @@ CListEvent* fnCreateEvent( void ) {
CListEvent *p = reinterpret_cast<CListEvent *>(mir_alloc(sizeof(CListEvent)));
if (p)
- ZeroMemory(p, sizeof(CListEvent));
+ memset(p, 0, sizeof(CListEvent));
return p;
}
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 47f27e5623..5cda86fb36 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -228,7 +228,7 @@ void API::updateState() {
BOOL result = FALSE;
- ::ZeroMemory(&sysState, sizeof(TSysState));
+ memset(&sysState, 0, sizeof(TSysState));
sysState.isThemed = IsThemeActive() ? true : false;
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 7344e6e6c6..318818105e 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -770,7 +770,7 @@ void IMG_ReadItem(const char *itemname, const char *szFileName) BOOL alloced = FALSE;
char szDrive[MAX_PATH], szPath[MAX_PATH];
- ZeroMemory(&tmpItem, sizeof(ImageItem));
+ memset(&tmpItem, 0, sizeof(ImageItem));
GetPrivateProfileStringA(itemname, "Glyph", "None", buffer, 500, szFileName);
if (strcmp(buffer, "None")) {
sscanf(buffer, "%d,%d,%d,%d", &tmpItem.glyphMetrics[0], &tmpItem.glyphMetrics[1],
@@ -839,7 +839,7 @@ done_with_glyph: IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
- ZeroMemory(newItem, sizeof(ImageItem));
+ memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
g_glyphItem = newItem;
}
@@ -852,7 +852,7 @@ done_with_glyph: ImageItem *pItem = g_ImageItems;
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
- ZeroMemory(newItem, sizeof(ImageItem));
+ memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
if (g_ImageItems == NULL)
@@ -879,7 +879,7 @@ done_with_glyph: COLORREF clr;
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
- ZeroMemory(newItem, sizeof(ImageItem));
+ memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
g_CLUIImageItem = newItem;
GetPrivateProfileStringA(itemname, "Colorkey", "e5e5e5", buffer, 500, szFileName);
@@ -901,7 +901,7 @@ done_with_glyph: IMG_CreateItem(&tmpItem, szFinalName, hdc);
if (tmpItem.hbm || tmpItem.dwFlags & IMAGE_GLYPH) {
newItem = reinterpret_cast<ImageItem *>(malloc(sizeof(ImageItem)));
- ZeroMemory(newItem, sizeof(ImageItem));
+ memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
p->imageItem = newItem;
if (g_ImageItems == NULL)
@@ -972,7 +972,7 @@ static void BTN_ReadItem(char *itemName, char *file) char szBuffer[1024];
ImageItem *imgItem = g_ImageItems;
- ZeroMemory(&tmpItem, sizeof(tmpItem));
+ memset(&tmpItem, 0, sizeof(tmpItem));
mir_snprintf(tmpItem.szName, sizeof(tmpItem.szName), "%s", &itemName[1]);
tmpItem.width = GetPrivateProfileIntA(itemName, "Width", 16, file);
tmpItem.height = GetPrivateProfileIntA(itemName, "Height", 16, file);
@@ -1149,7 +1149,7 @@ static void BTN_ReadItem(char *itemName, char *file) // create it
newItem = (ButtonItem *)malloc(sizeof(ButtonItem));
- ZeroMemory(newItem, sizeof(ButtonItem));
+ memset(newItem, 0, sizeof(ButtonItem));
if (g_ButtonItems == NULL) {
g_ButtonItems = newItem;
*newItem = tmpItem;
@@ -1197,7 +1197,7 @@ void IMG_LoadItems() IMG_DeleteItems();
char *szSections = reinterpret_cast<char *>(malloc(3002));
- ZeroMemory(szSections, 3002);
+ memset(szSections, 0, 3002);
GetPrivateProfileSectionNamesA(szSections, 3000, szFileName);
szSections[3001] = szSections[3000] = 0;
@@ -1246,7 +1246,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) file[MAX_PATH - 1] = 0;
ReadItem(&default_item, "%Default", file);
- ZeroMemory(szSections, 3000);
+ memset(szSections, 0, 3000);
p = szSections;
GetPrivateProfileSectionNamesA(szSections, 3000, file);
szSections[3001] = szSections[3000] = 0;
@@ -1257,7 +1257,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) continue;
}
items = reinterpret_cast<StatusItems_t *>(realloc(items, i * sizeof(StatusItems_t)));
- ZeroMemory(&items[i - 1], sizeof(StatusItems_t));
+ memset(&items[i - 1], 0, sizeof(StatusItems_t));
this_item = &items[i - 1];
GetPrivateProfileStringA(p, "Proto", "", this_item->szName, 40, file);
this_item->szName[39] = 0;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index eebaf61c4f..d9b664c1ee 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -159,7 +159,7 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam) HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
cfg::dat.tabSRMM_Avail = ServiceExists("SRMsg_MOD/GetWindowFlags") ? TRUE : FALSE;
- ZeroMemory((void *)overlayicons, sizeof(HICON) * 10);
+ memset(&overlayicons, 0, sizeof(overlayicons));
CLN_LoadAllIcons(1);
return 0;
@@ -181,7 +181,7 @@ extern "C" int __declspec(dllexport) CListInitialise() API::onInit();
RegisterCLUIFrameClasses();
- ZeroMemory((void *)&cfg::dat, sizeof(cfg::dat));
+ memset(&cfg::dat, 0, sizeof(cfg::dat));
int iCount = CallService(MS_DB_CONTACT_GETCOUNT, 0, 0);
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index b4a200fc46..4d8eb05820 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -1025,7 +1025,7 @@ void CreateViewModeFrame() RegisterClass(&wndclass);
- ZeroMemory(&frame, sizeof(frame));
+ memset(&frame, 0, sizeof(frame));
frame.cbSize = sizeof(frame);
frame.tname = _T("View modes");
frame.TBtname = TranslateT("View modes");
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index 4c5336eaaf..9e20f665b5 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -208,7 +208,7 @@ TCHAR *GetContactName(MCONTACT hContact, char *szProto) INT_PTR ret;
char proto[200];
- ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ memset(&ctInfo, 0, sizeof(ctInfo));
ctInfo.cbSize = sizeof(ctInfo);
if (szProto)
{
@@ -264,7 +264,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) CONTACTINFO ctInfo;
INT_PTR ret;
- ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ memset(&ctInfo, 0, sizeof(ctInfo));
ctInfo.cbSize = sizeof(ctInfo);
ctInfo.szProto = szProto;
ctInfo.dwFlag = CNF_UNIQUEID;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 01f15f3ebd..2a08772b9e 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -798,7 +798,7 @@ void showMsg(TCHAR *pName, DWORD pid,TCHAR *intIp,TCHAR *extIp,int intPort,int e struct CONNECTION *mpd = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
//MessageBox(NULL,"aaa","aaa",1);
- ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do.
+ memset(&ppd, 0, sizeof(ppd)); //This is always a good thing to do.
ppd.lchContact = NULL;//(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
if (settingResolveIp) {
@@ -886,7 +886,7 @@ extern "C" int __declspec(dllexport) Load(void) LoadSettings();
connExceptions=LoadSettingsConnections();
//create protocol
- //ZeroMemory(&pd,sizeof(pd));
+ //memset(&pd, 0, sizeof(pd));
//pd.cbSize=sizeof(pd);
pd.szName=PLUGINNAME;
pd.type=PROTOTYPE_PROTOCOL;
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 91a32f2a1a..d7454dfc84 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -408,7 +408,7 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara dbei.timestamp = time(NULL);
//make blob
TCTSend* maSend = (TCTSend*)_alloca(ackData->nContacts*sizeof(TCTSend));
- ZeroMemory(maSend, ackData->nContacts*sizeof(TCTSend));
+ memset(maSend, 0, (ackData->nContacts * sizeof(TCTSend)));
dbei.cbBlob = 0;
char* pBlob;
int i;
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 811c66f759..a583129741 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -190,7 +190,7 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut) WORD wOut;
struct ResizableByteBuffer buffer;
- ZeroMemory(&buffer,sizeof(buffer));
+ memset(&buffer, 0, sizeof(buffer));
fp=fopen(pszFileCSV,"rt");
if (fp != NULL) {
OutputDebugStringA("Running IP data convert...\n"); /* all ascii */
diff --git a/plugins/CryptoPP/src/GPGw/gpg_main.cpp b/plugins/CryptoPP/src/GPGw/gpg_main.cpp index 61c076e8df..ffb6a65e02 100644 --- a/plugins/CryptoPP/src/GPGw/gpg_main.cpp +++ b/plugins/CryptoPP/src/GPGw/gpg_main.cpp @@ -168,7 +168,7 @@ LPSTR __cdecl _gpg_encrypt(LPCSTR message, LPCSTR keyid) if(strlen(keyid))
{
- ZeroMemory(buffer, sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
gpgresult=gpgEncrypt(buffer, keyid, message);
if(gpgresult!=gpgSuccess)
@@ -205,7 +205,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) replace(buffer, "\r", "");
replace(buffer, "\n", txtcrlf);
- ZeroMemory(keyuserid, sizeof(keyuserid));
+ memset(keyuserid, 0, sizeof(keyuserid));
gpgresult=gpgDetectUserID(keyuserid, buffer);
storedpassphrase=NULL;
@@ -224,7 +224,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(storedpassphrase!=NULL)
{
strcpy(passphrase, storedpassphrase);
- ZeroMemory(plaintext, sizeof(plaintext));
+ memset(plaintext, 0, sizeof(plaintext));
gpgresult=gpgDecrypt(plaintext, buffer, passphrase);
}
else gpgresult=gpgUnknownError;
@@ -237,9 +237,9 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(dlgresult==IDOK)
{
strcpy(passphrase, dlgpassphrase);
- ZeroMemory(dlgpassphrase, passphrasesize);
+ memset(dlgpassphrase, 0, passphrasesize);
strcat(passphrase, txtcrlf);
- ZeroMemory(plaintext, sizeof(plaintext));
+ memset(plaintext, 0, sizeof(plaintext));
gpgresult=gpgDecrypt(plaintext, buffer, passphrase);
}
}
@@ -252,7 +252,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if ( gpgresult==gpgSuccess && useridvalid==TRUE)
addPassphrase(keyuserid, passphrase);
- ZeroMemory(passphrase, sizeof(passphrase));
+ memset(passphrase, 0, sizeof(passphrase));
decmessagelen = strlen(buffer)+1;
decmessage = (char *) LocalAlloc(LPTR,decmessagelen);
@@ -273,11 +273,11 @@ int __cdecl _gpg_select_keyid(HWND hdlg, LPSTR keyid) {
int dlgresult;
- ZeroMemory(keyid, keyidsize);
+ memset(keyid, 0, keyidsize);
dlgresult=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTKEY), hdlg, UserIdDialogProcedure, (LPARAM)keyid);
if(dlgresult!=IDOK)
- ZeroMemory(keyid, keyidsize);
+ memset(keyid, 0, keyidsize);
return (dlgresult==IDOK);
}
@@ -325,7 +325,7 @@ LPSTR GetEnvValue(LPCSTR szName) BOOL ShowSelectExecDlg(LPSTR path)
{
OPENFILENAME ofn;
- ZeroMemory(&ofn,sizeof(ofn));
+ memset(&ofn, 0, sizeof(ofn));
ofn.lpstrFile = GetRegValue(HKEY_CURRENT_USER,"Software\\GNU\\GnuPG","gpgProgram");
if ( ofn.lpstrFile && existsFile(ofn.lpstrFile) ) {
diff --git a/plugins/CryptoPP/src/GPGw/keys.cpp b/plugins/CryptoPP/src/GPGw/keys.cpp index 19606d446a..74674bedd3 100644 --- a/plugins/CryptoPP/src/GPGw/keys.cpp +++ b/plugins/CryptoPP/src/GPGw/keys.cpp @@ -24,7 +24,7 @@ void updateKeyUserIDs(const int atype) releaseKeyUserIDs(atype);
initKeyUserIDs(atype);
- ZeroMemory(buffer, sizeof(buffer));
+ memset(buffer, 0, sizeof(buffer));
if(atype==publickeyuserid) gpgresult=gpgListPublicKeys(buffer);
else gpgresult=gpgListSecretKeys(buffer);
diff --git a/plugins/CryptoPP/src/GPGw/passdialog.cpp b/plugins/CryptoPP/src/GPGw/passdialog.cpp index 8dfde8e09b..08ca1678a4 100644 --- a/plugins/CryptoPP/src/GPGw/passdialog.cpp +++ b/plugins/CryptoPP/src/GPGw/passdialog.cpp @@ -14,7 +14,7 @@ INT_PTR CALLBACK PassphraseDialogProcedure(HWND hdlg, UINT msg, WPARAM wparam, L switch(LOWORD(wparam))
{
case IDOK:
- ZeroMemory(dlgpassphrase, sizeof(dlgpassphrase));
+ memset(dlgpassphrase, 0, sizeof(dlgpassphrase));
GetDlgItemText(hdlg, IDC_PASSPHRASE, dlgpassphrase, SIZEOF(dlgpassphrase));
case IDCANCEL:
EndDialog(hdlg, wparam);
diff --git a/plugins/CryptoPP/src/GPGw/passphrases.cpp b/plugins/CryptoPP/src/GPGw/passphrases.cpp index 847472f5ac..6a88358370 100644 --- a/plugins/CryptoPP/src/GPGw/passphrases.cpp +++ b/plugins/CryptoPP/src/GPGw/passphrases.cpp @@ -18,7 +18,7 @@ void releasePassphrases(void) int i;
for(i=0; i<passphrasecount; i++)
- ZeroMemory(passphrases[i].passphrase, sizeof(passphrases[i].passphrase));
+ memset(passphrases[i].passphrase, 0, sizeof(passphrases[i].passphrase));
free(passphrases);
}
diff --git a/plugins/CryptoPP/src/GPGw/pipeexec.cpp b/plugins/CryptoPP/src/GPGw/pipeexec.cpp index fdefb147d6..3a04fd1697 100644 --- a/plugins/CryptoPP/src/GPGw/pipeexec.cpp +++ b/plugins/CryptoPP/src/GPGw/pipeexec.cpp @@ -6,7 +6,7 @@ BOOL isWindowsNT(void) BOOL result;
OSVERSIONINFO ovi;
- ZeroMemory(&ovi, sizeof(ovi));
+ memset(&ovi, 0, sizeof(ovi));
ovi.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
GetVersionEx(&ovi);
@@ -53,7 +53,7 @@ pxResult pxExecute(char *acommandline, char *ainput, char **aoutput, LPDWORD aex LogMessage("commandline:\n", acommandline, "\n");
- ZeroMemory(&securityattributes, sizeof(securityattributes));
+ memset(&securityattributes, 0, sizeof(securityattributes));
securityattributes.nLength=sizeof(SECURITY_ATTRIBUTES);
securityattributes.bInheritHandle=TRUE;
diff --git a/plugins/CryptoPP/src/GPGw/userdialog.cpp b/plugins/CryptoPP/src/GPGw/userdialog.cpp index 0227a5d549..a6f6cea17f 100644 --- a/plugins/CryptoPP/src/GPGw/userdialog.cpp +++ b/plugins/CryptoPP/src/GPGw/userdialog.cpp @@ -18,7 +18,7 @@ INT_PTR CALLBACK UserIdDialogProcedure(HWND hdlg, UINT msg, WPARAM wparam, LPARA static int iColWidth[] = { 110, 255 };
keyid = (char *)lparam;
- ZeroMemory(&lvc,sizeof(LVCOLUMN));
+ memset(&lvc, 0, sizeof(LVCOLUMN));
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
for (i = 0; i < 2; i++) {
@@ -63,7 +63,7 @@ void RefreshListView(HWND hLV) { int i;
ListView_DeleteAllItems(hLV);
- ZeroMemory(&lvi,sizeof(LVITEM));
+ memset(&lvi, 0, sizeof(LVITEM));
lvi.mask = LVIF_TEXT;
for (i = 0; i < getKeyUserIDCount(publickeyuserid); i++) {
diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp index 3c301b0162..d4ddb83ad3 100644 --- a/plugins/Db3x_mmap/src/dbcache.cpp +++ b/plugins/Db3x_mmap/src/dbcache.cpp @@ -79,7 +79,7 @@ void CDb3Mmap::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes) log0("buggy move!");
}
if (x > 0)
- ZeroMemory(m_pDbCache + ofsDest + bytes - x, x);
+ memset((m_pDbCache + ofsDest + bytes - x), 0, x);
if (ofsSource < m_dwFileSize)
MoveMemory(m_pDbCache + ofsDest, m_pDbCache + ofsSource, bytes - x);
@@ -116,8 +116,8 @@ void CDb3Mmap::DBWrite(DWORD ofs, PVOID pData, int bytes) void CDb3Mmap::DBFill(DWORD ofs, int bytes)
{
//log2("zerofill %d@%08x",bytes,ofs);
- if (ofs+bytes <= m_dwFileSize)
- ZeroMemory(m_pDbCache+ofs,bytes);
+ if ((ofs + bytes) <= m_dwFileSize)
+ memset((m_pDbCache + ofs), 0, bytes);
logg();
}
diff --git a/plugins/Db3x_mmap/src/dbtool/disk.cpp b/plugins/Db3x_mmap/src/dbtool/disk.cpp index 692fdb7fde..109df7b03b 100644 --- a/plugins/Db3x_mmap/src/dbtool/disk.cpp +++ b/plugins/Db3x_mmap/src/dbtool/disk.cpp @@ -62,9 +62,9 @@ int CDb3Mmap::ReadSegment(DWORD ofs, PVOID buf, int cbBytes) if (cb->bAggressive) {
if (ofs + cbBytes > sourceFileSize) {
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Can't write to working file, aggressive mode may be too aggressive now"));
- ZeroMemory(m_pDbCache + ofs, sourceFileSize - ofs);
+ memset((m_pDbCache + ofs), 0, (sourceFileSize - ofs));
}
- else ZeroMemory(m_pDbCache + ofs, cbBytes);
+ else memset((m_pDbCache + ofs), 0, cbBytes);
}
cb->spaceProcessed += cbBytes;
return ERROR_SUCCESS;
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index 52fcc5b673..783e222ffe 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -161,7 +161,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_SIZE:
{
UTILRESIZEDIALOG urd;
- ZeroMemory(&urd, sizeof(urd));
+ memset(&urd, 0, sizeof(urd));
urd.cbSize = sizeof(urd);
urd.hInstance = hInst;
urd.hwndDlg = hwnd;
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 714dcb0a7b..02aec62fca 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -154,7 +154,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.pszService = "DBEditorpp/MenuCommand";
Menu_AddMainMenuItem(&mi);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 1900000001;
mi.flags = 0;
@@ -240,7 +240,7 @@ extern "C" __declspec(dllexport) int Load(void) icex.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icex);
- ZeroMemory(&WatchListArray, sizeof(WatchListArray));
+ memset(&WatchListArray, 0, sizeof(WatchListArray));
return 0;
}
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 6248aeac86..493927ce6b 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -346,7 +346,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
UTILRESIZEDIALOG urd;
- ZeroMemory(&urd, sizeof(urd));
+ memset(&urd, 0, sizeof(urd));
urd.cbSize = sizeof(urd);
urd.hInstance = hInst;
urd.hwndDlg = hwnd;
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 96d15d638b..1f1a483bdd 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -214,7 +214,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SIZE:
{
UTILRESIZEDIALOG urd;
- ZeroMemory(&urd,sizeof(urd));
+ memset(&urd, 0, sizeof(urd));
urd.cbSize=sizeof(urd);
urd.hInstance=hInst;
urd.hwndDlg=hwnd;
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp index 0c0828383a..fd9e7ed387 100644 --- a/plugins/Exchange/src/MirandaExchange.cpp +++ b/plugins/Exchange/src/MirandaExchange.cpp @@ -891,7 +891,7 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR szEntryID ) DWORD dwCode = 0; - ZeroMemory ( &si, sizeof ( STARTUPINFO)); + memset(&si, 0, sizeof(STARTUPINFO)); si.cb = sizeof ( STARTUPINFO); si.dwFlags = STARTF_USESHOWWINDOW; diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 6e5bdbe79b..26394fa7b8 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -268,7 +268,7 @@ void FILEECHO::updateTitle() void BuildFreqTable(uchar *data, uint len, uint *freqTable)
{
- ZeroMemory(freqTable, 256*sizeof(uint));
+ memset(freqTable, 0, (256 * sizeof(uint)));
for(uint indx = 0; indx < len; indx++)
freqTable[data[indx]]++;
}
@@ -481,7 +481,7 @@ void FILEECHO::incomeRequest(char *param) if(!IsWindowVisible(hDlg) && !AutoMin)
{
CLISTEVENT cle;
- ZeroMemory(&cle, sizeof(cle));
+ memset(&cle, 0, sizeof(cle));
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
cle.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON));
@@ -1171,7 +1171,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam char str[MAX_PATH];
OPENFILENAME ofn;
- ZeroMemory(&ofn, sizeof(ofn));
+ memset(&ofn, 0, sizeof(ofn));
*str = 0;
GetDlgItemText(hDlg, IDC_FILENAME, str, SIZEOF(str));
//ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index c031563754..718d850118 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -274,7 +274,7 @@ int OptInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp;
- ZeroMemory(&odp, sizeof(odp));
+ memset(&odp, 0, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.position = -790000000;
odp.hInstance = hInst;
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index f6f5132ee4..e6e656197d 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -147,7 +147,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) { HCURSOR hPrevCursor = ::SetCursor(::LoadCursor(0, IDC_WAIT));
NETLIBHTTPREQUEST nlhr;
- ZeroMemory(&nlhr, sizeof(nlhr));
+ memset(&nlhr, 0, sizeof(nlhr));
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_DUMPASTEXT;
@@ -1489,7 +1489,7 @@ void InitGuiElements() { }
CLISTMENUITEM mi;
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = 0;
mi.pszContactOwner = NULL; //all contacts
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 1fc44a1218..15fc8679bb 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -160,7 +160,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM) SetForegroundWindow(hWndProgress);
LISTELEMENT *listStart = (LISTELEMENT*)malloc(sizeof(LISTELEMENT));
- ZeroMemory(listStart, sizeof(LISTELEMENT));
+ memset(listStart, 0, sizeof(LISTELEMENT));
while( 1 ) {
if ( dbe.eventType == EVENTTYPE_URL || dbe.eventType == EVENTTYPE_MESSAGE ) {
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 8154146c11..cb06a7020a 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -118,7 +118,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) char shEvent[10+1];
BYTE openNewWindow, mouseEvent;
- ZeroMemory(shEvent, _countof(shEvent));
+ memset(shEvent, 0, sizeof(shEvent));
pENLink = (ENLINK*)lpNmhdr;
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 1da3264c10..20bf744532 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -53,9 +53,9 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart) if ( listStart == NULL )
return -1;
- ZeroMemory(link, _countof(link)*sizeof(TCHAR));
- ZeroMemory(date, _countof(date)*sizeof(TCHAR));
- ZeroMemory(time, _countof(time)*sizeof(TCHAR));
+ memset(link, 0, sizeof(link));
+ memset(date, 0, sizeof(date));
+ memset(time, 0, sizeof(time));
msg = DbGetEventTextT(dbei, CP_ACP);
@@ -197,7 +197,7 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart) if ( newElement == NULL )
return -1;
- ZeroMemory(newElement, sizeof(LISTELEMENT));
+ memset(newElement, 0, sizeof(LISTELEMENT));
newElement->direction = direction;
newElement->type = type;
_tcsncpy_s(newElement->date, date, _TRUNCATE);
@@ -307,7 +307,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc SendDlgItemMessage( hDlg, IDC_MAIN, EM_AUTOURLDETECT, TRUE, 0 );
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETBKGNDCOLOR, FALSE, colourSet.background);
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR;
cf.crTextColor = colourSet.text;
@@ -321,7 +321,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc // How to set RTF colour, font, etc.... found at
// http://www.winehq.com/hypermail/wine-devel/2004/08/0608.html
- ZeroMemory(&pf, sizeof(pf));
+ memset(&pf, 0, sizeof(pf));
pf.cbSize = sizeof(pf);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_LEFT;
@@ -329,7 +329,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc if ( searchString != NULL )
{
- ZeroMemory( &cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
@@ -337,13 +337,13 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc _tcscpy_s(cf.szFaceName, _T("Arial"));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM) &cf);
- ZeroMemory(searchText, _countof(searchText)*sizeof(TCHAR));
- mir_sntprintf(searchText, _countof(searchText), _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
+ memset(searchText, 0, sizeof(searchText));
+ mir_sntprintf(searchText, SIZEOF(searchText), _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)searchText);
linePos += 2;
}
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
_tcscpy_s(cf.szFaceName, _T("Courier"));
@@ -436,14 +436,14 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc if ( _tcscmp(actualElement->date, lastDate) != 0 )
{
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR;
cf.crTextColor = colourSet.text;
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM)&cf);
if ( options.showLine != 0 )
DrawLine(hDlg, lineLen);
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
@@ -456,13 +456,13 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc linePos += 3;
}
_tcscpy_s(lastDate, actualElement->date);
- ZeroMemory( &cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof cf;
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
_tcscpy_s(cf.szFaceName, _T("Courier"));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM) &cf);
}
- ZeroMemory( &cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR;
@@ -513,7 +513,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc }
else if ( searchString == NULL )
{
- ZeroMemory( &cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_FACE;
cf.dwEffects = CFE_BOLD;
@@ -544,7 +544,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B CHARFORMAT cf;
PARAFORMAT pf;
- ZeroMemory(&pf, sizeof(pf));
+ memset(&pf, 0, sizeof(pf));
pf.cbSize = sizeof(pf);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_LEFT;
@@ -554,7 +554,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_SETBKGNDCOLOR, FALSE, BGColourSel);
SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, WM_SETTEXT , 0, 0);
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD | CFM_ITALIC | CFM_COLOR;
_tcscpy_s(cf.szFaceName, _T("Courier"));
@@ -565,7 +565,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B else
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_REPLACESEL, FALSE, (LPARAM)_T("\n"));
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_BOLD | CFM_FACE | CFM_COLOR;
cf.dwEffects = CFE_BOLD;
@@ -578,14 +578,14 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_REPLACESEL, FALSE, (LPARAM) _T("\n"));
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_ITALIC | CFM_BOLD | CFM_UNDERLINE | CFM_FACE;
_tcscpy_s(cf.szFaceName, _T("Courier"));
SendDlgItemMessage( hDlg, IDC_OPTIONS_RE, EM_SETCHARFORMAT, SCF_SELECTION | SCF_WORD, (LPARAM) &cf);
// incoming
- ZeroMemory(&cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = InColourSel;
@@ -608,7 +608,7 @@ int WriteOptionExample(HWND hDlg, DWORD InColourSel, DWORD OutColourSel, DWORD B SendDlgItemMessage(hDlg, IDC_OPTIONS_RE, EM_REPLACESEL, FALSE, (LPARAM)_T("http://miranda-ng.org\n"));
// outgoing
- ZeroMemory( &cf, sizeof(cf));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_COLOR | CFM_FACE;
cf.crTextColor = OutColourSel;
@@ -1276,7 +1276,7 @@ BOOL SaveEditAsStream( HWND hDlg ) // Initialize filename field
_tcscpy_s(szFilename, _T("*.rtf"));
// Fill in OPENFILENAME struct
- ZeroMemory(&ofn, sizeof(OPENFILENAME));
+ memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
TCHAR temp[MAX_PATH];
diff --git a/plugins/HistoryStats/src/canvas.cpp b/plugins/HistoryStats/src/canvas.cpp index 9830e36f07..e2b553d44a 100644 --- a/plugins/HistoryStats/src/canvas.cpp +++ b/plugins/HistoryStats/src/canvas.cpp @@ -118,7 +118,7 @@ bool Canvas::getDigest(Digest& digest) int nSize = m_nLineLength * m_nHeight;
BYTE* pData = new BYTE[nSize];
- ZeroMemory(pData, nSize);
+ memset(pData, 0, nSize);
if (GetDIBits(m_hDC, m_hBmp, 0, m_nHeight, pData, reinterpret_cast<BITMAPINFO*>(m_pBMIH), DIB_RGB_COLORS) != m_nHeight) {
delete[] pData;
diff --git a/plugins/HistoryStats/src/main.cpp b/plugins/HistoryStats/src/main.cpp index 5da8460d05..c6c63d6287 100644 --- a/plugins/HistoryStats/src/main.cpp +++ b/plugins/HistoryStats/src/main.cpp @@ -255,7 +255,7 @@ static INT_PTR MenuHistoryPaste(WPARAM wParam, LPARAM lParam) int blobBuffer = 4096;
HANDLE hEvent = mu::db_event::findFirst(g_hHistoryCopyContact);
- ZeroMemory(&dbe, sizeof(dbe));
+ memset(&dbe, 0, sizeof(dbe));
dbe.cbSize = sizeof(dbe);
dbe.pBlob = reinterpret_cast<BYTE*>(malloc(blobBuffer));
diff --git a/plugins/HistoryStats/src/mirandasettings.cpp b/plugins/HistoryStats/src/mirandasettings.cpp index c0da3dd256..a6707a2cc0 100644 --- a/plugins/HistoryStats/src/mirandasettings.cpp +++ b/plugins/HistoryStats/src/mirandasettings.cpp @@ -42,7 +42,7 @@ ext::string MirandaSettings::readStrDirect(const char* szSetting, const TCHAR* s {
DBVARIANT dbv;
- ZeroMemory(&dbv, sizeof(dbv));
+ memset(&dbv, 0, sizeof(dbv));
dbv.type = DBVT_WCHAR;
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index d7ecb26fe3..654751ff21 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -210,7 +210,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) char *szProto;
hContact = getRealContact(hContact);
szProto = getProto(hContact);
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
ci.szProto = szProto;
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index f3d754766f..df42325586 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -221,7 +221,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr }
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = event->hContact;
ci.szProto = szProto;
@@ -229,7 +229,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci))
szNickIn = encodeUTF8(event->hContact, szRealProto, ci.pszVal, ENF_NAMESMILEYS, true);
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = NULL;
ci.szProto = szProto;
@@ -401,7 +401,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, }
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = event->hContact;
ci.szProto = szProto;
@@ -409,7 +409,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
szNickIn = encodeUTF8(event->hContact, szRealProto, ci.pszVal, ENF_NAMESMILEYS, true);
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = NULL;
ci.szProto = szProto;
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 84fe165a26..d833f2cb9e 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -113,7 +113,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) if (!(hExistingDbEvent = db_event_first(hContact)))
return FALSE;
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
dwEventTimeStamp = dbeiExisting.timestamp;
@@ -130,7 +130,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) // check for equal timestamps
if (dbei.timestamp == dwPreviousTimeStamp) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hPreviousDbEvent, &dbeiExisting);
@@ -140,7 +140,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) // find event with another timestamp
hExistingDbEvent = db_event_next(hContact, hPreviousDbEvent);
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -161,7 +161,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) if (dbei.timestamp <= dwPreviousTimeStamp) {
// look back
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -187,7 +187,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) else {
// look forward
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
diff --git a/plugins/ListeningTo/src/players/player.cpp b/plugins/ListeningTo/src/players/player.cpp index 73b84dc71f..36b63a8523 100644 --- a/plugins/ListeningTo/src/players/player.cpp +++ b/plugins/ListeningTo/src/players/player.cpp @@ -23,7 +23,7 @@ extern void HasNewListeningInfo(); Player::Player() : name(_T("Player")), enabled(FALSE), needPoll(FALSE)
{
- ZeroMemory(&listening_info, sizeof(listening_info));
+ memset(&listening_info, 0, sizeof(listening_info));
InitializeCriticalSection(&cs);
}
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 3549ddc84a..f9af356b9a 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -468,7 +468,7 @@ void showMsg(TCHAR* sender,TCHAR* text, DWORD id, char *strUID) //The text for the second line. You could even make something like: char lpzText[128]; mir_tstrcpy(lpzText, "Hello world!"); It's your choice.
POPUPATT * mpd = (POPUPATT*)malloc(sizeof(POPUPATT));
- ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do.
+ memset(&ppd, 0, sizeof(ppd)); //This is always a good thing to do.
ppd.lchContact = NULL; //(HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
_tcscpy_s(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), sender);
@@ -716,7 +716,7 @@ void checkthread(void*) &retNoteOID, /* out: OID */
&retModified, /* out: */
&retNoteClass) ;
- ZeroMemory(strLink, sizeof(strLink));
+ memset(strLink, 0, sizeof(strLink));
mir_snprintf(strLink, SIZEOF(strLink), "%.8lX%.8lX%.8lX%.8lX",
retNoteOID.File.Innards[1],
retNoteOID.File.Innards[0],
@@ -752,8 +752,8 @@ void checkthread(void*) WCHAR msgFrom[512], msgSubject[512];
- ZeroMemory(msgFrom,sizeof(msgFrom));
- ZeroMemory(msgSubject,sizeof(msgSubject));
+ memset(msgFrom, 0, sizeof(msgFrom));
+ memset(msgSubject, 0, sizeof(msgSubject));
if(wcslen(field_from_UNICODE) < 512 && wcslen(field_from_UNICODE) > 3 && wcsstr(field_from_UNICODE, L"CN=") == field_from_UNICODE)
_tcsncpy_s(msgFrom, &(field_from_UNICODE[3]), wcscspn(field_from_UNICODE, L"/")-3 );
diff --git a/plugins/MenuItemEx/src/images.cpp b/plugins/MenuItemEx/src/images.cpp index bafb96f440..710b9570a9 100644 --- a/plugins/MenuItemEx/src/images.cpp +++ b/plugins/MenuItemEx/src/images.cpp @@ -130,7 +130,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) return NULL;
// Create bitmap
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = bmp.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = bmp.bmHeight;
@@ -183,7 +183,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) // UINT * ptPixels;
// HBITMAP DirectBitmap;
//
-// ZeroMemory(&RGB32BitsBITMAPINFO,sizeof(BITMAPINFO));
+// memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
// RGB32BitsBITMAPINFO.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
// RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;//bm.bmWidth;
// RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;//bm.bmHeight;
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp index 2a6e994056..56e3f44d9b 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp @@ -132,7 +132,7 @@ void InitSRMM() HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed);
if (options.bHaveButtonsBar) {
- ZeroMemory(&OTRButton, sizeof(OTRButton));
+ memset(&OTRButton, 0, sizeof(OTRButton));
OTRButton.cbSize = sizeof(OTRButton);
OTRButton.dwButtonID = 0;
OTRButton.pszModuleName = MODULENAME;
diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp index 9782eca20b..5998a2daf6 100644 --- a/plugins/MirOTR/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/MirOTR/src/utils.cpp @@ -112,7 +112,7 @@ void otrl_privkey_hash_to_humanT(TCHAR human[45], const unsigned char hash[20]) char* contact_get_id(MCONTACT hContact, bool bNameOnError) {
char* pszUniqueID = NULL;
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
ci.dwFlag = CNF_UNIQUEID;
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 9ca5594c6b..ef9746eb87 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -916,7 +916,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lPara // Create struct for dbevent DBEVENTINFO dbevent; - ZeroMemory(&dbevent, sizeof(dbevent)); + memset(&dbevent, 0, sizeof(dbevent)); //dbevent.flags |= PREF_UNICODE; dbevent.cbSize = sizeof(dbevent); dbevent.cbBlob = db_event_getBlobSize(hdbevent); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index e5809be5bf..473296553d 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -250,7 +250,7 @@ void CConfig::OnConnectionChanged() { int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM lParam)
{
OPTIONSDIALOGPAGE odp;
- ZeroMemory(&odp, sizeof(odp));
+ memset(&odp, 0, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.position = 847000000;
odp.hInstance = hInstance;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index db850a54c2..466b9cfe59 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -137,7 +137,7 @@ bool CLCDConnectionLogitech::Initialize(tstring strAppletName,bool bAutostart, b if(lgLcdInit() != ERROR_SUCCESS)
return false;
- ZeroMemory(&m_connectContext, sizeof(m_connectContext));
+ memset(&m_connectContext, 0, sizeof(m_connectContext));
m_connectContext.connection = LGLCD_INVALID_CONNECTION;
m_connectContext.appFriendlyName = m_strAppletName.c_str();
@@ -257,7 +257,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) }
// Now lets open the LCD. We must initialize the g_OpenContext structure.
- ZeroMemory(&OpenContext, sizeof(OpenContext));
+ memset(&OpenContext, 0, sizeof(OpenContext));
OpenContext.connection = m_hConnection;
OpenContext.deviceType = m_pConnectedDevice->GetIndex();//LGLCD_DEVICE_QVGA;
OpenContext.device = LGLCD_INVALID_DEVICE;
@@ -283,7 +283,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) m_pPixels = OpenContext.deviceType==LGLCD_DEVICE_QVGA? m_lcdBitmap.bmp_qvga32.pixels:m_lcdBitmap.bmp_mono.pixels;
m_iPixels = OpenContext.deviceType==LGLCD_DEVICE_QVGA? sizeof(m_lcdBitmap.bmp_qvga32.pixels):sizeof(m_lcdBitmap.bmp_mono.pixels);
m_pDrawingBuffer = (PBYTE) malloc(m_iPixels);
- ZeroMemory(m_pDrawingBuffer, m_iPixels);
+ memset(m_pDrawingBuffer, 0, m_iPixels);
m_iPriority = LGLCD_PRIORITY_NORMAL;
m_bConnected = true;
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index d1ed4dc48d..814410f9b8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -74,7 +74,7 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits return false;
}
- ZeroMemory(m_pBitmapInfo, nBMISize);
+ memset(m_pBitmapInfo, 0, nBMISize);
m_pBitmapInfo->bmiHeader.biSize = sizeof(m_pBitmapInfo->bmiHeader);
m_pBitmapInfo->bmiHeader.biWidth = m_nWidth;
m_pBitmapInfo->bmiHeader.biHeight = -m_nHeight;
@@ -298,7 +298,7 @@ void CLCDGfx::DrawText(int nX, int nY, LPCTSTR sText) int nOldBkMode = SetBkMode(m_hDC, TRANSPARENT);
DRAWTEXTPARAMS dtp;
- ZeroMemory(&dtp, sizeof(DRAWTEXTPARAMS));
+ memset(&dtp, 0, sizeof(DRAWTEXTPARAMS));
dtp.cbSize = sizeof(DRAWTEXTPARAMS);
RECT rBounds = {nX,nY,GetClipWidth(),GetClipHeight()};
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index f3a01450af..7d531cbea8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -9,7 +9,7 @@ CLCDInput::CLCDInput() {
m_lInputTime = 0;
m_iLinePosition = 0;
- ZeroMemory(&m_Marker,2*sizeof(SMarker));
+ memset(&m_Marker, 0, sizeof(m_Marker));
m_pScrollbar = NULL;
m_bShowSymbols = true;
@@ -573,7 +573,7 @@ void CLCDInput::Reset() m_lInputTime = 0;
m_bInsert = true;
- ZeroMemory(&m_Marker[0],sizeof(SMarker));
+ memset(&m_Marker[0], 0, sizeof(SMarker));
m_strText = _T("");
m_vLineOffsets.clear();
diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index 1e06d87774..9d49c40aa8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -11,7 +11,7 @@ CLCDTextObject::CLCDTextObject() m_hFont = NULL;
m_iFontHeight = 0;
// Initialize DRAWTEXTPARAMS
- ZeroMemory(&m_dtp, sizeof(DRAWTEXTPARAMS));
+ memset(&m_dtp, 0, sizeof(DRAWTEXTPARAMS));
m_dtp.cbSize = sizeof(DRAWTEXTPARAMS);
// Initialize alignment
m_iTextFormat = m_iTextAlignment = (DT_LEFT | DT_NOPREFIX);
@@ -107,7 +107,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) return;
LOGFONT lf;
- ZeroMemory(&lf, sizeof(lf));
+ memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
_tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE);
@@ -121,7 +121,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) void CLCDTextObject::SetFontPointSize(int nPointSize)
{
LOGFONT lf;
- ZeroMemory(&lf, sizeof(lf));
+ memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
lf.lfHeight = -MulDiv(nPointSize, 96, 72);
@@ -134,7 +134,7 @@ void CLCDTextObject::SetFontPointSize(int nPointSize) //************************************************************************
void CLCDTextObject::SetFontItalic(bool flag) {
LOGFONT lf;
- ZeroMemory(&lf, sizeof(lf));
+ memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
lf.lfItalic = flag;
@@ -148,7 +148,7 @@ void CLCDTextObject::SetFontItalic(bool flag) { void CLCDTextObject::SetFontWeight(int nWeight)
{
LOGFONT lf;
- ZeroMemory(&lf, sizeof(lf));
+ memset(&lf, 0, sizeof(lf));
GetObject(m_hFont, sizeof(LOGFONT), &lf);
lf.lfWeight = nWeight;
diff --git a/plugins/ModernOpt/src/mopt_selector.cpp b/plugins/ModernOpt/src/mopt_selector.cpp index ce5145cfa9..267848781b 100644 --- a/plugins/ModernOpt/src/mopt_selector.cpp +++ b/plugins/ModernOpt/src/mopt_selector.cpp @@ -117,7 +117,7 @@ struct TSelectorData TSelectorData()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
~TSelectorData()
{
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index 7c32b3fb5b..d23ad780fd 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -117,8 +117,8 @@ class CLHistoryDlg {
hFindDlg = NULL;
acFindStr[0] = 0;
- ZeroMemory(&fr, sizeof( fr ));
- fr.lStructSize = sizeof( fr);
+ memset(&fr, 0, sizeof(fr));
+ fr.lStructSize = sizeof(fr);
fr.hInstance = hInstance;
fr.Flags = FR_NOUPDOWN|FR_HIDEUPDOWN;//|FR_MATCHCASE|FR_WHOLEWORD;
// FR_DOWN|FR_FINDNEXT|FR_NOMATCHCASE;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 599ff08953..9e53605f25 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -888,17 +888,17 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar }
case IDC_FILE_VIEWER_BROWSE:
{
- OPENFILENAME ofn = { 0 }; // common dialog box structure
+ OPENFILENAME ofn; // common dialog box structure
TCHAR szFile[260]; // buffer for file name
+ TCHAR buf[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILE_VIEWER, szFile, SIZEOF(szFile));
// Initialize OPENFILENAME
- //ZeroMemory(&ofn, sizeof(OPENFILENAME));
+ memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = szFile;
ofn.nMaxFile = SIZEOF(szFile);
- TCHAR buf[MAX_PATH];
mir_sntprintf(buf, SIZEOF(buf), _T("%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c"), TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = buf;
ofn.nFilterIndex = 1;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 763be95870..1db6774808 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -939,7 +939,7 @@ void DisplayErrorDialog( const TCHAR *pszError, tstring& sFilePath, DBEVENTINFO _tcscpy( szFile, _T("DebugInfo.txt"));
// Initialize OPENFILENAME
- ZeroMemory(&ofn, sizeof(OPENFILENAME));
+ memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
//ofn.hwndOwner = NULL;
ofn.lpstrFile = szFile;
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 2469e22728..d9dd63ddf0 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -231,7 +231,7 @@ int CreateFrame() HookEvent(ME_COLOUR_RELOAD, ReloadColour);
for (int i = 0; i < NUM_FONTS; i++) {
- ZeroMemory(&font_id[i], sizeof(font_id[i]));
+ memset(&font_id[i], 0, sizeof(font_id[i]));
font_id[i].cbSize = sizeof(FontIDT);
_tcsncpy(font_id[i].group, LPGENT("My details"), SIZEOF(font_id[i].group));
@@ -892,7 +892,7 @@ void CalcRectangles(HWND hwnd) data->listening_to_rect = GetRect(hdc, r, proto->listening_to, DEFAULT_LISTENING_TO, proto, uFormat, next_top, text_left);
data->listening_to_text_rect = data->listening_to_rect;
- ZeroMemory(&data->listening_to_icon_rect, sizeof(data->listening_to_icon_rect));
+ memset(&data->listening_to_icon_rect, 0, sizeof(data->listening_to_icon_rect));
next_top = data->listening_to_rect.bottom + SPACE_TEXT_TEXT;
}
@@ -990,7 +990,7 @@ HBITMAP CreateBitmap32(int cx, int cy) BITMAPINFO RGB32BitsBITMAPINFO;
UINT *ptPixels;
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = cx;//bm.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = cy;//bm.bmHeight;
@@ -1493,7 +1493,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P InsertMenuItem(submenu, 0, TRUE, &mii);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
mii.fState = protocols->ListeningToEnabled() ? MFS_CHECKED : 0;
@@ -1531,7 +1531,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_CREATE:
{
data = new MyDetailsFrameData();
- ZeroMemory(data, sizeof(MyDetailsFrameData));
+ memset(data, 0, sizeof(MyDetailsFrameData));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
data->recalc_rectangles = true;
@@ -1895,7 +1895,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Enable listening to for %s"), proto->description);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.fType = MFT_STRING;
@@ -1912,7 +1912,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."),
CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, proto->status, GSMDF_TCHAR));
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1931,7 +1931,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."), proto->description);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1949,7 +1949,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my nickname for %s..."), proto->description);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1966,7 +1966,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my avatar for %s..."), proto->description);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1981,7 +1981,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
- ZeroMemory(&mii, sizeof(mii));
+ memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
mii.fState = protocols->ListeningToEnabled() ? MFS_CHECKED : 0;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index f5a43e8753..2da6d364d3 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -245,7 +245,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam) }
else {
SetAwayMsgData *dat = new SetAwayMsgData;
- ZeroMemory(dat, sizeof(SetAwayMsgData));
+ memset(dat, 0, sizeof(SetAwayMsgData));
dat->szProtocol = (char*)lParam;
dat->IsModeless = false;
DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), NULL, SetAwayMsgDlgProc, (LPARAM)dat);
@@ -359,7 +359,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM) }
SetAwayMsgData *dat = new SetAwayMsgData;
- ZeroMemory(dat, sizeof(SetAwayMsgData));
+ memset(dat, 0, sizeof(SetAwayMsgData));
dat->hInitContact = hContact;
dat->szProtocol = GetContactProto(hContact);
dat->IsModeless = false;
@@ -622,7 +622,7 @@ int MirandaLoaded(WPARAM, LPARAM) mi.pszService = MS_AWAYSYS_AUTOREPLY_TOGGLE;
g_hToggleSOEMenuItem = Menu_AddMainMenuItem(&mi);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = -2000005000;
mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE | CMIF_HIDDEN;
@@ -631,7 +631,7 @@ int MirandaLoaded(WPARAM, LPARAM) g_hReadStatMenuItem = Menu_AddContactMenuItem(&mi);
if (g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_USEMENUITEM)) {
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
mi.ptszName = LPGENT("Set status message"); // will never be shown
@@ -640,7 +640,7 @@ int MirandaLoaded(WPARAM, LPARAM) mi.pszService = MS_AWAYSYS_SETCONTACTSTATMSG;
g_hContactMenuItem = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = CMIF_TCHAR | CMIF_ROOTPOPUP;
mi.hIcon = NULL;
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index bc1fabe341..bdf5564e9a 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -370,7 +370,7 @@ HTREEITEM CCList::AddContact(MCONTACT hContact) return hContactItem;
TVINSERTSTRUCT tvIns;
- ZeroMemory(&tvIns, sizeof(tvIns));
+ memset(&tvIns, 0, sizeof(tvIns));
tvIns.hParent = AddGroup(db_get_s(hContact, "CList", "Group", _T("")));
tvIns.item.pszText = pcli->pfnGetContactDisplayName(hContact, 0);
tvIns.hInsertAfter = TVI_ROOT;
@@ -405,7 +405,7 @@ HTREEITEM CCList::AddGroup(TCString GroupName) GroupEnumData.GroupName = GroupName;
GroupEnumData.hGroup = NULL;
DBCONTACTENUMSETTINGS dbEnum;
- ZeroMemory(&dbEnum, sizeof(dbEnum));
+ memset(&dbEnum, 0, sizeof(dbEnum));
dbEnum.lParam = (LPARAM)&GroupEnumData;
dbEnum.pfnEnumProc = GroupEnum;
dbEnum.szModule = "CListGroups";
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp index 686ad07cac..a1f2c42840 100644 --- a/plugins/NewAwaySysMod/src/Services.cpp +++ b/plugins/NewAwaySysMod/src/Services.cpp @@ -175,7 +175,7 @@ INT_PTR InvokeStatusWindow(WPARAM wParam, LPARAM) return (int)g_SetAwayMsgPage.GetWnd();
}
SetAwayMsgData *dat = new SetAwayMsgData;
- ZeroMemory(dat, sizeof(SetAwayMsgData));
+ memset(dat, 0, sizeof(SetAwayMsgData));
dat->hInitContact = iswi->hContact;
dat->szProtocol = iswi->szProto;
dat->Message = (iswi->Flags & ISWF_UNICODE) ? iswi->wszMsg : _A2T(iswi->szMsg);
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 4e8c83192c..803f131970 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -187,7 +187,7 @@ extern "C" int __declspec(dllexport) Load() mi.pszService="/LoadPubKey";
hLoadPubKey = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=-0x7FFFFFFe;
mi.flags=CMIF_TCHAR;
@@ -196,7 +196,7 @@ extern "C" int __declspec(dllexport) Load() mi.pszService="/ToggleEncryption";
hToggleEncryption = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=-0x7FFFFFFd;
mi.flags=CMIF_TCHAR;
@@ -205,7 +205,7 @@ extern "C" int __declspec(dllexport) Load() mi.pszService="/SendKey";
hSendKey = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=-0x7FFFFFFe;
mi.flags=CMIF_TCHAR;
@@ -214,7 +214,7 @@ extern "C" int __declspec(dllexport) Load() mi.pszService="/ExportGPGKeys";
hExportGpgKeys = Menu_AddMainMenuItem(&mi);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=-0x7FFFFFFF;
mi.flags=CMIF_TCHAR;
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index de39d4a36e..5a051a1208 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -53,37 +53,37 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR col.fmt = LVCFMT_LEFT; col.cx = 50; ListView_InsertColumn(hwndList, 0, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Email"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 1, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Name"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 250; ListView_InsertColumn(hwndList, 2, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Creation date"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 3, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Expire date"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 4, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Key length"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 5, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = TranslateT("Accounts"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; @@ -1665,31 +1665,31 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar col.fmt = LVCFMT_LEFT; col.cx = 50; ListView_InsertColumn(hwndList, 0, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = _T("Email"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 1, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = _T("Name"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 250; ListView_InsertColumn(hwndList, 2, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = _T("Creation date"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 3, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = _T("Expiration date"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; col.cx = 30; ListView_InsertColumn(hwndList, 4, &col); - ZeroMemory(&col,sizeof(col)); + memset(&col, 0, sizeof(col)); col.pszText = _T("Key length"); col.mask = LVCF_TEXT | LVCF_WIDTH; col.fmt = LVCFMT_LEFT; diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 039d91cc35..c3d9a93f69 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -94,25 +94,25 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP col.fmt = LVCFMT_LEFT;
col.cx = 60;
ListView_InsertColumn(hwndList, 0, &col);
- ZeroMemory(&col,sizeof(col));
+ memset(&col, 0, sizeof(col));
col.pszText = TranslateT("Key ID");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 50;
ListView_InsertColumn(hwndList, 1, &col);
- ZeroMemory(&col,sizeof(col));
+ memset(&col, 0, sizeof(col));
col.pszText = TranslateT("Name");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 50;
ListView_InsertColumn(hwndList, 2, &col);
- ZeroMemory(&col,sizeof(col));
+ memset(&col, 0, sizeof(col));
col.pszText = TranslateT("Email");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
col.cx = 50;
ListView_InsertColumn(hwndList, 3, &col);
- ZeroMemory(&col,sizeof(col));
+ memset(&col, 0, sizeof(col));
col.pszText = TranslateT("Protocol");
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
@@ -156,7 +156,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if(db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0))
ListView_SetCheckState(hwndList, iRow, 1);
user_data[i] = hContact;
- ZeroMemory(&item,sizeof(item));
+ memset(&item, 0, sizeof(item));
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);// not sure about this
ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hwndList, 2, LVSCW_AUTOSIZE);
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 1474502e35..25cd58230b 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1456,7 +1456,7 @@ void ExportGpGKeysFunc(int type) break; } id += " contact_id "; - ZeroMemory(&dbv, sizeof(dbv)); + memset(&dbv, 0, sizeof(dbv)); db_get(hContact, proto, uid, &dbv); switch(dbv.type) { case DBVT_DELETED: diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index b80988d337..bf9bf100d1 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -74,7 +74,7 @@ void InitMenu() mi.pszService = MS_NEWSAGGREGATOR_CHANGEFEED;
hService2[6] = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.flags = CMIM_ICON;
if (db_get_b(NULL, MODULE, "AutoUpdate", 1))
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 1c7c1dba88..d7a66a4788 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -357,7 +357,7 @@ int StrReplace(TCHAR *lpszOld, const TCHAR *lpszNew, TCHAR *&lpszStr) // allocate buffer for result string
size_t nResultStrSize = nStrLen + (nNewLen - nOldLen) * nCount + 2;
pszResultStr = new TCHAR [nResultStrSize];
- ZeroMemory(pszResultStr, nResultStrSize * sizeof(TCHAR));
+ memset(pszResultStr, 0, (nResultStrSize * sizeof(TCHAR)));
pszStart = (TCHAR *)lpszStr;
pszEnd = (TCHAR *)lpszStr + nStrLen;
diff --git a/plugins/NotesAndReminders/src/hotkeys.cpp b/plugins/NotesAndReminders/src/hotkeys.cpp index fb5fb678c5..8038037792 100644 --- a/plugins/NotesAndReminders/src/hotkeys.cpp +++ b/plugins/NotesAndReminders/src/hotkeys.cpp @@ -13,7 +13,7 @@ void RegisterKeyBindings() {
HOTKEYDESC desc;
- ZeroMemory(&desc, sizeof(desc));
+ memset(&desc, 0, sizeof(desc));
desc.cbSize = sizeof(desc);
desc.ptszSection = _T(SECTIONNAME);
desc.dwFlags = HKD_TCHAR;
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index cb1c01a988..d9a3c9798e 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -184,8 +184,8 @@ static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont) static void InitFonts()
{
- ZeroMemory(&lfBody,sizeof(LOGFONT));
- ZeroMemory(&lfCaption,sizeof(LOGFONT));
+ memset(&lfBody, 0, sizeof(LOGFONT));
+ memset(&lfCaption, 0, sizeof(LOGFONT));
LoadNRFont(NR_FONTID_CAPTION, &lfCaption, (COLORREF*)&CaptionFontColor);
LoadNRFont(NR_FONTID_BODY, &lfBody, (COLORREF*)&BodyFontColor);
@@ -557,10 +557,10 @@ void InitSettings(void) g_RemindSMS = NULL;
else
{
- g_RemindSMS = (char*)malloc(Sz1+1);
- ZeroMemory(g_RemindSMS,Sz1+1);
- memcpy(g_RemindSMS,P,Sz1);
- FreeSettingBlob(Sz1,P);
+ g_RemindSMS = (char*)malloc(Sz1 + 1);
+ memcpy(g_RemindSMS, P, Sz1);
+ g_RemindSMS[Sz1] = 0;
+ FreeSettingBlob(Sz1, P);
}
g_lpszAltBrowser = db_get_sa(0,MODULENAME,"AltBrowser");
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp index 096b3de9ea..a35a757462 100644 --- a/plugins/NotifyAnything/src/main.cpp +++ b/plugins/NotifyAnything/src/main.cpp @@ -885,7 +885,7 @@ DWORD WINAPI udptcpThreadFunc(LPVOID useUdp) g_tcp_socket = sock;
SOCKADDR_IN addr;
- ZeroMemory(&addr, sizeof addr);
+ memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(g_settings.port);
if (g_settings.local_only) {
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index ab5e8d63ca..e6390a3e82 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -79,7 +79,7 @@ extern "C" __declspec(dllexport) int Load(void) Menu_AddMainMenuItem(&mi);
// Add empty updates folder menu item
hEmptyFolder = CreateServiceFunction(MODNAME"/EmptyFolder", EmptyFolder);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_TCHAR;
diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp index 7a88026b25..2335bae500 100644 --- a/plugins/PluginUpdater/src/checksum.cpp +++ b/plugins/PluginUpdater/src/checksum.cpp @@ -193,7 +193,7 @@ LBL_NotPE: pDBG->PointerToRawData >= pISH->PointerToRawData &&
pDBG->PointerToRawData + pDBG->SizeOfData <= pISH->PointerToRawData + pISH->SizeOfRawData)
{
- ZeroMemory(map.ptr + pDBG->PointerToRawData, pDBG->SizeOfData);
+ memset((map.ptr + pDBG->PointerToRawData), 0, pDBG->SizeOfData);
}
// patch resources
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 377fe2880d..33374c027f 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -69,7 +69,7 @@ HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurB // common funcs
void LoadOptions() {
- ZeroMemory(&PopupOptions, sizeof(PopupOptions));
+ memset(&PopupOptions, 0, sizeof(PopupOptions));
#if defined(_DEBUG)
PopupOptions.debug = db_get_b(NULL, MODULNAME, "debug", FALSE);
#endif
@@ -98,7 +98,7 @@ void PopupPreview() POPUPDATA2 ppd = {0};
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
ppd.flags = PU2_TCHAR;
@@ -108,7 +108,7 @@ void PopupPreview() CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
ppd.flags = PU2_TCHAR;
ppd.lptzTitle = lptzTitle2;
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index ce95fadc2c..2edb58f93e 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -72,7 +72,7 @@ static void updatePreviewImage(HWND hwndBox) gPreviewOk = false;
POPUPDATA2 ppd;
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
ppd.flags = PU2_TCHAR;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE);
diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp index f024eaa31e..9a4b4ed96f 100644 --- a/plugins/Popup/src/popup_gdiplus.cpp +++ b/plugins/Popup/src/popup_gdiplus.cpp @@ -76,7 +76,7 @@ HBITMAP SkinEngine_CreateDIB32(int cx, int cy) }
BITMAPINFO RGB32BitsBITMAPINFO;
- ZeroMemory(&RGB32BitsBITMAPINFO,sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;//bm.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;//bm.bmHeight;
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 16fcc7ed6d..5c61d32e65 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -103,7 +103,7 @@ bool LoadPopupWnd2() MSGERROR(msg);
}
- ZeroMemory(&wcl, sizeof(wcl));
+ memset(&wcl, 0, sizeof(wcl));
wcl.cbSize = sizeof(wcl);
wcl.lpfnWndProc = MenuHostWndProc;
wcl.style = 0;
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index f41c866600..3a9cc46681 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -505,7 +505,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt i = -1; break; case 'F': - ZeroMemory(&ci, sizeof(CONTACTINFO)); + memset(&ci, 0, sizeof(CONTACTINFO)); ci.cbSize = sizeof(CONTACTINFO); ci.hContact = hContact; ci.dwFlag = CNF_FIRSTNAME | CNF_UNICODE; @@ -537,7 +537,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt i = -1; break; case 'L': - ZeroMemory(&ci, sizeof(CONTACTINFO)); + memset(&ci, 0, sizeof(CONTACTINFO)); ci.cbSize = sizeof(CONTACTINFO); ci.hContact = hContact; ci.dwFlag = CNF_LASTNAME | CNF_UNICODE; diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp index ce8db16a78..4c3e63473c 100644 --- a/plugins/QuickMessages/src/main.cpp +++ b/plugins/QuickMessages/src/main.cpp @@ -111,7 +111,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam) if(textlenght)
{
pszText = (TCHAR *)mir_alloc((textlenght+10)*sizeof(TCHAR));
- ZeroMemory(pszText,(textlenght+10)*sizeof(TCHAR));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
SendMessage(mwpd->hwnd,EM_GETSELTEXT, 0, (LPARAM)pszText);
}
if(qd->ptszValue){
@@ -192,7 +192,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam) if(textlenght)
{
pszText = (TCHAR *)mir_alloc((textlenght+10)*sizeof(TCHAR));
- ZeroMemory(pszText,(textlenght+10)*sizeof(TCHAR));
+ memset(pszText, 0, ((textlenght + 10) * sizeof(TCHAR)));
SendMessage(hEdit,EM_GETSELTEXT, 0, (LPARAM)pszText);
}
diff --git a/plugins/Quotes/src/Chart.h b/plugins/Quotes/src/Chart.h index 8cd4718b94..8c40a4dfff 100644 --- a/plugins/Quotes/src/Chart.h +++ b/plugins/Quotes/src/Chart.h @@ -45,7 +45,7 @@ private: public:
CChart() : m_MaxY(),m_MinY()
{
- ZeroMemory(&m_rect,sizeof(m_rect));
+ memset(&m_rect, 0, sizeof(m_rect));
}
~CChart()
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 02aaf99b39..4f57f16cab 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -203,7 +203,7 @@ namespace h = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,Quotes_PrebuildContactMenu);
g_ahEvents.push_back(h);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.pszContactOwner = QUOTES_PROTOCOL_NAME;
hMenuRoot = NULL;
diff --git a/plugins/Quotes/src/OptionDukasCopy.cpp b/plugins/Quotes/src/OptionDukasCopy.cpp index 162c95bb7f..9f2397020c 100644 --- a/plugins/Quotes/src/OptionDukasCopy.cpp +++ b/plugins/Quotes/src/OptionDukasCopy.cpp @@ -28,7 +28,7 @@ namespace {
// USES_CONVERSION;
TVINSERTSTRUCT tvi;
- ZeroMemory(&tvi,sizeof(tvi));
+ memset(&tvi, 0, sizeof(tvi));
tvi.hParent = htiParent;
tvi.hInsertAfter = TVI_LAST;
@@ -152,7 +152,7 @@ namespace void tree_do_set_item_state(HWND hwndTree,HTREEITEM hti,ETreeCheckBoxState nState)
{
TVITEM tvi;
- ZeroMemory(&tvi,sizeof(tvi));
+ memset(&tvi, 0, sizeof(tvi));
tvi.mask = TVIF_STATE|TVIF_HANDLE;
tvi.hItem = hti;
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp index c6553a1c68..06f04a7e0b 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp @@ -611,7 +611,7 @@ namespace if(1 == ServiceExists(MS_POPUP_ADDPOPUPT))
{
POPUPDATAT ppd;
- ZeroMemory((void *)&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = hContact;
//if((true == bValidPrevRate))
if(tendency.IsValid())
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 8a0de4c59c..f176a8e77b 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -58,7 +58,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda void LoadDBSettings()
{
- ZeroMemory(&LastUCOpt, sizeof(LastUCOpt));
+ memset(&LastUCOpt, 0, sizeof(LastUCOpt));
LastUCOpt.MaxShownContacts = (INT)db_get_b( NULL, dbLastUC_ModuleName, dbLastUC_MaxShownContacts, 0 );
LastUCOpt.HideOffline = db_get_b( NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, 0 );
LastUCOpt.WindowAutoSize = db_get_b( NULL, dbLastUC_ModuleName, dbLastUC_WindowAutosize, 0 );
@@ -102,7 +102,7 @@ BOOL ShowListMainDlgProc_OpenContact(HWND hList, int item) {
if (item != -1) {
LVITEM lvi;
- ZeroMemory(&lvi, sizeof(lvi));
+ memset(&lvi, 0, sizeof(lvi));
lvi.mask = LVIF_PARAM;
lvi.lParam = NULL;
lvi.iItem = item;
@@ -120,7 +120,7 @@ BOOL ShowListMainDlgProc_OpenContactMenu(HWND hDlg, HWND hList, int item, LASTUC {
if (item != -1) {
LVITEM lvi;
- ZeroMemory(&lvi, sizeof(lvi));
+ memset(&lvi, 0, sizeof(lvi));
lvi.mask = LVIF_PARAM;
lvi.lParam = NULL;
lvi.iItem = item;
@@ -175,7 +175,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hDlg);
{
DlgDat = new LASTUC_DLG_DATA;
- ZeroMemory(DlgDat, sizeof(LASTUC_DLG_DATA));
+ memset(DlgDat, 0, sizeof(LASTUC_DLG_DATA));
DlgDat->Contacts = (cmultimap*)lParam;
RECT rc;
@@ -204,7 +204,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM // add header columns to listview
LVCOLUMN lvc;
- ZeroMemory(&lvc, sizeof(lvc));
+ memset(&lvc, 0, sizeof(lvc));
lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
lvc.fmt = LVCFMT_LEFT;
lvc.iSubItem = 0;
@@ -328,7 +328,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hList, &r);
if (PtInRect(&r, p)) {
LVHITTESTINFO lvh;
- ZeroMemory(&lvh, sizeof(lvh));
+ memset(&lvh, 0, sizeof(lvh));
lvh.pt = p;
ScreenToClient(hList, &lvh.pt);
ListView_HitTest(hList, &lvh);
@@ -410,7 +410,7 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam) __time64_t curTime;
//DWORD t;
DBEVENTINFO dbe;
- ZeroMemory(&dbe, sizeof(dbe));
+ memset(&dbe, 0, sizeof(dbe));
dbe.cbSize = sizeof(dbe);
BYTE buf[1];
dbe.pBlob = buf;
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 43e0ef12e4..4fa819f0b2 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -125,7 +125,7 @@ extern "C" int __declspec(dllexport) Load() char *strTmp;
CreateServiceFunction("RemovePersonalSettings/RemoveAll",RemoveAllService);
- ZeroMemory(&mi,sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize=sizeof(mi);
mi.position=-0x7FFFFFFF;
mi.flags=0;
@@ -670,7 +670,7 @@ void DeleteSettingEx(const char *szModule, const char *szSetting) lenModule = strlen(szModule);
if (szModule[0] == '*' || szModule[lenModule-1] == '*') {
DeleteModuleStruct dms;
- ZeroMemory(&dms, sizeof(dms));
+ memset(&dms, 0, sizeof(dms));
dms.filter = szModule;
dms.lenFilterMinusOne = lenModule-1;
@@ -692,7 +692,7 @@ void DeleteSettingEx(const char *szModule, const char *szSetting) DeleteModuleStruct dms;
DBCONTACTENUMSETTINGS dbces;
- ZeroMemory(&dms, sizeof(dms));
+ memset(&dms, 0, sizeof(dms));
dms.filter = szSetting;
dms.lenFilterMinusOne = lenSetting-1;
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp index 592641acaa..0d7eeb597d 100644 --- a/plugins/SMS/src/main.cpp +++ b/plugins/SMS/src/main.cpp @@ -60,7 +60,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) {
switch(dwReason) {
case DLL_PROCESS_ATTACH:
- ZeroMemory(&ssSMSSettings, sizeof(ssSMSSettings));
+ memset(&ssSMSSettings, 0, sizeof(ssSMSSettings));
ssSMSSettings.hInstance = hInstance;
ssSMSSettings.hHeap = HeapCreate(0, 0, 0);
DisableThreadLibraryCalls((HMODULE)hInstance);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 3d2a74c756..7af503ed9a 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -113,7 +113,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l {
HWND hwndToolTips=CreateWindowEx(WS_EX_TOPMOST,TOOLTIPS_CLASS,TEXT(""),WS_POPUP,0,0,0,0,NULL,NULL,GetModuleHandle(NULL),NULL);
TOOLINFO ti;
- ZeroMemory(&ti,sizeof(ti));
+ memset(&ti, 0, sizeof(ti));
ti.cbSize=sizeof(ti);
ti.uFlags=TTF_IDISHWND|TTF_SUBCLASS;
ti.uId=(UINT)GetDlgItem(hWndDlg,IDC_HISTORY);
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index e743e82bc6..225945e3d7 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -59,7 +59,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, BOOL bRedra HWND hwndRich = GetDlgItem(hwndDlg, IDC_CHAT_LOG);
LOGSTREAMDATA streamData;
- ZeroMemory(&streamData, sizeof(streamData));
+ memset(&streamData, 0, sizeof(streamData));
streamData.hwnd = hwndRich;
streamData.si = si;
streamData.lin = lin;
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index f36a1d24f6..719d5a5b69 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -303,7 +303,7 @@ void InitGlobals() {
HDC hdc = GetDC(NULL);
- ZeroMemory(&g_dat, sizeof(struct GlobalMessageData));
+ memset(&g_dat, 0, sizeof(struct GlobalMessageData));
g_dat.hMessageWindowList = WindowList_Create();
g_dat.hParentWindowList = WindowList_Create();
@@ -349,7 +349,7 @@ void FreeGlobals() WindowList_Destroy(g_dat.hMessageWindowList);
WindowList_Destroy(g_dat.hParentWindowList);
- ZeroMemory(&g_dat, sizeof(g_dat));
+ memset(&g_dat, 0, sizeof(g_dat));
}
void ReloadGlobals()
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 475188e03b..10f588a8a8 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -176,7 +176,7 @@ int RTL_Detect(WCHAR *pszwText) infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2));
if (infoTypeC2) {
- ZeroMemory(infoTypeC2, sizeof(WORD) * (iLen + 2));
+ memset(infoTypeC2, 0, (sizeof(WORD) * (iLen + 2)));
GetStringTypeW(CT_CTYPE2, pszwText, iLen, infoTypeC2);
@@ -759,7 +759,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->flags |= g_dat.ieviewInstalled ? g_dat.flags & SMF_USEIEVIEW : 0;
{
PARAFORMAT2 pf2;
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
if (!(dat->flags & SMF_RTL)) {
@@ -772,7 +772,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
/* Workaround to make Richedit display RTL messages correctly */
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA | PFM_OFFSETINDENT | PFM_RIGHTINDENT;
pf2.wEffects = PFE_RTLPARA;
@@ -1210,7 +1210,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_SWITCHRTL:
{
PARAFORMAT2 pf2;
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
dat->flags ^= SMF_RTL;
@@ -1660,7 +1660,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int bufSize = ansiBufSize + GetRichTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE), 1200, TRUE) + 2;
PARAFORMAT2 pf2;
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index aa99c773d1..afd2b0f479 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -852,7 +852,7 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend) if (dat->windowData.hwndLog != NULL) {
IEVIEWEVENT evt;
IEVIEWWINDOW ieWindow;
- ZeroMemory(&evt, sizeof(evt));
+ memset(&evt, 0, sizeof(evt));
evt.cbSize = sizeof(evt);
evt.dwFlags = ((dat->flags & SMF_RTL) ? IEEF_RTL : 0);
evt.hwnd = dat->windowData.hwndLog;
@@ -869,7 +869,7 @@ void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend) CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&evt);
dat->hDbEventLast = evt.hDbEventFirst != NULL ? evt.hDbEventFirst : dat->hDbEventLast;
- ZeroMemory(&ieWindow, sizeof(ieWindow));
+ memset(&ieWindow, 0, sizeof(ieWindow));
ieWindow.cbSize = sizeof(ieWindow);
ieWindow.iType = IEW_SCROLLBOTTOM;
ieWindow.hwnd = dat->windowData.hwndLog;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index b0773914c3..54b39dc590 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -698,7 +698,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, {
PARAFORMAT2 pf2;
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_OFFSETINDENT | PFM_RIGHTINDENT;
pf2.dxStartIndent = 30;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 07f033524c..2d17cbef67 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -221,7 +221,7 @@ TCHAR *GetRichTextWord(HWND hwnd, POINTL *ptl) {
TEXTRANGE tr;
CHARRANGE cr;
- ZeroMemory(&tr, sizeof(TEXTRANGE));
+ memset(&tr, 0, sizeof(TEXTRANGE));
pszWord = (TCHAR *)mir_alloc(sizeof(TCHAR) * (end - start + 1));
cr.cpMin = start;
cr.cpMax = end;
@@ -262,7 +262,7 @@ TCHAR *GetRichEditSelection(HWND hwnd) MessageSendQueueItem msi;
EDITSTREAM stream;
DWORD dwFlags = 0;
- ZeroMemory(&stream, sizeof(stream));
+ memset(&stream, 0, sizeof(stream));
stream.pfnCallback = StreamOutCallback;
stream.dwCookie = (DWORD_PTR) &msi;
dwFlags = SF_TEXT|SF_UNICODE|SFF_SELECTION;
@@ -432,7 +432,7 @@ void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList) void GetContactUniqueId(SrmmWindowData *dat, char *buf, int maxlen)
{
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = dat->windowData.hContact;
ci.szProto = dat->szProto;
diff --git a/plugins/SecureIM/src/images.cpp b/plugins/SecureIM/src/images.cpp index c3a0fbdde3..ce00b9fa68 100644 --- a/plugins/SecureIM/src/images.cpp +++ b/plugins/SecureIM/src/images.cpp @@ -112,7 +112,7 @@ HBITMAP CopyBitmapTo32(HBITMAP hBitmap) return NULL;
// Create bitmap
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = bmp.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = bmp.bmHeight;
@@ -163,7 +163,7 @@ HBITMAP CreateBitmap32(int cx, int cy) UINT * ptPixels;
HBITMAP DirectBitmap;
- ZeroMemory(&RGB32BitsBITMAPINFO, sizeof(BITMAPINFO));
+ memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
RGB32BitsBITMAPINFO.bmiHeader.biWidth = cx;//bm.bmWidth;
RGB32BitsBITMAPINFO.bmiHeader.biHeight = cy;//bm.bmHeight;
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index 933de76846..0bdf701aa1 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -45,7 +45,7 @@ int ResetMissed(void) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_b(hContact, S_MOD, "Missed", 0);
- ZeroMemory(&mcs,sizeof(mcs));
+ memset(&mcs, 0, sizeof(mcs));
return 0;
}
@@ -171,7 +171,7 @@ int ModeChange_mo(WPARAM,LPARAM lparam) case ID_STATUS_DND:
case ID_STATUS_NA:
if (ehmissed == NULL) {
- ZeroMemory(&mcs,sizeof(mcs));
+ memset(&mcs, 0, sizeof(mcs));
CheckIfOnline();
ehmissed = HookEvent(ME_CLIST_CONTACTICONCHANGED, Test);
}
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index 7314a1508d..3c9bc669fb 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -112,7 +112,7 @@ DWORD isSeen(MCONTACT hcontact, SYSTEMTIME *st) }
SYSTEMTIME lst;
- ZeroMemory(&lst,sizeof(lst));
+ memset(&lst, 0, sizeof(lst));
if (lst.wYear = db_get_w(hcontact,S_MOD,"Year",0)) {
if (lst.wMonth = db_get_w(hcontact,S_MOD,"Month",0)) {
if (lst.wDay = db_get_w(hcontact,S_MOD,"Day",0)) {
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 318567cb90..cc1e5d40c7 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -234,8 +234,8 @@ void CSend::svcSendMsgExit(const char* szMessage) { }else{ mir_freeAndNil(m_szEventMsg); m_cbEventMsg=mir_strlen(szMessage)+1; - m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg); - ZeroMemory(m_szEventMsg, m_cbEventMsg); + m_szEventMsg=(char*)mir_realloc(m_szEventMsg, (sizeof(char) * m_cbEventMsg)); + memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); mir_strcpy(m_szEventMsg,szMessage); if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { char *temp = mir_t2a(m_pszFileDesc); @@ -273,8 +273,8 @@ void CSend::svcSendFileExit() { mir_freeAndNil(m_szEventMsg); char* szFile = mir_t2a(m_pszFile); m_cbEventMsg=mir_strlen(szFile)+2; - m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg); - ZeroMemory(m_szEventMsg, m_cbEventMsg); + m_szEventMsg=(char*)mir_realloc(m_szEventMsg, (sizeof(char) * m_cbEventMsg)); + memset(m_szEventMsg, 0, (sizeof(char) * m_cbEventMsg)); mir_strcpy(m_szEventMsg,szFile); if (m_pszFileDesc && m_pszFileDesc[0] != NULL) { char* temp = mir_t2a(m_pszFileDesc); @@ -391,7 +391,7 @@ void CSend::Error(LPCTSTR pszFormat, ...) { va_end(vl); mir_free(m_ErrorMsg), m_ErrorMsg = mir_tstrdup(tszMsg); - ZeroMemory(&m_box, sizeof(MSGBOX)); + memset(&m_box, 0, sizeof(MSGBOX)); m_box.cbSize = sizeof(MSGBOX); m_box.hParent = NULL; m_box.hiLogo = Skin_GetIcon(ICO_COMMON_SSWINDOW1); diff --git a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp index 95b41262cf..5bb28a8da2 100644 --- a/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHTTPServer.cpp @@ -68,7 +68,7 @@ int CSendHTTPServer::Send() replaceStrT(m_fsi_pszRealPath, m_pszFile); - ZeroMemory(&m_fsi, sizeof(m_fsi)); + memset(&m_fsi, 0, sizeof(m_fsi)); m_fsi.lStructSize = sizeof(STFileShareInfo); m_fsi.pszSrvPath = m_fsi_pszSrvPath; m_fsi.nMaxDownloads = -1; // -1 = infinite diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index b4dc0dde92..d53a11c495 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -46,7 +46,7 @@ int CSendHost_ImageShack::Send() { Exit(ACKRESULT_FAILED); return !m_bAsync; } - ZeroMemory(&m_nlhr, sizeof(m_nlhr)); + memset(&m_nlhr, 0, sizeof(m_nlhr)); char* tmp; tmp=mir_t2a(m_pszFile); HTTPFormData frm[]={ // {"Referer",HTTPFORM_HEADER("http://www.imageshack.us/upload_api.php")}, diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index 1a4063e710..77be71704f 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -33,7 +33,7 @@ int CSendHost_Imgur::Send() Exit(ACKRESULT_FAILED); return !m_bAsync; } - ZeroMemory(&m_nlhr, sizeof(m_nlhr)); + memset(&m_nlhr, 0, sizeof(m_nlhr)); char* tmp; tmp=mir_t2a(m_pszFile); HTTPFormData frm[]={ {"Authorization",HTTPFORM_HEADER("Client-ID 2a7303d78abe041")}, diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp index 73830c7052..a3a640b986 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp @@ -33,7 +33,7 @@ int CSendHost_UploadPie::Send() Exit(ACKRESULT_FAILED); return !m_bAsync; } - ZeroMemory(&m_nlhr, sizeof(m_nlhr)); + memset(&m_nlhr, 0, sizeof(m_nlhr)); char* tmp; tmp=mir_t2a(m_pszFile); HTTPFormData frm[]={ {"MAX_FILE_SIZE",HTTPFORM_INT(3145728)},// ?? diff --git a/plugins/SendScreenshotPlus/src/ctrl_button.cpp b/plugins/SendScreenshotPlus/src/ctrl_button.cpp index 41773048c5..c42f35fa2e 100644 --- a/plugins/SendScreenshotPlus/src/ctrl_button.cpp +++ b/plugins/SendScreenshotPlus/src/ctrl_button.cpp @@ -365,7 +365,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L cs->style |= BS_OWNERDRAW; if (!(bct = (LPBTNCTRL)mir_alloc(sizeof(BTNCTRL)))) return FALSE; - ZeroMemory(bct, sizeof(BTNCTRL)); + memset(bct, 0, sizeof(BTNCTRL)); bct->hwnd = hwndBtn; bct->stateId = PBS_NORMAL; bct->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); @@ -383,7 +383,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L if (hwndToolTips) { TOOLINFO ti; - ZeroMemory(&ti, sizeof(ti)); + memset(&ti, 0, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; @@ -515,7 +515,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L if (lParam == MBBF_UNICODE) { TOOLINFOW ti; - ZeroMemory(&ti, sizeof(TOOLINFOW)); + memset(&ti, 0, sizeof(TOOLINFOW)); ti.cbSize = sizeof(TOOLINFOW); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; @@ -531,7 +531,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L else { TOOLINFOA ti; - ZeroMemory(&ti, sizeof(TOOLINFOA)); + memset(&ti, 0, sizeof(TOOLINFOA)); ti.cbSize = sizeof(TOOLINFOA); ti.uFlags = TTF_IDISHWND; ti.hwnd = bct->hwnd; @@ -638,7 +638,7 @@ void CtrlButtonLoadModule()/// @fixme : compatibility with UInfoEx is everything WNDCLASSEX wc; g_init=true; - ZeroMemory(&wc, sizeof(wc)); + memset(&wc, 0, sizeof(wc)); wc.cbSize = sizeof(wc); wc.lpszClassName = UINFOBUTTONCLASS; wc.lpfnWndProc = Button_WndProc; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 92cf5d8b5b..3e3dfde266 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -322,7 +322,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l db_set_b(session_list_recovered[i], MODNAME, "wasInLastSession", 0);
i++;
}
- ZeroMemory(session_list_recovered, sizeof(session_list_recovered));
+ memset(session_list_recovered, 0, sizeof(session_list_recovered));
g_bIncompletedSave = 0;
EnableWindow(GetDlgItem(hdlg, IDC_SESSDEL), FALSE);
@@ -418,7 +418,7 @@ INT_PTR CloseCurrentSession(WPARAM wparam, LPARAM lparam) }
else SendMessage(mwd.hwndWindow, WM_CLOSE, 0, 0);
}
- ZeroMemory(session_list, sizeof(session_list));
+ memset(session_list, 0, sizeof(session_list));
return 0;
}
@@ -820,7 +820,7 @@ static int PluginInit(WPARAM wparam, LPARAM lparam) cl.position = 10100000;
Menu_AddMainMenuItem(&cl);
- ZeroMemory(&cl, sizeof(cl));
+ memset(&cl, 0, sizeof(cl));
cl.cbSize = sizeof(cl);
cl.flags = CMIM_ICON;
cl.icolibItem = iconList[4].hIcolib;
@@ -875,7 +875,7 @@ extern "C" __declspec(dllexport) int Load(void) if (g_bIncompletedSave) {
int i = 0;
- ZeroMemory(session_list_recovered, sizeof(session_list_recovered));
+ memset(session_list_recovered, 0, sizeof(session_list_recovered));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (db_get_b(hContact, MODNAME, "wasInLastSession", 0))
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index e15609f625..25f60daaba 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -44,7 +44,7 @@ BOOL bChecked = FALSE; int OpLoadSessionContacts(WPARAM wparam, LPARAM lparam)
{
- ZeroMemory(session_list_t, sizeof(session_list_t));
+ memset(session_list_t, 0, sizeof(session_list_t));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (LoadContactsFromMask(hContact, 1, lparam)) {
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 18605152d3..5143b637db 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -44,7 +44,7 @@ void AddSessionMark(MCONTACT hContact, int mode, char bit) char *pszBuffer;
if (strlen(szValue) < g_ses_count) {
pszBuffer = (char*)mir_alloc(g_ses_count + 1);
- ZeroMemory(pszBuffer, g_ses_count + 1);
+ memset(pszBuffer, 0, (g_ses_count + 1));
strcpy(pszBuffer, szValue);
}
else pszBuffer = szValue.detouch();
@@ -160,8 +160,8 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) if (szValue) {
char *pszBuffer;
if (strlen(szValue) < (g_ses_count * 2)) {
- pszBuffer = (char*)mir_alloc(g_ses_count * 2 + 1);
- ZeroMemory(pszBuffer, g_ses_count * 2 + 1);
+ pszBuffer = (char*)mir_alloc((g_ses_count * 2) + 1);
+ memset(pszBuffer, 0, ((g_ses_count * 2) + 1));
strcpy(pszBuffer, szValue);
}
else pszBuffer = mir_strdup(szValue);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index 5d200019bb..b6619a2472 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -225,7 +225,7 @@ void ipcGetSkinIcons(THeaderIPC *ipch) // add Miranda icon
TSlotIPC *pct = ipcAlloc(ipch, sizeof(TSlotProtoIcons));
if (pct != NULL) {
- ZeroMemory(&spi.hIcons, sizeof(spi.hIcons));
+ memset(&spi.hIcons, 0, sizeof(spi.hIcons));
spi.hProto = 0; // no protocol
spi.hIcons[0] = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
pct->fType = REQUEST_NEWICONS;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 092f6ce090..8f465e07f7 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -258,7 +258,7 @@ INT addEvent(WPARAM hContact, LPARAM lParam) {
FORMATINFO fi;
- ZeroMemory(&fi, sizeof(fi));
+ memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
fi.flags = FIF_TCHAR;
fi.tszFormat = ptszTemp2;
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index cef55fa17f..29514f6529 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -162,7 +162,7 @@ void FreeMemory(HWND hwndTreeCtrl,HTREEITEM hti) bool tree_set_item_state(HWND hwndTree,HTREEITEM hti,ETreeCheckBoxState nState)
{
TVITEM tvi;
- ZeroMemory(&tvi,sizeof(tvi));
+ memset(&tvi, 0, sizeof(tvi));
tvi.mask = TVIF_STATE|TVIF_HANDLE;
tvi.hItem = hti;
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 169abca395..88f614d7d6 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -136,7 +136,7 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM continue;
lvi.pszText = mir_a2u(pd[i]->szName);
ListView_InsertItem(hProtocolsList, &lvi);
- ZeroMemory(protoOption, 256);
+ memset(protoOption, 0, sizeof(protoOption));
strcat(protoOption, "proto_");
strcat(protoOption, pd[i]->szName);
ListView_SetCheckState(hProtocolsList, j++, _getOptB(protoOption, 0));
@@ -201,7 +201,7 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM for (i = 0; i < numProtocols; i++) {
ListView_GetItemText(hProtocolsList, i, 0, buf, 256);
//wcstombs(protoName, buf, 256);
- ZeroMemory(protoOption, 256);
+ memset(protoOption, 0, sizeof(protoOption));
strcat(protoOption, "proto_");
strcat(protoOption, mir_u2a(buf));
_setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
diff --git a/plugins/Spamotron/src/sqlite3/sqlite3.c b/plugins/Spamotron/src/sqlite3/sqlite3.c index ec6d4d2c68..d9b165f088 100644 --- a/plugins/Spamotron/src/sqlite3/sqlite3.c +++ b/plugins/Spamotron/src/sqlite3/sqlite3.c @@ -26470,7 +26470,7 @@ static BOOL winceCreateLock(const char *zFilename, winFile *pFile){ BOOL bInit = TRUE; /* Initialize the local lockdata */ - ZeroMemory(&pFile->local, sizeof(pFile->local)); + memset(&pFile->local, 0, sizeof(pFile->local)); /* Replace the backslashes from the filename and lowercase it ** to derive a mutex name. */ @@ -26529,7 +26529,7 @@ static BOOL winceCreateLock(const char *zFilename, winFile *pFile){ /* Initialize the shared memory if we're supposed to */ if (bInit) { - ZeroMemory(pFile->shared, sizeof(winceLock)); + memset(pFile->shared, 0, sizeof(winceLock)); } winceMutexRelease(pFile->hMutex); diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 2fd9dff20f..c47406e435 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -490,7 +490,7 @@ void MarkUnread(MCONTACT hContact) pos = _dbv.pbVal; while (pos - _dbv.pbVal < _dbv.cpbVal) { DBEVENTINFO _dbei; - ZeroMemory(&_dbei, sizeof(_dbei)); + memset(&_dbei, 0, sizeof(_dbei)); _dbei.cbSize = sizeof(_dbei); memcpy(&_dbei.eventType, pos, sizeof(WORD)); pos += sizeof(WORD); diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index ba60ccf58d..38621eee1f 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -64,7 +64,7 @@ int InitOptionsCallback(WPARAM wParam,LPARAM) odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wParam, &odp);
- ZeroMemory(&odp,sizeof(odp));
+ memset(&odp, 0, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
odp.pszGroup = LPGEN("Message Sessions");
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index ccf4baf5ee..86ea80d46e 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -884,7 +884,7 @@ int AddContactTextBox(MCONTACT hContact, HWND hwnd, char *name, BOOL srmm, HWND if (dialogs.find(hwnd) == dialogs.end()) {
// Fill dialog data
Dialog *dlg = (Dialog *)malloc(sizeof(Dialog));
- ZeroMemory(dlg, sizeof(Dialog));
+ memset(dlg, 0, sizeof(Dialog));
dlg->re = new RichEdit(hwnd);
if (!dlg->re->IsValid()) {
@@ -1073,7 +1073,7 @@ void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL dlg->wrong_words->resize(dlg->wrong_words->size() + 1);
WrongWordPopupMenuData &data = (*dlg->wrong_words)[dlg->wrong_words->size() - 1];
- ZeroMemory(&data, sizeof(WrongWordPopupMenuData));
+ memset(&data, 0, sizeof(WrongWordPopupMenuData));
// Get suggestions
data.word = word;
@@ -1538,7 +1538,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) HDC hdc = GetDC(hwnd);
NONCLIENTMETRICS info;
- ZeroMemory(&info, sizeof(info));
+ memset(&info, 0, sizeof(info));
info.cbSize = sizeof(info);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(info), &info, 0);
HFONT hFont = CreateFontIndirect(&info.lfMenuFont);
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 06f6baf7fb..fb75ca538f 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -23,7 +23,7 @@ PLUGININFOEX pluginInfo={ void LoadOptions()
{
- ZeroMemory(&Options, sizeof(Options));
+ memset(&Options, 0, sizeof(Options));
Options.MessageRead = (BOOL)db_get_b(NULL, PLUGINNAME, "MessageRead", FALSE);
Options.MessageSend = (BOOL)db_get_b(NULL, PLUGINNAME, "MessageSend", TRUE);
Options.UrlRead = (BOOL)db_get_b(NULL, PLUGINNAME, "UrlRead", FALSE);
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index eb2cff358b..a4611dd7bf 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // basic tab
TCITEM tci;
- ZeroMemory(&tci, sizeof(TCITEM));
+ memset(&tci, 0, sizeof(TCITEM));
tci.mask = TCIF_TEXT|TCIF_PARAM;
tci.pszText = TranslateT("Basic");
hShow = hBasicTab = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_BASIC), hwndDlg, DlgProcKSBasicOpts, (LPARAM)GetParent(hwndDlg));
@@ -575,7 +575,7 @@ int OptionsInit(WPARAM wparam,LPARAM lparam) Options_AddPage(wparam, &odp);
if ( ServiceExists( MS_POPUP_ADDPOPUPT )) {
- ZeroMemory(&odp,sizeof(odp));
+ memset(&odp, 0, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.position = 150000000;
odp.ptszGroup = LPGENT("Popups");
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 5897463b61..d1be25ef01 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -103,7 +103,7 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){ TCHAR *tszParsed;
tstring tstrResult;
- ZeroMemory(&fi, sizeof(fi));
+ memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
fi.tszFormat = _tcsdup(tstrFormat.c_str());
fi.hContact = hContact;
@@ -208,7 +208,7 @@ tstring GetContactUid(MCONTACT hContact, tstring Protocol) char aUid[32]={0};
char *szProto = mir_utf8encodeW(Protocol.c_str());
CONTACTINFO ci;
- ZeroMemory((void *)&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.hContact = hContact;
ci.szProto = szProto;
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 0f939bb946..4f4e1b407d 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -46,7 +46,7 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){ FORMATINFO fi;
tstring tstrResult;
- ZeroMemory(&fi, sizeof(fi));
+ memset(&fi, 0, sizeof(fi));
fi.cbSize = sizeof(fi);
fi.tszFormat = _tcsdup(tstrFormat.c_str());
fi.hContact = hContact;
diff --git a/plugins/TabSRMM/src/ImageDataObject.cpp b/plugins/TabSRMM/src/ImageDataObject.cpp index 27359f6a51..b4ebda8f5d 100644 --- a/plugins/TabSRMM/src/ImageDataObject.cpp +++ b/plugins/TabSRMM/src/ImageDataObject.cpp @@ -143,7 +143,7 @@ bool CImageDataObject::InsertBitmap(IRichEditOle* pRichEditOle, HBITMAP hBitmap) // Now Add the object to the RichEdit
//
REOBJECT reobject;
- ZeroMemory(&reobject, sizeof(REOBJECT));
+ memset(&reobject, 0, sizeof(REOBJECT));
reobject.cbStruct = sizeof(REOBJECT);
CLSID clsid;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 9bc5f5dc47..162c597360 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -260,7 +260,7 @@ static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick) int bufferAlloced = 0;
IEVIEWEVENTDATA ied;
IEVIEWEVENT event;
- ZeroMemory(&event, sizeof(event));
+ memset(&event, 0, sizeof(event));
event.cbSize = sizeof(event);
event.dwFlags = 0;
event.hwnd = streamData->dat->hwndIEView ? streamData->dat->hwndIEView : streamData->dat->hwndHPP;
@@ -271,7 +271,7 @@ static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick) event.eventData = &ied;
event.count = 1;
- ZeroMemory(&ied, sizeof(ied));
+ memset(&ied, 0, sizeof(ied));
AddEventToBufferIEView(&buffer, &bufferEnd, &bufferAlloced, streamData, ptszNick);
ied.ptszNick = ptszNick;
ied.ptszText = buffer;
@@ -980,7 +980,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr HWND hwndRich = GetDlgItem(hwndDlg, IDC_CHAT_LOG);
LOGSTREAMDATA streamData;
- ZeroMemory(&streamData, sizeof(streamData));
+ memset(&streamData, 0, sizeof(streamData));
streamData.hwnd = hwndRich;
streamData.si = si;
streamData.lin = lin;
@@ -1043,7 +1043,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedr FINDTEXTEX fi, fi2;
CHARFORMAT2 cf2;
- ZeroMemory(&cf2, sizeof(CHARFORMAT2));
+ memset(&cf2, 0, sizeof(CHARFORMAT2));
cf2.cbSize = sizeof(cf2);
fi2.lpstrText = _T("#++~~");
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index 4c45d5bb11..2cbd1e4eba 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -336,7 +336,7 @@ char* Chat_Message_GetFromStream(HWND hwndDlg, SESSION_INFO *si) char* pszText = NULL;
EDITSTREAM stream;
- ZeroMemory(&stream, sizeof(stream));
+ memset(&stream, 0, sizeof(stream));
stream.pfnCallback = Chat_Message_StreamCallback;
stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index e867a9083f..44a6cf6774 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -67,8 +67,8 @@ static void Chat_SetMessageLog(TWindowData *dat) IEVIEWEVENT iee; //CheckAndDestroyHPP(dat); - ZeroMemory(&ieWindow, sizeof(ieWindow)); - ZeroMemory(&iee, sizeof(iee)); + memset(&ieWindow, 0, sizeof(ieWindow)); + memset(&iee, 0, sizeof(iee)); ieWindow.cbSize = sizeof(ieWindow); ieWindow.iType = IEW_CREATE; ieWindow.dwFlags = 0; @@ -80,7 +80,8 @@ static void Chat_SetMessageLog(TWindowData *dat) ieWindow.cy = 300; CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); dat->hwndIEView = ieWindow.hwnd; - ZeroMemory(&iee, sizeof(iee)); + + memset(&iee, 0, sizeof(iee)); iee.cbSize = sizeof(iee); iee.iType = IEE_CLEAR_LOG; iee.hwnd = dat->hwndIEView; @@ -98,7 +99,7 @@ static void Chat_SetMessageLog(TWindowData *dat) else if (iLogMode == WANT_HPP_LOG && dat->hwndHPP == 0) { IEVIEWWINDOW ieWindow; - ZeroMemory(&ieWindow, sizeof(ieWindow)); + memset(&ieWindow, 0, sizeof(ieWindow)); //CheckAndDestroyIEView(dat); ieWindow.cbSize = sizeof(IEVIEWWINDOW); ieWindow.iType = IEW_CREATE; diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index df70c33104..76ec3fe349 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -236,7 +236,7 @@ void CContactCache::allocStats() { if (m_stats == 0) { m_stats = new TSessionStats; - ::ZeroMemory(m_stats, sizeof(TSessionStats)); + memset(m_stats, 0, sizeof(TSessionStats)); } } @@ -397,7 +397,7 @@ void CContactCache::allocHistory() m_iHistoryCurrent = 0; m_iHistoryTop = 0; if (m_history) - ZeroMemory(m_history, sizeof(TInputHistory) * m_iHistorySize); + memset(m_history, 0, (sizeof(TInputHistory) * m_iHistorySize)); m_history[m_iHistorySize].szText = (TCHAR*)mir_alloc((HISTORY_INITIAL_ALLOCSIZE + 1) * sizeof(TCHAR)); m_history[m_iHistorySize].lLen = HISTORY_INITIAL_ALLOCSIZE; } diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 07af0eb40b..8136cc9e72 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -358,7 +358,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, GetWindowRect(hwndDlg, &rcWindow); CopyMemory(&pContainer->oldbuttons[0], &pContainer->buttons[0], sizeof(TitleBtn) * 3); - ZeroMemory(&pContainer->buttons[0], sizeof(TitleBtn) * 3); + memset(&pContainer->buttons[0], 0, (sizeof(TitleBtn) * 3)); isMin = isMax = isClose = FALSE; if (pt.x >= (rcWindow.left + pContainer->rcMin.left) && pt.x <= (rcWindow.left + pContainer->rcClose.right) && pt.y < rcWindow.top + 24 && wParam != HTTOPRIGHT) { @@ -857,7 +857,7 @@ panel_found: switch (((LPNMHDR)lParam)->code) { case TCN_SELCHANGE: - ZeroMemory(&item, sizeof(item)); + memset(&item, 0, sizeof(item)); iItem = TabCtrl_GetCurSel(hwndTab); item.mask = TCIF_PARAM; if (TabCtrl_GetItem(hwndTab, iItem, &item)) { @@ -947,7 +947,7 @@ panel_found: case ID_TABMENU_ATTACHTOCONTAINER: if ((iItem = GetTabItemFromMouse(hwndTab, &pt1)) == -1) break; - ZeroMemory(&item, sizeof(item)); + memset(&item, 0, sizeof(item)); item.mask = TCIF_PARAM; TabCtrl_GetItem(hwndTab, iItem, &item); CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM)item.lParam); @@ -1261,7 +1261,7 @@ panel_found: if (iNewTab != iCurrent) { TabControlData *tabdat = (TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA); - ZeroMemory(&item, sizeof(item)); + memset(&item, 0, sizeof(item)); item.mask = TCIF_PARAM; if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) { TabCtrl_SetCurSel(hwndTab, iNewTab); @@ -1348,7 +1348,7 @@ panel_found: SendMessage(hwndDlg, DM_UPDATETITLE, hContact, 0); } } - ZeroMemory(&item, sizeof(item)); + memset(&item, 0, sizeof(item)); item.mask = TCIF_PARAM; if ((curItem = TabCtrl_GetCurSel(hwndTab)) >= 0) TabCtrl_GetItem(hwndTab, curItem, &item); diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index b09bfdc44b..cfb4b0f37c 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -530,7 +530,7 @@ void CMenuBar::autoShow(const int showcmd) void CMenuBar::checkButtons() { if (!m_buttonsInit) { - ::ZeroMemory(m_TbButtons, sizeof(m_TbButtons)); + memset(m_TbButtons, 0, sizeof(m_TbButtons)); m_TbButtons[0].iBitmap = 0; m_TbButtons[0].iString = 0; diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 3f95a9d939..6e3ca777d5 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -127,7 +127,7 @@ void TSAPI DM_InitTip(TWindowData *dat) dat->hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_BALLOON, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, dat->hwnd, NULL, g_hInst, (LPVOID) NULL); - ZeroMemory(&dat->ti, sizeof(dat->ti)); + memset(&dat->ti, 0, sizeof(dat->ti)); dat->ti.cbSize = sizeof(dat->ti); dat->ti.lpszText = TranslateT("No status message"); dat->ti.hinst = g_hInst; @@ -205,8 +205,8 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, case IDC_FONTSTRIKEOUT: if (dat->SendFormat != 0) { // dont use formatting if disabled CHARFORMAT2 cf, cfOld; - ZeroMemory(&cf, sizeof(CHARFORMAT2)); - ZeroMemory(&cfOld, sizeof(CHARFORMAT2)); + memset(&cf, 0, sizeof(CHARFORMAT2)); + memset(&cfOld, 0, sizeof(CHARFORMAT2)); cfOld.cbSize = cf.cbSize = sizeof(CHARFORMAT2); cfOld.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT; SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cfOld); @@ -249,7 +249,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, submenu = GetSubMenu(m_pContainer->hMenuContext, 7); { CHARFORMAT2 cf; - ZeroMemory(&cf, sizeof(CHARFORMAT2)); + memset(&cf, 0, sizeof(CHARFORMAT2)); cf.cbSize = sizeof(CHARFORMAT2); cf.dwMask = CFM_COLOR; @@ -802,7 +802,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) SendMessage(hwndEdit, EM_SETBKGNDCOLOR, 0, dat->inputbg); CHARFORMAT2A cf2; - ZeroMemory(&cf2, sizeof(CHARFORMAT2A)); + memset(&cf2, 0, sizeof(CHARFORMAT2A)); cf2.cbSize = sizeof(cf2); if (fIsChat) { @@ -845,7 +845,7 @@ void TSAPI DM_InitRichEdit(TWindowData *dat) // The real text direction is then enforced by the streaming code which adds appropiate paragraph // and textflow formatting commands to the PARAFORMAT2 pf2; - ZeroMemory(&pf2, sizeof(PARAFORMAT2)); + memset(&pf2, 0, sizeof(PARAFORMAT2)); pf2.cbSize = sizeof(pf2); pf2.wEffects = PFE_RTLPARA; pf2.dwMask = PFM_RTLPARA; diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index 4e88571588..b67015e198 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -47,7 +47,7 @@ class CGlobals public:
CGlobals()
{
- ::ZeroMemory(this, sizeof(CGlobals));
+ memset(this, 0, sizeof(CGlobals));
m_TypingSoundAdded = false;
}
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 1e91712136..03cd19f9f4 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -86,7 +86,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) UINT textlenght = cr.cpMax - cr.cpMin;
if (textlenght) {
pszText = (TCHAR*)mir_alloc((textlenght + 1)*sizeof(TCHAR));
- ZeroMemory(pszText, (textlenght + 1)*sizeof(TCHAR));
+ memset(pszText, 0, ((textlenght + 1) * sizeof(TCHAR)));
SendDlgItemMessage(cbcd->hwndFrom, IDC_MESSAGE, EM_GETSELTEXT, 0, (LPARAM)pszText);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 1735b763a8..2259922508 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2764,7 +2764,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(hwndEdit, WM_SETREDRAW, FALSE, 0); PARAFORMAT2 pf2; - ZeroMemory(&pf2, sizeof(PARAFORMAT2)); + memset(&pf2, 0, sizeof(PARAFORMAT2)); pf2.cbSize = sizeof(pf2); pf2.dwMask = PFM_RTLPARA; SendMessage(hwndEdit, EM_SETSEL, 0, -1); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 07bc06b0b0..7adc174039 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -842,7 +842,7 @@ char* TSAPI Message_GetFromStream(HWND hwndRtf, const TWindowData *dat, DWORD dw if (hwndRtf == 0 || dat == 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
if (dwPassedFlags == 0)
@@ -1148,7 +1148,7 @@ void TSAPI SetMessageLog(TWindowData *dat) if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) {
IEVIEWWINDOW ieWindow;
- ZeroMemory(&ieWindow, sizeof(ieWindow));
+ memset(&ieWindow, 0, sizeof(ieWindow));
ieWindow.cbSize = sizeof(IEVIEWWINDOW);
ieWindow.iType = IEW_CREATE;
ieWindow.dwFlags = 0;
@@ -1334,7 +1334,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) szLI[0] = szLI[1] = 0;
- ZeroMemory(&pf2, sizeof(PARAFORMAT2));
+ memset(&pf2, 0, sizeof(PARAFORMAT2));
langID = (USHORT)_tcstol(szKLName, &stopped, 16);
dat->lcid = MAKELCID(langID, 0);
/*
@@ -1372,14 +1372,14 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_GETPARAFORMAT, 0, (LPARAM)&pf2);
if (Utils::FindRTLLocale(dat) && fLocaleNotSet) {
if (wCtype2[0] == C2_RIGHTTOLEFT || wCtype2[1] == C2_RIGHTTOLEFT || wCtype2[2] == C2_RIGHTTOLEFT) {
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.dwMask = PFM_RTLPARA;
pf2.cbSize = sizeof(pf2);
pf2.wEffects = PFE_RTLPARA;
SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
}
else {
- ZeroMemory(&pf2, sizeof(pf2));
+ memset(&pf2, 0, sizeof(pf2));
pf2.dwMask = PFM_RTLPARA;
pf2.cbSize = sizeof(pf2);
pf2.wEffects = 0;
@@ -1675,7 +1675,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) void TSAPI LoadThemeDefaults(TContainerData *pContainer)
{
- ZeroMemory(&pContainer->theme, sizeof(TLogTheme));
+ memset(&pContainer->theme, 0, sizeof(TLogTheme));
pContainer->theme.bg = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, GetSysColor(COLOR_WINDOW));
pContainer->theme.statbg = PluginConfig.crStatus;
pContainer->theme.oldinbg = PluginConfig.crOldIncoming;
@@ -1708,7 +1708,7 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer) {
BOOL bReadTemplates = TRUE;
- ZeroMemory(&pContainer->theme, sizeof(TLogTheme));
+ memset(&pContainer->theme, 0, sizeof(TLogTheme));
if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
if (CheckThemeVersion(pContainer->szAbsThemeFile) == 0) {
@@ -1820,7 +1820,7 @@ void TSAPI GetMyNick(TWindowData *dat) {
CONTACTINFO ci;
- ZeroMemory(&ci, sizeof(ci));
+ memset(&ci, 0, sizeof(ci));
ci.cbSize = sizeof(ci);
ci.hContact = NULL;
ci.szProto = const_cast<char *>(dat->cache->getActiveProto());
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index d7999714e6..752bee529d 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -130,7 +130,7 @@ void TSAPI CacheLogFonts() logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
- ZeroMemory(logfonts, sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2));
+ memset(logfonts, 0, (sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)));
for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
mir_snprintf(rtfFontsGlobal[i], SIZEOF(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
@@ -1222,7 +1222,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe fi.lpstrText = _T("##col##");
fi.chrg.cpMax = -1;
CHARFORMAT2 cf2;
- ZeroMemory(&cf2, sizeof(cf2));
+ memset(&cf2, 0, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_COLOR;
while (SendMessage(hwndrtf, EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) {
@@ -1257,7 +1257,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe fi.chrg.cpMax = -1;
CHARFORMAT2 cf2;
- ZeroMemory(&cf2, sizeof(cf2));
+ memset(&cf2, 0, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_BACKCOLOR;
@@ -1467,7 +1467,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
PARAFORMAT2 pf2;
- ZeroMemory(&pf2, sizeof(PARAFORMAT2));
+ memset(&pf2, 0, sizeof(PARAFORMAT2));
sel.cpMax = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTLENGTHEX, (WPARAM)>xl, 0);
sel.cpMin = sel.cpMax - 1;
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM)&sel);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 93caf5f1bf..afe1c7d294 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -442,7 +442,7 @@ int LoadSendRecvMessageModule(void) Win7Taskbar = new CTaskbarInteract; Win7Taskbar->updateMetrics(); - ZeroMemory(&nen_options, sizeof(nen_options)); + memset(&nen_options, 0, sizeof(nen_options)); M.m_hMessageWindowList = WindowList_Create(); PluginConfig.hUserPrefsWindowList = WindowList_Create(); sendQueue = new SendQueue; @@ -555,7 +555,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, newData.szInitialText = pszInitialText; char *szProto = GetContactProto(newData.hContact); - ZeroMemory(&newData.item, sizeof(newData.item)); + memset(&newData.item, 0, sizeof(newData.item)); // obtain various status information about the contact TCHAR *contactName = pcli->pfnGetContactDisplayName(newData.hContact, 0); diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index abe3a03f2b..79c0edac47 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -37,7 +37,7 @@ CSendLater *sendLater = 0; //
CSendLaterJob::CSendLaterJob()
{
- ZeroMemory(this, sizeof(CSendLaterJob));
+ memset(this, 0, sizeof(CSendLaterJob));
fSuccess = false;
}
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index a8b9b3f271..2ffc05e036 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -645,7 +645,7 @@ int SendQueue::RTL_Detect(const WCHAR *pszwText) WORD *infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2)); if (infoTypeC2) { - ZeroMemory(infoTypeC2, sizeof(WORD) * (iLen + 2)); + memset(infoTypeC2, 0, (sizeof(WORD) * (iLen + 2))); GetStringTypeW(CT_CTYPE2, pszwText, iLen, infoTypeC2); diff --git a/plugins/TabSRMM/src/sendqueue.h b/plugins/TabSRMM/src/sendqueue.h index 49341f718d..d3d51a0e7d 100644 --- a/plugins/TabSRMM/src/sendqueue.h +++ b/plugins/TabSRMM/src/sendqueue.h @@ -66,7 +66,7 @@ public: SendQueue()
{
- ZeroMemory(m_jobs, (sizeof(SendJob) * NR_SENDJOBS));
+ memset(m_jobs, 0, (sizeof(SendJob) * NR_SENDJOBS));
m_currentIndex = 0;
}
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 4690906a14..0035611a87 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -489,7 +489,7 @@ static void DrawThemesXpTabItem(HDC pDC, int ixItem, RECT *rcItem, UINT uiFlag, rcMem.right = szBmp.cx;
rcMem.bottom = szBmp.cy;
- ZeroMemory(&biOut, sizeof(BITMAPINFO)); // Fill local pixel arrays
+ memset(&biOut, 0, sizeof(BITMAPINFO)); // Fill local pixel arrays
bihOut = &biOut.bmiHeader;
bihOut->biSize = sizeof(BITMAPINFOHEADER);
@@ -711,7 +711,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) rctClip = rctPage;
InflateRect(&rctClip, -tabdat->pContainer->tBorder, -tabdat->pContainer->tBorder);
}
- else ZeroMemory(&rctClip, sizeof(RECT));
+ else memset(&rctClip, 0, sizeof(RECT));
HPEN hPenOld = (HPEN)SelectObject(hdc, PluginConfig.tabConfig.m_hPenLight);
/*
@@ -722,7 +722,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) if (!tabdat->bRefreshWithoutClip)
ExcludeClipRect(hdc, rctClip.left, rctClip.top, rctClip.right, rctClip.bottom);
else
- ZeroMemory(&rctClip, sizeof(RECT));
+ memset(&rctClip, 0, sizeof(RECT));
if ((!bClassicDraw || PluginConfig.m_fillColor) && IntersectRect(&rectTemp, &rctPage, &ps.rcPaint) && !CSkin::m_skinEnabled) {
RECT rcClient = rctPage;
if (dwStyle & TCS_BOTTOM) {
@@ -1389,7 +1389,7 @@ void TSAPI FreeTabConfig() if (PluginConfig.tabConfig.m_brushes[i])
DeleteObject(PluginConfig.tabConfig.m_brushes[i]);
- ZeroMemory(&PluginConfig.tabConfig, sizeof(myTabCtrl));
+ memset(&PluginConfig.tabConfig, 0, sizeof(PluginConfig.tabConfig));
}
/*
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 62cd362119..b42fbc2f24 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -140,9 +140,9 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP COLORREF url_unvisited = RGB(0, 0, 255); dat = (TWindowData*)mir_calloc( sizeof(TWindowData)); dat->pContainer = (TContainerData*)mir_alloc(sizeof(TContainerData)); - ZeroMemory(dat->pContainer, sizeof(TContainerData)); + memset(dat->pContainer, 0, sizeof(TContainerData)); teInfo = (TemplateEditorInfo *)dat->pContainer; - ZeroMemory(teInfo, sizeof(TemplateEditorInfo)); + memset(teInfo, 0, sizeof(TemplateEditorInfo)); teInfo->hContact = teNew->hContact; teInfo->rtl = teNew->rtl; teInfo->hwndParent = teNew->hwndParent; diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 829897679a..6dac4c24c7 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -373,7 +373,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de return;
BITMAPINFO bmi;
- ZeroMemory(&bmi, sizeof(BITMAPINFO));
+ memset(&bmi, 0, sizeof(BITMAPINFO));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
int ulBitmapWidth, ulBitmapHeight;
@@ -897,7 +897,7 @@ void CImageItem::Free() if (m_fillBrush)
::DeleteObject(m_fillBrush);
- ZeroMemory(this, sizeof(CImageItem));
+ memset(this, 0, sizeof(CImageItem));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1153,7 +1153,7 @@ void CSkin::Unload() m_SkinItems[ID_EXTBKINFOPANELBG] = _defInfoPanel;
}
- ZeroMemory(this, sizeof(CSkin));
+ memset(this, 0, sizeof(CSkin));
m_SkinItems = ::SkinItems;
setFileName();
@@ -1404,7 +1404,7 @@ void CSkin::Load(void) m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
- ZeroMemory(szSections, 6000);
+ memset(szSections, 0, 6000);
GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
TCHAR *p = szSections;
@@ -1537,7 +1537,7 @@ void CSkin::LoadItems() m_nrSkinIcons = 0;
szSections = (TCHAR*)mir_alloc((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
- ZeroMemory(szSections, (SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
GetPrivateProfileSection(_T("Icons"), szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
@@ -1550,7 +1550,7 @@ void CSkin::LoadItems() if (m_nrSkinIcons < NR_MAXSKINICONS && p1) {
LoadIcon(_T("Icons"), p, *(HICON*)&tmpIconDesc.uId);
if (tmpIconDesc.uId) {
- ZeroMemory(&m_skinIcons[m_nrSkinIcons], sizeof(TIconDesc));
+ memset(&m_skinIcons[m_nrSkinIcons], 0, sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1));
@@ -1563,7 +1563,7 @@ void CSkin::LoadItems() p += (mir_tstrlen(p) + 1);
}
- ZeroMemory(szSections, (SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
+ memset(szSections, 0, ((SECT_BUFFER_SIZE + 2) * sizeof(TCHAR)));
GetPrivateProfileSectionNames(szSections, SECT_BUFFER_SIZE, m_tszFileName);
szSections[SECT_BUFFER_SIZE] = 0;
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index 47ea5dcfcc..573afcf87f 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -88,7 +88,7 @@ class CImageItem public:
CImageItem()
{
- ZeroMemory(this, sizeof(CImageItem));
+ memset(this, 0, sizeof(CImageItem));
}
CImageItem(const CImageItem& From)
{
@@ -97,7 +97,7 @@ public: }
CImageItem(const TCHAR *szName)
{
- ZeroMemory(this, sizeof(CImageItem));
+ memset(this, 0, sizeof(CImageItem));
mir_sntprintf(m_szName, 40, szName);
m_szName[39] = 0;
}
@@ -239,7 +239,7 @@ public: CSkin()
{
- ZeroMemory(this, sizeof(CSkin));
+ memset(this, 0, sizeof(CSkin));
m_default_bf.SourceConstantAlpha = 255;
m_default_bf.AlphaFormat = AC_SRC_ALPHA;
m_default_bf.BlendOp = AC_SRC_OVER;
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index d4f2bf31ce..18f441a628 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -509,7 +509,7 @@ int Utils::FindRTLLocale(TWindowData *dat) WORD wCtype2[5];
if (dat->iHaveRTLLang == 0) {
- ZeroMemory(layouts, 20 * sizeof(HKL));
+ memset(layouts, 0, sizeof(layouts));
GetKeyboardLayoutList(20, layouts);
for (i=0; i < 20 && layouts[i]; i++) {
lcid = MAKELCID(LOWORD(layouts[i]), 0);
@@ -532,7 +532,7 @@ void Utils::RTF_CTableInit() int iSize = sizeof(TRTFColorTable) * RTF_CTABLE_DEFSIZE;
rtf_ctable = (TRTFColorTable *)mir_alloc(iSize);
- ZeroMemory(rtf_ctable, iSize);
+ memset(rtf_ctable, 0, iSize);
CopyMemory(rtf_ctable, _rtf_ctable, iSize);
rtf_ctable_size = RTF_CTABLE_DEFSIZE;
}
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 50aa0b2ac9..d9947000f2 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1080,7 +1080,7 @@ void CreateTrafficWindow(HWND hCluiWnd) if ( ServiceExists(MS_CLIST_FRAMES_ADDFRAME) )
{
// Ãîòîâèìñÿ ñîçäàâàòü ôðåéì
- ZeroMemory( &f, sizeof(CLISTFrame) );
+ memset(&f, 0, sizeof(CLISTFrame));
f.align = alBottom;
f.cbSize = sizeof(CLISTFrame);
f.height = TrafficWindowHeight();
@@ -1137,7 +1137,7 @@ void NotifyOnSend(void) {
POPUPDATAT ppd;
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
@@ -1156,7 +1156,7 @@ void NotifyOnRecv(void) {
POPUPDATAT ppd;
- ZeroMemory(&ppd, sizeof(ppd));
+ memset(&ppd, 0, sizeof(ppd));
ppd.lchContact = NULL;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"),MAX_CONTACTNAME);
diff --git a/plugins/TrafficCounter/src/vars.cpp b/plugins/TrafficCounter/src/vars.cpp index 613be1f438..df74fc82c9 100644 --- a/plugins/TrafficCounter/src/vars.cpp +++ b/plugins/TrafficCounter/src/vars.cpp @@ -167,7 +167,7 @@ void RegisterVariablesTokens(void) if (!bVariablesExists) return;
- ZeroMemory(&trs, sizeof(trs));
+ memset(&trs, 0, sizeof(trs));
trs.cbSize = sizeof(TOKENREGISTER);
// Ôóíêöèÿ, âîçâðàùàþùàÿ òðàôèê
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 192010f6e5..4925a08638 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -393,7 +393,7 @@ VOID SwitchLayout(bool lastword) TCHAR *selected = 0;
IEVIEWEVENT event;
HWND hwnd3 = GetParent(GetParent(hwnd2));
- ZeroMemory((void *)&event, sizeof(event));
+ memset(&event, 0, sizeof(event));
event.cbSize = sizeof(IEVIEWEVENT);
event.hContact = 0;
event.dwFlags = 0;
@@ -413,14 +413,14 @@ VOID SwitchLayout(bool lastword) ActivateKeyboardLayout((HKL)HKL_PREV, KLF_ACTIVATE); // return to prev layout
if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
- ZeroMemory(&smgp, sizeof(smgp));
+ memset(&smgp, 0, sizeof(smgp));
smgp.cbSize = sizeof(smgp);
smgp.str = buf;
smgp.flag = SAFL_TCHAR;
smileyPrs = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smgp);
}
- for (int i = 0; i < slen; i++) {
+ for (size_t i = 0; i < slen; i++) {
SHORT vks;
BYTE keys[256] = { 0 };
@@ -470,7 +470,7 @@ VOID SwitchLayout(bool lastword) if (slen != 0) {
if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) {
- ZeroMemory(&smgp, sizeof(smgp));
+ memset(&smgp, 0, sizeof(smgp));
smgp.cbSize = sizeof(smgp);
smgp.str = sel;
smgp.flag = SAFL_TCHAR;
@@ -707,7 +707,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) size_t slen = _tcslen(sel);
if (slen != 0) {
- ZeroMemory(&smgp, sizeof(smgp));
+ memset(&smgp, 0, sizeof(smgp));
smgp.cbSize = sizeof(smgp);
smgp.str = sel;
smgp.flag = SAFL_TCHAR;
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 6255e8cbad..61fab1365b 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -255,7 +255,7 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam) if (hUpperIcon!=NULL && GetObject(icoi.hbmColor,sizeof(bm),&bm)) {
hdc=CreateCompatibleDC(NULL);
if (hdc!=NULL) {
- ZeroMemory(&aptTriangle,sizeof(aptTriangle));
+ memset(&aptTriangle, 0, sizeof(aptTriangle));
aptTriangle[1].y=bm.bmHeight-1;
aptTriangle[2].x=bm.bmWidth-1;
hrgn=CreatePolygonRgn(aptTriangle,SIZEOF(aptTriangle),WINDING);
diff --git a/plugins/UserInfoEx/src/classMTime.cpp b/plugins/UserInfoEx/src/classMTime.cpp index 10c9d77a23..9ca9591b26 100644 --- a/plugins/UserInfoEx/src/classMTime.cpp +++ b/plugins/UserInfoEx/src/classMTime.cpp @@ -70,7 +70,7 @@ MTime::MTime(const MTime& mtime) void MTime::ZeroDate()
{
_isLocal = FALSE;
- ZeroMemory(&_SysTime, sizeof(_SysTime));
+ memset(&_SysTime, 0, sizeof(_SysTime));
}
/*********************************************
@@ -169,7 +169,7 @@ void MTime::UTCToLocal() if (!IsLocal()) {
TIME_ZONE_INFORMATION tzInfo;
- ZeroMemory(&tzInfo, sizeof(TIME_ZONE_INFORMATION));
+ memset(&tzInfo, 0, sizeof(TIME_ZONE_INFORMATION));
GetTimeZoneInformation(&tzInfo);
UTCToTzSpecificLocal(&tzInfo);
}
@@ -181,7 +181,7 @@ void MTime::UTCToTzSpecificLocal(int tzh) TIME_ZONE_INFORMATION tzInfo;
if (IsLocal()) LocalToUTC();
- ZeroMemory(&tzInfo, sizeof(TIME_ZONE_INFORMATION));
+ memset(&tzInfo, 0, sizeof(TIME_ZONE_INFORMATION));
if (tzh > 24) tzh = 24;
if (tzh < -24)tzh = -24;
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 4d774b0d2d..40efabafce 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -726,7 +726,7 @@ void CPsTree::PopupMenu() // init popup menu if (!(hPopup = CreatePopupMenu())) return; - ZeroMemory(&mii, sizeof(MENUITEMINFO)); + memset(&mii, 0, sizeof(MENUITEMINFO)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING|MIIM_ID; diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index 181c6ed7ed..28ff8c010c 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -258,7 +258,7 @@ INT_PTR CAnnivEditCtrl::DeleteDate(WORD wIndex) _numDates--;
if (wIndex < _numDates)
memmove(_pDates + wIndex, _pDates + wIndex + 1, (_numDates - wIndex) * sizeof(*_pDates));
- ZeroMemory(_pDates + _numDates, sizeof(*_pDates));
+ memset((_pDates + _numDates), 0, sizeof(*_pDates)); // XXX: check me: sizeof(*_pDates) -> (sizeof(*_pDates) - _numDates)
if (_curDate >= _numDates)
_curDate = _numDates - 1;
}
@@ -439,7 +439,7 @@ void CAnnivEditCtrl::OnMenuPopup() if (hMenu = CreatePopupMenu()) {
SetFocus(_hBtnMenu);
- ZeroMemory(&mii, sizeof(MENUITEMINFO));
+ memset(&mii, 0, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_ID|MIIM_STRING|MIIM_STATE;
diff --git a/plugins/UserInfoEx/src/ctrl_base.cpp b/plugins/UserInfoEx/src/ctrl_base.cpp index 1151592fe5..28d664d82b 100644 --- a/plugins/UserInfoEx/src/ctrl_base.cpp +++ b/plugins/UserInfoEx/src/ctrl_base.cpp @@ -74,7 +74,7 @@ INT_PTR CALLBACK Ctrl_SetTextColour(HWND hCtrl, HDC hdc) **/
CBaseCtrl::CBaseCtrl()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
_cbSize = sizeof(CBaseCtrl);
}
@@ -84,7 +84,7 @@ CBaseCtrl::CBaseCtrl() **/
CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting)
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
_cbSize = sizeof(CBaseCtrl);
_hwnd = GetDlgItem(hDlg, idCtrl);
if (!IsWindow(_hwnd)) throw;
@@ -100,7 +100,7 @@ CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszSetting) **/
CBaseCtrl::CBaseCtrl(HWND hDlg, WORD idCtrl, LPCSTR pszModule, LPCSTR pszSetting)
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
_cbSize = sizeof(CBaseCtrl);
_hwnd = GetDlgItem(hDlg, idCtrl);
if (!IsWindow(_hwnd)) throw;
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp index 9bb58ef736..8a85a81947 100644 --- a/plugins/UserInfoEx/src/ctrl_button.cpp +++ b/plugins/UserInfoEx/src/ctrl_button.cpp @@ -365,7 +365,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L cs->style |= BS_OWNERDRAW;
if (!(bct = (LPBTNCTRL)mir_alloc(sizeof(BTNCTRL))))
return FALSE;
- ZeroMemory(bct, sizeof(BTNCTRL));
+ memset(bct, 0, sizeof(BTNCTRL));
bct->hwnd = hwndBtn;
bct->stateId = PBS_NORMAL;
bct->hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
@@ -383,7 +383,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L if (hwndToolTips) {
TOOLINFO ti;
- ZeroMemory(&ti, sizeof(ti));
+ memset(&ti, 0, sizeof(ti));
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND;
ti.hwnd = bct->hwnd;
@@ -515,7 +515,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L if (lParam == MBBF_UNICODE) {
TOOLINFOW ti;
- ZeroMemory(&ti, sizeof(TOOLINFOW));
+ memset(&ti, 0, sizeof(TOOLINFOW));
ti.cbSize = sizeof(TOOLINFOW);
ti.uFlags = TTF_IDISHWND;
ti.hwnd = bct->hwnd;
@@ -531,7 +531,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L else {
TOOLINFOA ti;
- ZeroMemory(&ti, sizeof(TOOLINFOA));
+ memset(&ti, 0, sizeof(TOOLINFOA));
ti.cbSize = sizeof(TOOLINFOA);
ti.uFlags = TTF_IDISHWND;
ti.hwnd = bct->hwnd;
@@ -634,7 +634,7 @@ void CtrlButtonLoadModule() {
WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
+ memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.lpszClassName = UINFOBUTTONCLASS;
wc.lpfnWndProc = Button_WndProc;
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index a64ad354f2..8028dbc8a1 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -611,7 +611,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!(hMenu = CreatePopupMenu())) return 0;
SetFocus((HWND)lParam);
- ZeroMemory(&mii, sizeof(MENUITEMINFO));
+ memset(&mii, 0, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_ID|MIIM_STRING|MIIM_FTYPE|MIIM_STATE;
mii.fType = MFT_STRING;
@@ -1082,7 +1082,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L cbex->pItems + (int)lParam + 1,
(cbex->numItems - (int)lParam - 1) * sizeof(CBEXITEMINTERN));
cbex->numItems--;
- ZeroMemory(cbex->pItems + cbex->numItems, sizeof(CBEXITEMINTERN));
+ memset((cbex->pItems + cbex->numItems), 0, sizeof(CBEXITEMINTERN));
CtrlContactWndProc(hwnd, CBEXM_SETCURSEL, lParam - 1, FALSE);
return TRUE;
}
@@ -1246,7 +1246,7 @@ int CtrlContactLoadModule() {
WNDCLASSEX wc;
- ZeroMemory(&wc, sizeof(wc));
+ memset(&wc, 0, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.lpszClassName = UINFOCOMBOEXCLASS;
wc.lpfnWndProc = CtrlContactWndProc;
@@ -1343,7 +1343,7 @@ int CtrlContactAddMyItemsFromDB( LPTSTR sms;
int bAnyItemIsChanged = 0;
- ZeroMemory(&cbi, sizeof(cbi));
+ memset(&cbi, 0, sizeof(cbi));
cbi.iItem = -1;
cbi.wMask = CBEXIM_ALL;
cbi.pszIcon = szIcon;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 304dc426ea..6ebf3bba69 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -701,7 +701,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (!(pPs = (LPPS)mir_alloc(sizeof(PS))))
return FALSE;
- ZeroMemory(pPs, sizeof(PS));
+ memset(pPs, 0, sizeof(PS));
if (!(pPs->pTree = new CPsTree(pPs)))
return FALSE;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index bc44363ab4..5d34c90513 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -38,7 +38,7 @@ CExImContactBase::CExImContactBase() _pszAMPro = NULL; _pszUIDKey = NULL; _dbvUIDHash = NULL; - ZeroMemory(&_dbvUID, sizeof(DBVARIANT)); + memset(&_dbvUID, 0, sizeof(DBVARIANT)); _hContact = INVALID_CONTACT_ID; _isNewContact = FALSE; } @@ -60,7 +60,7 @@ CExImContactBase::~CExImContactBase() MIR_FREE(_pszAMPro); MIR_FREE(_pszUIDKey); db_free(&_dbvUID); - ZeroMemory(&_dbvUID, sizeof(DBVARIANT)); + memset(&_dbvUID, 0, sizeof(DBVARIANT)); } /** @@ -88,7 +88,7 @@ BYTE CExImContactBase::fromDB(MCONTACT hContact) MIR_FREE(_pszGroup); MIR_FREE(_pszUIDKey); db_free(&_dbvUID); - ZeroMemory(&_dbvUID, sizeof(DBVARIANT)); + memset(&_dbvUID, 0, sizeof(DBVARIANT)); // OWNER if (!_hContact) return TRUE; @@ -171,7 +171,7 @@ BYTE CExImContactBase::fromIni(LPSTR& row) MIR_FREE(_pszGroup); MIR_FREE(_pszUIDKey); db_free(&_dbvUID); - ZeroMemory(&_dbvUID, sizeof(DBVARIANT)); + memset(&_dbvUID, 0, sizeof(DBVARIANT)); _dbvUIDHash = 0; // read uid value @@ -303,7 +303,7 @@ void CExImContactBase::toIni(FILE* file, int modCount) // Proto loadet - GetContactName(hContact,pszProto,0) LPSTR pszCI = NULL; CONTACTINFO ci; - ZeroMemory(&ci, sizeof(ci)); + memset(&ci, 0, sizeof(ci)); ci.cbSize = sizeof(ci); ci.hContact = _hContact; @@ -438,7 +438,7 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) r = (LPSTR)mir_alloc((baselen + 8)); if (r == NULL) return NULL; - ZeroMemory((r + baselen), 8); + memset((r + baselen), 0, 8); ptr = r; if (bPrependType) { // Allways true. ptr[0] = 'n'; @@ -455,7 +455,7 @@ LPSTR CExImContactBase::uid2String(BYTE bPrependType) r = (LPSTR)mir_alloc(baselen); if (r == NULL) return NULL; - ZeroMemory(r, baselen); + memset(r, 0, baselen); ptr = r; if (bPrependType) { // XXX dead code. ptr[0] = 'n'; diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp index a809ad1a18..803afccde9 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImOpenSaveFile.cpp @@ -114,8 +114,6 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara // miranda button
switch (tbb->idCommand) {
case 41063:
- ZeroMemory(szBtnText, sizeof(szBtnText));
-
mir_tstrncpy(szBtnText, TranslateT("Miranda NG"), SIZEOF(szBtnText));
iString = SendMessage(hWnd, TB_ADDSTRING, NULL, (LPARAM)szBtnText);
if (iString != -1) tbb->iString = iString;
@@ -124,7 +122,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara if (hWndToolTip) {
TOOLINFO ti;
- ZeroMemory(&ti, sizeof(ti));
+ memset(&ti, 0, sizeof(ti));
ti.cbSize = sizeof(ti);
ti.hwnd = hWnd;
ti.lpszText = TranslateT("Shows Miranda's installation directory.");
@@ -143,7 +141,7 @@ static LRESULT CALLBACK PlacesBarSubclassProc(HWND hWnd, UINT uMsg, WPARAM wPara if (hWndToolTip) {
TOOLINFO ti;
- ZeroMemory(&ti, sizeof(ti));
+ memset(&ti, 0, sizeof(ti));
ti.cbSize = sizeof(ti);
ti.hwnd = hWnd;
ti.lpszText = TranslateT("Shows the directory with all your Miranda's profiles.");
@@ -202,10 +200,9 @@ static UINT_PTR CALLBACK OpenSaveFileDialogHook(HWND hDlg, UINT uMsg, WPARAM wPa **/
static void GetInitialDir(LPSTR pszInitialDir)
{
- CHAR szRelative[MAX_PATH];
-
- ZeroMemory(szRelative, sizeof(szRelative));
+ char szRelative[MAX_PATH];
+ szRelative[0] = 0;
// is some standard path defined
if (!db_get_static(0, MODNAME, "vCardPath", szRelative, SIZEOF(szRelative))) {
if (!PathToAbsolute(szRelative, pszInitialDir))
@@ -248,7 +245,7 @@ static void SaveInitialDir(LPSTR pszInitialDir) **/
static void InitOpenFileNameStruct(OPENFILENAMEA *pofn, HWND hWndParent, LPCSTR pszTitle, LPCSTR pszFilter, LPSTR pszInitialDir, LPSTR pszFile)
{
- ZeroMemory(pofn, sizeof(OPENFILENAME));
+ memset(pofn, 0, sizeof(OPENFILENAME));
pofn->hwndOwner = hWndParent;
pofn->lpstrTitle = pszTitle;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index bd6011c4d2..ffc2423ca2 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -39,8 +39,7 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO LPSTR temp = 0;
cchFileName--;
-
- ZeroMemory(pszFileName, cchFileName);
+ pszFileName[0] = 0;
switch (ExImContact->Typ) {
case EXIM_ALL:
@@ -83,6 +82,7 @@ static void DisplayNameToFileName(lpExImParam ExImContact, LPSTR pszFileName, WO cchFileName--;
}
mir_free(temp);
+ pszFileName[0] = 0;
}
LPCSTR FilterString(lpExImParam ExImContact)
@@ -210,7 +210,7 @@ if (ExImContact->Typ == EXIM_ACCOUNT || INT_PTR svcExIm_MainExport_Service(WPARAM wParam, LPARAM lParam)
{
ExImParam ExIm;
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&ExIm, 0, sizeof(ExIm));
ExIm.hContact = INVALID_CONTACT_ID;
ExIm.Typ = EXIM_ALL;
return SvcExImport_Export(&ExIm, (HWND)lParam);
@@ -219,7 +219,7 @@ INT_PTR svcExIm_MainExport_Service(WPARAM wParam, LPARAM lParam) INT_PTR svcExIm_MainImport_Service(WPARAM wParam, LPARAM lParam)
{
ExImParam ExIm;
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&ExIm, 0, sizeof(ExIm));
ExIm.hContact = INVALID_CONTACT_ID;
ExIm.Typ = EXIM_ALL;
return SvcExImport_Import(&ExIm, (HWND)lParam);
@@ -232,7 +232,7 @@ INT_PTR svcExIm_MainImport_Service(WPARAM wParam, LPARAM lParam) INT_PTR svcExIm_ContactExport_Service(WPARAM hContact, LPARAM lParam)
{
ExImParam ExIm;
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&ExIm, 0, sizeof(ExIm));
ExIm.hContact = hContact;
ExIm.Typ = EXIM_CONTACT;
return SvcExImport_Export(&ExIm, (HWND)lParam);
@@ -241,7 +241,7 @@ INT_PTR svcExIm_ContactExport_Service(WPARAM hContact, LPARAM lParam) INT_PTR svcExIm_ContactImport_Service(WPARAM hContact, LPARAM lParam)
{
ExImParam ExIm;
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&ExIm, 0, sizeof(ExIm));
ExIm.hContact = hContact;
ExIm.Typ = EXIM_CONTACT;
return SvcExImport_Import(&ExIm, (HWND)lParam);
@@ -266,9 +266,9 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM lParam) ExImParam ExIm;
INT_PTR hItem = 0, hRoot = 0, hParent = 0;
TCHAR tszGroup[120], tszItem[120];
- ZeroMemory(&tszGroup, sizeof(tszGroup));
- ZeroMemory(&tszItem, sizeof(tszItem));
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&tszGroup, 0, sizeof(tszGroup));
+ memset(&tszItem, 0, sizeof(tszItem));
+ memset(&ExIm, 0, sizeof(ExIm));
LPTSTR ptszGroup = tszGroup;
LPTSTR ptszItem = tszItem;
@@ -329,7 +329,7 @@ typedef struct INT_PTR svcExIm_Account_Service(WPARAM wParam, LPARAM lParam)
{
ExImParam ExIm;
- ZeroMemory(&ExIm, sizeof(ExIm));
+ memset(&ExIm, 0, sizeof(ExIm));
HWND hClist = (HWND)CallService(MS_CLUI_GETHWNDTREE,0,0);
lpStatusMenuExecParam smep = (lpStatusMenuExecParam) CallService(MO_MENUITEMGETOWNERDATA, (WPARAM) lParam, NULL);
ExIm.pszName = mir_strdup(smep->proto);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 80b970961c..d0fc03cadd 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -163,7 +163,7 @@ extern "C" int __declspec(dllexport) Load(void) ccEx.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES;
InitCommonControlsEx(&ccEx);
- ZeroMemory(&myGlobals, sizeof(MGLOBAL));
+ memset(&myGlobals, 0, sizeof(MGLOBAL));
// init clist interface
mir_getCLI();
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index 6748e4de04..4931695c6a 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -252,7 +252,7 @@ static int ProfileList_EndLabelEdit(LPLISTCTRL pList, BYTE bSave) DestroyWindow(pList->labelEdit.dropDown.hDrop);
DestroyWindow(hEdit);
ListView_RedrawItems(pList->hList, pList->labelEdit.iItem, pList->labelEdit.iItem);
- ZeroMemory(&pList->labelEdit, sizeof(pList->labelEdit));
+ memset(&pList->labelEdit, 0, sizeof(pList->labelEdit));
SetFocus(pList->hList);
return 0;
}
@@ -831,7 +831,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa }
// show tip only for text that is larger than te listview can display
if (textSize.cx > rchWnd.right - rchWnd.left || textSize.cx > rcItem.right - rcItem.left) {
- ZeroMemory(&ti, sizeof(TOOLINFO));
+ memset(&ti, 0, sizeof(TOOLINFO));
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS | TTF_TRANSPARENT;
ti.hinst = ghInst;
@@ -1037,7 +1037,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR if (!hList || !(pList = (LPLISTCTRL)mir_alloc(sizeof(LISTCTRL))))
return FALSE;
- ZeroMemory(pList, sizeof(LISTCTRL));
+ memset(pList, 0, sizeof(LISTCTRL));
TranslateDialogDefault(hDlg);
Ctrl_InitTextColours();
@@ -1045,7 +1045,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR // init info structure
pList->hList = hList;
pList->nType = CTRL_LIST_PROFILE;
- ZeroMemory(&pList->labelEdit, sizeof(pList->labelEdit));
+ memset(&pList->labelEdit, 0, sizeof(pList->labelEdit));
SetUserData(hList, pList);
// set new window procedure
@@ -1080,7 +1080,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR SetWindowPos(pList->hTip, HWND_TOPMOST, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- ZeroMemory(&ti, sizeof(TOOLINFO));
+ memset(&ti, 0, sizeof(TOOLINFO));
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS | TTF_TRANSPARENT;
ti.hinst = ghInst;
@@ -1274,7 +1274,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR pItem = ProfileList_GetItemData(((LPNMHDR)lParam)->hwndFrom, hi.iItem);
// insert menuitems
- ZeroMemory(&mii, sizeof(MENUITEMINFO));
+ memset(&mii, 0, sizeof(MENUITEMINFO));
mii.cbSize = sizeof(MENUITEMINFO);
mii.fMask = MIIM_ID|MIIM_STRING;
// insert "Add" Menuitem
diff --git a/plugins/UserInfoEx/src/svc_timezone_old.cpp b/plugins/UserInfoEx/src/svc_timezone_old.cpp index 5ebe29ec83..a4d49edbeb 100644 --- a/plugins/UserInfoEx/src/svc_timezone_old.cpp +++ b/plugins/UserInfoEx/src/svc_timezone_old.cpp @@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CTimeZone::CTimeZone()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
/**
diff --git a/plugins/Utils/mir_fonts.cpp b/plugins/Utils/mir_fonts.cpp index d43b8ddab4..237eb040f7 100644 --- a/plugins/Utils/mir_fonts.cpp +++ b/plugins/Utils/mir_fonts.cpp @@ -9,7 +9,7 @@ int FontService_RegisterFont(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,int position,BOOL bAllowEffects,LOGFONT *plfDefault,COLORREF clrDefault)
{
FontIDT fid;
- ZeroMemory(&fid,sizeof(fid));
+ memset(&fid, 0, sizeof(fid));
fid.cbSize=sizeof(fid);
mir_strncpy(fid.dbSettingsGroup,pszDbModule,sizeof(fid.dbSettingsGroup)); /* buffer safe */
mir_strncpy(fid.prefix,pszDbName,sizeof(fid.prefix)); /* buffer safe */
@@ -46,7 +46,7 @@ int FontService_GetFont(const TCHAR *pszSection,const TCHAR *pszDescription,COLO int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF clrDefault)
{
ColourIDT cid;
- ZeroMemory(&cid,sizeof(cid));
+ memset(&cid, 0, sizeof(cid));
cid.cbSize=sizeof(cid);
cid.defcolour=clrDefault;
mir_strncpy(cid.dbSettingsGroup,pszDbModule,sizeof(cid.dbSettingsGroup)); /* buffer safe */
@@ -60,7 +60,7 @@ int FontService_RegisterColor(const char *pszDbModule,const char *pszDbName,cons int FontService_GetColor(const TCHAR *pszSection,const TCHAR *pszDescription,COLORREF *pclr)
{
ColourIDT cid;
- ZeroMemory(&cid,sizeof(cid));
+ memset(&cid, 0, sizeof(cid));
cid.cbSize=sizeof(cid);
mir_tstrncpy(cid.group,pszSection,sizeof(cid.group)); /* buffer safe */
mir_tstrncpy(cid.name,pszDescription,sizeof(cid.name)); /* buffer safe */
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index d8f90efedf..7d7e9fdbc3 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -200,12 +200,12 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha ListView_SetExtendedListViewStyle(hwndProtocols, LVS_EX_CHECKBOXES);
- ZeroMemory(&lvc, sizeof(lvc));
+ memset(&lvc, 0, sizeof(lvc));
lvc.mask = LVCF_FMT;
lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
ListView_InsertColumn(hwndProtocols, 0, &lvc);
- ZeroMemory(&lvi, sizeof(lvi));
+ memset(&lvi, 0, sizeof(lvi));
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iSubItem = 0;
lvi.iItem = 1000;
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index ed9a034559..62cce73d33 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -493,7 +493,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM wPar if (tokenString == NULL) break; - ZeroMemory(tokenString, (len+1)*sizeof(TCHAR)); + memset(tokenString, 0, ((len + 1) * sizeof(TCHAR))); mir_sntprintf(tokenString, len + 1, _T("%c%s%c"), (tr->flags & TRF_FIELD) ? FIELD_CHAR : FUNC_CHAR, tr->tszTokenString, (tr->flags & TRF_FIELD) ? FIELD_CHAR : '('); SendDlgItemMessage(hwndInputDlg, IDC_TESTSTRING, EM_REPLACESEL, TRUE, (LPARAM)tokenString); mir_free(tokenString); @@ -613,7 +613,7 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); dat = (INPUTDLGDATA*)mir_alloc(sizeof(INPUTDLGDATA)); - ZeroMemory(dat, sizeof(INPUTDLGDATA)); + memset(dat, 0, sizeof(INPUTDLGDATA)); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); // splitter things dat->splitterPos = (INT_PTR)db_get_dw(NULL, MODULENAME, SETTING_SPLITTERPOS, -1); @@ -1076,7 +1076,7 @@ static INT_PTR CALLBACK helpDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM l // return the largest of all pages for (i = 0; i < count; i++) { TabCtrl_GetItem(hTab, i, &tci); - ZeroMemory(&pageMinMax, sizeof(pageMinMax)); + memset(&pageMinMax, 0, sizeof(pageMinMax)); SendMessage((HWND)tci.lParam, WM_GETMINMAXINFO, wParam, (LPARAM)&pageMinMax); ((MINMAXINFO*)lParam)->ptMinTrackSize.x = max(((MINMAXINFO*)lParam)->ptMinTrackSize.x, pageMinMax.ptMinTrackSize.x); ((MINMAXINFO*)lParam)->ptMinTrackSize.y = max(((MINMAXINFO*)lParam)->ptMinTrackSize.y, pageMinMax.ptMinTrackSize.y); @@ -1197,13 +1197,13 @@ INT_PTR showHelpService(WPARAM wParam, LPARAM lParam) if (fi == NULL) fi = (FORMATINFO*)mir_alloc(sizeof(FORMATINFO)); - ZeroMemory(fi, sizeof(FORMATINFO)); + memset(fi, 0, sizeof(FORMATINFO)); fi->cbSize = sizeof(FORMATINFO); fi->szFormat = (char *)lParam; if (vhs == NULL) vhs = (VARHELPINFO*)mir_alloc(sizeof(VARHELPINFO)); - ZeroMemory(vhs, sizeof(VARHELPINFO)); + memset(vhs, 0, sizeof(VARHELPINFO)); vhs->cbSize = sizeof(VARHELPINFO); vhs->fi = fi; vhs->hwndCtrl = (HWND)wParam; diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index b7bf78f26e..bd11a39c9f 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -60,7 +60,7 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (zeros + _tcslen(szVal) + 3)*sizeof(TCHAR));
+ memset(res, 0, ((zeros + _tcslen(szVal) + 3) * sizeof(TCHAR)));
_tcscpy(res, _T("0x"));
for (i = 0; i < zeros; i++)
*(res + 2 + i) = '0';
@@ -145,7 +145,7 @@ static TCHAR *parseNum(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (zeros + _tcslen(szVal) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((zeros + _tcslen(szVal) + 1) * sizeof(TCHAR)));
TCHAR *cur = res;
for (unsigned i = 0; i < zeros; i++)
*cur++ = '0';
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 335df51fb3..da55f2b00a 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -505,7 +505,7 @@ static HANDLE findDbEvent(MCONTACT hContact, HANDLE hDbEvent, int flags) BOOL bEventOk;
do {
- ZeroMemory(&dbe, sizeof(DBEVENTINFO));
+ memset(&dbe, 0, sizeof(DBEVENTINFO));
dbe.cbSize = sizeof(DBEVENTINFO);
dbe.cbBlob = 0;
dbe.pBlob = NULL;
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index e4721c0fdf..1d993f8b4c 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -117,7 +117,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai) if (res == NULL)
return res;
- ZeroMemory(res, ((cur - ai->targv[1]) + 1)*sizeof(TCHAR));
+ memset(res, 0, (((cur - ai->targv[1]) + 1) * sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1], cur - ai->targv[1]);
_tcscat(res, szReplacement);
return res;
@@ -168,7 +168,7 @@ static TCHAR *parseInsert(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (_tcslen(ai->targv[1]) + _tcslen(ai->targv[2]) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((_tcslen(ai->targv[1]) + _tcslen(ai->targv[2]) + 1) * sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1], pos);
_tcscpy(res + pos, ai->targv[2]);
_tcscpy(res + pos + _tcslen(ai->targv[2]), ai->targv[1] + pos);
@@ -189,7 +189,7 @@ static TCHAR *parseLeft(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (len + 1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1) * sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1], len);
return res;
}
@@ -274,7 +274,7 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (addcount + _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((addcount + _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
TCHAR *cur = res;
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -301,7 +301,7 @@ static TCHAR *parsePadright(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (addcount + _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((addcount + _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
_tcscpy(res, ai->targv[1]);
TCHAR *cur = res + _tcslen(ai->targv[1]);
for (unsigned int i = 0; i < addcount; i++)
@@ -328,7 +328,7 @@ static TCHAR *parsePadcut(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (padding + 1)*sizeof(TCHAR));
+ memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
TCHAR *cur = res;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -357,7 +357,7 @@ static TCHAR *parsePadcutright(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (padding + 1)*sizeof(TCHAR));
+ memset(res, 0, ((padding + 1) * sizeof(TCHAR)));
TCHAR *cur = res + padding - addcount;
for (int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -381,7 +381,7 @@ static TCHAR *parseRepeat(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (count * _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((count * _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
for (int i = 0; i < count; i++)
_tcscat(res, ai->targv[1]);
@@ -433,7 +433,7 @@ static TCHAR *parseRight(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (len + 1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1)*sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1] + _tcslen(ai->targv[1]) - len, len);
return res;
}
@@ -458,7 +458,7 @@ static TCHAR *parseScroll(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (2 * _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ memset(res, 0, ((2 * _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
_tcscpy(res, ai->targv[1]);
_tcscat(res, ai->targv[1]);
MoveMemory(res, res + move, (_tcslen(res + move) + 1)*sizeof(TCHAR));
@@ -487,7 +487,7 @@ static TCHAR *parseStrchr(ARGUMENTSINFO *ai) return NULL;
char *szVal[34];
- ZeroMemory(szVal, sizeof(szVal));
+ memset(szVal, 0, sizeof(szVal));
TCHAR *c = _tcschr(ai->targv[1], *ai->targv[2]);
if (c == NULL || *c == 0)
return mir_tstrdup(_T("0"));
@@ -602,7 +602,7 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai) return NULL;
TCHAR *res = (TCHAR*)mir_alloc((to - from + 1)*sizeof(TCHAR));
- ZeroMemory(res, (to - from + 1)*sizeof(TCHAR));
+ memset(res, 0, ((to - from + 1) * sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1] + from, to - from);
return res;
}
@@ -651,7 +651,7 @@ static TCHAR *parseTrim(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (ecur - scur + 2)*sizeof(TCHAR));
+ memset(res, 0, ((ecur - scur + 2) * sizeof(TCHAR)));
_tcsncpy(res, scur, ecur - scur + 1);
return res;
@@ -722,7 +722,7 @@ static TCHAR *getNthWord(TCHAR *szString, int w) if (res == NULL)
return NULL;
- ZeroMemory(res, (ecur - scur + 1)*sizeof(TCHAR));
+ memset(res, 0, ((ecur - scur + 1) * sizeof(TCHAR)));
_tcsncpy(res, scur, ecur - scur);
return res;
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 9788f986cd..c6d1fdb765 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -275,8 +275,8 @@ static TCHAR *parseDiffTime(ARGUMENTSINFO *ai) if (ai->argc != 3)
return NULL;
- ZeroMemory(&t0, sizeof(t0));
- ZeroMemory(&t1, sizeof(t1));
+ memset(&t0, 0, sizeof(t0));
+ memset(&t1, 0, sizeof(t1));
if (getTime(ai->targv[1], &t0) != 0)
return NULL;
@@ -316,7 +316,7 @@ static TCHAR *parseEnvironmentVariable(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, (len + 1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1) * sizeof(TCHAR)));
if (ExpandEnvironmentStrings(ai->targv[1], res, len) == 0) {
mir_free(res);
return NULL;
@@ -352,7 +352,7 @@ static TCHAR *parseFindWindow(ARGUMENTSINFO *ai) return NULL;
TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
- ZeroMemory(res, (len + 1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1) * sizeof(TCHAR)));
GetWindowText(hWin, res, len + 1);
return res;
}
@@ -490,7 +490,7 @@ static TCHAR *parseRegistryValue(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, len);
+ memset(res, 0, (len * sizeof(TCHAR)));
err = RegQueryValueEx(hKey, ai->targv[2], NULL, &type, (BYTE*)res, &len);
if ((err != ERROR_SUCCESS) || (type != REG_SZ)) {
RegCloseKey(hKey);
@@ -508,7 +508,7 @@ static int TsToSystemTime(SYSTEMTIME *sysTime, time_t timestamp) if (pTime == NULL)
return -1;
- ZeroMemory(sysTime, sizeof(SYSTEMTIME));
+ memset(sysTime, 0, sizeof(SYSTEMTIME));
sysTime->wDay = pTime->tm_mday;
sysTime->wDayOfWeek = pTime->tm_wday;
sysTime->wHour = pTime->tm_hour;
@@ -647,7 +647,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) // count number of lines
do {
- ZeroMemory(pBuf, bufSz);
+ memset(pBuf, 0, bufSz);
if (ReadFile(hFile, pBuf, bufSz - csz, &readSz, NULL) == 0) {
CloseHandle(hFile);
mir_free(pBuf);
@@ -730,7 +730,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) mir_free(pBuf);
return NULL;
}
- ZeroMemory(pBuf, bufSz);
+ memset(pBuf, 0, bufSz);
pCur = pBuf;
do {
icur = 0;
@@ -780,7 +780,7 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai) icur = pCur - pBuf;
pBuf = (PBYTE)mir_realloc(pBuf, bufSz);
pCur = pBuf + icur;
- ZeroMemory(pCur + 1, TXTFILEBUFSZ*csz);
+ memset((pCur + 1), 0, (TXTFILEBUFSZ * csz));
}
}
while (readSz > 0);
@@ -840,7 +840,7 @@ static TCHAR *parseUserName(ARGUMENTSINFO *ai) if (res == NULL)
return NULL;
- ZeroMemory(res, len + 1);
+ memset(res, 0, (len + 1));
if (!GetUserName(res, &len)) {
mir_free(res);
return NULL;
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index fe0899d6ad..cc1818eca9 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -299,7 +299,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) pargv[i+1] = argv[i]; pargv[0] = tr->tszTokenString; - ZeroMemory(&ai, sizeof(ai)); + memset(&ai, 0, sizeof(ai)); ai.cbSize = sizeof(ai); ai.argc = argc+1; ai.targv = pargv; @@ -389,19 +389,19 @@ static INT_PTR formatStringService(WPARAM wParam, LPARAM lParam) TCHAR *tszFormat, *orgFormat, *tszSource, *orgSource, *tRes; if (((FORMATINFO *)wParam)->cbSize >= sizeof(FORMATINFO)) { - ZeroMemory(&tempFi, sizeof(FORMATINFO)); + memset(&tempFi, 0, sizeof(FORMATINFO)); CopyMemory(&tempFi, (FORMATINFO *)wParam, sizeof(FORMATINFO)); fi = &tempFi; } else if (((FORMATINFO *)wParam)->cbSize == FORMATINFOV2_SIZE) { - ZeroMemory(&tempFi, sizeof(FORMATINFO)); + memset(&tempFi, 0, sizeof(FORMATINFO)); CopyMemory(&tempFi, (FORMATINFO *)wParam, FORMATINFOV2_SIZE); fi = &tempFi; } else { // old struct, must be ANSI fiv1 = (FORMATINFOV1 *)wParam; - ZeroMemory(&tempFi, sizeof(FORMATINFO)); + memset(&tempFi, 0, sizeof(FORMATINFO)); tempFi.cbSize = sizeof(FORMATINFO); tempFi.hContact = fiv1->hContact; tempFi.szFormat = fiv1->szFormat; @@ -481,7 +481,7 @@ int setParseOptions(struct ParseOptions *po) if (po == NULL) po = &gParseOpts; - ZeroMemory(po, sizeof(struct ParseOptions)); + memset(po, 0, sizeof(struct ParseOptions)); if (!db_get_b(NULL, MODULENAME, SETTING_STRIPALL, 0)) { po->bStripEOL = db_get_b(NULL, MODULENAME, SETTING_STRIPCRLF, 0); po->bStripWS = db_get_b(NULL, MODULENAME, SETTING_STRIPWS, 0); diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index ca24b7c690..dce15b01c0 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -288,7 +288,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // browse for the external log file
GetDlgItemText(hwndDlg, IDC_LOG, str, SIZEOF(str));
// Initialize OPENFILENAME
- ZeroMemory(&ofn, sizeof(OPENFILENAME));
+ memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = str;
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index 066861beed..bf4296c4dc 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -247,7 +247,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) };
// clean up old stuff
- ZeroMemory(Data, sizeof(*Data));
+ memset(Data, 0, sizeof(*Data));
Data->Enabled = FALSE;
// open the ini file
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 87facdb349..fa2baba340 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -94,7 +94,7 @@ void DestroyOptions(void) // load options from database + set default if the setting does not exist
void LoadOptions(void)
{
- ZeroMemory(&opt, sizeof(opt));
+ memset(&opt, 0, sizeof(opt));
// main options
opt.StartupUpdate = db_get_b(NULL, WEATHERPROTONAME, "StartupUpdate", true);
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 51387e5908..6efe057862 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -236,7 +236,7 @@ int SendToRichEdit(HWND hWindow, char *truncated, COLORREF rgbText, COLORREF rgb SetDlgItemText(hWindow, IDC_DATA, _T(""));
CHARFORMAT2 cfFM;
- ZeroMemory(&cfFM, sizeof(cfFM));
+ memset(&cfFM, 0, sizeof(cfFM));
cfFM.cbSize = sizeof(CHARFORMAT2);
cfFM.dwMask = CFM_COLOR | CFM_CHARSET | CFM_FACE | ENM_LINK | ENM_MOUSEEVENTS | CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_SIZE;
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 6d879a0b42..e583c4ed4e 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -271,15 +271,15 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn int alertIndex = 0, eventIndex = 0;
char tempraw[MAXSIZE1];
- ZeroMemory(&tempraw, sizeof(tempraw));
- ZeroMemory(&raw, sizeof(raw));
+ memset(&tempraw, 0, sizeof(tempraw));
+ memset(&raw, 0, sizeof(raw));
strncpy(tempraw, truncated, SIZEOF(tempraw));
- ZeroMemory(&alertstring, sizeof(alertstring));
- ZeroMemory(&Alerttempstring, sizeof(Alerttempstring));
- ZeroMemory(&Alerttempstring2, sizeof(Alerttempstring2));
- ZeroMemory(&cachecompare, sizeof(cachecompare));
+ memset(&alertstring, 0, sizeof(alertstring));
+ memset(&Alerttempstring, 0, sizeof(Alerttempstring));
+ memset(&Alerttempstring2, 0, sizeof(Alerttempstring2));
+ memset(&cachecompare, 0, sizeof(cachecompare));
// alerts
if (db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) { // ALERTS
@@ -436,7 +436,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
WErrorPopup((MCONTACT)contactname, TranslateT("Cannot read from file"));
else {
- ZeroMemory(&cachecompare, sizeof(cachecompare));
+ memset(&cachecompare, 0, sizeof(cachecompare));
fread(cachecompare, sizeof(cachecompare), 1, pcachefile);
fclose(pcachefile);
}
@@ -532,20 +532,20 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn alertpos = strstr(tempraw, Alerttempstring);
statalertpos = alertpos - tempraw;
- ZeroMemory(&alertpos, sizeof(alertpos));
+ memset(&alertpos, 0, sizeof(alertpos));
//end string
alertpos = strstr(tempraw, Alerttempstring2);
statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2);
if (statalertpos > statalertposend) {
memset(&tempraw, ' ', statalertpos);
- ZeroMemory(&alertpos, sizeof(alertpos));
+ memset(&alertpos, 0, sizeof(alertpos));
alertpos = strstr(tempraw, Alerttempstring2);
statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2);
}
if (statalertpos < statalertposend) {
- ZeroMemory(&raw, sizeof(raw));
+ memset(&raw, 0, sizeof(raw));
//start string
alertpos = strstr(tempraw, Alerttempstring);
@@ -557,7 +557,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (statalertpos > statalertposend) {
memset(&tempraw, ' ', statalertpos);
- ZeroMemory(&alertpos, sizeof(alertpos));
+ memset(&alertpos, 0, sizeof(alertpos));
alertpos = strstr(tempraw, Alerttempstring2);
statalertposend = alertpos - tempraw + (int)strlen(Alerttempstring2);
}
@@ -648,7 +648,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
WErrorPopup((MCONTACT)contactname, TranslateT("Cannot read from file"));
else {
- ZeroMemory(&cachecompare, sizeof(cachecompare));
+ memset(&cachecompare, 0, sizeof(cachecompare));
fread(cachecompare, sizeof(cachecompare), 1, pcachefile);
fclose(pcachefile);
}
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index ea05a9142c..a552c52554 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -51,7 +51,7 @@ INT_PTR CALLBACK DlgProcFind(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int startsel = 0, endsel = 0;
char buff[MAXSIZE1];
- ZeroMemory(&NewSearchstr, sizeof(NewSearchstr));
+ memset(&NewSearchstr, 0, sizeof(NewSearchstr));
int len = GetWindowTextLength(GetDlgItem(ParentHwnd, IDC_DATA));
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 9de894fd3e..02c724c07d 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -59,13 +59,14 @@ void GetData(void *param) Startingup = 0;
- ZeroMemory(&url, sizeof(url));
- ZeroMemory(&contactname, sizeof(contactname));
- ZeroMemory(&tempstring, sizeof(tempstring));
- ZeroMemory(&tempstring2, sizeof(tempstring2));
- ZeroMemory(&dbv, sizeof(dbv));
- ZeroMemory(&tstr, sizeof(tstr));
- ZeroMemory(×tring, sizeof(timestring));
+ memset(&url, 0, sizeof(url));
+ memset(&contactname, 0, sizeof(contactname));
+ memset(&tempstring, 0, sizeof(tempstring));
+ memset(&tempstring2, 0, sizeof(tempstring2));
+ memset(&szInfo, 0, sizeof(szInfo));
+ memset(&dbv, 0, sizeof(dbv));
+ memset(&tstr, 0, sizeof(tstr));
+ memset(×tring, 0, sizeof(timestring));
db_set_b(hContact, MODULENAME, STOP_KEY, 0);
@@ -199,19 +200,19 @@ void GetData(void *param) pos = strstr(truncated2, tempstring);
statpos = pos - truncated2;
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX: looks bad.
// end string
pos = strstr(truncated2, tempstring2);
- statposend = pos - truncated2 + (int)strlen(tempstring2);
+ statposend = pos - truncated2 + strlen(tempstring2);
if (statpos > statposend) {
memset(&truncated2, ' ', statpos);
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX: looks bad.
pos = strstr(truncated2, tempstring2);
- statposend = pos - truncated2 + (int)strlen(tempstring2);
+ statposend = pos - truncated2 + strlen(tempstring2);
}
if (statpos < statposend) {
- ZeroMemory(&raw, sizeof(raw));
+ memset(&raw, 0, sizeof(raw));
// get size for malloc
MallocSize = statposend - statpos;
@@ -227,7 +228,7 @@ void GetData(void *param) if (statpos > statposend) {
memset(&truncated2, ' ', statpos);
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX
pos = strstr(truncated2, tempstring2);
statposend = pos - truncated2 + (int)strlen(tempstring2);
}
@@ -285,8 +286,8 @@ void GetData(void *param) setlocale(LC_ALL, "");
if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
- ZeroMemory(&temptime, sizeof(temptime));
- ZeroMemory(&tstr, sizeof(tstr));
+ memset(&temptime, 0, sizeof(temptime));
+ memset(&tstr, 0, sizeof(tstr));
ftime = time(NULL);
nTime = localtime(&ftime);
// 12 hour
@@ -304,8 +305,8 @@ void GetData(void *param) }
else {
db_get_ts(hContact, "CList", "MyHandle", &dbv);
- ZeroMemory(&temptime, sizeof(temptime));
- ZeroMemory(&tstr, sizeof(tstr));
+ memset(&temptime, 0, sizeof(temptime));
+ memset(&tstr, 0, sizeof(tstr));
ftime = time(NULL);
nTime = localtime(&ftime);
// 12 hour
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 9ac45b6711..f15a0c6658 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -25,7 +25,7 @@ void LoadOptions() {
DBVARIANT dbv = { 0 };
dbv.type = DBVT_TCHAR;
- ZeroMemory(&WumfOptions, sizeof(WumfOptions));
+ memset(&WumfOptions, 0, sizeof(WumfOptions));
if (db_get_ts(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
{
_tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp index 8d8a8ea739..21c90a7b85 100644 --- a/plugins/WinterSpeak/src/EventInformation.cpp +++ b/plugins/WinterSpeak/src/EventInformation.cpp @@ -14,7 +14,7 @@ EventInformation::EventInformation() : m_event_strings(), m_event_info() m_event_strings[EVENTTYPE_AUTHREQUEST] = TranslateW(L"%u requests your authorization");
m_event_strings[EVENTTYPE_FILE] = TranslateW(L"there is an incoming file from %u");
- ZeroMemory(&m_event_info, sizeof(m_event_info));
+ memset(&m_event_info, 0, sizeof(m_event_info));
}
//------------------------------------------------------------------------------
@@ -30,7 +30,7 @@ bool EventInformation::isValidEvent(HANDLE event) {
delete m_event_info.pBlob;
}
- ZeroMemory(&m_event_info, sizeof(m_event_info));
+ memset(&m_event_info, 0, sizeof(m_event_info));
// find out and assign the space we need for the new event
m_event_info.cbSize = sizeof(m_event_info);
diff --git a/plugins/WinterSpeak/src/MirandaDialog.cpp b/plugins/WinterSpeak/src/MirandaDialog.cpp index fad87285f6..200f398e41 100644 --- a/plugins/WinterSpeak/src/MirandaDialog.cpp +++ b/plugins/WinterSpeak/src/MirandaDialog.cpp @@ -23,7 +23,7 @@ WCHAR *MirandaDialog::Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) { return NULL;
WCHAR *res = (WCHAR*)mir_alloc((len+1)*sizeof(WCHAR));
- ZeroMemory(res, (len+1)*sizeof(WCHAR));
+ memset(res, 0, ((len + 1) * sizeof(WCHAR)));
GetDlgItemText(hwndDlg, nIDDlgItem, res, len+1);
return res;
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp index 32b44dcd33..612ac7181a 100644 --- a/plugins/YAMN/src/account.cpp +++ b/plugins/YAMN/src/account.cpp @@ -109,10 +109,10 @@ int InitAccount(HACCOUNT Which) SWMRGInitialize(Which->MessagesAccessSO,NULL); //zero memory, where timestamps are stored - ZeroMemory(&Which->LastChecked,sizeof(Which->LastChecked)); - ZeroMemory(&Which->LastSChecked,sizeof(Which->LastSChecked)); - ZeroMemory(&Which->LastSynchronised,sizeof(Which->LastSynchronised)); - ZeroMemory(&Which->LastMail,sizeof(Which->LastMail)); + memset(&Which->LastChecked, 0, sizeof(Which->LastChecked)); + memset(&Which->LastSChecked, 0, sizeof(Which->LastSChecked)); + memset(&Which->LastSynchronised, 0, sizeof(Which->LastSynchronised)); + memset(&Which->LastMail, 0, sizeof(Which->LastMail)); Which->Name=NULL; Which->Mails=NULL; diff --git a/plugins/YAMN/src/browser/badconnect.cpp b/plugins/YAMN/src/browser/badconnect.cpp index 3387028fc8..eeccc75553 100644 --- a/plugins/YAMN/src/browser/badconnect.cpp +++ b/plugins/YAMN/src/browser/badconnect.cpp @@ -20,7 +20,7 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPa if ((HIWORD(wParam)==STN_CLICKED) && (CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)&PluginParam))) {
PROCESS_INFORMATION pi;
STARTUPINFOW si;
- ZeroMemory(&si,sizeof(si));
+ memset(&si, 0, sizeof(si));
si.cb=sizeof(si);
HACCOUNT ActualAccount = (HACCOUNT)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0);
#ifdef DEBUG_SYNCHRO
@@ -167,7 +167,7 @@ INT_PTR CALLBACK DlgProcYAMNBadConnection(HWND hDlg,UINT msg,WPARAM wParam,LPARA {
NOTIFYICONDATA nid;
- ZeroMemory(&nid,sizeof(NOTIFYICONDATA));
+ memset(&nid, 0, sizeof(NOTIFYICONDATA));
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd=hDlg;
nid.uID=0;
@@ -242,7 +242,7 @@ DWORD WINAPI BadConnection(LPVOID Param) SendMessage(hBadConnect,WM_SETICON,ICON_BIG,(LPARAM)g_LoadIconEx(3));
SendMessage(hBadConnect,WM_SETICON,ICON_SMALL,(LPARAM)g_LoadIconEx(3));
- ZeroMemory(&nid,sizeof(nid));
+ memset(&nid, 0, sizeof(nid));
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd=hBadConnect;
nid.hIcon=g_LoadIconEx(3);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index c983eadddf..125365ec54 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -357,7 +357,7 @@ int UpdateMails(HWND hDlg,HACCOUNT ActualAccount,DWORD nflags,DWORD nnflags) DebugLog(SynchroFile,"UpdateMails:ActualAccountMsgsSO-write enter\n"); #endif - ZeroMemory(&MN,sizeof(MN)); + memset(&MN, 0, sizeof(MN)); for (msgq=(HYAMNMAIL)ActualAccount->Mails;msgq != NULL;msgq=msgq->Next) { @@ -498,14 +498,14 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb struct CHeader UnicodeHeader; BOOL Loaded,Extracted,FromStrNew=FALSE; - ZeroMemory(&item,sizeof(item)); - ZeroMemory(&UnicodeHeader,sizeof(UnicodeHeader)); + memset(&item, 0, sizeof(item)); + memset(&UnicodeHeader, 0, sizeof(UnicodeHeader)); if (hListView != NULL) { item.mask=LVIF_TEXT | LVIF_PARAM; item.iItem=0; - ZeroMemory(&fi,sizeof(fi)); + memset(&fi, 0, sizeof(fi)); fi.flags=LVFI_PARAM; //let's go search item by lParam number lfoundi=0; } @@ -623,7 +623,7 @@ int AddNewMailsToListView(HWND hListView,HACCOUNT ActualAccount,struct CMailNumb if (Extracted) { DeleteHeaderContent(&UnicodeHeader); - ZeroMemory(&UnicodeHeader,sizeof(UnicodeHeader)); + memset(&UnicodeHeader, 0, sizeof(UnicodeHeader)); } if (!Loaded) @@ -641,7 +641,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR char *NotIconText = Translate("- new mail message(s)"); NOTIFYICONDATA nid; - ZeroMemory(&nid,sizeof(nid)); + memset(&nid, 0, sizeof(nid)); if (MN->Real.EventNC+MN->Virtual.EventNC) NotifyEventHooks(hNewMailHook,0,0); @@ -751,7 +751,7 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR { PROCESS_INFORMATION pi; STARTUPINFOW si; - ZeroMemory(&si,sizeof(si)); + memset(&si, 0, sizeof(si)); si.cb=sizeof(si); if (ActualAccount->NewMailN.App != NULL) @@ -1188,8 +1188,8 @@ int CALLBACK ListViewCompareProc(LPARAM lParam1, LPARAM lParam2,LPARAM lParamSor HYAMNMAIL email2 = (HYAMNMAIL)lParam2; struct CShortHeader Header1; struct CShortHeader Header2; - ZeroMemory(&Header1,sizeof(Header1)); - ZeroMemory(&Header2,sizeof(Header2)); + memset(&Header1, 0, sizeof(Header1)); + memset(&Header2, 0, sizeof(Header2)); try { ExtractShortHeader(email1->MailData->TranslatedHeader,&Header1); @@ -1829,7 +1829,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM #endif WriteDoneFcn(ActualAccount->MessagesAccessSO); - ZeroMemory(&nid,sizeof(NOTIFYICONDATA)); + memset(&nid, 0, sizeof(NOTIFYICONDATA)); delete mwui; SetWindowLongPtr(hDlg,DWLP_USER,(LONG_PTR)NULL); @@ -2056,7 +2056,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM PROCESS_INFORMATION pi; STARTUPINFOW si; - ZeroMemory(&si,sizeof(si)); + memset(&si, 0, sizeof(si)); si.cb=sizeof(si); #ifdef DEBUG_SYNCHRO @@ -2226,7 +2226,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM NOTIFYICONDATA nid; struct CMailWinUserInfo *mwui=(struct CMailWinUserInfo *)GetWindowLongPtr(hDlg,DWLP_USER); - ZeroMemory(&nid,sizeof(nid)); + memset(&nid, 0, sizeof(nid)); nid.cbSize=sizeof(NOTIFYICONDATA); nid.hWnd=hDlg; nid.uID=0; diff --git a/plugins/YAMN/src/mails/mime.cpp b/plugins/YAMN/src/mails/mime.cpp index 30706d9cc2..0be13215dc 100644 --- a/plugins/YAMN/src/mails/mime.cpp +++ b/plugins/YAMN/src/mails/mime.cpp @@ -347,7 +347,7 @@ void ExtractHeader(struct CMimeItem *items,int &CP,struct CHeader *head) {
struct CShortHeader ShortHeader;
- ZeroMemory(&ShortHeader,sizeof(struct CShortHeader));
+ memset(&ShortHeader, 0, sizeof(struct CShortHeader));
ShortHeader.Priority=ShortHeader.CP=-1;
#ifdef DEBUG_DECODE
DebugLog(DecodeFile,"<Extracting header>\n");
diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index e9a1f61dd9..0e1e9ab5a5 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -215,7 +215,7 @@ char* CNLClient::Recv(char *buf,int buflen) throw(DWORD) }
}
- ZeroMemory(buf,buflen);
+ memset(buf, 0, buflen);
if (SOCKET_ERROR==(Rcv=LocalNetlib_Recv(hConnection,buf,buflen,MSG_DUMPASTEXT)))
{
free(buf);
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 455a981ca0..83fc6b93ce 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -1329,12 +1329,9 @@ INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lPa BOOL TesterFC = (IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED);
BOOL TesterNC = (IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED);
- ZeroMemory(&Tester,sizeof(Tester));
- ZeroMemory(&TesterF,sizeof(TesterF));
- ZeroMemory(&TesterF,sizeof(TesterN));
- Tester.lchContact=NULL;
- TesterF.lchContact=NULL;
- TesterN.lchContact=NULL;
+ memset(&Tester, 0, sizeof(Tester));
+ memset(&TesterF, 0, sizeof(TesterF));
+ memset(&TesterN, 0, sizeof(TesterN));
Tester.lchIcon=g_LoadIconEx(2);
TesterF.lchIcon=g_LoadIconEx(3);
TesterN.lchIcon=g_LoadIconEx(1);
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 686cb59363..7c7fede24f 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -209,7 +209,7 @@ TCHAR *GetContactName(MCONTACT hContact, char *szProto) CONTACTINFO ctInfo;
char proto[200];
- ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ memset(&ctInfo, 0, sizeof(ctInfo));
ctInfo.cbSize = sizeof(ctInfo);
if (szProto)
{
@@ -257,7 +257,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) {
CONTACTINFO ctInfo;
- ZeroMemory((void *) &ctInfo, sizeof(ctInfo));
+ memset(&ctInfo, 0, sizeof(ctInfo));
ctInfo.cbSize = sizeof(ctInfo);
ctInfo.szProto = szProto;
ctInfo.dwFlag = CNF_DISPLAY | CNF_TCHAR;
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index eb2940adb2..fe2640ae0d 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -36,7 +36,7 @@ TCHAR *Hlp_GetDlgItemText(HWND hwndDlg, int nIDDlgItem) { return NULL;
TCHAR *res = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
- ZeroMemory(res, (len+1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1) * sizeof(TCHAR)));
GetDlgItemText(hwndDlg, nIDDlgItem, res, len+1);
return res;
@@ -49,7 +49,7 @@ TCHAR *Hlp_GetWindowText(HWND hwndDlg) return NULL;
TCHAR *res = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
- ZeroMemory(res, (len+1)*sizeof(TCHAR));
+ memset(res, 0, ((len + 1) * sizeof(TCHAR)));
GetWindowText(hwndDlg, res, len+1);
return res;
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index f23f949db3..7e3bf7f3a1 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -74,7 +74,7 @@ int selectFont(HWND hDlg, LOGFONT *lf) HDC hDC = GetDC(hDlg);
CHOOSEFONT cf;
- ZeroMemory(&cf, sizeof(CHOOSEFONT));
+ memset(&cf, 0, sizeof(CHOOSEFONT));
cf.lStructSize = sizeof(cf);
cf.hwndOwner = hDlg;
cf.hDC = hDC;
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 8407f426fd..c2b74f219d 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -2267,7 +2267,7 @@ void CAimProto::snac_admin_account_confirm(SNAC &snac)//family 0x0007 char sn[33];
int sn_length=buf[SNAC_SIZE*2];
MCONTACT hContact;
- ZeroMemory(sn,sizeof(sn));
+ memset(sn, 0, sizeof(sn));
memcpy(sn,&buf[SNAC_SIZE*2+1],sn_length);
hContact=find_contact(sn);
if (hContact)
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 39d33a7f91..2e170253ab 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -220,7 +220,7 @@ void CMLan::Check() void CMLan::RequestStatus(bool answer, u_long addr) { TPacket pak; - ZeroMemory(&pak, sizeof(pak)); + memset(&pak, 0, sizeof(pak)); pak.flReqStatus = answer; pak.strName = m_name; SendPacketExt(pak, addr); @@ -349,7 +349,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) pak.flIsUrl ? PSR_URL : PSR_MESSAGE, 0, (LPARAM)&pre ); TPacket npak; - ZeroMemory(&npak, sizeof(npak)); + memset(&npak, 0, sizeof(npak)); npak.idAckMessage = pak.idMessage; npak.flIsUrl = pak.flIsUrl; SendPacketExt(npak, from.S_un.S_addr); @@ -408,7 +408,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (mesAway) { TPacket npak; - ZeroMemory(&npak, sizeof(npak)); + memset(&npak, 0, sizeof(npak)); npak.idAckAwayMessage = pak.idReqAwayMessage; npak.strAwayMessage = mesAway; SendPacketExt(npak, cont->m_addr.S_un.S_addr); @@ -426,7 +426,7 @@ void CMLan::RecvMessageUrl(CCSDATA* ccs) DBEVENTINFO dbei; PROTORECVEVENT *pre=(PROTORECVEVENT*)ccs->lParam; - ZeroMemory(&dbei,sizeof(dbei)); + memset(&dbei, 0, sizeof(dbei)); if (!mir_strcmp(ccs->szProtoService, PSR_MESSAGE)) dbei.eventType = EVENTTYPE_MESSAGE; @@ -576,7 +576,7 @@ void CMLan::SendMessageExt(TDataHolder* hold) else { TPacket pak; - ZeroMemory(&pak, sizeof(pak)); + memset(&pak, 0, sizeof(pak)); u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); pak.strMessage = hold->msg; pak.idMessage = hold->id; @@ -592,7 +592,7 @@ void CMLan::GetAwayMsgExt(TDataHolder* hold) // TODO: check all other params (offline user, offline protocol) Sleep(0); TPacket pak; - ZeroMemory(&pak, sizeof(pak)); + memset(&pak, 0, sizeof(pak)); pak.idReqAwayMessage = hold->id; u_long addr = db_get_dw((MCONTACT)hold->hContact, PROTONAME, "ipaddr", 0); SendPacketExt(pak, addr); @@ -787,7 +787,7 @@ u_char* CMLan::CreatePacket(TPacket& pak, int* pBufLen) void CMLan::ParsePacket(TPacket& pak, u_char* buf, int len) { - ZeroMemory(&pak, sizeof(pak)); + memset(&pak, 0, sizeof(pak)); u_char* buf_end = buf+len; while (*buf && buf<buf_end) { @@ -893,7 +893,7 @@ void CMLan::SaveSettings() CMLan::TFileConnection::TFileConnection() { - ZeroMemory(this, sizeof(TFileConnection)); + memset(this, 0, sizeof(TFileConnection)); InitializeCriticalSection(&m_csAccess); m_state = FCS_OK; } diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index e3f871cfdf..f54dda4d3e 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -463,7 +463,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) httpHeaders[1].szValue = token;
//construct 2nd request
- ZeroMemory(&req, sizeof(req));
+ memset(&req, 0, sizeof(req));
req.cbSize = sizeof(req);
req.requestType = REQUEST_POST;
req.szUrl = "http://avatars.nowe.gg/upload";
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 6d4749f585..4918700cc8 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -349,7 +349,7 @@ int GGPROTO::oauth_receivetoken() mir_free(str);
str = mir_strdup(szUrl);
- ZeroMemory(&req, sizeof(req));
+ memset(&req, 0, sizeof(req));
req.cbSize = sizeof(req);
req.requestType = REQUEST_POST;
req.szUrl = szUrl;
@@ -376,7 +376,7 @@ int GGPROTO::oauth_receivetoken() token = NULL;
token_secret = NULL;
- ZeroMemory(&req, sizeof(req));
+ memset(&req, 0, sizeof(req));
req.cbSize = sizeof(req);
req.requestType = REQUEST_POST;
req.szUrl = szUrl;
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index bbd3e6b01f..88596aeaaf 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -275,6 +275,6 @@ void GGPROTO::threadwait(GGTHREAD *thread) if (!thread->hThread) return;
while (WaitForSingleObjectEx(thread->hThread, INFINITE, TRUE) != WAIT_OBJECT_0);
CloseHandle(thread->hThread);
- ZeroMemory(thread, sizeof(GGTHREAD));
+ memset(thread, 0, sizeof(GGTHREAD));
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 3a08e3b817..6ecc46abba 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -733,7 +733,7 @@ CDccSession::CDccSession(CIrcProto* _pro, DCCINFO* pdci) : di = pdci; // Setup values passed to the constructor - ZeroMemory(&pfts, sizeof(PROTOFILETRANSFERSTATUS)); + memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS)); pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS); if (di->iType == DCC_SEND && di->bSender == false) diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp index d1e999f7bc..a72e9b1384 100644 --- a/protocols/IRCG/src/ui_utils.cpp +++ b/protocols/IRCG/src/ui_utils.cpp @@ -1351,7 +1351,7 @@ HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE;
tvi->hItem = hItem;
GetItem(tvi);
@@ -1359,7 +1359,7 @@ void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE|TVIF_TEXT;
tvi->hItem = hItem;
tvi->pszText = szText;
diff --git a/protocols/IcqOscarJ/src/chan_04close.cpp b/protocols/IcqOscarJ/src/chan_04close.cpp index 12eef821ba..3c774e5ce0 100644 --- a/protocols/IcqOscarJ/src/chan_04close.cpp +++ b/protocols/IcqOscarJ/src/chan_04close.cpp @@ -189,7 +189,7 @@ void CIcqProto::handleSignonError(WORD wError) case 0x06: // Internal Client error (bad input to authorizer)
case 0x07: // Invalid account
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
- ZeroMemory(m_szPassword, sizeof(m_szPassword));
+ memset(m_szPassword, 0, sizeof(m_szPassword));
icq_LogFatalParam(LPGEN("Connection failed.\nYour ICQ number or password was rejected (%d)."), wError);
break;
diff --git a/protocols/IcqOscarJ/src/i18n.cpp b/protocols/IcqOscarJ/src/i18n.cpp index 5f2c1f4f2a..5b7ab1d2a2 100644 --- a/protocols/IcqOscarJ/src/i18n.cpp +++ b/protocols/IcqOscarJ/src/i18n.cpp @@ -273,7 +273,7 @@ int __stdcall utf8_encode(const char *from, char **to) }
WCHAR *unicode = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
- ZeroMemory(unicode, (wchars + 1) * sizeof(WCHAR));
+ memset(unicode, 0, ((wchars + 1) * sizeof(WCHAR)));
int err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, (int)mir_strlen(from), unicode, wchars);
if (err != wchars) {
@@ -308,7 +308,7 @@ char* __stdcall ansi_to_utf8_codepage(const char *ansi, WORD wCp) {
size_t wchars = mir_strlen(ansi);
WCHAR *unicode = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
- ZeroMemory(unicode, (wchars + 1) * sizeof(WCHAR));
+ memset(unicode, 0, ((wchars + 1) * sizeof(WCHAR)));
MultiByteToWideChar(wCp, MB_PRECOMPOSED, ansi, (int)wchars, unicode, (int)wchars);
@@ -331,7 +331,7 @@ int __stdcall utf8_decode_codepage(const char *from, char **to, WORD wCp) if (bHasCP_UTF8) {
size_t inlen = mir_strlen(from) + 1;
WCHAR *wszTemp = (WCHAR *)_alloca(inlen * sizeof(WCHAR));
- ZeroMemory(wszTemp, inlen * sizeof(WCHAR));
+ memset(wszTemp, 0, (inlen * sizeof(WCHAR)));
// Convert the UTF-8 string to UCS
if (MultiByteToWideChar(CP_UTF8, 0, from, -1, wszTemp, (int)inlen)) {
@@ -402,13 +402,13 @@ int __stdcall utf8_decode_static(const char *from, char *to, size_t to_size) return 0;
// Clear target
- ZeroMemory(to, to_size);
+ memset(to, 0, to_size);
// Use the native conversion routines when available
if (bHasCP_UTF8) {
size_t inlen = mir_strlen(from) + 1;
WCHAR *wszTemp = (WCHAR*)_alloca(inlen * sizeof(WCHAR));
- ZeroMemory(wszTemp, inlen * sizeof(WCHAR));
+ memset(wszTemp, 0, (inlen * sizeof(WCHAR)));
// Convert the UTF-8 string to UCS
if (MultiByteToWideChar(CP_UTF8, 0, from, -1, wszTemp, (int)inlen)) {
@@ -460,7 +460,7 @@ WCHAR* __stdcall ansi_to_unicode(const char *ansi) char* __stdcall unicode_to_ansi_static(const WCHAR *unicode, char *ansi, size_t ansi_size)
{
- ZeroMemory(ansi, ansi_size);
+ memset(ansi, 0, ansi_size);
if (WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode, (int)mir_wstrlen(unicode), ansi, (int)ansi_size, NULL, NULL) > 1)
return ansi;
diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp index 32df7bae33..6afa3fef6f 100644 --- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp @@ -27,7 +27,7 @@ static void file_buildProtoFileTransferStatus(filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
- ZeroMemory(pfts, sizeof(PROTOFILETRANSFERSTATUS));
+ memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF | (ft->sending ? PFTS_SENDING : PFTS_RECEIVING); /* Standard FT is Ansi only */
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 2e4f3045de..158f76ffc6 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -93,7 +93,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : HookProtoEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
// Initialize status message struct
- ZeroMemory(&m_modeMsgs, sizeof(icq_mode_messages));
+ memset(&m_modeMsgs, 0, sizeof(icq_mode_messages));
m_modeMsgsMutex = new icq_critical_section();
connectionHandleMutex = new icq_critical_section();
localSeqMutex = new icq_critical_section();
@@ -1023,7 +1023,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts, // This is kinda messy, but there is no simple way to do it. First
// we need to calculate the length of the packet.
contacts = (struct icq_contactsend_s*)_alloca(sizeof(struct icq_contactsend_s)*nContacts);
- ZeroMemory(contacts, sizeof(struct icq_contactsend_s)*nContacts);
+ memset(contacts, 0, (sizeof(struct icq_contactsend_s) * nContacts));
size_t nDataLen = 0, nNamesLen = 0;
for (i = 0; i < nContacts; i++) {
@@ -1138,7 +1138,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int flags, int nContacts, // This is kinda messy, but there is no simple way to do it. First
// we need to calculate the length of the packet.
contacts = (struct icq_contactsend_s*)_alloca(sizeof(struct icq_contactsend_s)*nContacts);
- ZeroMemory(contacts, sizeof(struct icq_contactsend_s)*nContacts);
+ memset(contacts, 0, (sizeof(struct icq_contactsend_s) * nContacts));
{
size_t nBodyLength = 0;
for (i = 0; i < nContacts; i++) {
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 94356f5602..5ea930f0b7 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -110,7 +110,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) while (serverThreadHandle) {
if (info.bReinitRecver) { // we reconnected, reinit struct
info.bReinitRecver = false;
- ZeroMemory(&packetRecv, sizeof(packetRecv));
+ memset(&packetRecv, 0, sizeof(packetRecv));
packetRecv.cbSize = sizeof(packetRecv);
packetRecv.dwTimeout = 1000;
}
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index c656024087..ade1819f0b 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -1031,7 +1031,7 @@ void CIcqProto::oftFileResume(oscar_filetransfer *ft, int action, const TCHAR *s static void oft_buildProtoFileTransferStatus(oscar_filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts)
{
- ZeroMemory(pfts, sizeof(PROTOFILETRANSFERSTATUS));
+ memset(pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts->cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts->hContact = ft->hContact;
pfts->flags = PFTS_UTF + ((ft->flags & OFTF_SENDING) ? PFTS_SENDING : PFTS_RECEIVING);
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 32e8baa7c8..b452758539 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -1397,7 +1397,7 @@ void* __fastcall SAFE_MALLOC(size_t size) if (size) {
p = malloc(size);
if (p)
- ZeroMemory(p, size);
+ memset(p, 0, size);
}
return p;
}
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 7e20519a89..9b24a941d7 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -292,7 +292,7 @@ struct CJabberHttpAuthParams TCHAR *m_szUrl;
CJabberHttpAuthParams()
{
- ZeroMemory(this, sizeof(CJabberHttpAuthParams));
+ memset(this, 0, sizeof(CJabberHttpAuthParams));
}
~CJabberHttpAuthParams()
{
@@ -306,7 +306,7 @@ struct CJabberHttpAuthParams mir_free(m_szId);
mir_free(m_szMethod);
mir_free(m_szUrl);
- ZeroMemory(this, sizeof(CJabberHttpAuthParams));
+ memset(this, 0, sizeof(CJabberHttpAuthParams));
}
};
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 72be7ad08d..40cb7df0f8 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -130,7 +130,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) if (!(hExistingDbEvent = db_event_first(hContact)))
return FALSE;
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
dwEventTimeStamp = dbeiExisting.timestamp;
@@ -148,7 +148,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) // check for equal timestamps
if (dbei.timestamp == dwPreviousTimeStamp) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hPreviousDbEvent, &dbeiExisting);
@@ -161,7 +161,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) // find event with another timestamp
hExistingDbEvent = db_event_next(hContact, hPreviousDbEvent);
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -182,7 +182,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) if (dbei.timestamp <= dwPreviousTimeStamp) {
// look back
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
@@ -212,7 +212,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) else {
// look forward
while (hExistingDbEvent != NULL) {
- ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ memset(&dbeiExisting, 0, sizeof(dbeiExisting));
dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 52fd10c3f0..beddbee510 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -374,7 +374,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b for (i=0; i<40 && buffer[i+5]==str[i]; i++);
mir_free(str);
- ZeroMemory(data, 10);
+ memset(data, 0, sizeof(data));
data[1] = (i>=20)?0:2;
data[0] = 5;
data[3] = 1;
@@ -506,7 +506,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch // 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
BYTE data[47];
- ZeroMemory(data, sizeof(data));
+ memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
@@ -701,7 +701,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char // 45-46 dst.port (0)
if (datalen == 2 && buffer[0] == 5 && buffer[1] == 0) {
BYTE data[47];
- ZeroMemory(data, sizeof(data));
+ memset(data, 0, sizeof(data));
*((DWORD*)data) = 0x03000105;
data[4] = 40;
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index bfb4bc8a76..73e75d5faf 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -996,7 +996,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) lvhti.pt.x = rcCtl.left + 5;
lvhti.pt.y = rcHdr.bottom + 5;
int iFirst = ListView_HitTest(hwndList, &lvhti);
- ZeroMemory(&lvhti, sizeof(lvhti));
+ memset(&lvhti, 0, sizeof(lvhti));
lvhti.pt.x = rcCtl.left + 5;
lvhti.pt.y = rcCtl.bottom - 5;
int iLast = ListView_HitTest(hwndList, &lvhti);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 24db2e9e5f..e221abd5b1 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -143,7 +143,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) if ((bDirect || bProxy) && !_tcscmp(xmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
- ZeroMemory(jbt, sizeof(JABBER_BYTE_TRANSFER));
+ memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
jbt->srcJID = mir_tstrdup(pInfo->m_szTo);
jbt->dstJID = mir_tstrdup(pInfo->m_szFrom);
jbt->sid = mir_tstrdup(ft->sid);
@@ -156,7 +156,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) }
else if (!_tcscmp(xmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof (JABBER_IBB_TRANSFER));
- ZeroMemory(jibb, sizeof(JABBER_IBB_TRANSFER));
+ memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
jibb->dstJID = mir_tstrdup(pInfo->m_szFrom);
jibb->sid = mir_tstrdup(ft->sid);
@@ -434,7 +434,7 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo) if ((sid = xmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
- ZeroMemory(jbt, sizeof(JABBER_BYTE_TRANSFER));
+ memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
jbt->iqNode = xi.copyNode(iqNode);
jbt->pfnRecv = &CJabberProto::FtReceive;
jbt->pfnFinal = &CJabberProto::FtReceiveFinal;
@@ -478,7 +478,7 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen) if (bOpen) {
if (!item->jibb) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof(JABBER_IBB_TRANSFER));
- ZeroMemory(jibb, sizeof(JABBER_IBB_TRANSFER));
+ memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(from);
jibb->dstJID = mir_tstrdup(to);
jibb->sid = mir_tstrdup(sid);
diff --git a/protocols/JabberG/src/jabber_presence_manager.h b/protocols/JabberG/src/jabber_presence_manager.h index 9b33288192..93a0c2757f 100644 --- a/protocols/JabberG/src/jabber_presence_manager.h +++ b/protocols/JabberG/src/jabber_presence_manager.h @@ -49,7 +49,7 @@ public: CJabberPresenceInfo()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
~CJabberPresenceInfo()
{
@@ -72,7 +72,7 @@ class CJabberPresencePermanentInfo public:
CJabberPresencePermanentInfo()
{
- ZeroMemory(this, sizeof(CJabberPresencePermanentInfo));
+ memset(this, 0, sizeof(CJabberPresencePermanentInfo));
}
~CJabberPresencePermanentInfo()
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h index 806b42839f..86cd472cc5 100644 --- a/protocols/JabberG/src/jabber_rc.h +++ b/protocols/JabberG/src/jabber_rc.h @@ -111,7 +111,7 @@ protected: public:
CJabberAdhocNode(CJabberProto* pProto, TCHAR* szJid, TCHAR* szNode, TCHAR* szName, JABBER_ADHOC_HANDLER pHandler)
{
- ZeroMemory(this, sizeof(CJabberAdhocNode));
+ memset(this, 0, sizeof(CJabberAdhocNode));
replaceStrT(m_szJid, szJid);
replaceStrT(m_szNode, szNode);
replaceStrT(m_szName, szName);
diff --git a/protocols/JabberG/src/jabber_send_manager.h b/protocols/JabberG/src/jabber_send_manager.h index 375b279b05..75e23956b4 100644 --- a/protocols/JabberG/src/jabber_send_manager.h +++ b/protocols/JabberG/src/jabber_send_manager.h @@ -49,7 +49,7 @@ public: CJabberSendInfo()
{
- ZeroMemory(this, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
~CJabberSendInfo()
{
@@ -73,7 +73,7 @@ class CJabberSendPermanentInfo public:
CJabberSendPermanentInfo()
{
- ZeroMemory(this, sizeof(CJabberSendPermanentInfo));
+ memset(this, 0, sizeof(CJabberSendPermanentInfo));
}
~CJabberSendPermanentInfo()
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index e214f6dbe1..b2dd0a460a 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1174,7 +1174,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (!pParams)
return;
- ZeroMemory(pParams, sizeof(CJabberHttpAuthParams));
+ memset(pParams, 0, sizeof(CJabberHttpAuthParams));
pParams->m_nType = CJabberHttpAuthParams::MSG;
pParams->m_szFrom = mir_tstrdup(from);
LPCTSTR ptszThread = xmlGetText(xmlGetChild(node, "thread"));
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index dad25263b6..a6a550ea7f 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -441,7 +441,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_USERDETAILS)); dat = (JabberUserInfoDlgData *)mir_alloc(sizeof(JabberUserInfoDlgData)); - ZeroMemory(dat, sizeof(JabberUserInfoDlgData)); + memset(dat, 0, sizeof(JabberUserInfoDlgData)); dat->resourcesCount = -1; if (CallService(MS_DB_CONTACT_IS, (WPARAM)lParam, 0)) diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 58f55518cd..0dcbfca763 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1205,7 +1205,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s TCHAR *szListeningTo;
if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) {
LISTENINGTOINFO li;
- ZeroMemory(&li, sizeof(li));
+ memset(&li, 0, sizeof(li));
li.cbSize = sizeof(li);
li.dwFlags = LTI_TCHAR;
li.ptszArtist = (TCHAR*)szArtist;
diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index 9718015fdf..f20062aff5 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -1643,7 +1643,7 @@ HTREEITEM CCtrlTreeView::FindNamedItem(HTREEITEM hItem, const TCHAR *name) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE;
tvi->hItem = hItem;
GetItem(tvi);
@@ -1651,7 +1651,7 @@ void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi) void CCtrlTreeView::GetItem(HTREEITEM hItem, TVITEMEX *tvi, TCHAR *szText, int iTextLength)
{
- ZeroMemory(tvi, sizeof(*tvi));
+ memset(tvi, 0, sizeof(*tvi));
tvi->mask = TVIF_CHILDREN|TVIF_HANDLE|TVIF_IMAGE|TVIF_INTEGRAL|TVIF_PARAM|TVIF_SELECTEDIMAGE|TVIF_STATE|TVIF_TEXT;
tvi->hItem = hItem;
tvi->pszText = szText;
diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index 7a24ed7f70..1e94deb493 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -182,7 +182,7 @@ HANDLE add_contextmenu(MCONTACT) { mi = BlockContactItem();
hMenuBlockContactItem = Menu_AddContactMenuItem(&mi);
- ZeroMemory(&mi, sizeof(mi));
+ memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = -2000005000;
mi.flags = CMIF_TCHAR;
diff --git a/protocols/SkypeClassic/src/debug.cpp b/protocols/SkypeClassic/src/debug.cpp index beb19c6db6..4e7f7fd7b7 100644 --- a/protocols/SkypeClassic/src/debug.cpp +++ b/protocols/SkypeClassic/src/debug.cpp @@ -26,8 +26,8 @@ void init_debug(void) { char *p;
char logfile[MAX_PATH];
- ZeroMemory(logfile, sizeof(logfile));
- p=logfile+GetModuleFileNameA(NULL, logfile, sizeof(logfile));
+ memset(logfile, 0, sizeof(logfile));
+ p=logfile+GetModuleFileNameA(NULL, logfile, SIZEOF(logfile));
if (!(p=strrchr (logfile, '\\'))) p=logfile; else p++;
sprintf (p, "%s_log.txt", SKYPE_PROTONAME);
m_szLogBuf = (char*)calloc (1, (m_iBufSize = INITBUF));
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 3caea3d09f..246e3403a2 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -51,7 +51,7 @@ extern BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD); int RegisterOptions(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp;
- ZeroMemory(&odp, sizeof(odp));
+ memset(&odp, 0, sizeof(odp));
odp.cbSize = sizeof(odp);
odp.hInstance = hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
@@ -401,7 +401,7 @@ INT_PTR CALLBACK OptionsProxyDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPA db_set_w(NULL, SKYPE_PROTONAME, "Port", (unsigned short)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE));
db_set_b(NULL, SKYPE_PROTONAME, "RequiresPassword", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_REQPASS), BM_GETCHECK,0,0)));
db_set_b (NULL, SKYPE_PROTONAME, "UseSkype2Socket", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_USES2S), BM_GETCHECK,0,0)));
- ZeroMemory(buf, sizeof(buf));
+ memset(buf, 0, sizeof(buf));
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, buf, SIZEOF(buf));
db_set_s(NULL, SKYPE_PROTONAME, "Password", buf);
return TRUE;
@@ -853,7 +853,7 @@ INT_PTR CALLBACK DetailsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
- ZeroMemory (&myProfile, sizeof(myProfile));
+ memset(&myProfile, 0, sizeof(myProfile));
SkypeProfile_Load(&myProfile);
if(SkypeInitialized)
SkypeProfile_LoadFromSkype(&myProfile);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 9897d5b873..a872d20484 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -187,12 +187,12 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam) else if (threadData != NULL && strlen(threadData->password) > 0)
password = mir_strdup(threadData->password);
- ZeroMemory(&cookie, sizeof(cookie));
+ memset(&cookie, 0, sizeof(cookie));
if (login != NULL && password != NULL) {
mir_snprintf( form, SIZEOF(form), "username=%s&password=%s", login, password);
headers[0].szName = "Content-Type";
headers[0].szValue = "application/x-www-form-urlencoded";
- ZeroMemory(&req, sizeof(req));
+ memset(&req, 0, sizeof(req));
req.cbSize = sizeof(req);
req.requestType = REQUEST_POST;
req.flags = 0;
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index 6d468591bf..2d00b0a5a7 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -252,7 +252,7 @@ static void TlenGetAvatarThread(void *ptr) { item->newAvatarDownloading = TRUE; } request = replaceTokens(data->proto->threadData->tlenConfig.mailBase, data->proto->threadData->tlenConfig.avatarGet, login, data->proto->threadData->avatarToken, 0, 0); - ZeroMemory(&req, sizeof(req)); + memset(&req, 0, sizeof(req)); req.cbSize = sizeof(req); req.requestType = data->proto->threadData->tlenConfig.avatarGetMthd; req.flags = 0; @@ -391,7 +391,7 @@ void TlenRemoveAvatar(TlenProtocol *proto) { data->proto =proto; data->req = req; request = replaceTokens(proto->threadData->tlenConfig.mailBase, proto->threadData->tlenConfig.avatarRemove, "", proto->threadData->avatarToken, 0, 0); - ZeroMemory(req, sizeof(NETLIBHTTPREQUEST)); + memset(req, 0, sizeof(NETLIBHTTPREQUEST)); req->cbSize = sizeof(NETLIBHTTPREQUEST); req->requestType = proto->threadData->tlenConfig.avatarGetMthd; req->szUrl = request; @@ -415,7 +415,7 @@ void TlenUploadAvatar(TlenProtocol *proto, unsigned char *data, int dataLen, int threadData->proto = proto; req = (NETLIBHTTPREQUEST *)mir_alloc(sizeof(NETLIBHTTPREQUEST)); headers = (NETLIBHTTPHEADER *)mir_alloc(sizeof(NETLIBHTTPHEADER)); - ZeroMemory(req, sizeof(NETLIBHTTPREQUEST)); + memset(req, 0, sizeof(NETLIBHTTPREQUEST)); req->cbSize = sizeof(NETLIBHTTPREQUEST); req->requestType = proto->threadData->tlenConfig.avatarUploadMthd; req->szUrl = request; diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 8791aa76e3..be2fae8617 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -271,7 +271,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) { for (unsigned int i = 0; i < sizeFilter; i++)
if (szFilter[i] == '|') szFilter[i] = 0;
//openfiledia vorbereiten
- ZeroMemory(ofn, sizeof(OPENFILENAMEA));
+ memset(ofn, 0, sizeof(OPENFILENAMEA));
ofn->lStructSize = sizeof(OPENFILENAMEA);
ofn->hwndOwner = hwndDlg;
ofn->lpstrFile = szFile;
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 723431b1d4..748e007aaa 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -381,7 +381,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) { case XFIRE_FOUNDBUDDYS_ID:
{
PROTOSEARCHRESULT psr;
- ZeroMemory(&psr, sizeof(psr));
+ memset(&psr, 0, sizeof(psr));
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
@@ -888,7 +888,7 @@ static int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam) {
/*NETLIB***********************************/
NETLIBUSER nlu;
- ZeroMemory(&nlu, sizeof(nlu));
+ memset(&nlu, 0, sizeof(nlu));
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
nlu.szSettingsModule = protocolname;
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index 16327f356c..c73b469548 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -483,7 +483,7 @@ void CYahooProto::ext_got_file(const char *me, const char *who, const char *url, hContact = add_buddy(who, who, 0 /* NO FT for other IMs */, PALF_TEMPORARY);
char fn[1024];
- ZeroMemory(fn, 1024);
+ memset(fn, 0, sizeof(fn));
if (fname != NULL)
mir_strncpy(fn, fname, 1024);
diff --git a/protocols/Yahoo/src/http_gateway.cpp b/protocols/Yahoo/src/http_gateway.cpp index bbdc47c861..bace76d247 100644 --- a/protocols/Yahoo/src/http_gateway.cpp +++ b/protocols/Yahoo/src/http_gateway.cpp @@ -21,7 +21,7 @@ int YAHOO_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION *nloc, NETLIBHTTPRE debugLogA("YAHOO_httpGatewayInit!!!");
- ZeroMemory(&nlhpi, sizeof(nlhpi));
+ memset(&nlhpi, 0, sizeof(nlhpi));
nlhpi.cbSize = sizeof(nlhpi);
nlhpi.szHttpPostUrl = "http://shttp.msg.yahoo.com/notify/";
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;
|