Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
1c56d293
Commit
1c56d293
authored
16 years ago
by
Michael Karcher
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
widl: Dereference operator in expr works on any declared pointer.
parent
f80e4aa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/rpcrt4/tests/server.c
+23
-0
23 additions, 0 deletions
dlls/rpcrt4/tests/server.c
dlls/rpcrt4/tests/server.idl
+1
-0
1 addition, 0 deletions
dlls/rpcrt4/tests/server.idl
tools/widl/expr.c
+3
-0
3 additions, 0 deletions
tools/widl/expr.c
with
27 additions
and
0 deletions
dlls/rpcrt4/tests/server.c
+
23
−
0
View file @
1c56d293
...
...
@@ -226,6 +226,23 @@ s_sum_conf_array(int x[], int n)
return
sum
;
}
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
)
{
...
...
@@ -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
"
);
...
...
This diff is collapsed.
Click to expand it.
dlls/rpcrt4/tests/server.idl
+
1
−
0
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);
...
...
This diff is collapsed.
Click to expand it.
tools/widl/expr.c
+
3
−
0
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 "
:
""
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment