* [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables.
@ 2010-05-06 18:32 Michael Snyder
2010-05-07 17:23 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Michael Snyder @ 2010-05-06 18:32 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: tmp21.txt --]
[-- Type: text/plain, Size: 5250 bytes --]
2010-05-06 Michael Snyder <msnyder@vmware.com>
* eval.c (evaluate_subexp_standard): Delete unused variable.
* valops.c (value_cast_pointers): Delete unused variable.
(value_dynamic_cast): Delete unused variable.
(value_array): Delete unused variable.
(find_overload_match): Delete unused variable.
* valarith.c (value_subscript): Delete unused variable.
(value_binop): Delete unused variable.
* valprint.c (_initialize_valprint): Delete unused variable.
* printcmd.c (print_command_1): Delete unused variable.
(address_info): Delete unused variable.
(printf_command): Delete unused variable.
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.129
diff -u -p -r1.129 eval.c
--- eval.c 15 Mar 2010 17:29:36 -0000 1.129
+++ eval.c 6 May 2010 18:25:21 -0000
@@ -690,7 +690,7 @@ evaluate_subexp_standard (struct type *e
struct type *type;
int nargs;
struct value **argvec;
- int upper, lower, retcode;
+ int upper, lower;
int code;
int ix;
long mem_offset;
@@ -1418,7 +1418,6 @@ evaluate_subexp_standard (struct type *e
{
/* Unpack it locally so we can properly handle overload
resolution. */
- struct type *qual_type;
char *name;
int local_tem;
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.239
diff -u -p -r1.239 valops.c
--- valops.c 15 Mar 2010 17:29:36 -0000 1.239
+++ valops.c 6 May 2010 18:25:21 -0000
@@ -298,7 +298,6 @@ value_cast_structs (struct type *type, s
struct value *
value_cast_pointers (struct type *type, struct value *arg2)
{
- struct type *type1 = check_typedef (type);
struct type *type2 = check_typedef (value_type (arg2));
struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
@@ -695,7 +694,7 @@ dynamic_cast_check_2 (struct type *desir
struct value *
value_dynamic_cast (struct type *type, struct value *arg)
{
- int unambiguous = 0, full, top, using_enc;
+ int full, top, using_enc;
struct type *resolved_type = check_typedef (type);
struct type *arg_type = check_typedef (value_type (arg));
struct type *class_type, *rtti_type;
@@ -1614,7 +1613,6 @@ value_array (int lowbound, int highbound
unsigned int typelength;
struct value *val;
struct type *arraytype;
- CORE_ADDR addr;
/* Validate that the bounds are reasonable and that each of the
elements have the same size. */
@@ -2334,8 +2332,6 @@ find_overload_match (struct type **arg_t
int num_fns = 0;
struct type *basetype = NULL;
int boffset;
- int ix;
- int static_offset;
struct cleanup *old_cleanups = NULL;
const char *obj_type_name = NULL;
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.82
diff -u -p -r1.82 valarith.c
--- valarith.c 16 Mar 2010 20:51:23 -0000 1.82
+++ valarith.c 6 May 2010 18:25:21 -0000
@@ -146,7 +146,6 @@ an integer nor a pointer of the same typ
struct value *
value_subscript (struct value *array, LONGEST index)
{
- struct value *bound;
int c_style = current_language->c_style_arrays;
struct type *tarray;
@@ -881,7 +880,6 @@ value_binop (struct value *arg1, struct
if (TYPE_CODE (type1) == TYPE_CODE_DECFLOAT
|| TYPE_CODE (type2) == TYPE_CODE_DECFLOAT)
{
- struct type *v_type;
int len_v1, len_v2, len_v;
enum bfd_endian byte_order_v1, byte_order_v2, byte_order_v;
gdb_byte v1[16], v2[16];
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.91
diff -u -p -r1.91 valprint.c
--- valprint.c 20 Apr 2010 22:26:56 -0000 1.91
+++ valprint.c 6 May 2010 18:25:21 -0000
@@ -1631,8 +1631,6 @@ show_print (char *args, int from_tty)
void
_initialize_valprint (void)
{
- struct cmd_list_element *c;
-
add_prefix_cmd ("print", no_class, set_print,
_("Generic command for setting how things print."),
&setprintlist, "set print ", 0, &setlist);
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.177
diff -u -p -r1.177 printcmd.c
--- printcmd.c 4 May 2010 06:48:26 -0000 1.177
+++ printcmd.c 6 May 2010 18:25:21 -0000
@@ -959,7 +959,6 @@ print_command_1 (char *exp, int inspect,
if (exp && *exp)
{
- struct type *type;
expr = parse_expression (exp);
old_chain = make_cleanup (free_current_contents, &expr);
cleanup = 1;
@@ -1175,7 +1174,6 @@ sym_info (char *arg, int from_tty)
static void
address_info (char *exp, int from_tty)
{
- struct block *block;
struct gdbarch *gdbarch;
int regno;
struct symbol *sym;
@@ -2383,7 +2381,6 @@ printf_command (char *arg, int from_tty)
{
struct gdbarch *gdbarch
= get_type_arch (value_type (val_args[i]));
- enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct type *wctype = lookup_typename (current_language, gdbarch,
"wchar_t", NULL, 0);
struct type *valtype;
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables.
2010-05-06 18:32 [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables Michael Snyder
@ 2010-05-07 17:23 ` Tom Tromey
2010-05-07 18:49 ` Michael Snyder
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2010-05-07 17:23 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:
Michael> struct value *
Michael> value_cast_pointers (struct type *type, struct value *arg2)
Michael> {
Michael> - struct type *type1 = check_typedef (type);
Michael> struct type *type2 = check_typedef (value_type (arg2));
Michael> struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
Michael> struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
In this case I think the intent is for t1 to reference type1, and not type.
I would recommend making that change rather than deleting type1.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables.
2010-05-07 17:23 ` Tom Tromey
@ 2010-05-07 18:49 ` Michael Snyder
0 siblings, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2010-05-07 18:49 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 652 bytes --]
Tom Tromey wrote:
>>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:
>
> Michael> struct value *
> Michael> value_cast_pointers (struct type *type, struct value *arg2)
> Michael> {
> Michael> - struct type *type1 = check_typedef (type);
> Michael> struct type *type2 = check_typedef (value_type (arg2));
> Michael> struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
> Michael> struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
>
> In this case I think the intent is for t1 to reference type1, and not type.
> I would recommend making that change rather than deleting type1.
OK -- committed as attached.
[-- Attachment #2: type1.txt --]
[-- Type: text/plain, Size: 895 bytes --]
2010-05-07 Michael Snyder <msnyder@vmware.com>
* valops.c (value_cast_pointers): Restore unused variable 'type1',
and use it to compute variable 't1'.
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.241
diff -u -p -r1.241 valops.c
--- valops.c 7 May 2010 14:46:26 -0000 1.241
+++ valops.c 7 May 2010 18:48:11 -0000
@@ -300,8 +300,9 @@ value_cast_structs (struct type *type, s
struct value *
value_cast_pointers (struct type *type, struct value *arg2)
{
+ struct type *type1 = check_typedef (type);
struct type *type2 = check_typedef (value_type (arg2));
- struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type));
+ struct type *t1 = check_typedef (TYPE_TARGET_TYPE (type1));
struct type *t2 = check_typedef (TYPE_TARGET_TYPE (type2));
if (TYPE_CODE (t1) == TYPE_CODE_STRUCT
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-05-07 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-06 18:32 [patch] eval, valops, valarith, valprint, printcmd.c: delete unused variables Michael Snyder
2010-05-07 17:23 ` Tom Tromey
2010-05-07 18:49 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox