Author: khornicek
Date: Wed Feb 15 10:53:41 2017
New Revision: 73802
URL:
http://svn.reactos.org/svn/reactos?rev=73802&view=rev
Log:
[SPIDER]
- Make the formatting a bit more consistent.
[EVENTVWR]
- Remove an useless cast.
Modified:
trunk/reactos/base/applications/games/spider/spider.cpp
trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
Modified: trunk/reactos/base/applications/games/spider/spider.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/sp…
==============================================================================
--- trunk/reactos/base/applications/games/spider/spider.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/games/spider/spider.cpp [iso-8859-1] Wed Feb 15
10:53:41 2017
@@ -57,21 +57,21 @@
case WM_COMMAND:
switch(LOWORD(wParam))
{
- case IDOK:
- if (IsDlgButtonChecked(hDlg, IDC_DIF_ONECOLOR) == BST_CHECKED)
- dwDifficulty = IDC_DIF_ONECOLOR;
- else if (IsDlgButtonChecked(hDlg, IDC_DIF_TWOCOLORS) == BST_CHECKED)
- dwDifficulty = IDC_DIF_TWOCOLORS;
- else if (IsDlgButtonChecked(hDlg, IDC_DIF_FOURCOLORS) == BST_CHECKED)
- dwDifficulty = IDC_DIF_FOURCOLORS;
-
- NewGame();
- EndDialog(hDlg, TRUE);
- return TRUE;
-
- case IDCANCEL:
- EndDialog(hDlg, FALSE);
- return TRUE;
+ case IDOK:
+ if (IsDlgButtonChecked(hDlg, IDC_DIF_ONECOLOR) == BST_CHECKED)
+ dwDifficulty = IDC_DIF_ONECOLOR;
+ else if (IsDlgButtonChecked(hDlg, IDC_DIF_TWOCOLORS) == BST_CHECKED)
+ dwDifficulty = IDC_DIF_TWOCOLORS;
+ else if (IsDlgButtonChecked(hDlg, IDC_DIF_FOURCOLORS) == BST_CHECKED)
+ dwDifficulty = IDC_DIF_FOURCOLORS;
+
+ NewGame();
+ EndDialog(hDlg, TRUE);
+ return TRUE;
+
+ case IDCANCEL:
+ EndDialog(hDlg, FALSE);
+ return TRUE;
}
break;
}
@@ -122,16 +122,16 @@
MakePath(szHelpPath, MAX_PATH, _T(".hlp"));
hwnd = CreateWindow(szAppName,
- szAppName,
- WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- 0, /*The real size will be computed in WndProc through WM_GETMINMAXINFO
*/
- 0, /* The real size will be computed in WndProc through WM_GETMINMAXINFO
*/
- NULL,
- NULL,
- hInst,
- NULL);
+ szAppName,
+ WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ 0, /*The real size will be computed in WndProc through
WM_GETMINMAXINFO */
+ 0, /* The real size will be computed in WndProc through
WM_GETMINMAXINFO */
+ NULL,
+ NULL,
+ hInst,
+ NULL);
hwndMain = hwnd;
@@ -142,9 +142,9 @@
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIFFICULTY), hwnd, DifficultyDlgProc);
- while(GetMessage(&msg, NULL,0,0))
- {
- if(!TranslateAccelerator(hwnd, hAccelTable, &msg))
+ while (GetMessage(&msg, NULL,0,0))
+ {
+ if (!TranslateAccelerator(hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -153,17 +153,12 @@
return msg.wParam;
}
-LRESULT CALLBACK
-CardImageWndProc(HWND hwnd,
- UINT msg,
- WPARAM wParam,
- LPARAM lParam)
-{
- PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd,
- GWL_USERDATA);
+LRESULT CALLBACK CardImageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ PCARDBACK pCardBack = (PCARDBACK)GetWindowLongPtr(hwnd, GWL_USERDATA);
static WNDPROC hOldProc = NULL;
- if(!pCardBack)
+ if (!pCardBack)
return FALSE;
if (!hOldProc)
@@ -171,55 +166,51 @@
switch (msg)
{
- case WM_PAINT:
- {
- HDC hdc;
- PAINTSTRUCT ps;
- HPEN hPen, hOldPen;
- HBRUSH hBrush, hOldBrush;
- RECT rc;
-
- hdc = BeginPaint(hwnd, &ps);
-
- if (pCardBack->bSelected)
- {
- hPen = CreatePen(PS_SOLID, 2, RGB(0,0,0));
- }
- else
- {
- DWORD Face = GetSysColor(COLOR_3DFACE);
- hPen = CreatePen(PS_SOLID, 2, Face);
- }
-
- GetClientRect(hwnd, &rc);
- hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
- hOldPen = (HPEN)SelectObject(hdc, hPen);
- hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
-
- Rectangle(hdc,
- rc.left+1,
- rc.top+1,
- rc.right,
- rc.bottom);
-
- StretchBlt(hdc,
- 2,
- 2,
- CARDBACK_OPTIONS_WIDTH,
- CARDBACK_OPTIONS_HEIGHT,
- __hdcCardBitmaps,
- pCardBack->hdcNum * __cardwidth,
- 0,
- __cardwidth,
- __cardheight,
- SRCCOPY);
-
- SelectObject(hdc, hOldPen);
- SelectObject(hdc, hOldBrush);
-
- EndPaint(hwnd, &ps);
-
- break;
+ case WM_PAINT:
+ {
+ HDC hdc;
+ PAINTSTRUCT ps;
+ HPEN hPen, hOldPen;
+ HBRUSH hBrush, hOldBrush;
+ RECT rc;
+
+ hdc = BeginPaint(hwnd, &ps);
+
+ if (pCardBack->bSelected)
+ {
+ hPen = CreatePen(PS_SOLID, 2, RGB(0,0,0));
+ }
+ else
+ {
+ DWORD Face = GetSysColor(COLOR_3DFACE);
+ hPen = CreatePen(PS_SOLID, 2, Face);
+ }
+
+ GetClientRect(hwnd, &rc);
+ hBrush = (HBRUSH)GetStockObject(NULL_BRUSH);
+ hOldPen = (HPEN)SelectObject(hdc, hPen);
+ hOldBrush = (HBRUSH)SelectObject(hdc, hBrush);
+
+ Rectangle(hdc, rc.left+1, rc.top+1, rc.right, rc.bottom);
+
+ StretchBlt(hdc,
+ 2,
+ 2,
+ CARDBACK_OPTIONS_WIDTH,
+ CARDBACK_OPTIONS_HEIGHT,
+ __hdcCardBitmaps,
+ pCardBack->hdcNum * __cardwidth,
+ 0,
+ __cardwidth,
+ __cardheight,
+ SRCCOPY);
+
+ SelectObject(hdc, hOldPen);
+ SelectObject(hdc, hOldBrush);
+
+ EndPaint(hwnd, &ps);
+
+ break;
}
case WM_LBUTTONDOWN:
@@ -227,87 +218,73 @@
break;
}
- return CallWindowProc(hOldProc,
- hwnd,
- msg,
- wParam,
- lParam);
-}
-
-
-INT_PTR CALLBACK CardBackDlgProc(HWND hDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam)
+ return CallWindowProc(hOldProc, hwnd, msg, wParam, lParam);
+}
+
+
+INT_PTR CALLBACK CardBackDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static PCARDBACK pCardBacks = NULL;
switch (uMsg)
{
- case WM_INITDIALOG:
- {
- INT i, c;
- SIZE_T size = sizeof(CARDBACK) * NUM_CARDBACKS;
-
- pCardBacks = (PCARDBACK)HeapAlloc(GetProcessHeap(), 0, size);
-
- if(!pCardBacks)
- return FALSE;
-
- for (i = 0, c = CARDBACK_START; c <= CARDBACK_END; i++, c++)
- {
- pCardBacks[i].hSelf = GetDlgItem(hDlg, c);
- pCardBacks[i].bSelected = FALSE;
- pCardBacks[i].hdcNum = CARDBACK_RES_START + i;
- pCardBacks[i].imgNum = i + 1;
- pCardBacks[i].hOldProc = (WNDPROC)SetWindowLongPtr(pCardBacks[i].hSelf,
- GWLP_WNDPROC,
-
(LONG_PTR)CardImageWndProc);
-
- SetWindowLongPtr(pCardBacks[i].hSelf,
- GWL_USERDATA,
- (LONG_PTR)&pCardBacks[i]);
- }
-
- return TRUE;
- }
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
- {
- INT i, num = 0;
- for (i = 0; i < NUM_CARDBACKS; i++)
- {
- if (pCardBacks[i].bSelected)
+ case WM_INITDIALOG:
+ {
+ INT i, c;
+ SIZE_T size = sizeof(CARDBACK) * NUM_CARDBACKS;
+
+ pCardBacks = (PCARDBACK)HeapAlloc(GetProcessHeap(), 0, size);
+
+ if (!pCardBacks)
+ return FALSE;
+
+ for (i = 0, c = CARDBACK_START; c <= CARDBACK_END; i++, c++)
+ {
+ pCardBacks[i].hSelf = GetDlgItem(hDlg, c);
+ pCardBacks[i].bSelected = FALSE;
+ pCardBacks[i].hdcNum = CARDBACK_RES_START + i;
+ pCardBacks[i].imgNum = i + 1;
+ pCardBacks[i].hOldProc = (WNDPROC)SetWindowLongPtr(pCardBacks[i].hSelf,
+ GWLP_WNDPROC,
+
(LONG_PTR)CardImageWndProc);
+
+ SetWindowLongPtr(pCardBacks[i].hSelf, GWL_USERDATA,
(LONG_PTR)&pCardBacks[i]);
+ }
+
+ return TRUE;
+ }
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+ {
+ INT i, num = 0;
+ for (i = 0; i < NUM_CARDBACKS; i++)
{
- num = pCardBacks[i].imgNum;
+ if (pCardBacks[i].bSelected)
+ {
+ num = pCardBacks[i].imgNum;
+ }
}
- }
-
- EndDialog(hDlg, LOWORD(wParam) == IDOK ? num : FALSE);
- HeapFree(GetProcessHeap(), 0, pCardBacks);
- return TRUE;
- }
-
- if (HIWORD(wParam) == STN_CLICKED)
- {
- INT i;
- RECT rc;
- for (i = 0; i < NUM_CARDBACKS; i++)
- {
- if (pCardBacks[i].hSelf == (HWND)lParam)
+
+ EndDialog(hDlg, LOWORD(wParam) == IDOK ? num : FALSE);
+ HeapFree(GetProcessHeap(), 0, pCardBacks);
+ return TRUE;
+ }
+
+ if (HIWORD(wParam) == STN_CLICKED)
+ {
+ INT i;
+ RECT rc;
+ for (i = 0; i < NUM_CARDBACKS; i++)
{
- pCardBacks[i].bSelected = TRUE;
+ pCardBacks[i].bSelected = pCardBacks[i].hSelf == (HWND)lParam;
+
+ GetClientRect(pCardBacks[i].hSelf, &rc);
+ InvalidateRect(pCardBacks[i].hSelf, &rc, TRUE);
}
- else
- pCardBacks[i].bSelected = FALSE;
-
- GetClientRect(pCardBacks[i].hSelf, &rc);
- InvalidateRect(pCardBacks[i].hSelf, &rc, TRUE);
- }
-
- break;
- }
+
+ break;
+ }
}
return FALSE;
@@ -318,10 +295,7 @@
{
INT cardBack;
- if ((cardBack = DialogBox(hInstance,
- MAKEINTRESOURCE(IDD_CARDBACK),
- hwnd,
- CardBackDlgProc)))
+ if ((cardBack = DialogBox(hInstance, MAKEINTRESOURCE(IDD_CARDBACK), hwnd,
CardBackDlgProc)))
{
SpiderWnd.SetBackCardIdx(CARDBACK_RES_START + (cardBack - 1));
SpiderWnd.Redraw();
@@ -332,7 +306,7 @@
{
static int nWidth, nHeight;
- switch(iMsg)
+ switch (iMsg)
{
case WM_CREATE:
{
@@ -373,27 +347,27 @@
}
case WM_COMMAND:
- switch(LOWORD(wParam))
- {
- case IDM_GAME_NEW:
- NewGame();
- return 0;
-
- case IDM_GAME_DECK:
- ShowDeckOptionsDlg(hwnd);
- return 0;
-
- case IDM_HELP_CONTENTS:
- WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY, (DWORD)"How
to play");
- return 0;
-
- case IDM_HELP_ABOUT:
- MessageBox(hwnd, MsgAbout, szAppName, MB_OK|MB_ICONINFORMATION);
- return 0;
-
- case IDM_GAME_EXIT:
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- return 0;
+ switch (LOWORD(wParam))
+ {
+ case IDM_GAME_NEW:
+ NewGame();
+ return 0;
+
+ case IDM_GAME_DECK:
+ ShowDeckOptionsDlg(hwnd);
+ return 0;
+
+ case IDM_HELP_CONTENTS:
+ WinHelp(hwnd, szHelpPath, HELP_CONTENTS, 0);//HELP_KEY,
(DWORD)"How to play");
+ return 0;
+
+ case IDM_HELP_ABOUT:
+ MessageBox(hwnd, MsgAbout, szAppName, MB_OK|MB_ICONINFORMATION);
+ return 0;
+
+ case IDM_GAME_EXIT:
+ PostMessage(hwnd, WM_CLOSE, 0, 0);
+ return 0;
}
return 0;
Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] Wed Feb 15
10:53:41 2017
@@ -1594,7 +1594,7 @@
goto SkipEvent;
/* Get the computer name and filter it */
- lpszComputerName = (LPWSTR)((LPBYTE)pEvlrBuffer + sizeof(EVENTLOGRECORD) +
(wcslen(lpszSourceName) + 1) * sizeof(WCHAR));
+ lpszComputerName = (LPWSTR)(pEvlrBuffer + sizeof(EVENTLOGRECORD) +
(wcslen(lpszSourceName) + 1) * sizeof(WCHAR));
if (!FilterByString(EventLogFilter->ComputerNames, lpszComputerName))
goto SkipEvent;