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
2d7b1f18
Commit
2d7b1f18
authored
Feb 21, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Feb 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Allow is_string_type to work for typedef'd types.
parent
e2d70fff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
2 deletions
+45
-2
server.c
dlls/rpcrt4/tests/server.c
+22
-0
server.idl
dlls/rpcrt4/tests/server.idl
+13
-0
header.h
tools/widl/header.h
+2
-1
typegen.c
tools/widl/typegen.c
+8
-1
No files found.
dlls/rpcrt4/tests/server.c
View file @
2d7b1f18
...
...
@@ -93,6 +93,12 @@ s_str_length(const char *s)
}
int
s_str_t_length
(
str_t
s
)
{
return
strlen
(
s
);
}
int
s_cstr_length
(
const
char
*
s
,
int
n
)
{
int
len
=
0
;
...
...
@@ -497,6 +503,16 @@ s_sum_L1_norms(int n, vector_t *vs)
return
sum
;
}
s123_t
*
s_get_s123
(
void
)
{
s123_t
*
s
=
MIDL_user_allocate
(
sizeof
*
s
);
s
->
f1
=
1
;
s
->
f2
=
2
;
s
->
f3
=
3
;
return
s
;
}
str_t
s_get_filename
(
void
)
{
...
...
@@ -693,6 +709,7 @@ basic_tests(void)
ok
(
x
==
25
,
"RPC square_ref
\n
"
);
ok
(
str_length
(
string
)
==
strlen
(
string
),
"RPC str_length
\n
"
);
ok
(
str_t_length
(
string
)
==
strlen
(
string
),
"RPC str_length
\n
"
);
ok
(
dot_self
(
&
a
)
==
59
,
"RPC dot_self
\n
"
);
ok
(
str_struct_len
(
&
ss
)
==
lstrlenA
(
string
),
"RPC str_struct_len
\n
"
);
...
...
@@ -959,6 +976,7 @@ pointer_tests(void)
name_t
name
;
void
*
buffer
;
int
*
pa2
;
s123_t
*
s123
;
ok
(
test_list_length
(
list
)
==
3
,
"RPC test_list_length
\n
"
);
ok
(
square_puint
(
p1
)
==
121
,
"RPC square_puint
\n
"
);
...
...
@@ -1012,6 +1030,10 @@ pointer_tests(void)
pa2
=
a
;
ok
(
sum_pcarr2
(
4
,
&
pa2
)
==
10
,
"RPC sum_pcarr2
\n
"
);
s123
=
get_s123
();
ok
(
s123
->
f1
==
1
&&
s123
->
f2
==
2
&&
s123
->
f3
==
3
,
"RPC get_s123
\n
"
);
MIDL_user_free
(
s123
);
}
static
int
...
...
dlls/rpcrt4/tests/server.idl
View file @
2d7b1f18
...
...
@@ -82,6 +82,7 @@ cpp_quote("#endif")
void
square_out
(
int
x
,
[
out
]
int
*
y
)
;
void
square_ref
(
[
in
,
out
]
int
*
x
)
;
int
str_length
(
[
string
]
const
char
*
s
)
;
int
str_t_length
(
str_t
s
)
;
int
cstr_length
(
[
string
,
size_is
(
n
)
]
const
char
*
s
,
int
n
)
;
int
dot_self
(
vector_t
*
v
)
;
double
square_half
(
double
x
,
[
out
]
double
*
y
)
;
...
...
@@ -300,6 +301,18 @@ cpp_quote("#endif")
int sum_pcarr2(int n, [size_is(, n)] int **pa);
int sum_L1_norms(int n, [size_is(n)] vector_t *vs);
/* Don'
t
use
this
except
in
the
get_s123
test
.
*/
typedef
struct
{
int
f1
;
int
f2
;
int
f3
;
}
s123_t
;
/*
Make
sure
WIDL
generates
a
type
format
string
for
a
previously
unseen
type
as
a
return
value
.
*/
s123_t
*
get_s123
(
void
)
;
void
get_5numbers
(
[
in
]
int
count
,
[
out
,
length_is
(
count
)
]
pints_t
pn
[
5
]
)
;
void
get_numbers
(
[
in
]
int
length
,
[
in
]
int
size
,
[
out
,
length_is
(
length
),
size_is
(
size
)
]
pints_t
pn
[]
)
;
str_t
get_filename
(
void
)
;
...
...
tools/widl/header.h
View file @
2d7b1f18
...
...
@@ -78,7 +78,8 @@ static inline int last_array(const type_t *type)
static
inline
int
is_string_type
(
const
attr_list_t
*
attrs
,
const
type_t
*
type
)
{
return
is_attr
(
attrs
,
ATTR_STRING
)
&&
(
last_ptr
(
type
)
||
last_array
(
type
));
return
((
is_attr
(
attrs
,
ATTR_STRING
)
||
is_attr
(
type
->
attrs
,
ATTR_STRING
))
&&
(
last_ptr
(
type
)
||
last_array
(
type
)));
}
static
inline
int
is_context_handle
(
const
type_t
*
type
)
...
...
tools/widl/typegen.c
View file @
2d7b1f18
...
...
@@ -2355,6 +2355,13 @@ static size_t process_tfs(FILE *file, const ifref_list_t *ifaces, type_pred_t pr
{
if
(
is_local
(
func
->
def
->
attrs
))
continue
;
if
(
!
is_void
(
func
->
def
->
type
))
update_tfsoff
(
func
->
def
->
type
,
write_typeformatstring_var
(
file
,
2
,
NULL
,
func
->
def
->
type
,
func
->
def
,
&
typeformat_offset
),
file
);
current_func
=
func
;
if
(
func
->
args
)
LIST_FOR_EACH_ENTRY
(
var
,
func
->
args
,
const
var_t
,
entry
)
...
...
@@ -2821,7 +2828,7 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
fprintf
(
file
,
";
\n
"
);
}
if
(
(
phase
==
PHASE_FREE
)
||
(
pointer_type
==
RPC_FC_UP
)
)
if
(
phase
==
PHASE_FREE
||
pass
==
PASS_RETURN
||
pointer_type
==
RPC_FC_UP
)
print_phase_function
(
file
,
indent
,
"Pointer"
,
phase
,
var
,
start_offset
-
(
type
->
size_is
?
4
:
2
));
else
...
...
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