diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-20 11:21:59 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-20 11:21:59 +0200 |
commit | 9a476d752d5693cba41ae966e680b9ae1e03f144 (patch) | |
tree | 64a85a5e06c6212ca24ee4d1b7a1edb191546fad /gcc/ada/s-imgint.adb | |
parent | 88438c0e875c0bd43b55c793811a017416447145 (diff) | |
download | gcc-9a476d752d5693cba41ae966e680b9ae1e03f144.tar.gz |
[multiple changes]
2016-04-20 Yannick Moy <moy@adacore.com>
* osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
* einfo.adb (Set_Overridden_Operation): Add assertion.
* sem_util.adb (Unique_Entity): for renaming-as-body return the spec
entity.
2016-04-20 Javier Miranda <miranda@adacore.com>
* exp_unst.adb (Append_Unique_Call): New subprogram.
(Unnest_Subprogram): Replace the unique occurrence
of Call.Append() by Append_Unique_Call() which protects us from
adding to the Calls table duplicated entries.
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* exp_attr.adb (Is_GCC_Target): Fix for C backend.
* xref_lib.ads (Dependencies_Tables): instantiate
Table package with types that guarantee its safe use.
* s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
procedures.
From-SVN: r235248
Diffstat (limited to 'gcc/ada/s-imgint.adb')
-rw-r--r-- | gcc/ada/s-imgint.adb | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/gcc/ada/s-imgint.adb b/gcc/ada/s-imgint.adb index 88dc5849def..4fad4e66e75 100644 --- a/gcc/ada/s-imgint.adb +++ b/gcc/ada/s-imgint.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2015, 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- -- @@ -31,6 +31,12 @@ package body System.Img_Int is + procedure Set_Digits + (T : Integer; S : in out String; P : in out Natural); + -- Set digits of absolute value of T, which is zero or negative. We work + -- with the negative of the value so that the largest negative number is + -- not a special case. + ------------------- -- Image_Integer -- ------------------- @@ -53,6 +59,23 @@ package body System.Img_Int is Set_Image_Integer (V, S, P); end Image_Integer; + ---------------- + -- Set_Digits -- + ---------------- + + procedure Set_Digits + (T : Integer; S : in out String; P : in out Natural) is + begin + if T <= -10 then + Set_Digits (T / 10, S, P); + P := P + 1; + S (P) := Character'Val (48 - (T rem 10)); + else + P := P + 1; + S (P) := Character'Val (48 - T); + end if; + end Set_Digits; + ----------------------- -- Set_Image_Integer -- ----------------------- @@ -60,38 +83,14 @@ package body System.Img_Int is procedure Set_Image_Integer (V : Integer; S : in out String; - P : in out Natural) - is - procedure Set_Digits (T : Integer); - -- Set digits of absolute value of T, which is zero or negative. We work - -- with the negative of the value so that the largest negative number is - -- not a special case. - - ---------------- - -- Set_Digits -- - ---------------- - - procedure Set_Digits (T : 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); - end if; - end Set_Digits; - - -- Start of processing for Set_Image_Integer - + P : in out Natural) is begin if V >= 0 then - Set_Digits (-V); + Set_Digits (-V, S, P); else P := P + 1; S (P) := '-'; - Set_Digits (V); + Set_Digits (V, S, P); end if; end Set_Image_Integer; |