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
929a7598
Commit
929a7598
authored
Aug 29, 2006
by
Dan Hipschman
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add an is_ptr function.
parent
aadc90b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
20 deletions
+18
-20
client.c
tools/widl/client.c
+1
-1
parser.y
tools/widl/parser.y
+1
-1
proxy.c
tools/widl/proxy.c
+3
-17
typelib.c
tools/widl/typelib.c
+11
-0
widltypes.h
tools/widl/widltypes.h
+2
-1
No files found.
tools/widl/client.c
View file @
929a7598
...
...
@@ -91,7 +91,7 @@ static void check_pointers(const func_t *func)
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
if
(
is_
pointe
r
(
var
)
&&
cant_be_null
(
var
))
if
(
is_
var_pt
r
(
var
)
&&
cant_be_null
(
var
))
{
print_client
(
"if (!%s)
\n
"
,
var
->
name
);
print_client
(
"{
\n
"
);
...
...
tools/widl/parser.y
View file @
929a7598
...
...
@@ -1342,7 +1342,7 @@ static type_t *reg_typedefs(type_t *type, var_t *names, attr_t *attrs)
}
cur = alias(cur, names->name);
cur->attrs = attrs;
if (
cur->ref
)
if (
is_ptr(cur)
)
cur->type = get_pointer_type(cur);
reg_type(cur, cur->name, 0);
}
...
...
tools/widl/proxy.c
View file @
929a7598
...
...
@@ -128,23 +128,9 @@ static void clear_output_vars( var_t *arg )
}
}
int
is_
pointer
(
var_t
*
arg
)
int
is_
var_ptr
(
var_t
*
v
)
{
if
(
arg
->
ptr_level
)
return
1
;
switch
(
ref_type
(
arg
->
type
))
{
case
RPC_FC_RP
:
case
RPC_FC_C_CSTRING
:
case
RPC_FC_C_WSTRING
:
case
RPC_FC_FP
:
case
RPC_FC_OP
:
case
RPC_FC_UP
:
return
1
;
}
return
0
;
return
v
->
ptr_level
||
is_ptr
(
v
->
type
);
}
int
cant_be_null
(
var_t
*
v
)
...
...
@@ -213,7 +199,7 @@ static void proxy_check_pointers( var_t *arg )
{
END_OF_LIST
(
arg
);
while
(
arg
)
{
if
(
is_
pointe
r
(
arg
)
&&
cant_be_null
(
arg
))
{
if
(
is_
var_pt
r
(
arg
)
&&
cant_be_null
(
arg
))
{
print_proxy
(
"if(!%s)
\n
"
,
arg
->
name
);
indent
++
;
print_proxy
(
"RpcRaiseException(RPC_X_NULL_REF_POINTER);
\n
"
);
...
...
tools/widl/typelib.c
View file @
929a7598
...
...
@@ -73,6 +73,17 @@ type_t *alias(type_t *t, const char *name)
return
a
;
}
int
is_ptr
(
type_t
*
t
)
{
unsigned
char
c
=
t
->
type
;
return
c
==
RPC_FC_RP
||
c
==
RPC_FC_UP
||
c
==
RPC_FC_FP
||
c
==
RPC_FC_OP
||
c
==
RPC_FC_C_CSTRING
||
c
==
RPC_FC_C_WSTRING
;
}
/* List of oleauto types that should be recognized by name.
* (most of) these seem to be intrinsic types in mktyplib. */
...
...
tools/widl/widltypes.h
View file @
929a7598
...
...
@@ -297,7 +297,8 @@ type_t *alias(type_t *t, const char *name);
/* Get the actual type field for a type (chase down typedef references). */
unsigned
char
ref_type
(
const
type_t
*
type
);
int
is_pointer
(
var_t
*
v
);
int
is_ptr
(
type_t
*
t
);
int
is_var_ptr
(
var_t
*
v
);
int
cant_be_null
(
var_t
*
v
);
#endif
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