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
3bfa88dc
Commit
3bfa88dc
authored
Feb 06, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Take array dimensions into account when computing buffer size.
parent
3fa891bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
typegen.c
tools/widl/typegen.c
+16
-10
No files found.
tools/widl/typegen.c
View file @
3bfa88dc
...
@@ -1543,8 +1543,10 @@ static unsigned int get_required_buffer_size_type(
...
@@ -1543,8 +1543,10 @@ static unsigned int get_required_buffer_size_type(
const
type_t
*
type
,
int
ptr_level
,
const
array_dims_t
*
array
,
const
type_t
*
type
,
int
ptr_level
,
const
array_dims_t
*
array
,
const
char
*
name
,
unsigned
int
*
alignment
)
const
char
*
name
,
unsigned
int
*
alignment
)
{
{
size_t
size
=
0
;
*
alignment
=
0
;
*
alignment
=
0
;
if
(
ptr_level
==
0
&&
!
array
)
if
(
ptr_level
==
0
)
{
{
switch
(
type
->
type
)
switch
(
type
->
type
)
{
{
...
@@ -1553,25 +1555,29 @@ static unsigned int get_required_buffer_size_type(
...
@@ -1553,25 +1555,29 @@ static unsigned int get_required_buffer_size_type(
case
RPC_FC_USMALL
:
case
RPC_FC_USMALL
:
case
RPC_FC_SMALL
:
case
RPC_FC_SMALL
:
*
alignment
=
4
;
*
alignment
=
4
;
return
1
;
size
=
1
;
break
;
case
RPC_FC_WCHAR
:
case
RPC_FC_WCHAR
:
case
RPC_FC_USHORT
:
case
RPC_FC_USHORT
:
case
RPC_FC_SHORT
:
case
RPC_FC_SHORT
:
*
alignment
=
4
;
*
alignment
=
4
;
return
2
;
size
=
2
;
break
;
case
RPC_FC_ULONG
:
case
RPC_FC_ULONG
:
case
RPC_FC_LONG
:
case
RPC_FC_LONG
:
case
RPC_FC_FLOAT
:
case
RPC_FC_FLOAT
:
case
RPC_FC_ERROR_STATUS_T
:
case
RPC_FC_ERROR_STATUS_T
:
*
alignment
=
4
;
*
alignment
=
4
;
return
4
;
size
=
4
;
break
;
case
RPC_FC_HYPER
:
case
RPC_FC_HYPER
:
case
RPC_FC_DOUBLE
:
case
RPC_FC_DOUBLE
:
*
alignment
=
8
;
*
alignment
=
8
;
return
8
;
size
=
8
;
break
;
case
RPC_FC_IGNORE
:
case
RPC_FC_IGNORE
:
case
RPC_FC_BIND_PRIMITIVE
:
case
RPC_FC_BIND_PRIMITIVE
:
...
@@ -1579,7 +1585,6 @@ static unsigned int get_required_buffer_size_type(
...
@@ -1579,7 +1585,6 @@ static unsigned int get_required_buffer_size_type(
case
RPC_FC_STRUCT
:
case
RPC_FC_STRUCT
:
{
{
size_t
size
=
0
;
const
var_t
*
field
;
const
var_t
*
field
;
if
(
!
type
->
fields
)
return
0
;
if
(
!
type
->
fields
)
return
0
;
LIST_FOR_EACH_ENTRY
(
field
,
type
->
fields
,
const
var_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
field
,
type
->
fields
,
const
var_t
,
entry
)
...
@@ -1589,20 +1594,21 @@ static unsigned int get_required_buffer_size_type(
...
@@ -1589,20 +1594,21 @@ static unsigned int get_required_buffer_size_type(
field
->
type
,
field
->
ptr_level
,
field
->
array
,
field
->
name
,
field
->
type
,
field
->
ptr_level
,
field
->
array
,
field
->
name
,
&
alignment
);
&
alignment
);
}
}
return
size
;
break
;
}
}
case
RPC_FC_RP
:
case
RPC_FC_RP
:
if
(
is_base_type
(
type
->
ref
->
type
)
||
type
->
ref
->
type
==
RPC_FC_STRUCT
)
if
(
is_base_type
(
type
->
ref
->
type
)
||
type
->
ref
->
type
==
RPC_FC_STRUCT
)
return
get_required_buffer_size_type
(
type
->
ref
,
0
,
NULL
,
name
,
alignment
);
size
=
get_required_buffer_size_type
(
type
->
ref
,
0
,
NULL
,
name
,
alignment
);
return
0
;
break
;
default:
default:
error
(
"get_required_buffer_size: Unknown/unsupported type: %s (0x%02x)
\n
"
,
name
,
type
->
type
);
error
(
"get_required_buffer_size: Unknown/unsupported type: %s (0x%02x)
\n
"
,
name
,
type
->
type
);
return
0
;
return
0
;
}
}
if
(
array
)
size
*=
get_array_size
(
array
);
}
}
return
0
;
return
size
;
}
}
static
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
)
...
...
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