dbghelp: Constify some variables

Andrew Talbot Andrew.Talbot at talbotville.com
Thu Apr 19 16:00:04 CDT 2007


Changelog:
    dbghelp: Constify some variables.

diff -urN a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
--- a/dlls/dbghelp/dbghelp_private.h	2007-03-13 21:58:13.000000000 +0000
+++ b/dlls/dbghelp/dbghelp_private.h	2007-04-19 20:55:31.000000000 +0100
@@ -62,8 +62,8 @@
 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 @@
                                             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 -urN a/dlls/dbghelp/storage.c b/dlls/dbghelp/storage.c
--- a/dlls/dbghelp/storage.c	2006-12-11 13:45:46.000000000 +0000
+++ b/dlls/dbghelp/storage.c	2007-04-19 21:28:58.000000000 +0100
@@ -101,13 +101,13 @@
     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 @@
     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 @@
     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 -urN a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
--- a/dlls/dbghelp/symbol.c	2007-03-21 22:04:07.000000000 +0000
+++ b/dlls/dbghelp/symbol.c	2007-04-19 21:37:06.000000000 +0100
@@ -612,7 +612,7 @@
     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 @@
     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 @@
 
 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 @@
  *
  * 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 @@
     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 -urN a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
--- a/dlls/dbghelp/type.c	2007-03-13 21:58:11.000000000 +0000
+++ b/dlls/dbghelp/type.c	2007-04-19 20:42:43.000000000 +0100
@@ -100,7 +100,7 @@
     }
 }
 
-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-patches mailing list