From: Tom Tromey Date: Mon, 26 Feb 2024 20:50:54 +0000 (-0700) Subject: Remove two unnecessary casts X-Git-Tag: gdb-15-branchpoint~876 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c3b59d5ba864609049df054e117bf6417194d22;p=thirdparty%2Fbinutils-gdb.git Remove two unnecessary casts I noticed a spot in ada-lang.c where the return value of value_as_address was cast to CORE_ADDR -- a no-op cast. I searched and found another. This patch fixes both. --- diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 3f398540010..1c26ebf7b30 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10993,7 +10993,7 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, arg1)); else return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int, - (CORE_ADDR) value_as_address (arg1)); + value_as_address (arg1)); } if (ada_is_array_descriptor_type (type)) diff --git a/gdb/eval.c b/gdb/eval.c index 4c438f927c0..2759b46a5df 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1685,7 +1685,7 @@ eval_op_ind (struct type *expect_type, struct expression *exp, BUILTIN_TYPE_LONGEST would seem to be a mistake. */ if (type->code () == TYPE_CODE_INT) return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int, - (CORE_ADDR) value_as_address (arg1)); + value_as_address (arg1)); return value_ind (arg1); }