Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
038d9e8a
Commit
038d9e8a
authored
Aug 10, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhlp32: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c33c75fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
macro.c
programs/winhlp32/macro.c
+1
-1
macro.lex.l
programs/winhlp32/macro.lex.l
+4
-4
winhelp.c
programs/winhlp32/winhelp.c
+3
-3
No files found.
programs/winhlp32/macro.c
View file @
038d9e8a
...
...
@@ -154,7 +154,7 @@ void CALLBACK MACRO_About(void)
WCHAR
name
[
256
];
HICON
icon
=
LoadImageW
(
Globals
.
hInstance
,
MAKEINTRESOURCEW
(
IDI_WINHELP
),
IMAGE_ICON
,
48
,
48
,
LR_SHARED
);
LoadStringW
(
Globals
.
hInstance
,
STID_WINE_HELP
,
name
,
sizeof
(
name
)
/
sizeof
(
WCHAR
)
);
LoadStringW
(
Globals
.
hInstance
,
STID_WINE_HELP
,
name
,
ARRAY_SIZE
(
name
)
);
ShellAboutW
(
MACRO_CurrentWindow
()
->
hMainWnd
,
name
,
NULL
,
icon
);
}
...
...
programs/winhlp32/macro.lex.l
View file @
038d9e8a
...
...
@@ -75,7 +75,7 @@ struct lexret yylval;
/* opening a new one */
if (lex_data->quote_stk_idx == 0)
{
assert(lex_data->cache_used <
sizeof(lex_data->cache_string) / sizeof(lex_data->cache_string[0]
));
assert(lex_data->cache_used <
ARRAY_SIZE(lex_data->cache_string
));
lex_data->strptr = lex_data->cache_string[lex_data->cache_used] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data->macroptr) + 1);
yylval.string = lex_data->strptr;
lex_data->cache_used++;
...
...
@@ -83,7 +83,7 @@ struct lexret yylval;
}
else *lex_data->strptr++ = yytext[0];
lex_data->quote_stack[lex_data->quote_stk_idx++] = yytext[0];
assert(lex_data->quote_stk_idx <
sizeof(lex_data->quote_stack) / sizeof(lex_data->quote_stack[0]
));
assert(lex_data->quote_stk_idx <
ARRAY_SIZE(lex_data->quote_stack
));
}
else
{
...
...
@@ -222,7 +222,7 @@ CheckArgs_end:
static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret)
{
void* pa[2];
int idx = MACRO_CheckArgs(pa,
sizeof(pa)/sizeof(pa[0]
), args);
int idx = MACRO_CheckArgs(pa,
ARRAY_SIZE(pa
), args);
if (idx < 0) return 0;
if (!fn) return 1;
...
...
@@ -257,7 +257,7 @@ static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret)
static int MACRO_CallVoidFunc(void *fn, const char* args)
{
void* pa[6];
int idx = MACRO_CheckArgs(pa,
sizeof(pa)/sizeof(pa[0]
), args);
int idx = MACRO_CheckArgs(pa,
ARRAY_SIZE(pa
), args);
if (idx < 0) return 0;
if (!fn) return 1;
...
...
programs/winhlp32/winhelp.c
View file @
038d9e8a
...
...
@@ -595,7 +595,7 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage)
if
(
!
Globals
.
history
.
index
||
Globals
.
history
.
set
[
0
].
page
!=
wpage
->
page
)
{
num
=
sizeof
(
Globals
.
history
.
set
)
/
sizeof
(
Globals
.
history
.
set
[
0
]
);
num
=
ARRAY_SIZE
(
Globals
.
history
.
set
);
/* we're full, remove latest entry */
if
(
Globals
.
history
.
index
==
num
)
{
...
...
@@ -610,7 +610,7 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage)
}
if
(
win
->
hHistoryWnd
)
InvalidateRect
(
win
->
hHistoryWnd
,
NULL
,
TRUE
);
num
=
sizeof
(
win
->
back
.
set
)
/
sizeof
(
win
->
back
.
set
[
0
]
);
num
=
ARRAY_SIZE
(
win
->
back
.
set
);
if
(
win
->
back
.
index
==
num
)
{
/* we're full, remove latest entry */
...
...
@@ -1136,7 +1136,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
GetWindowRect
(
hWnd
,
&
r
);
r
.
right
=
r
.
left
+
30
*
tm
.
tmAveCharWidth
;
r
.
bottom
=
r
.
top
+
(
sizeof
(
Globals
.
history
.
set
)
/
sizeof
(
Globals
.
history
.
set
[
0
])
)
*
tm
.
tmHeight
;
r
.
bottom
=
r
.
top
+
ARRAY_SIZE
(
Globals
.
history
.
set
)
*
tm
.
tmHeight
;
AdjustWindowRect
(
&
r
,
GetWindowLongW
(
hWnd
,
GWL_STYLE
),
FALSE
);
if
(
r
.
left
<
0
)
{
r
.
right
-=
r
.
left
;
r
.
left
=
0
;}
if
(
r
.
top
<
0
)
{
r
.
bottom
-=
r
.
top
;
r
.
top
=
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