Module: wine Branch: refs/heads/master Commit: 511463f3a592e92663826086c516b6dc46ce7382 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=511463f3a592e92663826086...
Author: Robert Shearman rob@codeweavers.com Date: Tue Feb 7 12:31:17 2006 +0100
widl: More const attributes.
---
tools/widl/header.c | 36 ++++++++++++++++++------------------ tools/widl/widltypes.h | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c index ef77308..c618406 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -80,7 +80,7 @@ int is_void(const type_t *t, const var_t return 0; }
-static void write_guid(const char *guid_prefix, const char *name, UUID *uuid) +static void write_guid(const char *guid_prefix, const char *name, const UUID *uuid) { if (!uuid) return; fprintf(header, "DEFINE_GUID(%s_%s, 0x%08lx, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x," @@ -333,7 +333,7 @@ static int user_type_registered(const ch return 0; }
-static void check_for_user_types(var_t *v) +static void check_for_user_types(const var_t *v) { while (v) { type_t *type = v->type; @@ -355,7 +355,7 @@ static void check_for_user_types(var_t * } else if (type->fields) { - var_t *fields = type->fields; + const var_t *fields = type->fields; while (NEXT_LINK(fields)) fields = NEXT_LINK(fields); check_for_user_types(fields); } @@ -383,7 +383,7 @@ void write_user_types(void)
void write_typedef(type_t *type, const var_t *names) { - char *tname = names->tname; + const char *tname = names->tname; const var_t *lname; while (NEXT_LINK(names)) names = NEXT_LINK(names); lname = names; @@ -654,9 +654,9 @@ static void write_cpp_method_def(const t } }
-static void do_write_c_method_def(const type_t *iface, char *name) +static void do_write_c_method_def(const type_t *iface, const char *name) { - func_t *cur = iface->funcs; + const func_t *cur = iface->funcs;
if (iface->ref) do_write_c_method_def(iface->ref, name);
@@ -665,7 +665,7 @@ static void do_write_c_method_def(const indent(header, 0); fprintf(header, "/*** %s methods ***/\n", iface->name); while (cur) { - var_t *def = cur->def; + const var_t *def = cur->def; if (!is_callas(def->attrs)) { indent(header, 0); write_type(header, def->type, def, def->tname); @@ -692,14 +692,14 @@ static void write_c_disp_method_def(cons
static void write_method_proto(const type_t *iface) { - func_t *cur = iface->funcs; + const func_t *cur = iface->funcs;
if (!cur) return; while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); while (cur) { - var_t *def = cur->def; - var_t *cas = is_callas(def->attrs); - var_t *args; + const var_t *def = cur->def; + const var_t *cas = is_callas(def->attrs); + const var_t *args; if (!is_local(def->attrs)) { /* proxy prototype */ write_type(header, def->type, def, def->tname); @@ -725,11 +725,11 @@ static void write_method_proto(const typ check_for_user_types(args); } if (cas) { - func_t *m = iface->funcs; + const func_t *m = iface->funcs; while (m && strcmp(get_name(m->def), cas->name)) m = NEXT_LINK(m); if (m) { - var_t *mdef = m->def; + const var_t *mdef = m->def; /* proxy prototype - use local prototype */ write_type(header, mdef->type, mdef, mdef->tname); fprintf(header, " CALLBACK %s_", iface->name); @@ -756,9 +756,9 @@ static void write_method_proto(const typ
static void write_function_proto(const type_t *iface) { - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); - var_t* explicit_handle_var; + const var_t* explicit_handle_var;
func_t *cur = iface->funcs; while (NEXT_LINK(cur)) cur = NEXT_LINK(cur); @@ -813,19 +813,19 @@ void write_forward(type_t *iface)
static void write_iface_guid(const type_t *iface) { - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); write_guid("IID", iface->name, uuid); }
static void write_dispiface_guid(const type_t *iface) { - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); write_guid("DIID", iface->name, uuid); }
static void write_coclass_guid(class_t *cocl) { - UUID *uuid = get_attrp(cocl->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(cocl->attrs, ATTR_UUID); write_guid("CLSID", cocl->name, uuid); }
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 0534339..36d4aad 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -206,7 +206,7 @@ struct _var_t { expr_t *array; type_t *type; var_t *args; /* for function pointers */ - char *tname; + const char *tname; attr_t *attrs; expr_t *eval; long lval;