winedump: Fix compiler warnings with flag -Wcast-qual - winedump/symbol.c::symbol_get_type - remove constness from the parameter because parameter is changed inside of function - winedump/search.c: - remove not needed variable type_str_tmp - remove constness from the type_str because it's changed in the symbol_get_type
Mikhail Maroukhine
mikolg at yandex.ru
Wed Mar 31 13:26:27 CDT 2010
---
tools/winedump/search.c | 14 +++++++-------
tools/winedump/symbol.c | 3 +--
tools/winedump/winedump.h | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/tools/winedump/search.c b/tools/winedump/search.c
index 2893697..ba7b0e4 100644
--- a/tools/winedump/search.c
+++ b/tools/winedump/search.c
@@ -242,14 +242,14 @@ static int symbol_from_prototype (parsed_symbol *sym, const char *proto)
static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
{
int is_const, is_volatile, is_struct, is_signed, is_unsigned, ptrs = 0;
- const char *iter, *type_str, *base_type, *catch_unsigned;
- char dest_type, *type_str_tmp;
+ const char *iter, *base_type, *catch_unsigned;
+ char dest_type, *type_str;
+ const char *origProtoRef = proto;
assert (sym && sym->symbol);
assert (proto && *proto);
assert (arg < 0 || (unsigned)arg == sym->argc);
- type_str = proto;
proto = str_match (proto, "const", &is_const);
proto = str_match (proto, "volatile", &is_volatile);
@@ -297,13 +297,13 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
if (!*proto)
return NULL;
- type_str = type_str_tmp = str_substring (type_str, proto);
+ type_str = str_substring (origProtoRef, proto);
if (iter == base_type || catch_unsigned)
{
/* 'unsigned' with no type */
char *tmp = str_create (2, type_str, " int");
- free (type_str_tmp);
- type_str = type_str_tmp = tmp;
+ free (type_str);
+ type_str = tmp;
}
symbol_clean_string (type_str);
@@ -326,7 +326,7 @@ static const char *get_type (parsed_symbol *sym, const char *proto, int arg)
iter = str_find_set (proto, " ,)");
if (!iter)
{
- free (type_str_tmp);
+ free (type_str);
return NULL;
}
sym->arg_name [arg] = str_substring (proto, iter);
diff --git a/tools/winedump/symbol.c b/tools/winedump/symbol.c
index 13725e5..9fd5c6f 100644
--- a/tools/winedump/symbol.c
+++ b/tools/winedump/symbol.c
@@ -287,10 +287,9 @@ int symbol_get_type (const char *string)
*
* Make a type string more Wine-friendly. Logically const :-)
*/
-void symbol_clean_string (const char *string)
+void symbol_clean_string (char *str)
{
const char * const *tab = swap_after;
- char *str = (char *)string;
#define SWAP(i, p, x, y) do { i = p; while ((i = str_replace (i, x, y))); } while(0)
diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h
index d7e4e1d..82eb6d8 100644
--- a/tools/winedump/winedump.h
+++ b/tools/winedump/winedump.h
@@ -176,7 +176,7 @@ const char *symbol_get_call_convention(const parsed_symbol *sym);
const char *symbol_get_spec_type (const parsed_symbol *sym, size_t arg);
-void symbol_clean_string (const char *string);
+void symbol_clean_string (char *string);
int symbol_get_type (const char *string);
--
1.6.3.3
------------Jlfq6yvGxxQGyeBcqx8tt4--
More information about the wine-patches
mailing list