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
2db27725
Commit
2db27725
authored
Jun 01, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Don't allow unions passed by value or floating point returns for interpreted functions.
parent
82d3ea86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
typegen.c
tools/widl/typegen.c
+25
-3
No files found.
tools/widl/typegen.c
View file @
2db27725
...
@@ -933,11 +933,33 @@ static unsigned int write_procformatstring_type(FILE *file, int indent,
...
@@ -933,11 +933,33 @@ static unsigned int write_procformatstring_type(FILE *file, int indent,
int
is_interpreted_func
(
const
type_t
*
iface
,
const
var_t
*
func
)
int
is_interpreted_func
(
const
type_t
*
iface
,
const
var_t
*
func
)
{
{
const
char
*
str
;
const
char
*
str
;
const
var_t
*
var
;
const
var_list_t
*
args
=
type_get_function_args
(
func
->
type
);
const
type_t
*
ret_type
=
type_function_get_rettype
(
func
->
type
);
const
type_t
*
ret_type
=
type_function_get_rettype
(
func
->
type
);
/* return value must fit in a long_ptr for interpreted functions */
if
(
type_get_type
(
ret_type
)
==
TYPE_BASIC
)
if
(
type_get_type
(
ret_type
)
==
TYPE_BASIC
&&
type_memsize
(
ret_type
)
>
pointer_size
)
{
return
0
;
switch
(
type_basic_get_type
(
ret_type
))
{
case
TYPE_BASIC_INT64
:
case
TYPE_BASIC_HYPER
:
/* return value must fit in a long_ptr */
if
(
pointer_size
<
8
)
return
0
;
break
;
case
TYPE_BASIC_FLOAT
:
case
TYPE_BASIC_DOUBLE
:
/* floating point values can't be returned */
return
0
;
default:
break
;
}
}
/* unions passed by value are not supported */
if
(
args
)
LIST_FOR_EACH_ENTRY
(
var
,
args
,
const
var_t
,
entry
)
if
(
type_get_type
(
var
->
type
)
==
TYPE_UNION
||
type_get_type
(
var
->
type
)
==
TYPE_ENCAPSULATED_UNION
)
return
0
;
if
((
str
=
get_attrp
(
func
->
attrs
,
ATTR_OPTIMIZE
)))
return
!
strcmp
(
str
,
"i"
);
if
((
str
=
get_attrp
(
func
->
attrs
,
ATTR_OPTIMIZE
)))
return
!
strcmp
(
str
,
"i"
);
if
((
str
=
get_attrp
(
iface
->
attrs
,
ATTR_OPTIMIZE
)))
return
!
strcmp
(
str
,
"i"
);
if
((
str
=
get_attrp
(
iface
->
attrs
,
ATTR_OPTIMIZE
)))
return
!
strcmp
(
str
,
"i"
);
return
0
;
return
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