Commit 77a03520 by Arnaud Charlet

[multiple changes]

2013-01-29  Ben Brosgol  <brosgol@adacore.com>

	* gnat_rm.texi: Fixed typos. Minor edits.

2013-01-29  Bob Duff  <duff@adacore.com>

	* a-convec.adb: Minor reformatting.

2013-01-29  Pascal Obry  <obry@adacore.com>

	* tempdir.adb, tempdir.ads (Use_Temp_Dir): Set wether to use the temp
	directory.

From-SVN: r195548
parent 23b64e65
2013-01-29 Ben Brosgol <brosgol@adacore.com>
* gnat_rm.texi: Fixed typos. Minor edits.
2013-01-29 Bob Duff <duff@adacore.com>
* a-convec.adb: Minor reformatting.
2013-01-29 Pascal Obry <obry@adacore.com>
* tempdir.adb, tempdir.ads (Use_Temp_Dir): Set wether to use the temp
directory.
2013-01-29 Ed Schonberg <schonberg@adacore.com> 2013-01-29 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Preserve loop * exp_ch5.adb (Expand_Iterator_Loop_Over_Array): Preserve loop
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2004-2012, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -582,8 +582,8 @@ package body Ada.Containers.Vectors is ...@@ -582,8 +582,8 @@ package body Ada.Containers.Vectors is
C := Capacity; C := Capacity;
else else
raise Capacity_Error raise Capacity_Error with
with "Requested capacity is less than Source length"; "Requested capacity is less than Source length";
end if; end if;
return Target : Vector do return Target : Vector do
......
...@@ -2893,7 +2893,7 @@ implementation_kind ::= By_Entry | By_Protected_Procedure | By_Any ...@@ -2893,7 +2893,7 @@ implementation_kind ::= By_Entry | By_Protected_Procedure | By_Any
This is an Ada 2012 representation pragma which applies to protected, task This is an Ada 2012 representation pragma which applies to protected, task
and synchronized interface primitives. The use of pragma Implemented provides and synchronized interface primitives. The use of pragma Implemented provides
a way to impose a static requirement on the overriding operation by adhering a way to impose a static requirement on the overriding operation by adhering
to one of the three implementation kids: entry, protected procedure or any of to one of the three implementation kinds: entry, protected procedure or any of
the above. This pragma is available in all earlier versions of Ada as an the above. This pragma is available in all earlier versions of Ada as an
implementation-defined pragma. implementation-defined pragma.
...@@ -3237,7 +3237,7 @@ of the same name). It is also available as an implementation-defined ...@@ -3237,7 +3237,7 @@ of the same name). It is also available as an implementation-defined
pragma in all earlier versions. It specifies that the pragma in all earlier versions. It specifies that the
designated object or all objects of the designated type must be designated object or all objects of the designated type must be
independently addressable. This means that separate tasks can safely independently addressable. This means that separate tasks can safely
manipulate such objects. For example, if two comonents of a record are manipulate such objects. For example, if two components of a record are
independent, then two separate tasks may access these two components. independent, then two separate tasks may access these two components.
This may place This may place
constraints on the representation of the object (for instance prohibiting constraints on the representation of the object (for instance prohibiting
...@@ -3257,9 +3257,10 @@ pragma Independent_Components (Local_NAME); ...@@ -3257,9 +3257,10 @@ pragma Independent_Components (Local_NAME);
This pragma is standard in Ada 2012 mode (which also provides an aspect This pragma is standard in Ada 2012 mode (which also provides an aspect
of the same name). It is also available as an implementation-defined of the same name). It is also available as an implementation-defined
pragma in all earlier versions. It specifies that the components of the pragma in all earlier versions. It specifies that the components of the
designated object or all objects of the designated type must be designated object, or the components of each object of the designated
type, must be
independently addressable. This means that separate tasks can safely independently addressable. This means that separate tasks can safely
manipulate separate components in the composite object. this may place manipulate separate components in the composite object. This may place
constraints on the representation of the object (for instance prohibiting constraints on the representation of the object (for instance prohibiting
tight packing). tight packing).
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2013, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -35,8 +35,7 @@ package body Tempdir is ...@@ -35,8 +35,7 @@ package body Tempdir is
Tmpdir : constant String := "TMPDIR"; Tmpdir : constant String := "TMPDIR";
Gnutmpdir : constant String := "GNUTMPDIR"; Gnutmpdir : constant String := "GNUTMPDIR";
No_Dir : aliased String := ""; Temp_Dir : String_Access := new String'("");
Temp_Dir : String_Access := No_Dir'Access;
---------------------- ----------------------
-- Create_Temp_File -- -- Create_Temp_File --
...@@ -60,7 +59,6 @@ package body Tempdir is ...@@ -60,7 +59,6 @@ package body Tempdir is
begin begin
if Temp_Dir'Length /= 0 then if Temp_Dir'Length /= 0 then
return Temp_Dir.all; return Temp_Dir.all;
else else
return Current_Dir; return Current_Dir;
end if; end if;
...@@ -102,7 +100,6 @@ package body Tempdir is ...@@ -102,7 +100,6 @@ package body Tempdir is
Path_Name : constant String := Path_Name : constant String :=
Normalize_Pathname Normalize_Pathname
(Directory & Directory_Separator & File_Name.all); (Directory & Directory_Separator & File_Name.all);
begin begin
Name_Len := Path_Name'Length; Name_Len := Path_Name'Length;
Name_Buffer (1 .. Name_Len) := Path_Name; Name_Buffer (1 .. Name_Len) := Path_Name;
...@@ -112,13 +109,16 @@ package body Tempdir is ...@@ -112,13 +109,16 @@ package body Tempdir is
end if; end if;
end Create_Temp_File; end Create_Temp_File;
-- Start of elaboration for package Tempdir ------------------
-- Use_Temp_Dir --
------------------
begin procedure Use_Temp_Dir (Status : Boolean) is
declare
Dir : String_Access; Dir : String_Access;
begin begin
if Status then
-- On VMS, if GNUTMPDIR is defined, use it -- On VMS, if GNUTMPDIR is defined, use it
if OpenVMS then if OpenVMS then
...@@ -133,14 +133,25 @@ begin ...@@ -133,14 +133,25 @@ begin
else else
Dir := Getenv (Tmpdir); Dir := Getenv (Tmpdir);
end if; end if;
end if;
if Dir'Length > 0 and then Free (Temp_Dir);
Is_Absolute_Path (Dir.all) and then
Is_Directory (Dir.all) if Dir /= null
and then Dir'Length > 0
and then Is_Absolute_Path (Dir.all)
and then Is_Directory (Dir.all)
then then
Temp_Dir := new String'(Normalize_Pathname (Dir.all)); Temp_Dir := new String'(Normalize_Pathname (Dir.all));
else
Temp_Dir := new String'("");
end if; end if;
Free (Dir); Free (Dir);
end; end Use_Temp_Dir;
-- Start of elaboration for package Tempdir
begin
Use_Temp_Dir (Status => True);
end Tempdir; end Tempdir;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2003-2010, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2013, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -44,4 +44,10 @@ package Tempdir is ...@@ -44,4 +44,10 @@ package Tempdir is
-- directory. If temporary file cannot be created, FD gets the value -- directory. If temporary file cannot be created, FD gets the value
-- Invalid_FD and Name gets the value No_Name. -- Invalid_FD and Name gets the value No_Name.
procedure Use_Temp_Dir (Status : Boolean);
-- Specify if the temp file should be created in the system temporary
-- directory as specified by the corresponding environment variables. If
-- Status is False, the temp files will be created into the current working
-- directory.
end Tempdir; end Tempdir;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment