Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Use std::vector for symtab_fns
Date: Wed, 11 Oct 2017 13:05:00 -0000	[thread overview]
Message-ID: <3f6790bb-4a36-2439-dece-42fbaa25b55f@redhat.com> (raw)
In-Reply-To: <1507665661-14742-1-git-send-email-simon.marchi@ericsson.com>

On 10/10/2017 09:01 PM, Simon Marchi wrote:
> Simple replacement of VEC with std::vector.
> 
> gdb/ChangeLog:
> 
> 	* symfile.c (registered_sym_fns): Make struct, not typedef.
> 	(DEF_VEC_O (registered_sym_fns)): Remove.
> 	(symtab_fns): Change type to std::vector.
> 	(add_symtab_fns): Adjust.
> 	(find_sym_fns): Adjust.


OK.

> -  for (i = 0; VEC_iterate (registered_sym_fns, symtab_fns, i, rsf); ++i)
> -    if (our_flavour == rsf->sym_flavour)
> -      return rsf->sym_fns;
> +  for (registered_sym_fns &rsf : symtab_fns)

Small nit: could this be a const ref?  I think it's a good
rule to prefer const over non-const references if we can.

> +    if (our_flavour == rsf.sym_flavour)
> +      return rsf.sym_fns;
>  
>    error (_("I'm sorry, Dave, I can't do that.  Symbol format `%s' unknown."),
>  	 bfd_get_target (abfd));
> 

Thanks,
Pedro Alves


  reply	other threads:[~2017-10-11 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 20:01 Simon Marchi
2017-10-11 13:05 ` Pedro Alves [this message]
2017-10-11 13:36   ` Simon Marchi

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=3f6790bb-4a36-2439-dece-42fbaa25b55f@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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