aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-util.adb
diff options
context:
space:
mode:
authorThomas Quinot <quinot@adacore.com>2010-06-14 13:09:06 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-06-14 15:09:06 +0200
commitb14bd03f5dc4c3aeeaea2023b3bb1884e2fe4a58 (patch)
tree644d95c20142b722e374da23c877fc0986c0d0c5 /gcc/ada/lib-util.adb
parent7eaa7cdf7da806ba900237e34eb11fd580039da3 (diff)
downloadgcc-b14bd03f5dc4c3aeeaea2023b3bb1884e2fe4a58.zip
gcc-b14bd03f5dc4c3aeeaea2023b3bb1884e2fe4a58.tar.gz
gcc-b14bd03f5dc4c3aeeaea2023b3bb1884e2fe4a58.tar.bz2
lib-util.adb: Minor code reorganization.
2010-06-14 Thomas Quinot <quinot@adacore.com> * lib-util.adb: Minor code reorganization. From-SVN: r160738
Diffstat (limited to 'gcc/ada/lib-util.adb')
-rw-r--r--gcc/ada/lib-util.adb47
1 files changed, 21 insertions, 26 deletions
diff --git a/gcc/ada/lib-util.adb b/gcc/ada/lib-util.adb
index e6af023..9047690 100644
--- a/gcc/ada/lib-util.adb
+++ b/gcc/ada/lib-util.adb
@@ -40,8 +40,13 @@ package body Lib.Util is
Info_Buffer_Col : Natural := 1;
-- Column number of next character to be written.
- -- Can be different from Info_Buffer_Len + 1.
- -- because of tab characters written by Write_Info_Tab.
+ -- Can be different from Info_Buffer_Len + 1 because of tab characters
+ -- written by Write_Info_Tab.
+
+ procedure Write_Info_Hex_Byte (J : Natural);
+ -- Place two hex digits representing the value J (which is in the range
+ -- 0-255) in Info_Buffer, incrementing Info_Buffer_Len by 2. The digits
+ -- are output using lower case letters.
---------------------
-- Write_Info_Char --
@@ -59,20 +64,6 @@ package body Lib.Util is
--------------------------
procedure Write_Info_Char_Code (Code : Char_Code) is
-
- procedure Write_Info_Hex_Byte (J : Natural);
- -- Write single hex digit
-
- procedure Write_Info_Hex_Byte (J : Natural) is
- Hexd : constant String := "0123456789abcdef";
-
- begin
- Write_Info_Char (Hexd (J / 16 + 1));
- Write_Info_Char (Hexd (J mod 16 + 1));
- end Write_Info_Hex_Byte;
-
- -- Start of processing for Write_Info_Char_Code
-
begin
-- 00 .. 7F
@@ -129,6 +120,17 @@ package body Lib.Util is
end Write_Info_EOL;
-------------------------
+ -- Write_Info_Hex_Byte --
+ -------------------------
+
+ procedure Write_Info_Hex_Byte (J : Natural) is
+ Hexd : constant array (0 .. 15) of Character := "0123456789abcdef";
+ begin
+ Write_Info_Char (Hexd (J / 16));
+ Write_Info_Char (Hexd (J mod 16));
+ end Write_Info_Hex_Byte;
+
+ -------------------------
-- Write_Info_Initiate --
-------------------------
@@ -210,16 +212,9 @@ package body Lib.Util is
end if;
else
- declare
- Hex : constant array (0 .. 15) of Character :=
- "0123456789ABCDEF";
-
- begin
- Write_Info_Char ('{');
- Write_Info_Char (Hex (Character'Pos (C) / 16));
- Write_Info_Char (Hex (Character'Pos (C) mod 16));
- Write_Info_Char ('}');
- end;
+ Write_Info_Char ('{');
+ Write_Info_Hex_Byte (Character'Pos (C));
+ Write_Info_Char ('}');
end if;
end loop;