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-imglli.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-imglli.adb')
-rw-r--r-- | gcc/ada/s-imglli.adb | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/ada/s-imglli.adb b/gcc/ada/s-imglli.adb index 5975b74458a..00b9b69aef5 100644 --- a/gcc/ada/s-imglli.adb +++ b/gcc/ada/s-imglli.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- -- @@ -37,29 +37,31 @@ package body System.Img_LLI is -- Image_Long_Long_Integer -- ----------------------------- - function Image_Long_Long_Integer (V : Long_Long_Integer) return String is - P : Natural; - S : String (1 .. Long_Long_Integer'Width); + procedure Image_Long_Long_Integer + (V : Long_Long_Integer; + S : in out String; + P : out Natural) + is + pragma Assert (S'First = 1); begin if V >= 0 then + S (1) := ' '; P := 1; - S (P) := ' '; else P := 0; end if; Set_Image_Long_Long_Integer (V, S, P); - return S (1 .. P); end Image_Long_Long_Integer; - --------------------------------- + ------------------------------ -- Set_Image_Long_Long_Integer -- - --------------------------------- + ----------------------------- procedure Set_Image_Long_Long_Integer (V : Long_Long_Integer; - S : out String; + S : in out String; P : in out Natural) is procedure Set_Digits (T : Long_Long_Integer); @@ -67,13 +69,16 @@ package body System.Img_LLI is -- with the negative of the value so that the largest negative number is -- not a special case. + ---------------- + -- Set_Digits -- + ---------------- + procedure Set_Digits (T : Long_Long_Integer) is begin if T <= -10 then Set_Digits (T / 10); P := P + 1; S (P) := Character'Val (48 - (T rem 10)); - else P := P + 1; S (P) := Character'Val (48 - T); @@ -85,13 +90,11 @@ package body System.Img_LLI is begin if V >= 0 then Set_Digits (-V); - else P := P + 1; S (P) := '-'; Set_Digits (V); end if; - end Set_Image_Long_Long_Integer; end System.Img_LLI; |