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
7f2419ce
Commit
7f2419ce
authored
Dec 26, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add some const attributes.
parent
73dff5c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
40 deletions
+40
-40
header.c
tools/widl/header.c
+23
-23
header.h
tools/widl/header.h
+10
-10
parser.y
tools/widl/parser.y
+3
-3
proxy.c
tools/widl/proxy.c
+3
-3
write_msft.c
tools/widl/write_msft.c
+1
-1
No files found.
tools/widl/header.c
View file @
7f2419ce
...
...
@@ -46,7 +46,7 @@ static void indent(FILE *h, int delta)
if
(
delta
>
0
)
indentation
+=
delta
;
}
int
is_attr
(
attr_t
*
a
,
enum
attr_type
t
)
int
is_attr
(
const
attr_t
*
a
,
enum
attr_type
t
)
{
while
(
a
)
{
if
(
a
->
type
==
t
)
return
1
;
...
...
@@ -55,7 +55,7 @@ int is_attr(attr_t *a, enum attr_type t)
return
0
;
}
void
*
get_attrp
(
attr_t
*
a
,
enum
attr_type
t
)
void
*
get_attrp
(
const
attr_t
*
a
,
enum
attr_type
t
)
{
while
(
a
)
{
if
(
a
->
type
==
t
)
return
a
->
u
.
pval
;
...
...
@@ -64,7 +64,7 @@ void *get_attrp(attr_t *a, enum attr_type t)
return
NULL
;
}
unsigned
long
get_attrv
(
attr_t
*
a
,
enum
attr_type
t
)
unsigned
long
get_attrv
(
const
attr_t
*
a
,
enum
attr_type
t
)
{
while
(
a
)
{
if
(
a
->
type
==
t
)
return
a
->
u
.
ival
;
...
...
@@ -73,7 +73,7 @@ unsigned long get_attrv(attr_t *a, enum attr_type t)
return
0
;
}
int
is_void
(
type_t
*
t
,
var_t
*
v
)
int
is_void
(
const
type_t
*
t
,
const
var_t
*
v
)
{
if
(
v
&&
v
->
ptr_level
)
return
0
;
if
(
!
t
->
type
&&
!
t
->
ref
)
return
1
;
...
...
@@ -90,7 +90,7 @@ static void write_guid(const char *guid_prefix, const char *name, UUID *uuid)
uuid
->
Data4
[
6
],
uuid
->
Data4
[
7
]);
}
static
void
write_pident
(
FILE
*
h
,
var_t
*
v
)
static
void
write_pident
(
FILE
*
h
,
const
var_t
*
v
)
{
int
c
;
for
(
c
=
0
;
c
<
v
->
ptr_level
;
c
++
)
{
...
...
@@ -99,7 +99,7 @@ static void write_pident(FILE *h, var_t *v)
if
(
v
->
name
)
fprintf
(
h
,
"%s"
,
v
->
name
);
}
void
write_name
(
FILE
*
h
,
var_t
*
v
)
void
write_name
(
FILE
*
h
,
const
var_t
*
v
)
{
if
(
is_attr
(
v
->
attrs
,
ATTR_PROPGET
))
fprintf
(
h
,
"get_"
);
...
...
@@ -110,12 +110,12 @@ void write_name(FILE *h, var_t *v)
fprintf
(
h
,
"%s"
,
v
->
name
);
}
c
har
*
get_name
(
var_t
*
v
)
c
onst
char
*
get_name
(
const
var_t
*
v
)
{
return
v
->
name
;
}
static
void
write_array
(
FILE
*
h
,
expr_t
*
v
,
int
field
)
static
void
write_array
(
FILE
*
h
,
const
expr_t
*
v
,
int
field
)
{
if
(
!
v
)
return
;
while
(
NEXT_LINK
(
v
))
v
=
NEXT_LINK
(
v
);
...
...
@@ -199,7 +199,7 @@ static void write_enums(FILE *h, var_t *v)
fprintf
(
h
,
"
\n
"
);
}
void
write_type
(
FILE
*
h
,
type_t
*
t
,
var_t
*
v
,
const
char
*
n
)
void
write_type
(
FILE
*
h
,
type_t
*
t
,
const
var_t
*
v
,
const
char
*
n
)
{
int
c
;
...
...
@@ -381,10 +381,10 @@ void write_user_types(void)
}
}
void
write_typedef
(
type_t
*
type
,
var_t
*
names
)
void
write_typedef
(
type_t
*
type
,
const
var_t
*
names
)
{
char
*
tname
=
names
->
tname
;
var_t
*
lname
;
const
var_t
*
lname
;
while
(
NEXT_LINK
(
names
))
names
=
NEXT_LINK
(
names
);
lname
=
names
;
fprintf
(
header
,
"typedef "
);
...
...
@@ -477,14 +477,14 @@ void write_expr(FILE *h, expr_t *e)
do_write_expr
(
h
,
e
,
0
);
}
void
write_constdef
(
var_t
*
v
)
void
write_constdef
(
const
var_t
*
v
)
{
fprintf
(
header
,
"#define %s ("
,
get_name
(
v
));
write_expr
(
header
,
v
->
eval
);
fprintf
(
header
,
")
\n\n
"
);
}
void
write_externdef
(
var_t
*
v
)
void
write_externdef
(
const
var_t
*
v
)
{
fprintf
(
header
,
"extern const "
);
write_type
(
header
,
v
->
type
,
NULL
,
v
->
tname
);
...
...
@@ -545,7 +545,7 @@ var_t *is_callas(attr_t *a)
return
get_attrp
(
a
,
ATTR_CALLAS
);
}
static
int
write_method_macro
(
type_t
*
iface
,
char
*
name
)
static
int
write_method_macro
(
const
type_t
*
iface
,
const
char
*
name
)
{
int
idx
;
func_t
*
cur
=
iface
->
funcs
;
...
...
@@ -636,7 +636,7 @@ void write_args(FILE *h, var_t *arg, const char *name, int method, int do_indent
if
(
do_indent
)
indentation
--
;
}
static
void
write_cpp_method_def
(
type_t
*
iface
)
static
void
write_cpp_method_def
(
const
type_t
*
iface
)
{
func_t
*
cur
=
iface
->
funcs
;
...
...
@@ -659,7 +659,7 @@ static void write_cpp_method_def(type_t *iface)
}
}
static
void
do_write_c_method_def
(
type_t
*
iface
,
char
*
name
)
static
void
do_write_c_method_def
(
const
type_t
*
iface
,
char
*
name
)
{
func_t
*
cur
=
iface
->
funcs
;
...
...
@@ -685,17 +685,17 @@ static void do_write_c_method_def(type_t *iface, char *name)
}
}
static
void
write_c_method_def
(
type_t
*
iface
)
static
void
write_c_method_def
(
const
type_t
*
iface
)
{
do_write_c_method_def
(
iface
,
iface
->
name
);
}
static
void
write_c_disp_method_def
(
type_t
*
iface
)
static
void
write_c_disp_method_def
(
const
type_t
*
iface
)
{
do_write_c_method_def
(
iface
->
ref
,
iface
->
name
);
}
static
void
write_method_proto
(
type_t
*
iface
)
static
void
write_method_proto
(
const
type_t
*
iface
)
{
func_t
*
cur
=
iface
->
funcs
;
...
...
@@ -759,7 +759,7 @@ static void write_method_proto(type_t *iface)
}
}
static
void
write_function_proto
(
type_t
*
iface
)
static
void
write_function_proto
(
const
type_t
*
iface
)
{
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
int
explicit_handle
=
is_attr
(
iface
->
attrs
,
ATTR_EXPLICIT_HANDLE
);
...
...
@@ -816,13 +816,13 @@ void write_forward(type_t *iface)
}
}
static
void
write_iface_guid
(
type_t
*
iface
)
static
void
write_iface_guid
(
const
type_t
*
iface
)
{
UUID
*
uuid
=
get_attrp
(
iface
->
attrs
,
ATTR_UUID
);
write_guid
(
"IID"
,
iface
->
name
,
uuid
);
}
static
void
write_dispiface_guid
(
type_t
*
iface
)
static
void
write_dispiface_guid
(
const
type_t
*
iface
)
{
UUID
*
uuid
=
get_attrp
(
iface
->
attrs
,
ATTR_UUID
);
write_guid
(
"DIID"
,
iface
->
name
,
uuid
);
...
...
@@ -895,7 +895,7 @@ static void write_com_interface(type_t *iface)
fprintf
(
header
,
"
\n
#endif /* __%s_INTERFACE_DEFINED__ */
\n\n
"
,
iface
->
name
);
}
static
void
write_rpc_interface
(
type_t
*
iface
)
static
void
write_rpc_interface
(
const
type_t
*
iface
)
{
unsigned
long
ver
=
get_attrv
(
iface
->
attrs
,
ATTR_VERSION
);
char
*
var
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
...
...
tools/widl/header.h
View file @
7f2419ce
...
...
@@ -21,13 +21,13 @@
#ifndef __WIDL_HEADER_H
#define __WIDL_HEADER_H
extern
int
is_attr
(
attr_t
*
a
,
enum
attr_type
t
);
extern
void
*
get_attrp
(
attr_t
*
a
,
enum
attr_type
t
);
extern
unsigned
long
get_attrv
(
attr_t
*
a
,
enum
attr_type
t
);
extern
int
is_void
(
type_t
*
t
,
var_t
*
v
);
extern
void
write_name
(
FILE
*
h
,
var_t
*
v
);
extern
c
har
*
get_name
(
var_t
*
v
);
extern
void
write_type
(
FILE
*
h
,
type_t
*
t
,
var_t
*
v
,
const
char
*
n
);
extern
int
is_attr
(
const
attr_t
*
a
,
enum
attr_type
t
);
extern
void
*
get_attrp
(
const
attr_t
*
a
,
enum
attr_type
t
);
extern
unsigned
long
get_attrv
(
const
attr_t
*
a
,
enum
attr_type
t
);
extern
int
is_void
(
const
type_t
*
t
,
const
var_t
*
v
);
extern
void
write_name
(
FILE
*
h
,
const
var_t
*
v
);
extern
c
onst
char
*
get_name
(
const
var_t
*
v
);
extern
void
write_type
(
FILE
*
h
,
type_t
*
t
,
const
var_t
*
v
,
const
char
*
n
);
extern
int
is_object
(
attr_t
*
a
);
extern
int
is_local
(
attr_t
*
a
);
extern
var_t
*
is_callas
(
attr_t
*
a
);
...
...
@@ -36,10 +36,10 @@ extern void write_forward(type_t *iface);
extern
void
write_interface
(
type_t
*
iface
);
extern
void
write_dispinterface
(
type_t
*
iface
);
extern
void
write_coclass
(
class_t
*
iface
);
extern
void
write_typedef
(
type_t
*
type
,
var_t
*
names
);
extern
void
write_typedef
(
type_t
*
type
,
const
var_t
*
names
);
extern
void
write_expr
(
FILE
*
h
,
expr_t
*
e
);
extern
void
write_constdef
(
var_t
*
v
);
extern
void
write_externdef
(
var_t
*
v
);
extern
void
write_constdef
(
const
var_t
*
v
);
extern
void
write_externdef
(
const
var_t
*
v
);
extern
void
write_library
(
const
char
*
name
,
attr_t
*
attr
);
extern
void
write_user_types
(
void
);
extern
var_t
*
get_explicit_handle_var
(
func_t
*
func
);
...
...
tools/widl/parser.y
View file @
7f2419ce
...
...
@@ -84,7 +84,7 @@ static var_t *make_var(char *name);
static func_t *make_func(var_t *def, var_t *args);
static class_t *make_class(char *name);
static type_t *reg_type(type_t *type, char *name, int t);
static type_t *reg_type(type_t *type, c
onst c
har *name, int t);
static type_t *reg_types(type_t *type, var_t *names, int t);
static type_t *find_type(const char *name, int t);
static type_t *find_type2(char *name, int t);
...
...
@@ -1102,7 +1102,7 @@ static int hash_ident(const char *name)
/***** type repository *****/
struct rtype {
char *name;
c
onst c
har *name;
type_t *type;
int t;
struct rtype *next;
...
...
@@ -1110,7 +1110,7 @@ struct rtype {
struct rtype *type_hash[HASHMAX];
static type_t *reg_type(type_t *type, char *name, int t)
static type_t *reg_type(type_t *type, c
onst c
har *name, int t)
{
struct rtype *nt;
int hash;
...
...
tools/widl/proxy.c
View file @
7f2419ce
...
...
@@ -206,7 +206,7 @@ static void proxy_check_pointers( var_t *arg )
static
void
marshall_size_arg
(
var_t
*
arg
)
{
int
index
=
0
;
type_t
*
type
=
get_base_type
(
arg
);
const
type_t
*
type
=
get_base_type
(
arg
);
expr_t
*
expr
;
expr
=
get_attrp
(
arg
->
attrs
,
ATTR_SIZEIS
);
...
...
@@ -728,7 +728,7 @@ static void stub_genmarshall( var_t *args )
stub_gen_marshall_copydata
(
args
);
}
static
void
gen_stub
(
type_t
*
iface
,
func_t
*
cur
,
char
*
cas
)
static
void
gen_stub
(
type_t
*
iface
,
func_t
*
cur
,
c
onst
c
har
*
cas
)
{
var_t
*
def
=
cur
->
def
;
var_t
*
arg
;
...
...
@@ -892,7 +892,7 @@ static void write_proxy(type_t *iface)
var_t
*
def
=
cur
->
def
;
if
(
!
is_local
(
def
->
attrs
))
{
var_t
*
cas
=
is_callas
(
def
->
attrs
);
char
*
cname
=
cas
?
cas
->
name
:
NULL
;
c
onst
c
har
*
cname
=
cas
?
cas
->
name
:
NULL
;
int
idx
=
cur
->
idx
;
if
(
cname
)
{
func_t
*
m
=
iface
->
funcs
;
...
...
tools/widl/write_msft.c
View file @
7f2419ce
...
...
@@ -1627,7 +1627,7 @@ static HRESULT add_impl_type(msft_typeinfo_t *typeinfo, type_t *ref)
}
static
msft_typeinfo_t
*
create_msft_typeinfo
(
msft_typelib_t
*
typelib
,
enum
type_kind
kind
,
char
*
name
,
attr_t
*
attr
,
int
idx
)
c
onst
c
har
*
name
,
attr_t
*
attr
,
int
idx
)
{
msft_typeinfo_t
*
msft_typeinfo
;
int
nameoffset
;
...
...
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