summaryrefslogtreecommitdiff
path: root/gcc/ada/s-imgrea.adb
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.adb
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.adb')
-rw-r--r--gcc/ada/s-imgrea.adb30
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/ada/s-imgrea.adb b/gcc/ada/s-imgrea.adb
index ae939de5fa3..e9fd56067f8 100644
--- a/gcc/ada/s-imgrea.adb
+++ b/gcc/ada/s-imgrea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 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- --
@@ -78,13 +78,13 @@ package body System.Img_Real is
-- Image_Floating_Point --
--------------------------
- function Image_Floating_Point
+ procedure Image_Floating_Point
(V : Long_Long_Float;
+ S : in out String;
+ P : out Natural;
Digs : Natural)
- return String
is
- P : Natural := 0;
- S : String (1 .. Long_Long_Float'Width);
+ pragma Assert (S'First = 1);
begin
-- Decide wether a blank should be prepended before the call to
@@ -101,32 +101,36 @@ package body System.Img_Real is
then
S (1) := ' ';
P := 1;
+ else
+ P := 0;
end if;
Set_Image_Real (V, S, P, 1, Digs - 1, 3);
- return S (1 .. P);
end Image_Floating_Point;
--------------------------------
-- Image_Ordinary_Fixed_Point --
--------------------------------
- function Image_Ordinary_Fixed_Point
- (V : Long_Long_Float;
- Aft : Natural)
- return String
+ procedure Image_Ordinary_Fixed_Point
+ (V : Long_Long_Float;
+ S : in out String;
+ P : out Natural;
+ Aft : Natural)
is
- P : Natural := 0;
- S : String (1 .. Long_Long_Float'Width);
+ pragma Assert (S'First = 1);
begin
+ -- Output space at start if non-negative
+
if V >= 0.0 then
S (1) := ' ';
P := 1;
+ else
+ P := 0;
end if;
Set_Image_Real (V, S, P, 1, Aft, 0);
- return S (1 .. P);
end Image_Ordinary_Fixed_Point;
--------------------