From f1bb0a474b4664f4dbba46574bbf248b50ed650b Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 7 Feb 2006 12:31:43 +0100 Subject: [PATCH] widl: Yet more const attributes. --- tools/widl/client.c | 18 +++++++++--------- tools/widl/header.c | 10 +++++----- tools/widl/header.h | 4 ++-- tools/widl/proxy.c | 6 +++--- tools/widl/server.c | 14 +++++++------- tools/widl/typegen.c | 4 ++-- tools/widl/typegen.h | 4 ++-- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tools/widl/client.c b/tools/widl/client.c index 91b4b392f7b..136e1315ad3 100644 --- a/tools/widl/client.c +++ b/tools/widl/client.c @@ -66,13 +66,13 @@ static int print_client( const char *format, ... ) } -static void print_message_buffer_size(func_t *func) +static void print_message_buffer_size(const func_t *func) { unsigned int total_size = 0; if (func->args) { - var_t *var = func->args; + const var_t *var = func->args; while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { @@ -90,8 +90,8 @@ static void print_message_buffer_size(func_t *func) static void write_function_stubs(type_t *iface) { - func_t *func = iface->funcs; - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const func_t *func = iface->funcs; + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); var_t *var; int method_count = 0; @@ -101,8 +101,8 @@ static void write_function_stubs(type_t *iface) while (NEXT_LINK(func)) func = NEXT_LINK(func); while (func) { - var_t *def = func->def; - var_t* explicit_handle_var; + const var_t *def = func->def; + const var_t* explicit_handle_var; unsigned int type_offset_func; /* check for a defined binding handle */ @@ -301,7 +301,7 @@ static void write_stubdescdecl(type_t *iface) static void write_stubdescriptor(type_t *iface, int expr_eval_routines) { - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); print_client("static const MIDL_STUB_DESC %s_StubDesc =\n", iface->name); print_client("{\n"); @@ -341,7 +341,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines) static void write_clientinterfacedecl(type_t *iface) { unsigned long ver = get_attrv(iface->attrs, ATTR_VERSION); - UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); + const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID); print_client("static const RPC_CLIENT_INTERFACE %s___RpcClientInterface =\n", iface->name ); print_client("{\n"); @@ -423,7 +423,7 @@ static void write_formatstringsdecl(type_t *iface) static void write_implicithandledecl(type_t *iface) { - char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); + const char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); if (implicit_handle) { diff --git a/tools/widl/header.c b/tools/widl/header.c index c6184066a94..925301de87e 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -491,16 +491,16 @@ void write_externdef(const var_t *v) } void write_library(const char *name, attr_t *attr) { - UUID *uuid = get_attrp(attr, ATTR_UUID); + const UUID *uuid = get_attrp(attr, ATTR_UUID); fprintf(header, "\n"); write_guid("LIBID", name, uuid); fprintf(header, "\n"); } -var_t* get_explicit_handle_var(func_t* func) +const var_t* get_explicit_handle_var(const func_t* func) { - var_t* var; + const var_t* var; if (!func->args) return NULL; @@ -535,7 +535,7 @@ int is_local(attr_t *a) return is_attr(a, ATTR_LOCAL); } -var_t *is_callas(attr_t *a) +const var_t *is_callas(attr_t *a) { return get_attrp(a, ATTR_CALLAS); } @@ -893,7 +893,7 @@ static void write_com_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); + const char *var = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); if (!iface->funcs) return; diff --git a/tools/widl/header.h b/tools/widl/header.h index a29502dd080..63c732fc8bd 100644 --- a/tools/widl/header.h +++ b/tools/widl/header.h @@ -30,7 +30,7 @@ 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 var_t *is_callas(attr_t *a); +extern const var_t *is_callas(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); @@ -43,7 +43,7 @@ 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); +extern const var_t* get_explicit_handle_var(const func_t* func); static inline int is_string_type(const attr_t *attrs, int ptr_level, const expr_t *array) { diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 97b471d8030..79b2ce78057 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -889,13 +889,13 @@ static void write_proxy(type_t *iface) fprintf(proxy, " * %s interface\n", iface->name); fprintf(proxy, " */\n"); while (cur) { - var_t *def = cur->def; + const var_t *def = cur->def; if (!is_local(def->attrs)) { - var_t *cas = is_callas(def->attrs); + const var_t *cas = is_callas(def->attrs); const char *cname = cas ? cas->name : NULL; int idx = cur->idx; if (cname) { - func_t *m = iface->funcs; + const func_t *m = iface->funcs; while (m && strcmp(get_name(m->def), cname)) m = NEXT_LINK(m); idx = m->idx; diff --git a/tools/widl/server.c b/tools/widl/server.c index 23b303e928d..7a96abc4a45 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -68,9 +68,9 @@ static int print_server(const char *format, ...) } -static void write_parameters_init(func_t *func) +static void write_parameters_init(const func_t *func) { - var_t *var; + const var_t *var; if (!func->args) return; @@ -91,16 +91,16 @@ static void write_function_stubs(type_t *iface) { char *implicit_handle = get_attrp(iface->attrs, ATTR_IMPLICIT_HANDLE); int explicit_handle = is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE); - func_t *func = iface->funcs; - var_t *var; - var_t* explicit_handle_var; + const func_t *func = iface->funcs; + const var_t *var; + const var_t* explicit_handle_var; unsigned int proc_offset = 0; unsigned int type_offset = 2; while (NEXT_LINK(func)) func = NEXT_LINK(func); while (func) { - var_t *def = func->def; + const var_t *def = func->def; unsigned long buffer_size = 0; unsigned int type_offset_func; @@ -260,7 +260,7 @@ static void write_function_stubs(type_t *iface) if (func->args) { - var_t *var = func->args; + const var_t *var = func->args; while (NEXT_LINK(var)) var = NEXT_LINK(var); while (var) { diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index df58428f38b..a518c0c0232 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1338,7 +1338,7 @@ unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment) return get_required_buffer_size_type(var->type, var->ptr_level, var->array, var->name, alignment); } -void marshall_arguments(FILE *file, int indent, func_t *func, +void marshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass) { unsigned int last_size = 0; @@ -1533,7 +1533,7 @@ void marshall_arguments(FILE *file, int indent, func_t *func, } } -void unmarshall_arguments(FILE *file, int indent, func_t *func, +void unmarshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass) { unsigned int last_size = 0; diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h index 22251294d91..82a6cb5684a 100644 --- a/tools/widl/typegen.h +++ b/tools/widl/typegen.h @@ -30,8 +30,8 @@ enum pass void write_procformatstring(FILE *file, type_t *iface); void write_typeformatstring(FILE *file, type_t *iface); unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment); -void marshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type_offset, enum pass pass); -void unmarshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type_offset, enum pass pass); +void marshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass); +void unmarshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass); size_t get_size_procformatstring_var(const var_t *var); size_t get_size_typeformatstring_var(const var_t *var); int write_expr_eval_routines(FILE *file, const char *iface);