This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 19/22] Convert tid_range_parser to class

>>>>> "Pedro" == Pedro Alves <> writes:

Pedro> Whoops, we ended up duplicating work here.

Oops :) But no big deal.

Pedro> Additional differences compared to yours are:
Pedro> - "bool" instead of "int".
Pedro> - "m_" prefixes.

Aha, the m_ prefix.  Cancel that earlier question...

Pedro> Let me know what you think.  It's super fine with me to rebase
Pedro> mine on top of yours.  Did you have a follow up patch for
Pedro> get_number_or_range too, perhaps?

I don't.  How about I just drop my patch?  That seems simplest to me.

Pedro>  void
Pedro> -init_number_or_range (struct get_number_or_range_state *state,
Pedro> -		      const char *string)
Pedro> +number_or_range_parser::init (const char *string)
Pedro>  {
Pedro> -  memset (state, 0, sizeof (*state));
Pedro> -  state->string = string;
Pedro> +  memset (this, 0, sizeof (*this));

I think it's better to do explicit initialization.
This will bite if this class ever is changed to have a vtable (unlikely
but it's better, IMO, to set a good example).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]