summaryrefslogtreecommitdiff
path: root/gcc/ada/s-imgrea.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:30:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:30:04 +0000
commit830a3f424d271773b4efa216a3006b108d48d04f (patch)
tree723bf7b7f6c79be9da7af8b7b5180dc8dc0f63f7 /gcc/ada/s-imgrea.ads
parent587185fc9008481f0b72ec5dcf732420b1a92288 (diff)
downloadgcc-830a3f424d271773b4efa216a3006b108d48d04f.tar.gz
2007-12-06 Robert Dewar <dewar@adacore.com>
* s-imenne.adb, s-imenne.ads: New files. * s-imgboo.adb, s-imgboo.ads, s-imgcha.adb, s-imgcha.ads, s-imgdec.adb, s-imgdec.ads, s-imgenu.ads, s-imgint.adb, s-imgint.ads, s-imglld.adb, s-imglld.ads, s-imglli.adb, s-imglli.ads, s-imgllu.adb, s-imgllu.ads, s-imgrea.adb, s-imgrea.ads, s-imguns.adb, s-imguns.ads, s-imgwch.adb, s-imgwch.ads: New calling sequence for Image routines to avoid sec stack usage. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130852 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-imgrea.ads')
-rw-r--r--gcc/ada/s-imgrea.ads43
1 files changed, 25 insertions, 18 deletions
diff --git a/gcc/ada/s-imgrea.ads b/gcc/ada/s-imgrea.ads
index 0f298bf9967..e00b78a69e8 100644
--- a/gcc/ada/s-imgrea.ads
+++ b/gcc/ada/s-imgrea.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -34,25 +34,31 @@
-- Image for fixed and float types (also used for Float_IO/Fixed_IO output)
package System.Img_Real is
- pragma Preelaborate;
+ pragma Pure;
- function Image_Ordinary_Fixed_Point
- (V : Long_Long_Float;
- Aft : Natural)
- return String;
- -- Computes the image of V and returns the result according to the rules
- -- for image for fixed-point types (RM 3.5(34)), where Aft is the value of
- -- the Aft attribute for the fixed-point type. This function is used only
- -- for ordinary fixed point (see package System.Img_Dec for handling of
- -- decimal fixed-point).
+ procedure Image_Ordinary_Fixed_Point
+ (V : Long_Long_Float;
+ S : in out String;
+ P : out Natural;
+ Aft : Natural);
+ -- Computes fixed_type'Image (V) and returns the result in S (1 .. P)
+ -- updating P on return. The result is computed according to the rules for
+ -- image for fixed-point types (RM 3.5(34)), where Aft is the value of the
+ -- Aft attribute for the fixed-point type. This function is used only for
+ -- ordinary fixed point (see package System.Img_Dec for handling of decimal
+ -- fixed-point). The caller guarantees that S is long enough to hold the
+ -- result and has a lower bound of 1.
- function Image_Floating_Point
+ procedure Image_Floating_Point
(V : Long_Long_Float;
- Digs : Natural)
- return String;
- -- Computes the image of V and returns the result according to the rules
- -- for image for foating-point types (RM 3.5(33)), where Digs is the value
- -- of the Digits attribute for the floating-point type.
+ S : in out String;
+ P : out Natural;
+ Digs : Natural);
+ -- Computes fixed_type'Image (V) and returns the result in S (1 .. P)
+ -- updating P on return. The result is computed according to the rules for
+ -- image for floating-point types (RM 3.5(33)), where Digs is the value of
+ -- the Digits attribute for the floating-point type. The caller guarantees
+ -- that S is long enough to hold the result and has a lower bound of 1.
procedure Set_Image_Real
(V : Long_Long_Float;
@@ -66,6 +72,7 @@ package System.Img_Real is
-- enough and no check is made for this. Constraint_Error will not
-- necessarily be raised if this is violated, since it is perfectly valid
-- to compile this unit with checks off). The Fore, Aft and Exp values
- -- can be set to any valid values for the case of use from Text_IO.
+ -- can be set to any valid values for the case of use from Text_IO. Note
+ -- that no space is stored at the start for non-negative values.
end System.Img_Real;