This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [patch][gold] Add some typedefs


Rafael Espindola <espindola@google.com> writes:

> 2009-11-24  Rafael Avila de Espindola  <espindola@google.com>
>
> 	* incremental.cc (Incremental_inputs_header,
> 	Incremental_inputs_header_write, Incremental_inputs_entry,
> 	Incremental_inputs_entry_write): Add a typedef with the data type.


>  template<int size, bool big_endian>
>  class Incremental_inputs_header
>  {
> + private:
> +  typedef internal::Incremental_inputs_header_data data_type;

In gold, local types are always capitalized.  So this should be
  typedef internal::Incremental_inputs_header_data Data_type;

> +  const data_type* p_;

In gold, the private data members always go at the bottom of the class
definition.  You can change the definition of p_ to use the typedef,
but leave the definition at the bottom where it already is.


>  template<int size, bool big_endian>
>  class Incremental_inputs_header_write
>  {
> + private:
> +  typedef internal::Incremental_inputs_header_data data_type;

Capitalize data_type.

> +  data_type* p_;

Keep p_ at the bottom of the class.


> @@ -155,12 +157,16 @@ class Incremental_inputs_header_write
>  template<int size, bool big_endian>
>  class Incremental_inputs_entry
>  {
> + private:
> +  typedef internal::Incremental_inputs_entry_data data_type;

Same.

> +  const data_type* p_;

Same.


> @@ -195,12 +198,16 @@ class Incremental_inputs_entry
>  template<int size, bool big_endian>
>  class Incremental_inputs_entry_write
>  {
> + private:
> +  typedef internal::Incremental_inputs_entry_data data_type;

Same.

> +  data_type* p_;

Same.


This is OK with those changes.

Thanks.

Ian


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