Robert Shearman : widl: Yet more const attributes.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 7 06:05:52 CST 2006


Module: wine
Branch: refs/heads/master
Commit: f1bb0a474b4664f4dbba46574bbf248b50ed650b
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=f1bb0a474b4664f4dbba46574bbf248b50ed650b

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Feb  7 12:31:43 2006 +0100

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 91b4b39..136e131 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -66,13 +66,13 @@ static int print_client( const char *for
 }
 
 
-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(fu
 
 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 
     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 *i
 
 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 
 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
 
 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 c618406..925301d 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 *
 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 a29502d..63c732f 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -30,7 +30,7 @@ extern const char* get_name(const var_t 
 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 *
 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 97b471d..79b2ce7 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 23b303e..7a96abc 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -68,9 +68,9 @@ static int print_server(const char *form
 }
 
 
-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 
 {
     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 
 
         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 df58428..a518c0c 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1338,7 +1338,7 @@ unsigned int get_required_buffer_size(co
     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 
     }
 }
 
-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 2225129..82a6cb5 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);




More information about the wine-cvs mailing list