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
6655071a
Commit
6655071a
authored
Jan 24, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Move initialization of the stub buffer size into write_remoting_arguments().
parent
85ed9ca3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
49 deletions
+29
-49
client.c
tools/widl/client.c
+0
-23
server.c
tools/widl/server.c
+0
-24
typegen.c
tools/widl/typegen.c
+29
-1
typegen.h
tools/widl/typegen.h
+0
-1
No files found.
tools/widl/client.c
View file @
6655071a
...
...
@@ -59,24 +59,6 @@ static int print_client( const char *format, ... )
}
static
void
print_message_buffer_size
(
const
func_t
*
func
)
{
unsigned
int
total_size
=
0
;
if
(
func
->
args
)
{
const
var_t
*
var
;
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
{
unsigned
int
alignment
;
total_size
+=
get_required_buffer_size
(
var
,
&
alignment
,
PASS_IN
);
total_size
+=
alignment
;
}
}
fprintf
(
client
,
" %u"
,
total_size
);
}
static
void
check_pointers
(
const
func_t
*
func
)
{
const
var_t
*
var
;
...
...
@@ -189,11 +171,6 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig
fprintf
(
client
,
"
\n
"
);
}
/* emit the message buffer size */
print_client
(
"_StubMsg.BufferLength ="
);
print_message_buffer_size
(
func
);
fprintf
(
client
,
";
\n
"
);
type_offset_func
=
*
type_offset
;
write_remoting_arguments
(
client
,
indent
,
func
,
&
type_offset_func
,
PASS_IN
,
PHASE_BUFFERSIZE
);
...
...
tools/widl/server.c
View file @
6655071a
...
...
@@ -88,7 +88,6 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig
LIST_FOR_EACH_ENTRY
(
func
,
iface
->
funcs
,
const
func_t
,
entry
)
{
const
var_t
*
def
=
func
->
def
;
unsigned
long
buffer_size
=
0
;
unsigned
int
type_offset_func
;
/* check for a defined binding handle */
...
...
@@ -222,31 +221,8 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset, unsig
fprintf
(
server
,
"();
\n
"
);
}
if
(
func
->
args
)
{
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
{
if
(
is_attr
(
var
->
attrs
,
ATTR_OUT
))
{
unsigned
int
alignment
;
buffer_size
+=
get_required_buffer_size
(
var
,
&
alignment
,
PASS_OUT
);
buffer_size
+=
alignment
;
}
}
}
if
(
!
is_void
(
def
->
type
,
NULL
))
{
unsigned
int
alignment
;
buffer_size
+=
get_required_buffer_size
(
def
,
&
alignment
,
PASS_RETURN
);
buffer_size
+=
alignment
;
}
if
(
has_out_arg_or_return
(
func
))
{
fprintf
(
server
,
"
\n
"
);
print_server
(
"_StubMsg.BufferLength = %u;
\n
"
,
buffer_size
);
type_offset_func
=
*
type_offset
;
write_remoting_arguments
(
server
,
indent
,
func
,
&
type_offset_func
,
PASS_OUT
,
PHASE_BUFFERSIZE
);
...
...
tools/widl/typegen.c
View file @
6655071a
...
...
@@ -1551,7 +1551,7 @@ static unsigned int get_required_buffer_size_type(
return
0
;
}
unsigned
int
get_required_buffer_size
(
const
var_t
*
var
,
unsigned
int
*
alignment
,
enum
pass
pass
)
static
unsigned
int
get_required_buffer_size
(
const
var_t
*
var
,
unsigned
int
*
alignment
,
enum
pass
pass
)
{
expr_t
*
size_is
=
get_attrp
(
var
->
attrs
,
ATTR_SIZEIS
);
int
has_size
=
(
size_is
&&
(
size_is
->
type
!=
EXPR_VOID
));
...
...
@@ -1621,6 +1621,28 @@ unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment,
}
}
static
unsigned
int
get_function_buffer_size
(
const
func_t
*
func
,
enum
pass
pass
)
{
const
var_t
*
var
;
unsigned
int
total_size
=
0
,
alignment
;
if
(
func
->
args
)
{
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
{
total_size
+=
get_required_buffer_size
(
var
,
&
alignment
,
pass
);
total_size
+=
alignment
;
}
}
if
(
pass
==
PASS_OUT
&&
!
is_void
(
func
->
def
->
type
,
NULL
))
{
total_size
+=
get_required_buffer_size
(
func
->
def
,
&
alignment
,
PASS_RETURN
);
total_size
+=
alignment
;
}
return
total_size
;
}
static
void
print_phase_function
(
FILE
*
file
,
int
indent
,
const
char
*
type
,
enum
remoting_phase
phase
,
const
char
*
varname
,
unsigned
int
type_offset
)
...
...
@@ -1767,6 +1789,12 @@ void write_remoting_arguments(FILE *file, int indent, const func_t *func,
if
(
!
func
->
args
)
return
;
if
(
phase
==
PHASE_BUFFERSIZE
)
{
unsigned
int
size
=
get_function_buffer_size
(
func
,
pass
);
print_file
(
file
,
indent
,
"_StubMsg.BufferLength = %u;
\n
"
,
size
);
}
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
{
const
type_t
*
type
=
var
->
type
;
...
...
tools/widl/typegen.h
View file @
6655071a
...
...
@@ -39,7 +39,6 @@ void write_formatstringsdecl(FILE *f, int indent, ifref_list_t *ifaces, int for_
void
write_procformatstring
(
FILE
*
file
,
const
ifref_list_t
*
ifaces
,
int
for_objects
);
void
write_typeformatstring
(
FILE
*
file
,
const
ifref_list_t
*
ifaces
,
int
for_objects
);
size_t
get_type_memsize
(
const
type_t
*
type
);
unsigned
int
get_required_buffer_size
(
const
var_t
*
var
,
unsigned
int
*
alignment
,
enum
pass
pass
);
void
print_phase_basetype
(
FILE
*
file
,
int
indent
,
enum
remoting_phase
phase
,
enum
pass
pass
,
const
var_t
*
var
,
const
char
*
varname
);
void
write_remoting_arguments
(
FILE
*
file
,
int
indent
,
const
func_t
*
func
,
unsigned
int
*
type_offset
,
enum
pass
pass
,
enum
remoting_phase
phase
);
size_t
get_size_procformatstring_var
(
const
var_t
*
var
);
...
...
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