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
1965332d
Commit
1965332d
authored
Aug 08, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serialui: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8c430a82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
confdlg.c
dlls/serialui/confdlg.c
+7
-7
No files found.
dlls/serialui/confdlg.c
View file @
1965332d
...
...
@@ -214,7 +214,7 @@ static BOOL SERIALUI_MakeBaudDword(LPDWORD lpdwBaudRate)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
(
sizeof
(
SERIALUI_BaudConvertTable
)
/
sizeof
(
DWORD
)
);
i
+=
2
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
SERIALUI_BaudConvertTable
);
i
+=
2
)
{
if
(
*
lpdwBaudRate
==
SERIALUI_BaudConvertTable
[
i
])
{
...
...
@@ -229,7 +229,7 @@ static BOOL SERIALUI_MakeBaudEnum(LPDWORD lpdwBaudRate)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
(
sizeof
(
SERIALUI_BaudConvertTable
)
/
sizeof
(
DWORD
)
);
i
+=
2
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
SERIALUI_BaudConvertTable
);
i
+=
2
)
{
if
(
*
lpdwBaudRate
==
SERIALUI_BaudConvertTable
[
i
+
1
])
{
...
...
@@ -352,8 +352,8 @@ static INT_PTR CALLBACK SERIALUI_ConfigDialogProc(HWND hWnd, UINT uMsg, WPARAM w
if
(
!
info
)
return
FALSE
;
SetWindowLongPtrW
(
hWnd
,
DWLP_USER
,
lParam
);
GetWindowTextW
(
hWnd
,
format
,
sizeof
(
format
)
/
sizeof
(
WCHAR
));
snprintfW
(
szTitle
,
sizeof
(
szTitle
)
/
sizeof
(
WCHAR
),
format
,
info
->
lpszDevice
);
GetWindowTextW
(
hWnd
,
format
,
ARRAY_SIZE
(
format
));
snprintfW
(
szTitle
,
ARRAY_SIZE
(
szTitle
),
format
,
info
->
lpszDevice
);
SetWindowTextW
(
hWnd
,
szTitle
);
SERIALUI_DCBToDialogInfo
(
hWnd
,
info
);
return
TRUE
;
...
...
@@ -501,7 +501,7 @@ BOOL WINAPI drvSetDefaultCommConfigW(
if
(
r
!=
ERROR_SUCCESS
)
return
FALSE
;
snprintfW
(
szKeyName
,
sizeof
(
szKeyName
)
/
sizeof
(
WCHAR
),
fmt
,
lpszCommKey
,
lpszDevice
);
snprintfW
(
szKeyName
,
ARRAY_SIZE
(
szKeyName
),
fmt
,
lpszCommKey
,
lpszDevice
);
r
=
RegCreateKeyW
(
hKeyReg
,
szKeyName
,
&
hKeyPort
);
if
(
r
==
ERROR_SUCCESS
)
{
...
...
@@ -556,7 +556,7 @@ DWORD WINAPI drvGetDefaultCommConfigW(
}
/* only "com1" - "com9" is allowed */
r
=
sizeof
(
comW
)
/
sizeof
(
WCHAR
);
/* len of "com\0" */
r
=
ARRAY_SIZE
(
comW
);
/* len of "com\0" */
lstrcpynW
(
szKeyName
,
lpszDevice
,
r
);
/* simulate a lstrcmpnW */
r
--
;
...
...
@@ -574,7 +574,7 @@ DWORD WINAPI drvGetDefaultCommConfigW(
r
=
RegConnectRegistryW
(
NULL
,
HKEY_LOCAL_MACHINE
,
&
hKeyReg
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
snprintfW
(
szKeyName
,
sizeof
(
szKeyName
)
/
sizeof
(
WCHAR
),
fmt
,
lpszCommKey
,
lpszDevice
);
snprintfW
(
szKeyName
,
ARRAY_SIZE
(
szKeyName
),
fmt
,
lpszCommKey
,
lpszDevice
);
r
=
RegOpenKeyW
(
hKeyReg
,
szKeyName
,
&
hKeyPort
);
if
(
r
==
ERROR_SUCCESS
)
{
...
...
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