This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref #173
- Loading branch information
Showing
5 changed files
with
45 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
package body Gneiss_Internal.Util with | ||
SPARK_Mode | ||
is | ||
|
||
function Get_First (Length : Integer) return Buffer_Index is | ||
(if Length < 1 then Buffer_Index'First + 1 else Buffer_Index'First); | ||
|
||
function Get_Last (Length : Integer) return Buffer_Index | ||
is | ||
begin | ||
if Length < 1 then | ||
return Buffer_Index'First; | ||
end if; | ||
if Long_Integer (Length) < Long_Integer (Buffer_Index'Last - Buffer_Index'First + 1) then | ||
return Buffer_Index (Long_Integer (Buffer_Index'First) + Long_Integer (Length) - 1); | ||
else | ||
return Buffer_Index'Last; | ||
end if; | ||
end Get_Last; | ||
|
||
end Gneiss_Internal.Util; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
package Gneiss_Internal.Util with | ||
SPARK_Mode | ||
is | ||
|
||
generic | ||
type Buffer_Index is range <>; | ||
function Get_First (Length : Integer) return Buffer_Index; | ||
|
||
generic | ||
type Buffer_Index is range <>; | ||
function Get_Last (Length : Integer) return Buffer_Index; | ||
|
||
end Gneiss_Internal.Util; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters