widl: Make 'attrs' field of type_t const.

This commit is contained in:
Robert Shearman 2006-02-07 12:32:57 +01:00 committed by Alexandre Julliard
parent e9ec85a01a
commit 4e40675032
4 changed files with 14 additions and 13 deletions

View file

@ -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(const func_t* func)
/********** 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);
}

View file

@ -28,9 +28,9 @@ extern int is_void(const type_t *t, const var_t *v);
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, const var_t *names);
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);

View file

@ -623,11 +623,12 @@ dispinterface: tDISPINTERFACE aIDENTIFIER { $$ = get_type(0, $2, 0); }
| 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;

View file

@ -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;