Robert Shearman : widl: Make 'attrs' field of type_t const.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Feb 7 06:06:00 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 4e406750329242c6bdce86a2c2e431aa2a5a6b88
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=4e406750329242c6bdce86a2c2e431aa2a5a6b88
Author: Robert Shearman <rob at codeweavers.com>
Date: Tue Feb 7 12:32:57 2006 +0100
widl: Make 'attrs' field of type_t const.
---
tools/widl/header.c | 8 ++++----
tools/widl/header.h | 8 ++++----
tools/widl/parser.y | 9 +++++----
tools/widl/widltypes.h | 2 +-
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 925301d..7f26233 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -490,7 +490,7 @@ void write_externdef(const var_t *v)
fprintf(header, ";\n\n");
}
-void write_library(const char *name, attr_t *attr) {
+void write_library(const char *name, const attr_t *attr) {
const UUID *uuid = get_attrp(attr, ATTR_UUID);
fprintf(header, "\n");
write_guid("LIBID", name, uuid);
@@ -521,7 +521,7 @@ const var_t* get_explicit_handle_var(con
/********** INTERFACES **********/
-int is_object(attr_t *a)
+int is_object(const attr_t *a)
{
while (a) {
if (a->type == ATTR_OBJECT || a->type == ATTR_ODL) return 1;
@@ -530,12 +530,12 @@ int is_object(attr_t *a)
return 0;
}
-int is_local(attr_t *a)
+int is_local(const attr_t *a)
{
return is_attr(a, ATTR_LOCAL);
}
-const var_t *is_callas(attr_t *a)
+const var_t *is_callas(const attr_t *a)
{
return get_attrp(a, ATTR_CALLAS);
}
diff --git a/tools/widl/header.h b/tools/widl/header.h
index 63c732f..e905ae4 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -28,9 +28,9 @@ extern int is_void(const type_t *t, cons
extern void write_name(FILE *h, const var_t *v);
extern const 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 const var_t *is_callas(attr_t *a);
+extern int is_object(const attr_t *a);
+extern int is_local(const attr_t *a);
+extern const var_t *is_callas(const attr_t *a);
extern void write_args(FILE *h, var_t *arg, const char *name, int obj, int do_indent);
extern void write_array(FILE *h, const expr_t *v, int field);
extern void write_forward(type_t *iface);
@@ -41,7 +41,7 @@ extern void write_typedef(type_t *type,
extern void write_expr(FILE *h, const expr_t *e, int brackets);
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_library(const char *name, const attr_t *attr);
extern void write_user_types(void);
extern const var_t* get_explicit_handle_var(const func_t* func);
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index ca890f4..5b24eef 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -623,11 +623,12 @@ dispinterface: tDISPINTERFACE aIDENTIFIE
| tDISPINTERFACE aKNOWNTYPE { $$ = get_type(0, $2, 0); }
;
-dispinterfacehdr: attributes dispinterface { $$ = $2;
+dispinterfacehdr: attributes dispinterface { attr_t *attrs;
+ $$ = $2;
if ($$->defined) yyerror("multiple definition error\n");
- $$->attrs = $1;
- $$->attrs = make_attr(ATTR_DISPINTERFACE);
- LINK($$->attrs, $1);
+ attrs = make_attr(ATTR_DISPINTERFACE);
+ LINK(attrs, $1);
+ $$->attrs = attrs;
$$->ref = find_type("IDispatch", 0);
if (!$$->ref) yyerror("IDispatch is undefined\n");
$$->defined = TRUE;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index c578da7..6af89ad 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -183,7 +183,7 @@ struct _type_t {
char *name;
unsigned char type;
struct _type_t *ref;
- attr_t *attrs;
+ const attr_t *attrs;
func_t *funcs;
var_t *fields;
int ignore, is_const, sign;
More information about the wine-cvs
mailing list