3 with System
, Ada
.Unchecked_Conversion
; use System
;
5 procedure BLKextract_From_Reg
is
7 type Byte
is range 0 .. +255;
10 type RGB
is array (1 .. 3) of Byte
;
13 type RAW_Packet
is range 0 .. 2 ** 32 - 1;
14 for RAW_Packet
'Size use 32;
16 type Composite_Packet
is record
20 for Composite_Packet
use record
21 Values
at 0 range 0 .. 23;
22 Pad
at 3 range 0 .. 7;
24 for Composite_Packet
'Size use 32;
26 function To_Composite_Packet
is
27 new Ada
.Unchecked_Conversion
(RAW_Packet
, Composite_Packet
);
29 function Blob
return RGB
is
30 RAW_Blob
: RAW_Packet
:= 16#
01020304#
;
32 return To_Composite_Packet
(RAW_Blob
).Values
;
35 Blob_Color
: RGB
:= Blob
;
38 if System
.Default_Bit_Order
= High_Order_First
then
39 Expected_Color
:= (1 => 1, 2 => 2, 3 => 3);
41 Expected_Color
:= (1 => 4, 2 => 3, 3 => 2);
44 for I
in Blob_Color
'Range loop
45 if Blob_Color
(I
) /= Expected_Color
(I
) then