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
bf0c37d5
Commit
bf0c37d5
authored
Dec 13, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Zero-initialize [out] structures and unions that contain pointers.
parent
8cc5561f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
typegen.c
tools/widl/typegen.c
+15
-2
No files found.
tools/widl/typegen.c
View file @
bf0c37d5
...
...
@@ -4588,6 +4588,7 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char
int
in_attr
,
out_attr
;
int
i
=
0
,
sep
=
0
;
const
var_t
*
var
;
type_t
*
ref
;
if
(
!
type_get_function_args
(
func
->
type
))
return
;
...
...
@@ -4646,7 +4647,8 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char
break
;
case
TGT_POINTER
:
fprintf
(
file
,
" = &%s_W%u;
\n
"
,
local_var_prefix
,
i
);
switch
(
typegen_detect_type
(
type_pointer_get_ref
(
var
->
type
),
var
->
attrs
,
TDT_IGNORE_STRINGS
))
ref
=
type_pointer_get_ref
(
var
->
type
);
switch
(
typegen_detect_type
(
ref
,
var
->
attrs
,
TDT_IGNORE_STRINGS
))
{
case
TGT_BASIC
:
case
TGT_ENUM
:
...
...
@@ -4659,9 +4661,20 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char
print_file
(
file
,
indent
,
"memset(&%s_W%u, 0, sizeof(%s_W%u));
\n
"
,
local_var_prefix
,
i
,
local_var_prefix
,
i
);
break
;
case
TGT_ARRAY
:
if
(
type_array_is_decl_as_ptr
(
ref
))
{
print_file
(
file
,
indent
,
"%s_W%u = 0;
\n
"
,
local_var_prefix
,
i
);
break
;
}
ref
=
type_array_get_element
(
ref
);
/* fall through */
case
TGT_STRUCT
:
case
TGT_UNION
:
case
TGT_ARRAY
:
if
(
type_has_pointers
(
ref
))
print_file
(
file
,
indent
,
"memset(&%s_W%u, 0, sizeof(%s_W%u));
\n
"
,
local_var_prefix
,
i
,
local_var_prefix
,
i
);
break
;
case
TGT_CTXT_HANDLE
:
case
TGT_CTXT_HANDLE_POINTER
:
case
TGT_INVALID
:
...
...
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