This AI updates among other things some declarations in big number
packages.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* libgnat/a-nbnbin.ads (From_Universal_Image): New.
(Big_Integer): Update definition.
* libgnat/a-nbnbre.ads, libgnat/a-nbnbre.adb
(From_Universal_Image): New.
(From_String): Remove alternate body, replaced by
From_Universal_Image.
(Big_Real): Update definition.
diff --git a/gcc/ada/libgnat/a-nbnbin.ads b/gcc/ada/libgnat/a-nbnbin.ads
--- a/gcc/ada/libgnat/a-nbnbin.ads
+++ b/gcc/ada/libgnat/a-nbnbin.ads
@@ -22,7 +22,7 @@ package Ada.Numerics.Big_Numbers.Big_Integers
with Preelaborate
is
type Big_Integer is private
- with Integer_Literal => From_String,
+ with Integer_Literal => From_Universal_Image,
Put_Image => Put_Image;
function Is_Valid (Arg : Big_Integer) return Boolean
@@ -116,6 +116,9 @@ is
function From_String (Arg : String) return Valid_Big_Integer
with Global => null;
+ function From_Universal_Image (Arg : String) return Valid_Big_Integer
+ renames From_String;
+
procedure Put_Image (S : in out Sink'Class; V : Big_Integer);
function "+" (L : Valid_Big_Integer) return Valid_Big_Integer
diff --git a/gcc/ada/libgnat/a-nbnbre.adb b/gcc/ada/libgnat/a-nbnbre.adb
--- a/gcc/ada/libgnat/a-nbnbre.adb
+++ b/gcc/ada/libgnat/a-nbnbre.adb
@@ -593,13 +593,6 @@ package body Ada.Numerics.Big_Numbers.Big_Reals is
end;
end From_String;
- function From_String
- (Numerator, Denominator : String) return Valid_Big_Real is
- begin
- return Big_Integers.From_String (Numerator) /
- Big_Integers.From_String (Denominator);
- end From_String;
-
--------------------------
-- From_Quotient_String --
--------------------------
diff --git a/gcc/ada/libgnat/a-nbnbre.ads b/gcc/ada/libgnat/a-nbnbre.ads
--- a/gcc/ada/libgnat/a-nbnbre.ads
+++ b/gcc/ada/libgnat/a-nbnbre.ads
@@ -21,7 +21,7 @@ package Ada.Numerics.Big_Numbers.Big_Reals
with Preelaborate
is
type Big_Real is private with
- Real_Literal => From_String,
+ Real_Literal => From_Universal_Image,
Put_Image => Put_Image;
function Is_Valid (Arg : Big_Real) return Boolean
@@ -122,8 +122,13 @@ is
function From_String (Arg : String) return Valid_Big_Real
with Global => null;
- function From_String (Numerator, Denominator : String) return Valid_Big_Real
- with Global => null;
+
+ function From_Universal_Image (Arg : String) return Valid_Big_Real
+ renames From_String;
+ function From_Universal_Image (Num, Den : String) return Valid_Big_Real is
+ (Big_Integers.From_Universal_Image (Num) /
+ Big_Integers.From_Universal_Image (Den))
+ with Global => null;
function To_Quotient_String (Arg : Big_Real) return String is
(Big_Integers.To_String (Numerator (Arg)) & " / "