summaryrefslogtreecommitdiff
path: root/translate/grt/grt-files.adb
diff options
context:
space:
mode:
authorgingold2008-08-30 13:30:19 +0000
committergingold2008-08-30 13:30:19 +0000
commitcd9300765e7e3fd43e450777e98a778146f700c2 (patch)
treef013fea17ae4eee9c1649e63b99b9bfe377fafb4 /translate/grt/grt-files.adb
parent4b6571671497ecc1f846bfa49678254e14511fc9 (diff)
downloadghdl-cd9300765e7e3fd43e450777e98a778146f700c2.tar.gz
ghdl-cd9300765e7e3fd43e450777e98a778146f700c2.tar.bz2
ghdl-cd9300765e7e3fd43e450777e98a778146f700c2.zip
Switch to gcc 4.3
Don't use tagged types in grt (not supported by recent versions of GNAT) Fix warnings
Diffstat (limited to 'translate/grt/grt-files.adb')
-rw-r--r--translate/grt/grt-files.adb26
1 files changed, 12 insertions, 14 deletions
diff --git a/translate/grt/grt-files.adb b/translate/grt/grt-files.adb
index 6da675d..a1ce0ce 100644
--- a/translate/grt/grt-files.adb
+++ b/translate/grt/grt-files.adb
@@ -18,8 +18,9 @@
with Grt.Errors; use Grt.Errors;
with Grt.Stdio; use Grt.Stdio;
with Grt.C; use Grt.C;
-with GNAT.Table;
+with Grt.Table;
with System; use System;
+pragma Elaborate_All (Grt.Table);
package body Grt.Files is
subtype C_Files is Grt.Stdio.FILEs;
@@ -31,12 +32,11 @@ package body Grt.Files is
Is_Alive : Boolean;
end record;
- package Files_Table is new GNAT.Table
+ package Files_Table is new Grt.Table
(Table_Component_Type => File_Entry_Type,
Table_Index_Type => Ghdl_File_Index,
Table_Low_Bound => 1,
- Table_Initial => 2,
- Table_Increment => 100);
+ Table_Initial => 2);
function Get_File (Index : Ghdl_File_Index) return C_Files
is
@@ -56,17 +56,13 @@ package body Grt.Files is
end Check_File_Mode;
function Create_File (Is_Text : Boolean; Sig : Ghdl_C_String)
- return Ghdl_File_Index
- is
- Res : Ghdl_File_Index;
+ return Ghdl_File_Index is
begin
- Files_Table.Increment_Last;
- Res := Files_Table.Last;
- Files_Table.Table (Res) := (Stream => NULL_Stream,
- Signature => Sig,
- Is_Text => Is_Text,
- Is_Alive => True);
- return Res;
+ Files_Table.Append ((Stream => NULL_Stream,
+ Signature => Sig,
+ Is_Text => Is_Text,
+ Is_Alive => True));
+ return Files_Table.Last;
end Create_File;
procedure Destroy_File (Is_Text : Boolean; Index : Ghdl_File_Index) is
@@ -289,6 +285,7 @@ package body Grt.Files is
Res : C_Files;
R : size_t;
R1 : int;
+ pragma Unreferenced (R, R1);
begin
Res := Get_File (File);
Check_File_Mode (File, True);
@@ -311,6 +308,7 @@ package body Grt.Files is
Res : C_Files;
R : size_t;
R1 : int;
+ pragma Unreferenced (R1);
begin
Res := Get_File (File);
Check_File_Mode (File, False);