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
f140ad6e
Commit
f140ad6e
authored
Jul 13, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wscript: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9933cc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
host.c
programs/wscript/host.c
+3
-3
main.c
programs/wscript/main.c
+4
-4
No files found.
programs/wscript/host.c
View file @
f140ad6e
...
@@ -84,7 +84,7 @@ static void print_string(const WCHAR *string)
...
@@ -84,7 +84,7 @@ static void print_string(const WCHAR *string)
ret
=
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
string
,
len
,
&
count
,
NULL
);
ret
=
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
string
,
len
,
&
count
,
NULL
);
if
(
ret
)
{
if
(
ret
)
{
static
const
WCHAR
crnlW
[]
=
{
'\r'
,
'\n'
};
static
const
WCHAR
crnlW
[]
=
{
'\r'
,
'\n'
};
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
crnlW
,
sizeof
(
crnlW
)
/
sizeof
(
*
crnlW
),
&
count
,
NULL
);
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
crnlW
,
ARRAY_SIZE
(
crnlW
),
&
count
,
NULL
);
return
;
return
;
}
}
...
@@ -183,7 +183,7 @@ static HRESULT WINAPI Host_get_FullName(IHost *iface, BSTR *out_Path)
...
@@ -183,7 +183,7 @@ static HRESULT WINAPI Host_get_FullName(IHost *iface, BSTR *out_Path)
WINE_TRACE
(
"(%p)
\n
"
,
out_Path
);
WINE_TRACE
(
"(%p)
\n
"
,
out_Path
);
if
(
GetModuleFileNameW
(
NULL
,
fullPath
,
sizeof
(
fullPath
)
/
sizeof
(
WCHAR
))
==
0
)
if
(
GetModuleFileNameW
(
NULL
,
fullPath
,
ARRAY_SIZE
(
fullPath
))
==
0
)
return
E_FAIL
;
return
E_FAIL
;
if
(
!
(
*
out_Path
=
SysAllocString
(
fullPath
)))
if
(
!
(
*
out_Path
=
SysAllocString
(
fullPath
)))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -198,7 +198,7 @@ static HRESULT WINAPI Host_get_Path(IHost *iface, BSTR *out_Path)
...
@@ -198,7 +198,7 @@ static HRESULT WINAPI Host_get_Path(IHost *iface, BSTR *out_Path)
WINE_TRACE
(
"(%p)
\n
"
,
out_Path
);
WINE_TRACE
(
"(%p)
\n
"
,
out_Path
);
if
(
GetModuleFileNameW
(
NULL
,
path
,
sizeof
(
path
)
/
sizeof
(
WCHAR
))
==
0
)
if
(
GetModuleFileNameW
(
NULL
,
path
,
ARRAY_SIZE
(
path
))
==
0
)
return
E_FAIL
;
return
E_FAIL
;
pos
=
strrchrW
(
path
,
'\\'
);
pos
=
strrchrW
(
path
,
'\\'
);
howMany
=
pos
-
path
;
howMany
=
pos
-
path
;
...
...
programs/wscript/main.c
View file @
f140ad6e
...
@@ -253,7 +253,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
...
@@ -253,7 +253,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
if
(
res
!=
ERROR_SUCCESS
)
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
return
FALSE
;
size
=
sizeof
(
fileid
)
/
sizeof
(
WCHAR
);
size
=
ARRAY_SIZE
(
fileid
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
fileid
,
&
size
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
fileid
,
&
size
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
if
(
res
!=
ERROR_SUCCESS
)
...
@@ -266,7 +266,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
...
@@ -266,7 +266,7 @@ static BOOL get_engine_clsid(const WCHAR *ext, CLSID *clsid)
if
(
res
!=
ERROR_SUCCESS
)
if
(
res
!=
ERROR_SUCCESS
)
return
FALSE
;
return
FALSE
;
size
=
sizeof
(
progid
)
/
sizeof
(
WCHAR
);
size
=
ARRAY_SIZE
(
progid
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
progid
,
&
size
);
res
=
RegQueryValueW
(
hkey
,
NULL
,
progid
,
&
size
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
if
(
res
!=
ERROR_SUCCESS
)
...
@@ -446,8 +446,8 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
...
@@ -446,8 +446,8 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cm
WINE_FIXME
(
"No file name specified
\n
"
);
WINE_FIXME
(
"No file name specified
\n
"
);
return
1
;
return
1
;
}
}
res
=
GetFullPathNameW
(
filename
,
sizeof
(
scriptFullName
)
/
sizeof
(
WCHAR
),
scriptFullName
,
&
filepart
);
res
=
GetFullPathNameW
(
filename
,
ARRAY_SIZE
(
scriptFullName
),
scriptFullName
,
&
filepart
);
if
(
!
res
||
res
>
sizeof
(
scriptFullName
)
/
sizeof
(
WCHAR
))
if
(
!
res
||
res
>
ARRAY_SIZE
(
scriptFullName
))
return
1
;
return
1
;
ext
=
strrchrW
(
filepart
,
'.'
);
ext
=
strrchrW
(
filepart
,
'.'
);
...
...
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