This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] cleanup: remove unused - c-*
- From: Aleksandar Ristovski <aristovski at qnx dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 30 Jan 2013 22:25:35 -0500
- Subject: [patch] cleanup: remove unused - c-*
- Newsgroups: gmane.comp.gdb.patches
Hello,
This is removing unused variables and allows compiling with -Wunused.
Thanks,
Aleksandar Ristovski
QNX Software Systems
ChangeLog:
Aleksandar Ristovski <aristovski@qnx.com>
* c-exp.y (classify_inner_name): Remove unused TYPE.
* c-lang.c (c_printstr): Remove unused BYTE_ORDER, I, THINGS_PRINTED,
IN_QUOTES, NEED_COMMA, WCHAR_BUF, OUTPUT, CLEANUP, ITER, FINISHED,
NEED_ESCAPE.
(c_get_string): Remove unused KIND.
* c-typeprint.c (c_type_print_args): Remove unused I, LEN, ARGS,
TABLE2.
Index: gdb/c-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/c-exp.y,v
retrieving revision 1.110
diff -u -p -r1.110 c-exp.y
--- gdb/c-exp.y 25 Jan 2013 17:34:03 -0000 1.110
+++ gdb/c-exp.y 30 Jan 2013 22:25:14 -0000
@@ -2865,7 +2865,7 @@ classify_name (const struct block *block
static int
classify_inner_name (const struct block *block, int first_name)
{
- struct type *type, *new_type;
+ struct type *type;
char *copy;
if (first_name)
Index: gdb/c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.103
diff -u -p -r1.103 c-lang.c
--- gdb/c-lang.c 1 Jan 2013 06:32:40 -0000 1.103
+++ gdb/c-lang.c 30 Jan 2013 22:25:14 -0000
@@ -196,17 +196,6 @@ c_printstr (struct ui_file *stream, stru
const char *type_encoding;
const char *encoding;
- enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
- unsigned int i;
- unsigned int things_printed = 0;
- int in_quotes = 0;
- int need_comma = 0;
- struct obstack wchar_buf, output;
- struct cleanup *cleanup;
- struct wchar_iterator *iter;
- int finished = 0;
- int need_escape = 0;
-
str_type = (classify_type (type, get_type_arch (type), &type_encoding)
& ~C_CHAR);
switch (str_type)
@@ -255,7 +244,6 @@ c_get_string (struct value *value, gdb_b
int req_length = *length;
enum bfd_endian byte_order
= gdbarch_byte_order (get_type_arch (type));
- enum c_string_type kind;
if (element_type == NULL)
goto error;
@@ -284,7 +272,7 @@ c_get_string (struct value *value, gdb_b
if (! c_textual_element_type (element_type, 0))
goto error;
- kind = classify_type (element_type,
+ (void) classify_type (element_type,
get_type_arch (element_type),
charset);
width = TYPE_LENGTH (element_type);
Index: gdb/c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.90
diff -u -p -r1.90 c-typeprint.c
--- gdb/c-typeprint.c 14 Jan 2013 20:59:26 -0000 1.90
+++ gdb/c-typeprint.c 30 Jan 2013 22:25:14 -0000
@@ -462,13 +462,10 @@ c_type_print_args (struct type *type, st
int linkage_name, enum language language,
const struct type_print_options *flags)
{
- int i, len;
- struct field *args;
+ int i;
int printed_any = 0;
fprintf_filtered (stream, "(");
- args = TYPE_FIELDS (type);
- len = TYPE_NFIELDS (type);
for (i = 0; i < TYPE_NFIELDS (type); i++)
{
@@ -1298,7 +1295,6 @@ c_type_print_base (struct type *type, st
for (i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++)
{
struct type *target = TYPE_TYPEDEF_FIELD_TYPE (type, i);
- struct typedef_hash_table *table2;
/* Dereference the typedef declaration itself. */
gdb_assert (TYPE_CODE (target) == TYPE_CODE_TYPEDEF);