summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
commitb2fad485cd5b41744ef0cc4a02722c021afd926c (patch)
treeaa19403cd699066600e8306be8ad33e4a17fba6f /plugins/Clist_modern
parentfc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff)
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp27
-rw-r--r--plugins/Clist_modern/src/modern_image_array.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_row.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp6
6 files changed, 31 insertions, 28 deletions
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;