emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/wisi 01c34d0 33/35: In wisi, missed a few files in 3.1.


From: Stefan Monnier
Subject: [elpa] externals/wisi 01c34d0 33/35: In wisi, missed a few files in 3.1.2 release
Date: Sat, 28 Nov 2020 14:47:59 -0500 (EST)

branch: externals/wisi
commit 01c34d04d2b841ad8ef8359d4f188f51968fda92
Author: Stephen Leake <stephen_leake@stephe-leake.org>
Commit: Stephen Leake <stephen_leake@stephe-leake.org>

    In wisi, missed a few files in 3.1.2 release
---
 sal-gen_unbounded_definite_vectors.adb | 12 ++++++++----
 sal-gen_unbounded_definite_vectors.ads |  8 +++++---
 sal.adb                                |  2 +-
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/sal-gen_unbounded_definite_vectors.adb 
b/sal-gen_unbounded_definite_vectors.adb
index faf1b45..9e1c189 100644
--- a/sal-gen_unbounded_definite_vectors.adb
+++ b/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/sal-gen_unbounded_definite_vectors.ads 
b/sal-gen_unbounded_definite_vectors.ads
index 818a223..29ecae0 100644
--- a/sal-gen_unbounded_definite_vectors.ads
+++ b/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/sal.adb b/sal.adb
index 08a2184..6265651 100644
--- a/sal.adb
+++ b/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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]