Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for range integer type to generator
- Loading branch information
Showing
5 changed files
with
109 additions
and
46 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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package Types is | ||
|
||
type Byte is mod 2**8; | ||
type Bytes is array (Positive range <>) of Byte; | ||
type Payload_Type is new Bytes; | ||
type Byte is mod 2**8; | ||
type Bytes is array (Positive range <>) of Byte; | ||
type Payload_Type is new Bytes; | ||
|
||
procedure Bytes_Put (Buffer : Bytes); | ||
procedure Bytes_Put (Buffer : Bytes); | ||
|
||
generic | ||
type UXX is mod <>; | ||
function Convert_To (Buffer : Bytes) return UXX with | ||
Depends => (Convert_To'Result => Buffer), | ||
generic | ||
type UXX is mod <>; | ||
function Convert_To_Mod (Buffer : Bytes) return UXX | ||
with | ||
Pre => UXX'Size rem 8 = 0 and then Buffer'Length = UXX'Size / 8; | ||
|
||
generic | ||
type Int is range <>; | ||
function Convert_To_Int (Buffer : Bytes) return Int | ||
with | ||
Pre => Int'Size rem 8 = 0 and then Buffer'Length = Int'Size / 8; | ||
|
||
end Types; |
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