From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id CDE283858C98; Mon, 26 Feb 2024 20:55:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDE283858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708980939; bh=w/8VMHOXqx8jV26Je/2wYLKbeaWU16it1Crgsa2BeK0=; h=From:To:Subject:Date:From; b=r1rYJG6JN2O3n3X05ekWgEJlE20ZZZFBLW+gYcDK3Ir4yaUj047RH7CQ8T+IV6LVg LXVWOpkgyougnUA1i0ZwZcMAPKIUnt64bbwX/qehD392IqspHBBVegW5vYQ+Qgc03g wuDztHEmfnSAZT7JCJK76wFQrrbD0FnofnEpXAdI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove two unnecessary casts X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 3d2d21728b6db4430ff168ee27e12fc6e2627fad X-Git-Newrev: 4c3b59d5ba864609049df054e117bf6417194d22 Message-Id: <20240226205539.CDE283858C98@sourceware.org> Date: Mon, 26 Feb 2024 20:55:39 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4c3b59d5ba86= 4609049df054e117bf6417194d22 commit 4c3b59d5ba864609049df054e117bf6417194d22 Author: Tom Tromey Date: Mon Feb 26 13:50:54 2024 -0700 Remove two unnecessary casts =20 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: --- gdb/ada-lang.c | 2 +- gdb/eval.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 *expe= ct_type, arg1)); else return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int, - (CORE_ADDR) value_as_address (arg1)); + value_as_address (arg1)); } =20 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 express= ion *exp, BUILTIN_TYPE_LONGEST would seem to be a mistake. */ if (type->code () =3D=3D 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); }