branch: master commit fced8435670570df42415e76652d2b1cd7fb8f8c Author: Stephen Leake <stephen_le...@stephe-leake.org> Commit: Stephen Leake <stephen_le...@stephe-leake.org>
In wisi, missed a few files in 3.1.2 release --- packages/wisi/sal-gen_unbounded_definite_vectors.adb | 12 ++++++++---- packages/wisi/sal-gen_unbounded_definite_vectors.ads | 8 +++++--- packages/wisi/sal.adb | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/wisi/sal-gen_unbounded_definite_vectors.adb b/packages/wisi/sal-gen_unbounded_definite_vectors.adb index faf1b45..9e1c189 100644 --- a/packages/wisi/sal-gen_unbounded_definite_vectors.adb +++ b/packages/wisi/sal-gen_unbounded_definite_vectors.adb @@ -525,8 +525,10 @@ package body SAL.Gen_Unbounded_Definite_Vectors is end Variable_Ref; overriding function First (Object : Iterator) return Cursor - is begin - if Object.Container.Elements = null then + is + use all type Ada.Containers.Count_Type; + begin + if Object.Container.Length = 0 then return (Object.Container, Invalid_Peek_Index); else return (Object.Container, To_Peek_Type (Object.Container.First)); @@ -534,8 +536,10 @@ package body SAL.Gen_Unbounded_Definite_Vectors is end First; overriding function Last (Object : Iterator) return Cursor - is begin - if Object.Container.Elements = null then + is + use all type Ada.Containers.Count_Type; + begin + if Object.Container.Length = 0 then return (Object.Container, Invalid_Peek_Index); else return (Object.Container, To_Peek_Type (Object.Container.Last)); diff --git a/packages/wisi/sal-gen_unbounded_definite_vectors.ads b/packages/wisi/sal-gen_unbounded_definite_vectors.ads index 818a223..29ecae0 100644 --- a/packages/wisi/sal-gen_unbounded_definite_vectors.ads +++ b/packages/wisi/sal-gen_unbounded_definite_vectors.ads @@ -177,10 +177,12 @@ package SAL.Gen_Unbounded_Definite_Vectors is function Iterate (Container : aliased in Vector) return Iterator_Interfaces.Reversible_Iterator'Class; function Constant_Ref (Container : aliased in Vector; Position : in Cursor) return Constant_Reference_Type - with Inline, Pre => Has_Element (Position); + with Pre => Has_Element (Position) and then + To_Index (Position) in Container.First_Index .. Container.Last_Index; function Variable_Ref (Container : aliased in Vector; Position : in Cursor) return Variable_Reference_Type - with Pre => Has_Element (Position); + with Pre => Has_Element (Position) and then + To_Index (Position) in Container.First_Index .. Container.Last_Index; pragma Inline (Variable_Ref); private @@ -194,7 +196,7 @@ private Elements : Array_Access; -- Elements may be non-null with First = No_Index, after -- Set_Capacity. If First /= No_Index and Last >= First, Elements /= - -- null. + -- null. First > Last means Vector is empty. First : Extended_Index := No_Index; Last : Extended_Index := No_Index; end record; diff --git a/packages/wisi/sal.adb b/packages/wisi/sal.adb index 08a2184..6265651 100644 --- a/packages/wisi/sal.adb +++ b/packages/wisi/sal.adb @@ -26,7 +26,7 @@ package body SAL is function Version return String is begin - return "SAL 3.4"; + return "SAL 3.5"; end Version; end SAL;