[Ada] Simplify calls to Name_Find with known string parameter
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 1 Dec 2021 15:54:43 +0000 (16:54 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 Jan 2022 11:32:37 +0000 (11:32 +0000)
gcc/ada/

* gnatls.adb (Gnatls): Use Name_Find function.
* targparm.adb (Get_Target_Parameters): Likewise.

gcc/ada/gnatls.adb
gcc/ada/targparm.adb

index b20cda4..4c69b72 100644 (file)
@@ -2092,10 +2092,7 @@ begin
          Hi   : Source_Ptr;
 
       begin
-         Name_Buffer (1 .. 10) := "system.ads";
-         Name_Len := 10;
-
-         Read_Source_File (Name_Find, 0, Hi, Text, FD);
+         Read_Source_File (Name_Find ("system.ads"), 0, Hi, Text, FD);
 
          if Null_Source_Buffer_Ptr (Text) then
             No_Runtime := True;
index ade05c2..d5755e1 100644 (file)
@@ -157,10 +157,7 @@ package body Targparm is
          return;
       end if;
 
-      Name_Buffer (1 .. 10) := "system.ads";
-      Name_Len := 10;
-
-      Read_Source_File (Name_Find, 0, Hi, Text, FD);
+      Read_Source_File (Name_Find ("system.ads"), 0, Hi, Text, FD);
 
       if Null_Source_Buffer_Ptr (Text) then
          Write_Line ("fatal error, run-time library not installed correctly");