2 -- { dg-options "-gnatws" }
4 with System
.Storage_Elements
; use System
.Storage_Elements
;
5 with Unchecked_Conversion
;
6 with Slice7_Pkg
; use Slice7_Pkg
;
10 type Discrete_Type
is range 1 .. 32;
12 Max_Byte_Count
: constant := 4;
13 subtype Byte_Count_Type
is Storage_Offset
range 1..Max_Byte_Count
;
15 subtype Buffer_Type
is Storage_Array
(Byte_Count_Type
);
16 function Convert_Put
is new Unchecked_Conversion
(Integer, Buffer_Type
);
18 function Set_Buffer_Size
return Byte_Count_Type
is
23 Buffer_Size
: constant Byte_Count_Type
:= Set_Buffer_Size
;
24 Buffer_End
: constant Byte_Count_Type
:= Max_Byte_Count
;
25 Buffer_Start
: constant Byte_Count_Type
:= Buffer_End
- Buffer_Size
+ 1;
30 Put
(Convert_Put
(Discrete_Type
'Pos (Obj
)));
32 Put
(Convert_Put
(Discrete_Type
'Pos (Obj
))
33 (Buffer_Start
..Buffer_End
));
35 Put
(Convert_Put
(Discrete_Type
'Pos (Obj
) -
36 Discrete_Type
'Pos (Discrete_Type
'First))
37 (Buffer_Start
..Buffer_End
));