30
30
pragma Ada_2012;
31
31
32
32
with Ada.Calendar.Time_Zones ;
33
- with Ada.Float_Text_IO ;
34
- with Ada.Long_Float_Text_IO ;
35
33
with Ada.Strings.Fixed ;
36
34
with Ada.Tags ;
37
35
with Ada.Task_Attributes ;
@@ -79,7 +77,6 @@ package body SOAP.Types is
79
77
generic
80
78
type T is digits <>;
81
79
Inf : T;
82
- with procedure Put (Result : out String; V : T);
83
80
function F_Image_G (V : T) return String;
84
81
-- Generic routine to get the Image of a floating point number, this is
85
82
-- used for Float and Long_Float to support the NaN and +/-INF special
@@ -355,12 +352,7 @@ package body SOAP.Types is
355
352
end if ;
356
353
357
354
else
358
- declare
359
- Result : String (1 .. T'Width * 2 );
360
- begin
361
- Put (Result, V);
362
- return Strings.Fixed.Trim (Result, Strings.Both);
363
- end ;
355
+ return Strings.Fixed.Trim (T'Image (V), Strings.Both);
364
356
end if ;
365
357
end F_Image_G ;
366
358
@@ -873,18 +865,7 @@ package body SOAP.Types is
873
865
874
866
pragma Suppress (Validity_Check);
875
867
876
- procedure Put (R : out String; V : Float);
877
-
878
- -- -------
879
- -- Put --
880
- -- -------
881
-
882
- procedure Put (R : out String; V : Float) is
883
- begin
884
- Float_Text_IO.Put (R, V);
885
- end Put ;
886
-
887
- function Image is new F_Image_G (Float, Float_Infinity, Put);
868
+ function Image is new F_Image_G (Float, Float_Infinity);
888
869
889
870
begin
890
871
return Image (O.V);
@@ -894,18 +875,7 @@ package body SOAP.Types is
894
875
895
876
pragma Suppress (Validity_Check);
896
877
897
- procedure Put (R : out String; V : Long_Float);
898
-
899
- -- -------
900
- -- Put --
901
- -- -------
902
-
903
- procedure Put (R : out String; V : Long_Float) is
904
- begin
905
- Long_Float_Text_IO.Put (R, V);
906
- end Put ;
907
-
908
- function Image is new F_Image_G (Long_Float, Long_Float_Infinity, Put);
878
+ function Image is new F_Image_G (Long_Float, Long_Float_Infinity);
909
879
910
880
begin
911
881
return Image (O.V);
0 commit comments