This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

make real.h constants more consistent


This is a small patch that simply hides the implementation of real
constants for e, 1/3, sqrt(2) from outside real.[ch]. I think this
makes the code cleaner (each constant has its own function, no special
enumeration constants needed, no switch needed) and easier to read
(dconst_e is easier and shorter than *get_real_const (rv_e)).

This version does not hide the function call.

Bootstrapped and regression tested with --enable-languages=all,ada on
x86_64-unknown-linux-gnu.

OK for trunk?


2008-08-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* real.h (dconst_e, dconst_third, dconst_sqrt2, dconst_e_ptr,
	dconst_third_ptr, dconst_sqrt2_ptr): Declare.
	(enum real_value_const): Delete.
	(get_real_const): Delete.
	* real.c (get_real_const): Delete.
	(dconst_e_ptr): Define.
	(dconst_third_ptr): Define.
	(dconst_sqrt2_ptr): Define.
	* builtins.c: Update all callers.

Attachment: dconst-try2.diff
Description: Text document


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