diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-11-09 20:46:38 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-11-09 20:46:38 +0100 |
commit | 144cedec159574df474579fa2cc7fde7e61eadbc (patch) | |
tree | cf6baa5b3a959d0c91ca837b9383930d9e2486b6 /src | |
parent | fbd853c88b4b1c3008b1b39882ac2b99b6e59460 (diff) | |
download | ghdl-144cedec159574df474579fa2cc7fde7e61eadbc.tar.gz ghdl-144cedec159574df474579fa2cc7fde7e61eadbc.tar.bz2 ghdl-144cedec159574df474579fa2cc7fde7e61eadbc.zip |
lists: add a subtype for valid lists
Diffstat (limited to 'src')
-rw-r--r-- | src/lists.adb | 2 | ||||
-rw-r--r-- | src/lists.ads | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lists.adb b/src/lists.adb index 1acbbbf38..a4585f79a 100644 --- a/src/lists.adb +++ b/src/lists.adb @@ -169,7 +169,7 @@ package body Lists is Chunk_Free_List := No_Chunk_Index; end Initialize; - function Iterate (List : List_Type) return Iterator + function Iterate (List : List_Valid_Type) return Iterator is L : List_Record renames Listt.Table (List); begin diff --git a/src/lists.ads b/src/lists.ads index a4359b51b..d06170223 100644 --- a/src/lists.ads +++ b/src/lists.ads @@ -24,6 +24,8 @@ package Lists is Null_List : constant List_Type := 0; List_All : constant List_Type := 1; + subtype List_Valid_Type is List_Type range List_All + 1 .. List_Type'Last; + ----------- -- Lists -- ----------- @@ -99,7 +101,7 @@ package Lists is -- end loop; type Iterator is private; - function Iterate (List : List_Type) return Iterator; + function Iterate (List : List_Valid_Type) return Iterator; function Is_Valid (It : Iterator) return Boolean; procedure Next (It : in out Iterator); function Get_Element (It : Iterator) return El_Type; |