diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-01 10:07:24 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-01 10:07:24 +0000 |
commit | 22631b419cdf2889e3d298f8f6012ce939735a28 (patch) | |
tree | 91820ae56088b235e14ebd8b3e430343693d843a /gcc/ada/s-dimmks.ads | |
parent | 3cc18861212f992470d0e8edce992792ca23872b (diff) | |
download | gcc-22631b419cdf2889e3d298f8f6012ce939735a28.tar.gz |
2012-10-01 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Process_Convention, Process_Import_Or_Interface):
Adjust test so that when the pragma comes from an aspect
specification it only applies to the entity in the original
declaration.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* gnat_ugn.texi: Document new command line switch -fada-spec-parent.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c, g-socket.ads: Minor code improvement: use gcc
builtin __alignof__ to get the alignment of struct fd_set.
2012-10-01 Vincent Pucci <pucci@adacore.com>
* exp_ch6.adb (Expand_Call): Remove call to
Remove_Dimension_In_Call.
* sem_aggr.adb (Resolve_Array_Aggregate): Analyze dimension of
components in array aggregate.
(Resolve_Aggr_Expr): Propagate dimensions from the original expression
Expr to the new created expression New_Expr when resolving the
expression of a component in record aggregates.
(Resolve_Record_Aggregate): Analyze
dimension of components in record (or extension) aggregate.
* sem_ch6.adb (Analyze_Subprogram_Specification): Analyze
dimension of formals with default expressions in subprogram
specification.
* sem_ch8.adb (Analyze_Expanded_Name): Analyze dimension of
expanded names.
(Find_Selected_Component): Analyze dimension of selected component.
* sem_dim.adb: Several dimension error messages reformatting.
(Dimensions_Msg_Of): New flag Description_Needed in order to
differentiate two different sort of dimension error messages.
(Dim_Warning_For_Numeric_Literal): New routine.
(Exists): New routine.
(Move_Dimensions): Routine spec moved to spec file.
* sem_dim.ads (String_From_Numeric_Literal): New routine.
(Analyze_Dimension): Analyze dimension only when the
node comes from source. Dimension analysis for expanded names added.
(Analyze_Dimension_Array_Aggregate): New routine.
(Analyze_Dimension_Call): New routine.
(Analyze_Dimension_Component_Declaration): Warning if default
expression is a numeric literal.
(Analyze_Dimension_Extension_Or_Record_Aggregate): New routine.
(Analyze_Dimension_Formals): New routine.
(Analyze_Dimension_Object_Declaration): Warning if default
expression is a numeric literal.
(Symbol_Of): Return either the dimension subtype symbol or the
dimension symbol built by From_Dim_To_Str_Of_Unit_Symbols.
* sem_dim.ads (Analyze_Dimension_Array_Aggregate): New routine.
(Analyze_Dimension_Call): New routine.
(Analyze_Dimension_Extension_Or_Record_Aggregate): New routine.
(Analyze_Dimension_Formals): New routine.
(Move_Dimensions): Moved from sem_dim.adb.
* s-dimmks.ads: Turn off the warnings for dimensioned object
declaration. Dimensioned subtypes sorted in alphabetical
order. New subtypes Area, Speed, Volume.
* s-dmotpr.ads: Turn off the warnings for dimensioned object
declaration.
* sem_res.adb (Resolve_Call): Analyze dimension for calls.
2012-10-01 Thomas Quinot <quinot@adacore.com>
* Make-generated.in: Minor cleanup of all targets: use
MOVE_IF_CHANGE to put generated files in place, to avoid useless
recompilations.
2012-10-01 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Expand_Dispatching_Call): For functions returning
interface types add an implicit conversion to the returned object
to force the displacement of the pointer to the returned object
to reference the corresponding secondary dispatch table. This
is needed to handle well combined calls involving secondary
dispatch tables (for example Obj.Prim1.Prim2).
* exp_ch4.adb (Expand_Allocator_Expression): Declare internal
access type as access to constant or access to variable depending
on the context. Found working in this ticket.
2012-10-01 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Apply_Predicate_Check): Do not apply check to
actual of predicate checking procedure, to prevent infinite
recursion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-dimmks.ads')
-rw-r--r-- | gcc/ada/s-dimmks.ads | 184 |
1 files changed, 106 insertions, 78 deletions
diff --git a/gcc/ada/s-dimmks.ads b/gcc/ada/s-dimmks.ads index fd0fc0060eb..fa0c6e0356d 100644 --- a/gcc/ada/s-dimmks.ads +++ b/gcc/ada/s-dimmks.ads @@ -103,6 +103,9 @@ package System.Dim.Mks is -- SI Base units + pragma Warnings (Off); + -- Turn off the all the dimension warnings + m : constant Length := 1.0; kg : constant Mass := 1.0; s : constant Time := 1.0; @@ -111,98 +114,134 @@ package System.Dim.Mks is mol : constant Amount_Of_Substance := 1.0; cd : constant Luminous_Intensity := 1.0; + pragma Warnings (On); + -- SI Derived dimensioned subtypes + subtype Absorbed_Dose is Mks_Type + with + Dimension => (Symbol => "Gy", + Meter => 2, + Second => -2, + others => 0); + subtype Angle is Mks_Type with Dimension => (Symbol => "rad", others => 0); - subtype Solid_Angle is Mks_Type + subtype Area is Mks_Type with - Dimension => (Symbol => "sr", + Dimension => ( + Meter => 2, others => 0); - subtype Frequency is Mks_Type + subtype Catalytic_Activity is Mks_Type with - Dimension => (Symbol => "Hz", + Dimension => (Symbol => "kat", Second => -1, + Mole => 1, others => 0); - subtype Force is Mks_Type + subtype Celsius_Temperature is Mks_Type with - Dimension => (Symbol => 'N', - Meter => 1, - Kilogram => 1, - Second => -2, + Dimension => (Symbol => "°C", + Kelvin => 1, + others => 0); + + subtype Electric_Capacitance is Mks_Type + with + Dimension => (Symbol => 'F', + Meter => -2, + Kilogram => -1, + Second => 4, + Ampere => 2, others => 0); - subtype Pressure is Mks_Type + subtype Electric_Charge is Mks_Type with - Dimension => (Symbol => "Pa", - Meter => -1, - Kilogram => 1, - Second => -2, + Dimension => (Symbol => 'C', + Second => 1, + Ampere => 1, + others => 0); + + subtype Electric_Conductance is Mks_Type + with + Dimension => (Symbol => 'S', + Meter => -2, + Kilogram => -1, + Second => 3, + Ampere => 2, others => 0); - subtype Energy is Mks_Type + subtype Electric_Potential_Difference is Mks_Type with - Dimension => (Symbol => 'J', + Dimension => (Symbol => 'V', Meter => 2, Kilogram => 1, - Second => -2, + Second => -3, + Ampere => -1, others => 0); - subtype Power is Mks_Type + subtype Electric_Resistance is Mks_Type with - Dimension => (Symbol => 'W', + Dimension => (Symbol => "Ω", Meter => 2, Kilogram => 1, Second => -3, + Ampere => -2, others => 0); - subtype Electric_Charge is Mks_Type + subtype Energy is Mks_Type with - Dimension => (Symbol => 'C', - Second => 1, - Ampere => 1, + Dimension => (Symbol => 'J', + Meter => 2, + Kilogram => 1, + Second => -2, + others => 0); + + subtype Equivalent_Dose is Mks_Type + with + Dimension => (Symbol => "Sv", + Meter => 2, + Second => -2, others => 0); - subtype Electric_Potential_Difference is Mks_Type + subtype Force is Mks_Type with - Dimension => (Symbol => 'V', - Meter => 2, + Dimension => (Symbol => 'N', + Meter => 1, Kilogram => 1, - Second => -3, - Ampere => -1, + Second => -2, others => 0); - subtype Electric_Capacitance is Mks_Type + subtype Frequency is Mks_Type with - Dimension => (Symbol => 'F', - Meter => -2, - Kilogram => -1, - Second => 4, - Ampere => 2, - others => 0); + Dimension => (Symbol => "Hz", + Second => -1, + others => 0); - subtype Electric_Resistance is Mks_Type + subtype Illuminance is Mks_Type with - Dimension => (Symbol => "Ω", + Dimension => (Symbol => "lx", + Meter => -2, + Candela => 1, + others => 0); + + subtype Inductance is Mks_Type + with + Dimension => (Symbol => 'H', Meter => 2, Kilogram => 1, - Second => -3, + Second => -2, Ampere => -2, others => 0); - subtype Electric_Conductance is Mks_Type + subtype Luminous_Flux is Mks_Type with - Dimension => (Symbol => 'S', - Meter => -2, - Kilogram => -1, - Second => 3, - Ampere => 2, - others => 0); + Dimension => (Symbol => "lm", + Candela => 1, + others => 0); subtype Magnetic_Flux is Mks_Type with @@ -221,33 +260,21 @@ package System.Dim.Mks is Ampere => -1, others => 0); - subtype Inductance is Mks_Type + subtype Power is Mks_Type with - Dimension => (Symbol => 'H', + Dimension => (Symbol => 'W', Meter => 2, Kilogram => 1, - Second => -2, - Ampere => -2, + Second => -3, others => 0); - subtype Celsius_Temperature is Mks_Type - with - Dimension => (Symbol => "°C", - Kelvin => 1, - others => 0); - - subtype Luminous_Flux is Mks_Type - with - Dimension => (Symbol => "lm", - Candela => 1, - others => 0); - - subtype Illuminance is Mks_Type + subtype Pressure is Mks_Type with - Dimension => (Symbol => "lx", - Meter => -2, - Candela => 1, - others => 0); + Dimension => (Symbol => "Pa", + Meter => -1, + Kilogram => 1, + Second => -2, + others => 0); subtype Radioactivity is Mks_Type with @@ -255,27 +282,27 @@ package System.Dim.Mks is Second => -1, others => 0); - subtype Absorbed_Dose is Mks_Type + subtype Solid_Angle is Mks_Type with - Dimension => (Symbol => "Gy", - Meter => 2, - Second => -2, + Dimension => (Symbol => "sr", others => 0); - subtype Equivalent_Dose is Mks_Type + subtype Speed is Mks_Type with - Dimension => (Symbol => "Sv", - Meter => 2, - Second => -2, + Dimension => ( + Meter => 1, + Second => -1, others => 0); - subtype Catalytic_Activity is Mks_Type + subtype Volume is Mks_Type with - Dimension => (Symbol => "kat", - Second => -1, - Mole => 1, + Dimension => ( + Meter => 3, others => 0); + pragma Warnings (Off); + -- Turn off the all the dimension warnings + rad : constant Angle := 1.0; sr : constant Solid_Angle := 1.0; Hz : constant Frequency := 1.0; @@ -349,4 +376,5 @@ package System.Dim.Mks is kA : constant Electric_Current := 1.0E+03; -- kilo MeA : constant Electric_Current := 1.0E+06; -- mega + pragma Warnings (On); end System.Dim.Mks; |