winedump: code cleanup Change Log: - winedump/symbol.c::symbol_clean_string - remove constness from parameter because it's changed inside of function - winedump/search.c::get_type - cleanup variable usage
Mikhail Maroukhine
mikolg at yandex.ru
Mon Mar 29 08:48:25 CDT 2010
---
tools/winedump/search.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 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);
--
1.6.3.3
------------VRRt0hTGm5SLrL8ACJ73zw--
More information about the wine-patches
mailing list