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
c5aaadc4
Commit
c5aaadc4
authored
May 18, 2007
by
Dan Hipschman
Committed by
Alexandre Julliard
May 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Lay framework for unions with simple unions working.
parent
18724eae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
0 deletions
+74
-0
server.c
dlls/rpcrt4/tests/server.c
+34
-0
server.idl
dlls/rpcrt4/tests/server.idl
+14
-0
server_defines.h
dlls/rpcrt4/tests/server_defines.h
+24
-0
parser.y
tools/widl/parser.y
+1
-0
typegen.c
tools/widl/typegen.c
+0
-0
widltypes.h
tools/widl/widltypes.h
+1
-0
No files found.
dlls/rpcrt4/tests/server.c
View file @
c5aaadc4
...
...
@@ -21,6 +21,7 @@
#include <windows.h>
#include "wine/test.h"
#include "server.h"
#include "server_defines.h"
#include <stdio.h>
...
...
@@ -138,6 +139,19 @@ s_sum_sp(sp_t *sp)
return
sp
->
x
+
sp
->
s
->
x
;
}
double
s_square_sun
(
sun_t
*
sun
)
{
switch
(
sun
->
s
)
{
case
SUN_I
:
return
sun
->
u
.
i
*
sun
->
u
.
i
;
case
SUN_F1
:
case
SUN_F2
:
return
sun
->
u
.
f
*
sun
->
u
.
f
;
default:
return
0
.
0
;
}
}
void
s_stop
(
void
)
{
...
...
@@ -253,6 +267,24 @@ basic_tests(void)
}
static
void
union_tests
(
void
)
{
sun_t
sun
;
sun
.
s
=
SUN_I
;
sun
.
u
.
i
=
9
;
ok
(
square_sun
(
&
sun
)
==
81
.
0
,
"RPC square_sun
\n
"
);
sun
.
s
=
SUN_F1
;
sun
.
u
.
f
=
5
.
0
;
ok
(
square_sun
(
&
sun
)
==
25
.
0
,
"RPC square_sun
\n
"
);
sun
.
s
=
SUN_I
;
sun
.
u
.
i
=
-
2
.
0
;
ok
(
square_sun
(
&
sun
)
==
4
.
0
,
"RPC square_sun
\n
"
);
}
static
void
client
(
const
char
*
test
)
{
if
(
strcmp
(
test
,
"tcp_basic"
)
==
0
)
...
...
@@ -266,6 +298,7 @@ client(const char *test)
ok
(
RPC_S_OK
==
RpcBindingFromStringBinding
(
binding
,
&
IServer_IfHandle
),
"RpcBindingFromStringBinding
\n
"
);
basic_tests
();
union_tests
();
ok
(
RPC_S_OK
==
RpcStringFree
(
&
binding
),
"RpcStringFree
\n
"
);
ok
(
RPC_S_OK
==
RpcBindingFree
(
&
IServer_IfHandle
),
"RpcBindingFree
\n
"
);
...
...
@@ -281,6 +314,7 @@ client(const char *test)
ok
(
RPC_S_OK
==
RpcBindingFromStringBinding
(
binding
,
&
IServer_IfHandle
),
"RpcBindingFromStringBinding
\n
"
);
basic_tests
();
union_tests
();
stop
();
ok
(
RPC_S_OK
==
RpcStringFree
(
&
binding
),
"RpcStringFree
\n
"
);
...
...
dlls/rpcrt4/tests/server.idl
View file @
c5aaadc4
...
...
@@ -18,6 +18,8 @@
*
Foundation
,
Inc
.
,
51
Franklin
St
,
Fifth
Floor
,
Boston
,
MA
02110
-
1301
,
USA
*/
#
include
"server_defines.h"
typedef
struct
tag_vector
{
int
x
;
...
...
@@ -53,6 +55,17 @@ interface IServer
vector_t
**
pv
;
}
pvectors_t
;
typedef
struct
{
[
switch_is
(
s
)
]
union
{
[
case
(
SUN_I
)
]
int
i
;
[
case
(
SUN_F1
,
SUN_F2
)
]
float
f
;
}
u
;
int
s
;
}
sun_t
;
int
int_return
(
void
)
;
int
square
(
int
x
)
;
int
sum
(
int
x
,
int
y
)
;
...
...
@@ -81,5 +94,6 @@ interface IServer
} sp_t;
int sum_sp(sp_t *sp);
double square_sun(sun_t *sun);
void stop(void);
}
dlls/rpcrt4/tests/server_defines.h
0 → 100644
View file @
c5aaadc4
/*
* Constants shared between server.c and server.idl
*
* Copyright (C) Google 2007 (Dan Hipschman)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* sun_t case values */
#define SUN_I 10
#define SUN_F1 -2
#define SUN_F2 7
tools/widl/parser.y
View file @
c5aaadc4
...
...
@@ -1260,6 +1260,7 @@ static var_t *make_var(char *name)
v->attrs = NULL;
v->array = NULL;
v->eval = NULL;
v->corrdesc = 0;
return v;
}
...
...
tools/widl/typegen.c
View file @
c5aaadc4
This diff is collapsed.
Click to expand it.
tools/widl/widltypes.h
View file @
c5aaadc4
...
...
@@ -220,6 +220,7 @@ struct _var_t {
var_list_t
*
args
;
/* for function pointers */
attr_list_t
*
attrs
;
expr_t
*
eval
;
size_t
corrdesc
;
/* offset to correlation descriptor (e.g., for unions) */
/* parser-internal */
struct
list
entry
;
...
...
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