Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a9933cc2
Commit
a9933cc2
authored
Jul 13, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemine: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c99d5f31
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
dialog.c
programs/winemine/dialog.c
+4
-5
main.c
programs/winemine/main.c
+5
-5
No files found.
programs/winemine/dialog.c
View file @
a9933cc2
...
...
@@ -69,9 +69,8 @@ INT_PTR CALLBACK CongratsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lP
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
)
)
{
case
IDOK
:
GetDlgItemTextW
(
hDlg
,
IDC_EDITNAME
,
p_board
->
best_name
[
p_board
->
difficulty
],
sizeof
(
p_board
->
best_name
[
p_board
->
difficulty
]
)
/
sizeof
(
WCHAR
)
);
GetDlgItemTextW
(
hDlg
,
IDC_EDITNAME
,
p_board
->
best_name
[
p_board
->
difficulty
],
ARRAY_SIZE
(
p_board
->
best_name
[
p_board
->
difficulty
]
));
EndDialog
(
hDlg
,
0
);
return
TRUE
;
...
...
@@ -107,8 +106,8 @@ INT_PTR CALLBACK TimesDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
case
WM_COMMAND
:
switch
(
LOWORD
(
wParam
)
)
{
case
IDC_RESET
:
LoadStringW
(
NULL
,
IDC_CONFIRMTITLE
,
confirm_title
,
sizeof
(
confirm_title
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
NULL
,
IDC_CONFIRMTEXT
,
confirm_text
,
sizeof
(
confirm_text
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
NULL
,
IDC_CONFIRMTITLE
,
confirm_title
,
ARRAY_SIZE
(
confirm_title
)
);
LoadStringW
(
NULL
,
IDC_CONFIRMTEXT
,
confirm_text
,
ARRAY_SIZE
(
confirm_text
)
);
confirm_msgbox_result
=
MessageBoxW
(
hDlg
,
confirm_text
,
confirm_title
,
MB_OKCANCEL
|
MB_DEFBUTTON2
|
MB_ICONWARNING
);
if
(
confirm_msgbox_result
!=
IDOK
)
break
;
...
...
programs/winemine/main.c
View file @
a9933cc2
...
...
@@ -112,7 +112,7 @@ static void LoadBoard( BOARD *p_board )
size
=
sizeof
(
data
);
if
(
RegQueryValueExW
(
hkey
,
key_name
,
NULL
,
&
type
,
(
LPBYTE
)
data
,
&
size
)
==
ERROR_SUCCESS
)
lstrcpynW
(
p_board
->
best_name
[
i
],
data
,
sizeof
(
p_board
->
best_name
[
i
])
/
sizeof
(
WCHAR
)
);
lstrcpynW
(
p_board
->
best_name
[
i
],
data
,
ARRAY_SIZE
(
p_board
->
best_name
[
i
])
);
else
LoadStringW
(
p_board
->
hInst
,
IDS_NOBODY
,
p_board
->
best_name
[
i
],
MAX_PLAYER_NAME_SIZE
+
1
);
}
...
...
@@ -179,7 +179,7 @@ void SaveBoard( BOARD *p_board )
for
(
i
=
0
;
i
<
3
;
i
++
)
{
wsprintfW
(
key_name
,
nameW
,
i
+
1
);
lstrcpynW
(
data
,
p_board
->
best_name
[
i
],
sizeof
(
data
)
/
sizeof
(
WCHAR
)
);
lstrcpynW
(
data
,
p_board
->
best_name
[
i
],
ARRAY_SIZE
(
data
)
);
RegSetValueExW
(
hkey
,
key_name
,
0
,
REG_SZ
,
(
LPBYTE
)
data
,
(
lstrlenW
(
data
)
+
1
)
*
sizeof
(
WCHAR
)
);
}
...
...
@@ -1003,8 +1003,8 @@ static LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
case
IDM_ABOUT
:
{
WCHAR
appname
[
256
],
other
[
256
];
LoadStringW
(
board
.
hInst
,
IDS_APPNAME
,
appname
,
sizeof
(
appname
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
board
.
hInst
,
IDS_ABOUT
,
other
,
sizeof
(
other
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
board
.
hInst
,
IDS_APPNAME
,
appname
,
ARRAY_SIZE
(
appname
)
);
LoadStringW
(
board
.
hInst
,
IDS_ABOUT
,
other
,
ARRAY_SIZE
(
other
)
);
ShellAboutW
(
hWnd
,
appname
,
other
,
LoadImageW
(
board
.
hInst
,
MAKEINTRESOURCEW
(
IDI_WINEMINE
),
IMAGE_ICON
,
48
,
48
,
LR_SHARED
));
return
0
;
...
...
@@ -1025,7 +1025,7 @@ int WINAPI wWinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int c
HACCEL
haccel
;
WCHAR
appname
[
20
];
LoadStringW
(
hInst
,
IDS_APPNAME
,
appname
,
sizeof
(
appname
)
/
sizeof
(
WCHAR
));
LoadStringW
(
hInst
,
IDS_APPNAME
,
appname
,
ARRAY_SIZE
(
appname
));
wc
.
cbSize
=
sizeof
(
wc
);
wc
.
style
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment