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
1550938a
Commit
1550938a
authored
Mar 23, 2006
by
Eric Kohl
Committed by
Alexandre Julliard
Mar 23, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Fix format string size calculation.
- Move proc format string size calculation from client.c and server.c to typegen.c. - Implement type format string size calculation.
parent
9873494c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
60 deletions
+76
-60
client.c
tools/widl/client.c
+5
-29
server.c
tools/widl/server.c
+5
-29
typegen.c
tools/widl/typegen.c
+63
-1
typegen.h
tools/widl/typegen.h
+3
-1
No files found.
tools/widl/client.c
View file @
1550938a
/*
* IDL Compiler
*
* Copyright 2005 Eric Kohl
* Copyright 2005
-2006
Eric Kohl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -384,35 +384,11 @@ static void write_formatdesc( const char *str )
static
void
write_formatstringsdecl
(
type_t
*
iface
)
{
int
byte_count
=
1
;
print_client
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
get_size_typeformatstring
(
iface
));
print_client
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
3
);
/* FIXME */
/* determine the proc format string size */
if
(
iface
->
funcs
)
{
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
/* argument list size */
if
(
func
->
args
)
{
var_t
*
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
}
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
}
print_client
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
byte_count
);
print_client
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
get_size_procformatstring
(
iface
));
fprintf
(
client
,
"
\n
"
);
write_formatdesc
(
"TYPE"
);
...
...
tools/widl/server.c
View file @
1550938a
/*
* IDL Compiler
*
* Copyright 2005 Eric Kohl
* Copyright 2005
-2006
Eric Kohl
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -472,35 +472,11 @@ static void write_formatdesc( const char *str )
static
void
write_formatstringsdecl
(
type_t
*
iface
)
{
int
byte_count
=
1
;
print_server
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
get_size_typeformatstring
(
iface
));
print_server
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
3
);
/* FIXME */
/* determine the proc format string size */
if
(
iface
->
funcs
)
{
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
/* argument list size */
if
(
func
->
args
)
{
var_t
*
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
}
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
}
print_server
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
byte_count
);
print_server
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
get_size_procformatstring
(
iface
));
fprintf
(
server
,
"
\n
"
);
write_formatdesc
(
"TYPE"
);
...
...
tools/widl/typegen.c
View file @
1550938a
/*
* Format String Generator for IDL Compiler
*
* Copyright 2005 Eric Kohl
* Copyright 2005
-2006
Eric Kohl
* Copyright 2005-2006 Robert Shearman
*
* This library is free software; you can redistribute it and/or
...
...
@@ -1591,6 +1591,68 @@ size_t get_size_typeformatstring_var(const var_t *var)
return
type_offset
;
}
size_t
get_size_procformatstring
(
const
type_t
*
iface
)
{
size_t
size
=
1
;
func_t
*
func
;
var_t
*
var
;
if
(
iface
->
funcs
)
{
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
/* argument list size */
if
(
func
->
args
)
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
size
+=
get_size_procformatstring_var
(
var
);
var
=
PREV_LINK
(
var
);
}
}
/* return value size */
size
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
}
return
size
;
}
size_t
get_size_typeformatstring
(
const
type_t
*
iface
)
{
size_t
size
=
3
;
func_t
*
func
;
var_t
*
var
;
if
(
iface
->
funcs
)
{
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
/* argument list size */
if
(
func
->
args
)
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
size
+=
get_size_typeformatstring_var
(
var
);
var
=
PREV_LINK
(
var
);
}
}
func
=
PREV_LINK
(
func
);
}
}
return
size
;
}
static
void
write_struct_expr
(
FILE
*
h
,
const
expr_t
*
e
,
int
brackets
,
const
var_t
*
fields
,
const
char
*
structvar
)
{
...
...
tools/widl/typegen.h
View file @
1550938a
/*
* Format String Generator for IDL Compiler
*
* Copyright 2005 Eric Kohl
* Copyright 2005
-2006
Eric Kohl
* Copyright 2005 Robert Shearman
*
* This library is free software; you can redistribute it and/or
...
...
@@ -41,5 +41,7 @@ unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment)
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
);
size_t
get_size_typeformatstring_var
(
const
var_t
*
var
);
size_t
get_size_procformatstring
(
const
type_t
*
iface
);
size_t
get_size_typeformatstring
(
const
type_t
*
iface
);
int
write_expr_eval_routines
(
FILE
*
file
,
const
char
*
iface
);
void
write_expr_eval_routine_list
(
FILE
*
file
,
const
char
*
iface
);
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