diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-13 10:30:04 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-13 10:30:04 +0000 |
commit | 830a3f424d271773b4efa216a3006b108d48d04f (patch) | |
tree | 723bf7b7f6c79be9da7af8b7b5180dc8dc0f63f7 /gcc/ada/s-imglld.adb | |
parent | 587185fc9008481f0b72ec5dcf732420b1a92288 (diff) | |
download | gcc-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-imglld.adb')
-rw-r--r-- | gcc/ada/s-imglld.adb | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/gcc/ada/s-imglld.adb b/gcc/ada/s-imglld.adb index de456196ac7..a75711b8f9a 100644 --- a/gcc/ada/s-imglld.adb +++ b/gcc/ada/s-imglld.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- 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- -- @@ -32,36 +32,33 @@ ------------------------------------------------------------------------------ with System.Img_Dec; use System.Img_Dec; -with System.Img_LLI; use System.Img_LLI; package body System.Img_LLD is ----------------------------- -- Image_Long_Long_Decimal -- - ----------------------------- + ---------------------------- - function Image_Long_Long_Decimal + procedure Image_Long_Long_Decimal (V : Long_Long_Integer; + S : in out String; + P : out Natural; Scale : Integer) - return String is - P : Natural := 0; - S : String (1 .. 64); + pragma Assert (S'First = 1); begin - Set_Image_Long_Long_Decimal - (V, S, P, Scale, 1, Integer'Max (1, Scale), 0); - - -- Mess around to make sure we have the objectionable space at the - -- start for positive numbers in accordance with the annoying rules! + -- Add space at start for non-negative numbers - if S (1) /= ' ' and then S (1) /= '-' then - S (2 .. P + 1) := S (1 .. P); + if V >= 0 then S (1) := ' '; - return S (1 .. P + 1); + P := 1; else - return S (1 .. P); + P := 0; end if; + + Set_Image_Long_Long_Decimal + (V, S, P, Scale, 1, Integer'Max (1, Scale), 0); end Image_Long_Long_Decimal; --------------------------------- @@ -70,14 +67,14 @@ package body System.Img_LLD is procedure Set_Image_Long_Long_Decimal (V : Long_Long_Integer; - S : out String; + S : in out String; P : in out Natural; Scale : Integer; Fore : Natural; Aft : Natural; Exp : Natural) is - Digs : String := Image_Long_Long_Integer (V); + Digs : String := Long_Long_Integer'Image (V); -- Sign and digits of decimal value begin |