diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-23 18:33:02 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-23 18:33:02 +0100 |
commit | 345bcdbf2fbe012a8b4da772329d18757fef5594 (patch) | |
tree | cf0b071286121889773d35c0bd0f84e15e726853 /src/lists.ads | |
parent | 501366998031d73cc4286aefabffafda39921a67 (diff) | |
download | ghdl-345bcdbf2fbe012a8b4da772329d18757fef5594.tar.gz ghdl-345bcdbf2fbe012a8b4da772329d18757fef5594.tar.bz2 ghdl-345bcdbf2fbe012a8b4da772329d18757fef5594.zip |
Update python binding for flists.
Diffstat (limited to 'src/lists.ads')
-rw-r--r-- | src/lists.ads | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lists.ads b/src/lists.ads index 07e319d9f..efb7a21ea 100644 --- a/src/lists.ads +++ b/src/lists.ads @@ -103,11 +103,20 @@ package Lists is function Get_Element (It : Iterator) return Node_Type; procedure Set_Element (It : Iterator; El : Node_Type); + -- Use the C convention for all these subprograms, so that the Iterator is + -- always passed by reference. + pragma Convention (C, Is_Valid); + pragma Convention (C, Next); + pragma Convention (C, Get_Element); + pragma Convention (C, Set_Element); + -- Like Iterate, but if LIST is Null_List, it returns an iterator that is -- never valid. function Iterate_Safe (List : List_Type) return Iterator; + private type Chunk_Index_Type is new Int32; + for Chunk_Index_Type'Size use 32; No_Chunk_Index : constant Chunk_Index_Type := 0; Chunk_Len : constant := 7; @@ -123,9 +132,11 @@ private type Iterator is record Chunk : Chunk_Index_Type; Chunk_Idx : Nat32; - Remains : Natural; + Remain : Nat32; end record; + pragma Convention (C, Iterator); + pragma Inline (Iterate); pragma Inline (Is_Valid); pragma Inline (Next); pragma Inline (Get_Element); |