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
b88d82a1
Commit
b88d82a1
authored
Apr 22, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Pass the actual type into check_remoting_fields and check_field_common…
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
parent
b81904b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
parser.y
tools/widl/parser.y
+16
-13
No files found.
tools/widl/parser.y
View file @
b88d82a1
...
@@ -2427,15 +2427,23 @@ static const attr_list_t *check_coclass_attrs(const char *name, const attr_list_
...
@@ -2427,15 +2427,23 @@ static const attr_list_t *check_coclass_attrs(const char *name, const attr_list_
return attrs;
return attrs;
}
}
static void check_remoting_fields(type_t *type);
static void check_remoting_fields(
const var_t *var,
type_t *type);
/* checks that properties common to fields and arguments are consistent */
/* checks that properties common to fields and arguments are consistent */
static void check_field_common(const
char
*container_type,
static void check_field_common(const
type_t
*container_type,
const char *container_name, const var_t *arg)
const char *container_name, const var_t *arg)
{
{
type_t *type = arg->type;
type_t *type = arg->type;
int is_wire_marshal = 0;
int is_wire_marshal = 0;
int is_context_handle = 0;
int is_context_handle = 0;
const char *container_type_name = NULL;
if (is_struct(container_type->type))
container_type_name = "struct";
else if (is_union(container_type->type))
container_type_name = "union";
else if (container_type->type == RPC_FC_FUNCTION)
container_type_name = "function";
if (is_attr(arg->attrs, ATTR_LENGTHIS) &&
if (is_attr(arg->attrs, ATTR_LENGTHIS) &&
(is_attr(arg->attrs, ATTR_STRING) || is_aliaschain_attr(arg->type, ATTR_STRING)))
(is_attr(arg->attrs, ATTR_STRING) || is_aliaschain_attr(arg->type, ATTR_STRING)))
...
@@ -2465,16 +2473,15 @@ static void check_field_common(const char *container_type,
...
@@ -2465,16 +2473,15 @@ static void check_field_common(const char *container_type,
}
}
if (type->type == 0 && !is_attr(arg->attrs, ATTR_IIDIS) && !is_wire_marshal && !is_context_handle)
if (type->type == 0 && !is_attr(arg->attrs, ATTR_IIDIS) && !is_wire_marshal && !is_context_handle)
error_loc_info(&arg->loc_info, "parameter \'%s\' of %s \'%s\' cannot derive from void *\n", arg->name, container_type, container_name);
error_loc_info(&arg->loc_info, "parameter \'%s\' of %s \'%s\' cannot derive from void *\n", arg->name, container_type
_name
, container_name);
else if (type->type == RPC_FC_FUNCTION)
else if (type->type == RPC_FC_FUNCTION)
error_loc_info(&arg->loc_info, "parameter \'%s\' of %s \'%s\' cannot be a function pointer\n", arg->name, container_type, container_name);
error_loc_info(&arg->loc_info, "parameter \'%s\' of %s \'%s\' cannot be a function pointer\n", arg->name, container_type
_name
, container_name);
else if (!is_wire_marshal && (is_struct(type->type) || is_union(type->type)))
else if (!is_wire_marshal && (is_struct(type->type) || is_union(type->type)))
check_remoting_fields(type);
check_remoting_fields(
arg,
type);
}
}
static void check_remoting_fields(type_t *type)
static void check_remoting_fields(
const var_t *var,
type_t *type)
{
{
const char *container_type = NULL;
const var_t *field;
const var_t *field;
const var_list_t *fields = NULL;
const var_list_t *fields = NULL;
...
@@ -2484,10 +2491,7 @@ static void check_remoting_fields(type_t *type)
...
@@ -2484,10 +2491,7 @@ static void check_remoting_fields(type_t *type)
type->checked = TRUE;
type->checked = TRUE;
if (is_struct(type->type))
if (is_struct(type->type))
{
fields = type->fields_or_args;
fields = type->fields_or_args;
container_type = "structure";
}
else if (is_union(type->type))
else if (is_union(type->type))
{
{
if (type->type == RPC_FC_ENCAPSULATED_UNION)
if (type->type == RPC_FC_ENCAPSULATED_UNION)
...
@@ -2497,11 +2501,10 @@ static void check_remoting_fields(type_t *type)
...
@@ -2497,11 +2501,10 @@ static void check_remoting_fields(type_t *type)
}
}
else
else
fields = type->fields_or_args;
fields = type->fields_or_args;
container_type = "union";
}
}
if (fields) LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry )
if (fields) LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry )
if (field->type) check_field_common(
container_
type, type->name, field);
if (field->type) check_field_common(type, type->name, field);
}
}
/* checks that arguments for a function make sense for marshalling and unmarshalling */
/* checks that arguments for a function make sense for marshalling and unmarshalling */
...
@@ -2545,7 +2548,7 @@ static void check_remoting_args(const func_t *func)
...
@@ -2545,7 +2548,7 @@ static void check_remoting_args(const func_t *func)
}
}
}
}
check_field_common(
"function"
, funcname, arg);
check_field_common(
func->def->type
, funcname, arg);
}
}
}
}
...
...
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