diff options
Diffstat (limited to 'gcc/ada/libgnat/a-ztinio.adb')
-rw-r--r-- | gcc/ada/libgnat/a-ztinio.adb | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/gcc/ada/libgnat/a-ztinio.adb b/gcc/ada/libgnat/a-ztinio.adb index c0726ce..ab8741e 100644 --- a/gcc/ada/libgnat/a-ztinio.adb +++ b/gcc/ada/libgnat/a-ztinio.adb @@ -30,11 +30,35 @@ ------------------------------------------------------------------------------ with Ada.Wide_Wide_Text_IO.Integer_Aux; +with System.Img_BIU; use System.Img_BIU; +with System.Img_Int; use System.Img_Int; +with System.Img_LLB; use System.Img_LLB; +with System.Img_LLI; use System.Img_LLI; +with System.Img_LLW; use System.Img_LLW; +with System.Img_WIU; use System.Img_WIU; +with System.Val_Int; use System.Val_Int; +with System.Val_LLI; use System.Val_LLI; with System.WCh_Con; use System.WCh_Con; with System.WCh_WtS; use System.WCh_WtS; package body Ada.Wide_Wide_Text_IO.Integer_IO is + package Aux_Int is new + Ada.Wide_Wide_Text_IO.Integer_Aux + (Integer, + Scan_Integer, + Set_Image_Integer, + Set_Image_Width_Integer, + Set_Image_Based_Integer); + + package Aux_LLI is new + Ada.Wide_Wide_Text_IO.Integer_Aux + (Long_Long_Integer, + Scan_Long_Long_Integer, + Set_Image_Long_Long_Integer, + Set_Image_Width_Long_Long_Integer, + Set_Image_Based_Long_Long_Integer); + Need_LLI : constant Boolean := Num'Base'Size > Integer'Size; -- Throughout this generic body, we distinguish between the case where type -- Integer is acceptable, and where a Long_Long_Integer is needed. This @@ -44,8 +68,6 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is subtype TFT is Ada.Wide_Wide_Text_IO.File_Type; -- File type required for calls to routines in Aux - package Aux renames Ada.Wide_Wide_Text_IO.Integer_Aux; - --------- -- Get -- --------- @@ -55,11 +77,16 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is Item : out Num; Width : Field := 0) is + -- We depend on a range check to get Data_Error + + pragma Unsuppress (Range_Check); + pragma Unsuppress (Overflow_Check); + begin if Need_LLI then - Aux.Get_LLI (TFT (File), Long_Long_Integer (Item), Width); + Aux_LLI.Get (TFT (File), Long_Long_Integer (Item), Width); else - Aux.Get_Int (TFT (File), Integer (Item), Width); + Aux_Int.Get (TFT (File), Integer (Item), Width); end if; exception @@ -79,6 +106,11 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is Item : out Num; Last : out Positive) is + -- We depend on a range check to get Data_Error + + pragma Unsuppress (Range_Check); + pragma Unsuppress (Overflow_Check); + S : constant String := Wide_Wide_String_To_String (From, WCEM_Upper); -- String on which we do the actual conversion. Note that the method -- used for wide character encoding is irrelevant, since if there is @@ -87,9 +119,9 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is begin if Need_LLI then - Aux.Gets_LLI (S, Long_Long_Integer (Item), Last); + Aux_LLI.Gets (S, Long_Long_Integer (Item), Last); else - Aux.Gets_Int (S, Integer (Item), Last); + Aux_Int.Gets (S, Integer (Item), Last); end if; exception @@ -108,9 +140,9 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is is begin if Need_LLI then - Aux.Put_LLI (TFT (File), Long_Long_Integer (Item), Width, Base); + Aux_LLI.Put (TFT (File), Long_Long_Integer (Item), Width, Base); else - Aux.Put_Int (TFT (File), Integer (Item), Width, Base); + Aux_Int.Put (TFT (File), Integer (Item), Width, Base); end if; end Put; @@ -132,9 +164,9 @@ package body Ada.Wide_Wide_Text_IO.Integer_IO is begin if Need_LLI then - Aux.Puts_LLI (S, Long_Long_Integer (Item), Base); + Aux_LLI.Puts (S, Long_Long_Integer (Item), Base); else - Aux.Puts_Int (S, Integer (Item), Base); + Aux_Int.Puts (S, Integer (Item), Base); end if; for J in S'Range loop |