public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [pushed] Remove two unnecessary casts
Date: Tue, 27 Feb 2024 15:17:05 -0800	[thread overview]
Message-ID: <a3d7ea20-458d-485c-8ebb-b12ed9f02d35@FreeBSD.org> (raw)
In-Reply-To: <20240226205202.509729-1-tromey@adacore.com>

On 2/26/24 12:52 PM, Tom Tromey wrote:
> 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.
> ---
>   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 *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);
>   }
>   

LGTM

Approved-By: John Baldwin <jhb@FreeBSD.org>

-- 
John Baldwin


  reply	other threads:[~2024-02-27 23:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 20:52 Tom Tromey
2024-02-27 23:17 ` John Baldwin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-13 15:59 Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3d7ea20-458d-485c-8ebb-b12ed9f02d35@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).