[gtkada] Glade (Gate) bug when generating code for large powers of 10.

Nicolas Setton setton at act-europe.fr
Tue Dec 2 11:08:38 CET 2003


Hello,

> The attached patch modifies To_Float to check for this case of power of
> 10 exponentiation and generate a comparable floating point literal
> instead:
> 
> Gtk_New (Spinbutton1_Adj, 1.0, 0.0, 1.0e+06, 1.0, 10.0, 10.0);
>                                     ^^^^^^^ Compilable and correct


Thanks a lot for this patch!

Note that there were many style errors (spaces required, lines too long,
etc), so in the future make sure that your file compiles with the style
options enabled ("-gnaty" would probably be enough)

Apart from that, the patch looks good and works well, so I'm integrating
it right away.

> I have a .glade file that exercises the patch with these variations (and
> which causes the original version to generate invalid code) for anyone
> that wants it.  (I don't want to clutter the list with it.)

That won't be necessary, I've added the test case our internal testing
suite.

Thanks again for the contribution!

Nico



More information about the gtkada mailing list