summaryrefslogtreecommitdiff
path: root/gcc/ada/stringt.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/stringt.adb')
-rw-r--r--gcc/ada/stringt.adb22
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/ada/stringt.adb b/gcc/ada/stringt.adb
index e59881a219e..5be78732cae 100644
--- a/gcc/ada/stringt.adb
+++ b/gcc/ada/stringt.adb
@@ -80,16 +80,16 @@ package body Stringt is
-------------------------------
procedure Add_String_To_Name_Buffer (S : String_Id) is
- Len : constant Natural := Natural (String_Length (S));
+ begin
+ Append (Global_Name_Buffer, S);
+ end Add_String_To_Name_Buffer;
+ procedure Append (Buf : in out Bounded_String; S : String_Id) is
begin
- for J in 1 .. Len loop
- Name_Buffer (Name_Len + J) :=
- Get_Character (Get_String_Char (S, Int (J)));
+ for X in 1 .. String_Length (S) loop
+ Append (Buf, Get_Character (Get_String_Char (S, X)));
end loop;
-
- Name_Len := Name_Len + Len;
- end Add_String_To_Name_Buffer;
+ end Append;
----------------
-- End_String --
@@ -330,12 +330,8 @@ package body Stringt is
procedure String_To_Name_Buffer (S : String_Id) is
begin
- Name_Len := Natural (String_Length (S));
-
- for J in 1 .. Name_Len loop
- Name_Buffer (J) :=
- Get_Character (Get_String_Char (S, Int (J)));
- end loop;
+ Name_Len := 0;
+ Append (Global_Name_Buffer, S);
end String_To_Name_Buffer;
---------------------