Andrew Talbot : dbghelp: Constify some variables.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 20 07:11:02 CDT 2007


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

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Thu Apr 19 22:00:04 2007 +0100

dbghelp: Constify some variables.

---

 dlls/dbghelp/dbghelp_private.h |   10 +++++-----
 dlls/dbghelp/storage.c         |    8 ++++----
 dlls/dbghelp/symbol.c          |   10 +++++-----
 dlls/dbghelp/type.c            |    2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 9eccde6..a84d91c 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -62,8 +62,8 @@ unsigned vector_length(const struct vector* v);
 void*    vector_at(const struct vector* v, unsigned pos);
 void*    vector_add(struct vector* v, struct pool* pool);
 /*void     vector_pool_normalize(struct vector* v, struct pool* pool); */
-void*    vector_iter_up(const struct vector* v, void* elt);
-void*    vector_iter_down(const struct vector* v, void* elt);
+void*    vector_iter_up(const struct vector* v, const void* elt);
+void*    vector_iter_down(const struct vector* v, const void* elt);
 
 struct sparse_array
 {
@@ -557,10 +557,10 @@ extern struct symt_function_point*
                                             enum SymTagEnum point, 
                                             const struct location* loc,
                                             const char* name);
-extern BOOL         symt_fill_func_line_info(struct module* module,
-                                             struct symt_function* func, 
+extern BOOL         symt_fill_func_line_info(const struct module* module,
+                                             const struct symt_function* func,
                                              DWORD addr, IMAGEHLP_LINE* line);
-extern BOOL         symt_get_func_line_next(struct module* module, PIMAGEHLP_LINE line);
+extern BOOL         symt_get_func_line_next(const struct module* module, PIMAGEHLP_LINE line);
 extern struct symt_thunk*
                     symt_new_thunk(struct module* module, 
                                    struct symt_compiland* parent,
diff --git a/dlls/dbghelp/storage.c b/dlls/dbghelp/storage.c
index 2d88d8c..e196143 100644
--- a/dlls/dbghelp/storage.c
+++ b/dlls/dbghelp/storage.c
@@ -101,13 +101,13 @@ void* pool_alloc(struct pool* pool, unsigned len)
     return ret;
 }
 
-static struct pool_arena* pool_is_last(struct pool* pool, void* p, unsigned old_size)
+static struct pool_arena* pool_is_last(const struct pool* pool, const void* p, unsigned old_size)
 {
     struct pool_arena*  arena;
 
     for (arena = pool->first; arena; arena = arena->next)
     {
-        if (arena->current == (char*)p + old_size) return arena;
+        if (arena->current == (const char*)p + old_size) return arena;
     }
     return NULL;
 }
@@ -206,7 +206,7 @@ static unsigned vector_position(const struct vector* v, const void* elt)
     return 0;
 }
 
-void* vector_iter_up(const struct vector* v, void* elt)
+void* vector_iter_up(const struct vector* v, const void* elt)
 {
     unsigned    pos;
 
@@ -216,7 +216,7 @@ void* vector_iter_up(const struct vector* v, void* elt)
     return vector_at(v, pos);
 }
 
-void* vector_iter_down(const struct vector* v, void* elt)
+void* vector_iter_down(const struct vector* v, const void* elt)
 {
     unsigned    pos;
     if (!elt) return vector_at(v, vector_length(v) - 1);
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index 2907bf3..2af5c88 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -612,7 +612,7 @@ struct sym_enum
     char                                buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME];
 };
 
-static BOOL send_symbol(const struct sym_enum* se, struct module_pair* pair,
+static BOOL send_symbol(const struct sym_enum* se, const struct module_pair* pair,
                         const struct symt_function* func, const struct symt* sym)
 {
     symt_fill_sym_info(pair, func, sym, se->sym_info);
@@ -622,7 +622,7 @@ static BOOL send_symbol(const struct sym_enum* se, struct module_pair* pair,
     return !se->cb(se->sym_info, se->sym_info->Size, se->user);
 }
 
-static BOOL symt_enum_module(struct module_pair* pair, regex_t* regex,
+static BOOL symt_enum_module(struct module_pair* pair, const regex_t* regex,
                              const struct sym_enum* se)
 {
     void*                       ptr;
@@ -752,7 +752,7 @@ struct symt_ht* symt_find_nearest(struct module* module, DWORD addr)
 
 static BOOL symt_enum_locals_helper(struct module_pair* pair,
                                     regex_t* preg, const struct sym_enum* se,
-                                    struct symt_function* func, struct vector* v)
+                                    struct symt_function* func, const struct vector* v)
 {
     struct symt**       plsym = NULL;
     struct symt*        lsym = NULL;
@@ -1223,7 +1223,7 @@ BOOL WINAPI SymGetSymFromName(HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symb
  *
  * fills information about a file
  */
-BOOL symt_fill_func_line_info(struct module* module, struct symt_function* func, 
+BOOL symt_fill_func_line_info(const struct module* module, const struct symt_function* func,
                               DWORD addr, IMAGEHLP_LINE* line)
 {
     struct line_info*   dli = NULL;
@@ -1450,7 +1450,7 @@ BOOL WINAPI SymGetLinePrev64(HANDLE hProcess, PIMAGEHLP_LINE64 Line)
     return TRUE;
 }
     
-BOOL symt_get_func_line_next(struct module* module, PIMAGEHLP_LINE line)
+BOOL symt_get_func_line_next(const struct module* module, PIMAGEHLP_LINE line)
 {
     struct line_info*   li;
 
diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
index 7429b04..97c606a 100644
--- a/dlls/dbghelp/type.c
+++ b/dlls/dbghelp/type.c
@@ -100,7 +100,7 @@ const char* symt_get_name(const struct symt* sym)
     }
 }
 
-static struct symt* symt_find_type_by_name(struct module* module, 
+static struct symt* symt_find_type_by_name(const struct module* module,
                                            enum SymTagEnum sym_tag, 
                                            const char* typename)
 {




More information about the wine-cvs mailing list