Merge C++ conversion into trunk (5/6 - double_int rewrite)

Lawrence Crowl crowl@google.com
Mon Aug 13 20:28:00 GMT 2012


On 8/12/12, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sun, 12 Aug 2012, Diego Novillo wrote:
> > This implements the double_int rewrite.
> >
> > See http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00711.html for
> > details.
>
> I am taking it as a chance to ask a couple questions about the coding
> conventions.
>
> > 2012-08-12   Lawrence Crowl  <crowl@google.com>
> >
> > 	* hash-table.h
> > 	(typedef double_int): Change to struct (POD).
> > 	(double_int::make): New overloads for int to double-int conversion.
>
> Isn't that double_int::from_* now?

Yes.

> > +typedef struct double_int
> > {
> > [...]
> > } double_int;
>
> Does the coding convention say something about this verbosity?

No.  It helps to have it in code that is compiled by both C and C++.
In this case, it will only be compiled by C++ and the verbosity
is unnecessary.  I left the verbosity as it was to help keep the
diff synchronized.  I certainly don't object to a cleanup pass for
this kind of stuff.

> > +  HOST_WIDE_INT to_signed () const;
> > +  unsigned HOST_WIDE_INT to_unsigned () const;
> > +
> > +  /* Conversion query functions.  */
> > +
> > +  bool fits_unsigned() const;
> > +  bool fits_signed() const;
>
> Space before the parentheses or not?

Space.  Sorry, gcc is the only coding convention I've used that
requires the space.  My fingers sometimes forget.

-- 
Lawrence Crowl



More information about the Gcc-patches mailing list