s-stchop.adb, [...]: Make sure sources obey short-circuit style rule.
[gcc.git] / gcc / ada / prj-conf.adb
index 59b6c14025e2ea1756e17557f3610d779c63fbac..fee0bbfa2357344428233357025d5abd2647c12b 100644 (file)
@@ -351,7 +351,7 @@ package body Prj.Conf is
       end if;
 
       if Target = "" then
-         OK := not Autoconf_Specified or Tgt_Name = No_Name;
+         OK := not Autoconf_Specified or else Tgt_Name = No_Name;
       else
          OK := Tgt_Name /= No_Name
                  and then Target = Get_Name_String (Tgt_Name);
@@ -705,7 +705,7 @@ package body Prj.Conf is
             --  gprconfig.
 
             if not Is_Directory (Obj_Dir)
-              and then (Setup_Projects or Subdirs /= null)
+              and then (Setup_Projects or else Subdirs /= null)
             then
                begin
                   Create_Path (Obj_Dir);
@@ -846,7 +846,8 @@ package body Prj.Conf is
             Always_Errout_Finalize => False,
             Packages_To_Check      => Packages_To_Check,
             Current_Directory      => Current_Directory,
-            Is_Config_File         => True);
+            Is_Config_File         => True,
+            Flags                  => Flags);
       else
          --  Maybe the user will want to create his own configuration file
          Config_Project_Node := Empty_Node;
@@ -882,8 +883,8 @@ package body Prj.Conf is
       --  auto-conf mode, since the appropriate target was passed to gprconfig.
 
       if not Automatically_Generated
-        and not Check_Target
-          (Config, Autoconf_Specified, Project_Tree, Target_Name)
+        and then not
+          Check_Target (Config, Autoconf_Specified, Project_Tree, Target_Name)
       then
          Automatically_Generated := True;
          goto Process_Config_File;
@@ -1004,7 +1005,8 @@ package body Prj.Conf is
          Always_Errout_Finalize => False,
          Packages_To_Check      => Packages_To_Check,
          Current_Directory      => Current_Directory,
-         Is_Config_File         => False);
+         Is_Config_File         => False,
+         Flags                  => Flags);
 
       if User_Project_Node = Empty_Node then
          User_Project_Node := Empty_Node;
@@ -1176,6 +1178,8 @@ package body Prj.Conf is
       Name   : Name_Id;
       Naming : Project_Node_Id;
 
+   --  Start of processing for Add_Default_GNAT_Naming_Scheme
+
    begin
       if Config_File = Empty_Node then
 
@@ -1185,10 +1189,15 @@ package body Prj.Conf is
          Name_Buffer (1 .. Name_Len) := Auto_Cgpr;
          Name := Name_Find;
 
+         --  An invalid project name to avoid conflicts with user-created ones
+
+         Name_Len := 5;
+         Name_Buffer (1 .. Name_Len) := "_auto";
+
          Config_File :=
            Create_Project
              (In_Tree        => Project_Tree,
-              Name           => Name_Default,
+              Name           => Name_Find,
               Full_Path      => Path_Name_Type (Name),
               Is_Config_File => True);
 
@@ -1211,8 +1220,8 @@ package body Prj.Conf is
             Create_Attribute (Name_Library_Auto_Init_Supported, "false");
          end if;
 
-         --  Setup Ada support (Ada is the default language here, since this is
-         --  only called when no config file existed initially, ie for
+         --  Setup Ada support (Ada is the default language here, since this
+         --  is only called when no config file existed initially, ie for
          --  gnatmake).
 
          Create_Attribute (Name_Default_Language, "ada");
@@ -1230,7 +1239,6 @@ package body Prj.Conf is
               (Project                => Config_File,
                In_Tree                => Project_Tree,
                Backward_Compatibility => False);
-
          end if;
       end if;
    end Add_Default_GNAT_Naming_Scheme;