This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] auxv, blockframe, regcache, charset, disasm, source, value.c: remove unused variables.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 06 May 2010 11:08:46 -0700
- Subject: [patch] auxv, blockframe, regcache, charset, disasm, source, value.c: remove unused variables.
2010-05-06 Michael Snyder <msnyder@vmware.com>
* auxv.c (target_auxv_search): Delete unused variable.
* blockframe.c (get_frame_block): Delete unused variable.
* regcache.c (regcache_cpy): Delete unused variable.
(regcache_cpy_no_passthrough): Delete unused variable.
* charset.c (wchar_iterate): Delete unused variable.
(find_charset_names): Delete unused variable.
(_initialize_charset): Delete unused variable.
* disasm.c (do_mixed_source_and_assembly):
Delete unused variable.
* source.c (set_default_source_symtab_and_line):
Delete unused variable.
(set_substitute_path_command): Delete unused variable.
* value.c (preserve_values): Delete unused variable.
(value_from_double): Delete unused variable.
Index: auxv.c
===================================================================
RCS file: /cvs/src/src/gdb/auxv.c,v
retrieving revision 1.25
diff -u -p -r1.25 auxv.c
--- auxv.c 14 Jan 2010 21:14:59 -0000 1.25
+++ auxv.c 6 May 2010 18:06:18 -0000
@@ -258,7 +258,6 @@ target_auxv_search (struct target_ops *o
gdb_byte *data;
LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data);
gdb_byte *ptr = data;
- int ents = 0;
if (n <= 0)
return n;
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.126
diff -u -p -r1.126 blockframe.c
--- blockframe.c 10 Mar 2010 18:20:06 -0000 1.126
+++ blockframe.c 6 May 2010 18:06:18 -0000
@@ -59,7 +59,6 @@ struct block *
get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
{
const CORE_ADDR pc = get_frame_address_in_block (frame);
- struct frame_info *next_frame;
struct block *bl;
int inline_count;
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.178
diff -u -p -r1.178 regcache.c
--- regcache.c 29 Apr 2010 16:33:15 -0000 1.178
+++ regcache.c 6 May 2010 18:06:18 -0000
@@ -350,9 +350,6 @@ do_cooked_read (void *src, int regnum, g
void
regcache_cpy (struct regcache *dst, struct regcache *src)
{
- int i;
- gdb_byte *buf;
-
gdb_assert (src != NULL && dst != NULL);
gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
gdb_assert (src != dst);
@@ -369,7 +366,6 @@ regcache_cpy (struct regcache *dst, stru
void
regcache_cpy_no_passthrough (struct regcache *dst, struct regcache *src)
{
- int i;
gdb_assert (src != NULL && dst != NULL);
gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
/* NOTE: cagney/2002-05-17: Don't let the caller do a no-passthrough
Index: charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.31
diff -u -p -r1.31 charset.c
--- charset.c 6 Apr 2010 17:47:40 -0000 1.31
+++ charset.c 6 May 2010 18:06:18 -0000
@@ -634,7 +634,6 @@ wchar_iterate (struct wchar_iterator *it
size_t orig_in = iter->bytes;
size_t out_avail = out_request * sizeof (gdb_wchar_t);
size_t num;
- gdb_wchar_t result;
size_t r = iconv (iter->desc,
(ICONV_CONST char **) &iter->input, &iter->bytes,
@@ -814,7 +813,7 @@ find_charset_names (void)
/* The size of buf is chosen arbitrarily. */
char buf[1024];
char *start, *r;
- int len, keep_going;
+ int len;
r = fgets (buf, sizeof (buf), in);
if (!r)
@@ -909,8 +908,6 @@ default_auto_wide_charset (void)
void
_initialize_charset (void)
{
- struct cmd_list_element *new_cmd;
-
/* The first element is always "auto". */
VEC_safe_push (char_ptr, charsets, xstrdup ("auto"));
find_charset_names ();
Index: disasm.c
===================================================================
RCS file: /cvs/src/src/gdb/disasm.c,v
retrieving revision 1.39
diff -u -p -r1.39 disasm.c
--- disasm.c 6 May 2010 00:21:53 -0000 1.39
+++ disasm.c 6 May 2010 18:06:18 -0000
@@ -180,7 +180,6 @@ do_mixed_source_and_assembly (struct gdb
int i;
int out_of_order = 0;
int next_line = 0;
- CORE_ADDR pc;
int num_displayed = 0;
struct cleanup *ui_out_chain;
struct cleanup *ui_out_tuple_chain = make_cleanup (null_cleanup, 0);
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.110
diff -u -p -r1.110 source.c
--- source.c 14 Apr 2010 21:22:29 -0000 1.110
+++ source.c 6 May 2010 18:06:18 -0000
@@ -176,8 +176,6 @@ get_current_source_symtab_and_line (void
void
set_default_source_symtab_and_line (void)
{
- struct symtab_and_line cursal;
-
if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
@@ -1874,7 +1872,6 @@ unset_substitute_path_command (char *arg
static void
set_substitute_path_command (char *args, int from_tty)
{
- char *from_path, *to_path;
char **argv;
struct substitute_path_rule *rule;
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.101
diff -u -p -r1.101 value.c
--- value.c 22 Mar 2010 18:47:00 -0000 1.101
+++ value.c 6 May 2010 18:06:18 -0000
@@ -1481,7 +1481,6 @@ preserve_values (struct objfile *objfile
htab_t copied_types;
struct value_history_chunk *cur;
struct internalvar *var;
- struct value *val;
int i;
/* Create the hash table. We allocate on the objfile's obstack, since
@@ -2243,7 +2242,6 @@ value_from_double (struct type *type, DO
struct value *val = allocate_value (type);
struct type *base_type = check_typedef (type);
enum type_code code = TYPE_CODE (base_type);
- int len = TYPE_LENGTH (base_type);
if (code == TYPE_CODE_FLT)
{