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
1c56d293
Commit
1c56d293
authored
Jan 11, 2009
by
Michael Karcher
Committed by
Alexandre Julliard
Jan 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Dereference operator in expr works on any declared pointer.
parent
f80e4aa9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
server.c
dlls/rpcrt4/tests/server.c
+23
-0
server.idl
dlls/rpcrt4/tests/server.idl
+1
-0
expr.c
tools/widl/expr.c
+3
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
1c56d293
...
...
@@ -227,6 +227,23 @@ s_sum_conf_array(int x[], int n)
}
int
s_sum_conf_ptr_by_conf_ptr
(
int
n1
,
int
*
n2_then_x1
,
int
*
x2
)
{
int
i
;
int
sum
=
0
;
if
(
n1
==
0
)
return
0
;
for
(
i
=
1
;
i
<
n1
;
++
i
)
sum
+=
n2_then_x1
[
i
];
for
(
i
=
0
;
i
<
*
n2_then_x1
;
++
i
)
sum
+=
x2
[
i
];
return
sum
;
}
int
s_sum_unique_conf_array
(
int
x
[],
int
n
)
{
return
s_sum_conf_array
(
x
,
n
);
...
...
@@ -1127,6 +1144,7 @@ array_tests(void)
{{
1
,
-
2
,
3
,
-
4
},
{
2
,
3
,
5
,
7
},
{
-
4
,
-
1
,
-
14
,
4114
}}
};
int
c
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
int
c2
[]
=
{
10
,
100
,
200
};
vector_t
vs
[
2
]
=
{{
1
,
-
2
,
3
},
{
4
,
-
5
,
-
6
}};
cps_t
cps
;
cpsc_t
cpsc
;
...
...
@@ -1147,6 +1165,11 @@ array_tests(void)
ok
(
sum_conf_array
(
&
c
[
7
],
1
)
==
7
,
"RPC sum_conf_array
\n
"
);
ok
(
sum_conf_array
(
&
c
[
2
],
0
)
==
0
,
"RPC sum_conf_array
\n
"
);
ok
(
sum_conf_ptr_by_conf_ptr
(
1
,
c2
,
c
)
==
45
,
"RPC sum_conf_ptr_by_conf_ptr"
);
ok
(
sum_conf_ptr_by_conf_ptr
(
3
,
c2
,
c
)
==
345
,
"RPC sum_conf_ptr_by_conf_ptr"
);
c2
[
0
]
=
0
;
ok
(
sum_conf_ptr_by_conf_ptr
(
3
,
c2
,
c
)
==
300
,
"RPC sum_conf_ptr_by_conf_ptr"
);
ok
(
sum_unique_conf_array
(
ca
,
4
)
==
-
2
,
"RPC sum_unique_conf_array
\n
"
);
ok
(
sum_unique_conf_ptr
(
ca
,
5
)
==
3
,
"RPC sum_unique_conf_array
\n
"
);
ok
(
sum_unique_conf_ptr
(
NULL
,
10
)
==
0
,
"RPC sum_unique_conf_array
\n
"
);
...
...
dlls/rpcrt4/tests/server.idl
View file @
1c56d293
...
...
@@ -121,6 +121,7 @@ cpp_quote("#endif")
int test_list_length(test_list_t *ls);
int sum_fixed_int_3d(int m[2][3][4]);
int sum_conf_array([size_is(n)] int x[], int n);
int sum_conf_ptr_by_conf_ptr(int n1, [size_is(n1)] int *n2_then_x1, [size_is(*n2_then_x1)] int *x2);
int sum_unique_conf_array([size_is(n), unique] int x[], int n);
int sum_unique_conf_ptr([size_is(n), unique] int *x, int n);
int sum_var_array([length_is(n)] int x[20], int n);
...
...
tools/widl/expr.c
View file @
1c56d293
...
...
@@ -470,6 +470,9 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
result
=
resolve_expression
(
expr_loc
,
cont_type
,
e
->
ref
);
if
(
result
.
type
&&
is_ptr
(
result
.
type
))
result
.
type
=
type_pointer_get_ref
(
result
.
type
);
else
if
(
result
.
type
&&
is_array
(
result
.
type
)
&&
!
result
.
type
->
declarray
)
result
.
type
=
type_array_get_element
(
result
.
type
);
else
error_loc_info
(
&
expr_loc
->
v
->
loc_info
,
"dereference operator applied to non-pointer type in expression%s%s
\n
"
,
expr_loc
->
attr
?
" for attribute "
:
""
,
...
...
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