repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
AdaCore/Ada_Drivers_Library | Ada | 3,281 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2018, AdaCore and other contributors --
-- --
-- See github.com/AdaCore/Ada_Drivers_Library/graphs/contributors --
-- for more information --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL.Time;
package FE310.Time is
procedure Delay_Us (Us : Positive);
procedure Delay_Ms (Ms : Positive);
procedure Delay_S (S : Positive);
function HAL_Delay return not null HAL.Time.Any_Delays;
private
type HF1_Delays is new HAL.Time.Delays with null record;
overriding
procedure Delay_Microseconds (This : in out HF1_Delays;
Us : Integer);
overriding
procedure Delay_Milliseconds (This : in out HF1_Delays;
Ms : Integer);
overriding
procedure Delay_Seconds (This : in out HF1_Delays;
S : Integer);
end FE310.Time;
|
sergev/vak-opensource | Ada | 88 | adb | with Text_Io;
procedure Hello is
begin
Text_Io.Put_Line ("Hello, World!");
end Hello;
|
Fabien-Chouteau/GESTE | Ada | 127,955 | ads | package GESTE_Fonts.FreeMono24pt7b is
Font : constant Bitmap_Font_Ref;
private
FreeMono24pt7bBitmaps : aliased constant Font_Bitmap := (
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#70#, 16#00#,
16#00#, 16#07#, 16#00#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#1F#, 16#80#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#1F#,
16#80#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#F9#, 16#F8#, 16#00#, 16#1F#, 16#8F#, 16#80#,
16#01#, 16#F8#, 16#F8#, 16#00#, 16#1F#, 16#0F#, 16#80#, 16#01#, 16#F0#,
16#F8#, 16#00#, 16#0F#, 16#0F#, 16#80#, 16#00#, 16#F0#, 16#F8#, 16#00#,
16#0F#, 16#0F#, 16#00#, 16#00#, 16#F0#, 16#F0#, 16#00#, 16#0F#, 16#07#,
16#00#, 16#00#, 16#F0#, 16#70#, 16#00#, 16#0E#, 16#07#, 16#00#, 16#00#,
16#E0#, 16#70#, 16#00#, 16#06#, 16#06#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#86#, 16#00#, 16#00#, 16#18#, 16#60#, 16#00#,
16#01#, 16#86#, 16#00#, 16#00#, 16#18#, 16#60#, 16#00#, 16#01#, 16#86#,
16#00#, 16#00#, 16#18#, 16#60#, 16#00#, 16#01#, 16#86#, 16#00#, 16#00#,
16#18#, 16#60#, 16#00#, 16#01#, 16#06#, 16#00#, 16#00#, 16#30#, 16#60#,
16#00#, 16#03#, 16#04#, 16#00#, 16#07#, 16#FF#, 16#FF#, 16#00#, 16#7F#,
16#FF#, 16#F0#, 16#00#, 16#30#, 16#C0#, 16#00#, 16#03#, 16#0C#, 16#00#,
16#00#, 16#30#, 16#C0#, 16#00#, 16#03#, 16#0C#, 16#00#, 16#00#, 16#30#,
16#C0#, 16#00#, 16#03#, 16#0C#, 16#00#, 16#0F#, 16#FF#, 16#FE#, 16#00#,
16#FF#, 16#FF#, 16#E0#, 16#00#, 16#30#, 16#C0#, 16#00#, 16#02#, 16#0C#,
16#00#, 16#00#, 16#60#, 16#C0#, 16#00#, 16#06#, 16#0C#, 16#00#, 16#00#,
16#60#, 16#80#, 16#00#, 16#06#, 16#18#, 16#00#, 16#00#, 16#61#, 16#80#,
16#00#, 16#06#, 16#18#, 16#00#, 16#00#, 16#61#, 16#80#, 16#00#, 16#06#,
16#18#, 16#00#, 16#00#, 16#61#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#1F#, 16#80#,
16#00#, 16#07#, 16#FE#, 16#C0#, 16#00#, 16#F0#, 16#7C#, 16#00#, 16#1C#,
16#01#, 16#C0#, 16#01#, 16#80#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#C0#,
16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#FC#, 16#00#, 16#00#,
16#03#, 16#FC#, 16#00#, 16#00#, 16#07#, 16#F0#, 16#00#, 16#00#, 16#07#,
16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#00#, 16#06#, 16#00#, 16#20#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#,
16#00#, 16#70#, 16#00#, 16#C0#, 16#07#, 16#80#, 16#1C#, 16#00#, 16#7E#,
16#07#, 16#80#, 16#06#, 16#7F#, 16#F0#, 16#00#, 16#01#, 16#FC#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C0#, 16#00#,
16#01#, 16#FE#, 16#00#, 16#00#, 16#18#, 16#70#, 16#00#, 16#03#, 16#03#,
16#00#, 16#00#, 16#20#, 16#18#, 16#00#, 16#06#, 16#01#, 16#80#, 16#00#,
16#60#, 16#18#, 16#00#, 16#02#, 16#01#, 16#80#, 16#00#, 16#30#, 16#30#,
16#00#, 16#01#, 16#87#, 16#00#, 16#00#, 16#1F#, 16#E0#, 16#30#, 16#00#,
16#7C#, 16#1F#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#0F#, 16#C0#,
16#00#, 16#07#, 16#E0#, 16#00#, 16#03#, 16#F0#, 16#00#, 16#00#, 16#F8#,
16#00#, 16#00#, 16#0C#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#7F#, 16#80#,
16#00#, 16#0E#, 16#1C#, 16#00#, 16#00#, 16#C0#, 16#C0#, 16#00#, 16#18#,
16#06#, 16#00#, 16#01#, 16#80#, 16#60#, 16#00#, 16#18#, 16#06#, 16#00#,
16#01#, 16#80#, 16#60#, 16#00#, 16#0C#, 16#0C#, 16#00#, 16#00#, 16#E1#,
16#C0#, 16#00#, 16#07#, 16#F8#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#F6#, 16#00#, 16#00#,
16#3F#, 16#E0#, 16#00#, 16#07#, 16#08#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#F8#,
16#00#, 16#00#, 16#19#, 16#81#, 16#C0#, 16#03#, 16#0C#, 16#1C#, 16#00#,
16#60#, 16#63#, 16#00#, 16#06#, 16#06#, 16#30#, 16#00#, 16#60#, 16#33#,
16#00#, 16#06#, 16#03#, 16#E0#, 16#00#, 16#60#, 16#1E#, 16#00#, 16#06#,
16#00#, 16#C0#, 16#00#, 16#30#, 16#0C#, 16#00#, 16#03#, 16#81#, 16#E0#,
16#00#, 16#1C#, 16#33#, 16#C0#, 16#00#, 16#FF#, 16#3C#, 16#00#, 16#07#,
16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#80#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#1F#, 16#80#,
16#00#, 16#00#, 16#F8#, 16#00#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#07#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#1C#,
16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#03#, 16#80#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#03#, 16#80#,
16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#00#,
16#38#, 16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#03#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0E#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#38#,
16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#70#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0E#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#07#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#02#, 16#06#, 16#06#, 16#00#, 16#7C#, 16#63#, 16#E0#,
16#01#, 16#FF#, 16#F8#, 16#00#, 16#03#, 16#FC#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#00#, 16#19#, 16#80#, 16#00#,
16#03#, 16#8C#, 16#00#, 16#00#, 16#70#, 16#E0#, 16#00#, 16#06#, 16#06#,
16#00#, 16#00#, 16#C0#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#FF#, 16#FF#, 16#F8#, 16#0F#, 16#FF#, 16#FF#, 16#80#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#07#, 16#E0#, 16#00#, 16#00#,
16#7E#, 16#00#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#00#, 16#FC#, 16#00#,
16#00#, 16#0F#, 16#80#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#03#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#FF#,
16#F8#, 16#0F#, 16#FF#, 16#FF#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#,
16#01#, 16#F8#, 16#00#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#01#, 16#FC#,
16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#0E#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#03#, 16#00#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#,
16#02#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#80#, 16#00#, 16#03#, 16#FE#, 16#00#, 16#00#, 16#70#, 16#F0#,
16#00#, 16#0C#, 16#03#, 16#00#, 16#01#, 16#C0#, 16#18#, 16#00#, 16#18#,
16#01#, 16#C0#, 16#03#, 16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#C0#,
16#03#, 16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#60#, 16#06#, 16#00#,
16#06#, 16#00#, 16#60#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#, 16#00#,
16#60#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#60#, 16#00#,
16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#60#, 16#00#, 16#60#, 16#06#,
16#00#, 16#06#, 16#00#, 16#60#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#,
16#00#, 16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#0C#, 16#00#, 16#30#,
16#00#, 16#C0#, 16#01#, 16#80#, 16#1C#, 16#00#, 16#1C#, 16#01#, 16#80#,
16#00#, 16#C0#, 16#30#, 16#00#, 16#07#, 16#0F#, 16#00#, 16#00#, 16#3F#,
16#E0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#01#, 16#E0#, 16#00#,
16#00#, 16#3E#, 16#00#, 16#00#, 16#07#, 16#60#, 16#00#, 16#00#, 16#E6#,
16#00#, 16#00#, 16#1C#, 16#60#, 16#00#, 16#03#, 16#86#, 16#00#, 16#00#,
16#30#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#7F#, 16#FF#,
16#E0#, 16#07#, 16#FF#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#00#, 16#00#,
16#07#, 16#FC#, 16#00#, 16#01#, 16#E0#, 16#F0#, 16#00#, 16#38#, 16#03#,
16#80#, 16#03#, 16#00#, 16#18#, 16#00#, 16#60#, 16#00#, 16#C0#, 16#06#,
16#00#, 16#0C#, 16#00#, 16#40#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#07#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#03#,
16#80#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#07#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#03#,
16#00#, 16#04#, 16#00#, 16#60#, 16#00#, 16#40#, 16#0C#, 16#00#, 16#04#,
16#00#, 16#FF#, 16#FF#, 16#C0#, 16#0F#, 16#FF#, 16#FC#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#80#, 16#00#, 16#0F#, 16#FE#, 16#00#, 16#01#, 16#E0#, 16#70#,
16#00#, 16#38#, 16#01#, 16#80#, 16#03#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#70#, 16#00#,
16#00#, 16#FE#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#20#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#40#, 16#00#, 16#C0#,
16#07#, 16#00#, 16#1C#, 16#00#, 16#3C#, 16#07#, 16#80#, 16#01#, 16#FF#,
16#E0#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#00#,
16#00#, 16#01#, 16#F0#, 16#00#, 16#00#, 16#33#, 16#00#, 16#00#, 16#03#,
16#30#, 16#00#, 16#00#, 16#63#, 16#00#, 16#00#, 16#0C#, 16#30#, 16#00#,
16#00#, 16#C3#, 16#00#, 16#00#, 16#18#, 16#30#, 16#00#, 16#03#, 16#83#,
16#00#, 16#00#, 16#30#, 16#30#, 16#00#, 16#06#, 16#03#, 16#00#, 16#00#,
16#60#, 16#30#, 16#00#, 16#0C#, 16#03#, 16#00#, 16#01#, 16#C0#, 16#30#,
16#00#, 16#18#, 16#03#, 16#00#, 16#03#, 16#00#, 16#30#, 16#00#, 16#30#,
16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#7F#, 16#FF#, 16#C0#,
16#07#, 16#FF#, 16#FC#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#7F#,
16#C0#, 16#00#, 16#07#, 16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#FF#, 16#80#, 16#01#, 16#FF#, 16#F8#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#,
16#FC#, 16#00#, 16#01#, 16#FF#, 16#F0#, 16#00#, 16#1C#, 16#03#, 16#80#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#20#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#60#, 16#00#, 16#C0#, 16#07#, 16#00#, 16#38#,
16#00#, 16#3C#, 16#07#, 16#00#, 16#00#, 16#FF#, 16#E0#, 16#00#, 16#03#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#7E#, 16#00#, 16#00#, 16#3F#, 16#F0#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#07#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#87#, 16#E0#, 16#00#,
16#30#, 16#FF#, 16#00#, 16#03#, 16#1C#, 16#3C#, 16#00#, 16#33#, 16#00#,
16#C0#, 16#03#, 16#60#, 16#06#, 16#00#, 16#3C#, 16#00#, 16#60#, 16#03#,
16#C0#, 16#03#, 16#00#, 16#18#, 16#00#, 16#30#, 16#01#, 16#80#, 16#03#,
16#00#, 16#18#, 16#00#, 16#30#, 16#01#, 16#80#, 16#03#, 16#00#, 16#0C#,
16#00#, 16#30#, 16#00#, 16#C0#, 16#06#, 16#00#, 16#06#, 16#00#, 16#60#,
16#00#, 16#70#, 16#0C#, 16#00#, 16#03#, 16#83#, 16#80#, 16#00#, 16#1F#,
16#F0#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#FF#, 16#C0#,
16#07#, 16#FF#, 16#FC#, 16#00#, 16#60#, 16#00#, 16#40#, 16#06#, 16#00#,
16#0C#, 16#00#, 16#60#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#,
16#07#, 16#FE#, 16#00#, 16#00#, 16#E0#, 16#70#, 16#00#, 16#1C#, 16#03#,
16#80#, 16#03#, 16#80#, 16#1C#, 16#00#, 16#30#, 16#00#, 16#C0#, 16#03#,
16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#C0#, 16#03#, 16#00#, 16#0C#,
16#00#, 16#30#, 16#00#, 16#C0#, 16#03#, 16#80#, 16#0C#, 16#00#, 16#1C#,
16#01#, 16#80#, 16#00#, 16#E0#, 16#70#, 16#00#, 16#03#, 16#FE#, 16#00#,
16#00#, 16#3F#, 16#E0#, 16#00#, 16#0E#, 16#07#, 16#00#, 16#01#, 16#C0#,
16#18#, 16#00#, 16#38#, 16#00#, 16#C0#, 16#03#, 16#00#, 16#0C#, 16#00#,
16#30#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#60#, 16#00#,
16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#,
16#00#, 16#0C#, 16#00#, 16#38#, 16#01#, 16#C0#, 16#01#, 16#C0#, 16#38#,
16#00#, 16#0E#, 16#07#, 16#00#, 16#00#, 16#7F#, 16#E0#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#0F#, 16#80#, 16#00#, 16#03#, 16#FE#, 16#00#, 16#00#, 16#70#, 16#70#,
16#00#, 16#0E#, 16#01#, 16#80#, 16#01#, 16#C0#, 16#0C#, 16#00#, 16#18#,
16#00#, 16#C0#, 16#01#, 16#80#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#,
16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#30#, 16#03#, 16#00#,
16#07#, 16#00#, 16#18#, 16#00#, 16#70#, 16#01#, 16#80#, 16#0F#, 16#00#,
16#1C#, 16#01#, 16#B0#, 16#00#, 16#E0#, 16#3B#, 16#00#, 16#07#, 16#0F#,
16#30#, 16#00#, 16#3F#, 16#E3#, 16#00#, 16#00#, 16#F8#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#07#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#01#, 16#FF#,
16#00#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F0#,
16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#,
16#1F#, 16#C0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#,
16#01#, 16#F8#, 16#00#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#01#, 16#FC#,
16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#03#,
16#F0#, 16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#03#, 16#F0#, 16#00#,
16#00#, 16#1E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#00#,
16#7E#, 16#00#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#00#, 16#7C#, 16#00#,
16#00#, 16#0F#, 16#80#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#01#, 16#E0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#03#, 16#C0#,
16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#07#,
16#80#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#78#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#07#, 16#80#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#00#,
16#07#, 16#80#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#00#, 16#70#,
16#00#, 16#00#, 16#01#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FF#, 16#FF#, 16#FC#, 16#1F#,
16#FF#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#1F#, 16#FF#, 16#FF#, 16#C1#, 16#FF#, 16#FF#, 16#FC#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#00#,
16#78#, 16#00#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#00#, 16#07#, 16#80#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#,
16#0F#, 16#00#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#3C#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#01#, 16#E0#,
16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#07#,
16#80#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#C0#,
16#00#, 16#0F#, 16#FF#, 16#00#, 16#03#, 16#E0#, 16#78#, 16#00#, 16#38#,
16#01#, 16#C0#, 16#03#, 16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#60#,
16#03#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#3E#,
16#00#, 16#00#, 16#07#, 16#80#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#1F#, 16#80#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#1F#,
16#80#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#07#, 16#FE#, 16#00#,
16#00#, 16#F0#, 16#70#, 16#00#, 16#1C#, 16#03#, 16#80#, 16#01#, 16#80#,
16#18#, 16#00#, 16#38#, 16#01#, 16#80#, 16#03#, 16#00#, 16#0C#, 16#00#,
16#30#, 16#00#, 16#C0#, 16#06#, 16#00#, 16#0C#, 16#00#, 16#60#, 16#0F#,
16#C0#, 16#06#, 16#03#, 16#FC#, 16#00#, 16#60#, 16#78#, 16#C0#, 16#06#,
16#0E#, 16#0C#, 16#00#, 16#60#, 16#C0#, 16#C0#, 16#06#, 16#0C#, 16#0C#,
16#00#, 16#61#, 16#80#, 16#C0#, 16#06#, 16#18#, 16#0C#, 16#00#, 16#60#,
16#C0#, 16#C0#, 16#06#, 16#0C#, 16#0C#, 16#00#, 16#60#, 16#F0#, 16#C0#,
16#06#, 16#07#, 16#FC#, 16#00#, 16#60#, 16#1F#, 16#C0#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0F#, 16#01#, 16#80#, 16#00#,
16#7F#, 16#F8#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#F0#,
16#00#, 16#07#, 16#FF#, 16#00#, 16#00#, 16#01#, 16#B0#, 16#00#, 16#00#,
16#19#, 16#80#, 16#00#, 16#01#, 16#18#, 16#00#, 16#00#, 16#30#, 16#C0#,
16#00#, 16#03#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#C0#, 16#00#, 16#06#,
16#06#, 16#00#, 16#00#, 16#60#, 16#60#, 16#00#, 16#0C#, 16#03#, 16#00#,
16#00#, 16#C0#, 16#30#, 16#00#, 16#08#, 16#03#, 16#00#, 16#01#, 16#80#,
16#18#, 16#00#, 16#18#, 16#01#, 16#80#, 16#03#, 16#FF#, 16#F8#, 16#00#,
16#3F#, 16#FF#, 16#C0#, 16#02#, 16#00#, 16#0C#, 16#00#, 16#60#, 16#00#,
16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#C0#, 16#00#, 16#60#, 16#0C#,
16#00#, 16#03#, 16#00#, 16#C0#, 16#00#, 16#30#, 16#18#, 16#00#, 16#01#,
16#87#, 16#FC#, 16#03#, 16#FF#, 16#7F#, 16#C0#, 16#3F#, 16#F0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#FF#, 16#FE#, 16#00#, 16#3F#, 16#FF#, 16#F8#, 16#00#, 16#30#,
16#03#, 16#C0#, 16#03#, 16#00#, 16#0E#, 16#00#, 16#30#, 16#00#, 16#60#,
16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#20#, 16#03#, 16#00#,
16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#0C#, 16#00#,
16#30#, 16#03#, 16#80#, 16#03#, 16#FF#, 16#F0#, 16#00#, 16#3F#, 16#FF#,
16#80#, 16#03#, 16#00#, 16#1E#, 16#00#, 16#30#, 16#00#, 16#70#, 16#03#,
16#00#, 16#03#, 16#80#, 16#30#, 16#00#, 16#18#, 16#03#, 16#00#, 16#01#,
16#80#, 16#30#, 16#00#, 16#18#, 16#03#, 16#00#, 16#01#, 16#80#, 16#30#,
16#00#, 16#18#, 16#03#, 16#00#, 16#01#, 16#80#, 16#30#, 16#00#, 16#30#,
16#03#, 16#00#, 16#0E#, 16#03#, 16#FF#, 16#FF#, 16#C0#, 16#3F#, 16#FF#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#C0#, 16#00#, 16#07#, 16#FF#, 16#10#, 16#01#, 16#E0#,
16#3F#, 16#00#, 16#38#, 16#00#, 16#F0#, 16#07#, 16#00#, 16#07#, 16#00#,
16#60#, 16#00#, 16#30#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#,
16#30#, 16#0C#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#,
16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#07#, 16#00#, 16#01#, 16#80#,
16#38#, 16#00#, 16#38#, 16#01#, 16#C0#, 16#07#, 16#00#, 16#0F#, 16#01#,
16#E0#, 16#00#, 16#7F#, 16#F8#, 16#00#, 16#00#, 16#FE#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#F8#,
16#00#, 16#3F#, 16#FF#, 16#E0#, 16#00#, 16#60#, 16#0F#, 16#00#, 16#06#,
16#00#, 16#38#, 16#00#, 16#60#, 16#00#, 16#C0#, 16#06#, 16#00#, 16#0E#,
16#00#, 16#60#, 16#00#, 16#60#, 16#06#, 16#00#, 16#07#, 16#00#, 16#60#,
16#00#, 16#30#, 16#06#, 16#00#, 16#03#, 16#00#, 16#60#, 16#00#, 16#30#,
16#06#, 16#00#, 16#01#, 16#00#, 16#60#, 16#00#, 16#10#, 16#06#, 16#00#,
16#01#, 16#00#, 16#60#, 16#00#, 16#10#, 16#06#, 16#00#, 16#03#, 16#00#,
16#60#, 16#00#, 16#30#, 16#06#, 16#00#, 16#03#, 16#00#, 16#60#, 16#00#,
16#30#, 16#06#, 16#00#, 16#06#, 16#00#, 16#60#, 16#00#, 16#E0#, 16#06#,
16#00#, 16#0C#, 16#00#, 16#60#, 16#03#, 16#80#, 16#06#, 16#00#, 16#70#,
16#03#, 16#FF#, 16#FE#, 16#00#, 16#3F#, 16#FF#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#FF#, 16#FF#, 16#E0#, 16#3F#, 16#FF#, 16#FE#, 16#00#, 16#30#,
16#00#, 16#20#, 16#03#, 16#00#, 16#02#, 16#00#, 16#30#, 16#00#, 16#20#,
16#03#, 16#00#, 16#02#, 16#00#, 16#30#, 16#00#, 16#20#, 16#03#, 16#00#,
16#00#, 16#00#, 16#30#, 16#10#, 16#00#, 16#03#, 16#01#, 16#80#, 16#00#,
16#30#, 16#18#, 16#00#, 16#03#, 16#FF#, 16#80#, 16#00#, 16#3F#, 16#F8#,
16#00#, 16#03#, 16#01#, 16#80#, 16#00#, 16#30#, 16#18#, 16#00#, 16#03#,
16#01#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#10#, 16#03#, 16#00#, 16#01#, 16#00#, 16#30#,
16#00#, 16#10#, 16#03#, 16#00#, 16#01#, 16#00#, 16#30#, 16#00#, 16#10#,
16#03#, 16#00#, 16#01#, 16#03#, 16#FF#, 16#FF#, 16#F0#, 16#3F#, 16#FF#,
16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#FF#, 16#F0#, 16#3F#, 16#FF#,
16#FF#, 16#00#, 16#30#, 16#00#, 16#10#, 16#03#, 16#00#, 16#01#, 16#00#,
16#30#, 16#00#, 16#10#, 16#03#, 16#00#, 16#01#, 16#00#, 16#30#, 16#00#,
16#10#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#10#, 16#00#, 16#03#,
16#01#, 16#80#, 16#00#, 16#30#, 16#18#, 16#00#, 16#03#, 16#FF#, 16#80#,
16#00#, 16#3F#, 16#F8#, 16#00#, 16#03#, 16#01#, 16#80#, 16#00#, 16#30#,
16#18#, 16#00#, 16#03#, 16#01#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#E0#,
16#00#, 16#3F#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#07#, 16#FF#,
16#90#, 16#01#, 16#F0#, 16#3D#, 16#00#, 16#38#, 16#00#, 16#70#, 16#03#,
16#00#, 16#03#, 16#00#, 16#60#, 16#00#, 16#30#, 16#0E#, 16#00#, 16#01#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#1F#, 16#FC#, 16#18#, 16#01#, 16#FF#, 16#C1#,
16#80#, 16#00#, 16#10#, 16#18#, 16#00#, 16#01#, 16#01#, 16#80#, 16#00#,
16#10#, 16#0C#, 16#00#, 16#01#, 16#00#, 16#C0#, 16#00#, 16#10#, 16#06#,
16#00#, 16#01#, 16#00#, 16#70#, 16#00#, 16#10#, 16#03#, 16#80#, 16#03#,
16#00#, 16#1F#, 16#01#, 16#F0#, 16#00#, 16#7F#, 16#FE#, 16#00#, 16#00#,
16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FF#, 16#07#, 16#F8#, 16#0F#, 16#F0#, 16#7F#, 16#80#, 16#30#,
16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#,
16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#,
16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#,
16#30#, 16#00#, 16#40#, 16#03#, 16#FF#, 16#FC#, 16#00#, 16#3F#, 16#FF#,
16#C0#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#,
16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#,
16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#,
16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#,
16#03#, 16#00#, 16#04#, 16#01#, 16#FF#, 16#07#, 16#FC#, 16#1F#, 16#F0#,
16#7F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#FF#, 16#E0#, 16#07#, 16#FF#,
16#FE#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#7F#, 16#FF#,
16#E0#, 16#07#, 16#FF#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FF#,
16#FE#, 16#00#, 16#1F#, 16#FF#, 16#E0#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#0C#, 16#00#, 16#0C#, 16#00#,
16#C0#, 16#00#, 16#C0#, 16#0C#, 16#00#, 16#0C#, 16#00#, 16#C0#, 16#00#,
16#C0#, 16#0C#, 16#00#, 16#0C#, 16#00#, 16#C0#, 16#01#, 16#80#, 16#0C#,
16#00#, 16#18#, 16#00#, 16#C0#, 16#03#, 16#80#, 16#07#, 16#00#, 16#70#,
16#00#, 16#3C#, 16#0E#, 16#00#, 16#01#, 16#FF#, 16#C0#, 16#00#, 16#03#,
16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#FF#, 16#03#, 16#FC#, 16#3F#, 16#F0#, 16#3F#, 16#C0#, 16#30#,
16#00#, 16#E0#, 16#03#, 16#00#, 16#1C#, 16#00#, 16#30#, 16#03#, 16#80#,
16#03#, 16#00#, 16#70#, 16#00#, 16#30#, 16#0C#, 16#00#, 16#03#, 16#01#,
16#80#, 16#00#, 16#30#, 16#70#, 16#00#, 16#03#, 16#0E#, 16#00#, 16#00#,
16#31#, 16#C0#, 16#00#, 16#03#, 16#3C#, 16#00#, 16#00#, 16#36#, 16#F0#,
16#00#, 16#03#, 16#C3#, 16#80#, 16#00#, 16#38#, 16#1C#, 16#00#, 16#03#,
16#00#, 16#E0#, 16#00#, 16#30#, 16#06#, 16#00#, 16#03#, 16#00#, 16#30#,
16#00#, 16#30#, 16#03#, 16#80#, 16#03#, 16#00#, 16#18#, 16#00#, 16#30#,
16#01#, 16#80#, 16#03#, 16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#C0#,
16#03#, 16#00#, 16#06#, 16#03#, 16#FF#, 16#00#, 16#7E#, 16#3F#, 16#F0#,
16#07#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#FF#, 16#F0#, 16#00#, 16#1F#, 16#FF#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#08#,
16#00#, 16#60#, 16#01#, 16#80#, 16#06#, 16#00#, 16#18#, 16#00#, 16#60#,
16#01#, 16#80#, 16#06#, 16#00#, 16#18#, 16#00#, 16#60#, 16#01#, 16#80#,
16#06#, 16#00#, 16#18#, 16#00#, 16#60#, 16#01#, 16#81#, 16#FF#, 16#FF#,
16#F8#, 16#1F#, 16#FF#, 16#FF#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E0#, 16#00#,
16#7E#, 16#7F#, 16#00#, 16#07#, 16#E1#, 16#B0#, 16#00#, 16#D8#, 16#1B#,
16#00#, 16#0D#, 16#81#, 16#98#, 16#01#, 16#D8#, 16#19#, 16#80#, 16#19#,
16#81#, 16#8C#, 16#01#, 16#98#, 16#18#, 16#C0#, 16#31#, 16#81#, 16#86#,
16#03#, 16#18#, 16#18#, 16#60#, 16#61#, 16#81#, 16#83#, 16#06#, 16#18#,
16#18#, 16#30#, 16#C1#, 16#81#, 16#81#, 16#8C#, 16#18#, 16#18#, 16#19#,
16#81#, 16#81#, 16#81#, 16#D8#, 16#18#, 16#18#, 16#0F#, 16#81#, 16#81#,
16#80#, 16#F0#, 16#18#, 16#18#, 16#07#, 16#01#, 16#81#, 16#80#, 16#00#,
16#18#, 16#18#, 16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#,
16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#, 16#00#, 16#01#,
16#87#, 16#FC#, 16#03#, 16#FF#, 16#7F#, 16#C0#, 16#3F#, 16#F0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#F0#, 16#07#, 16#FC#, 16#7F#, 16#00#, 16#7F#, 16#C0#, 16#78#,
16#00#, 16#30#, 16#07#, 16#80#, 16#03#, 16#00#, 16#6C#, 16#00#, 16#30#,
16#06#, 16#E0#, 16#03#, 16#00#, 16#66#, 16#00#, 16#30#, 16#06#, 16#30#,
16#03#, 16#00#, 16#63#, 16#80#, 16#30#, 16#06#, 16#18#, 16#03#, 16#00#,
16#60#, 16#C0#, 16#30#, 16#06#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#60#,
16#30#, 16#06#, 16#07#, 16#03#, 16#00#, 16#60#, 16#30#, 16#30#, 16#06#,
16#01#, 16#83#, 16#00#, 16#60#, 16#18#, 16#30#, 16#06#, 16#00#, 16#C3#,
16#00#, 16#60#, 16#0E#, 16#30#, 16#06#, 16#00#, 16#63#, 16#00#, 16#60#,
16#03#, 16#30#, 16#06#, 16#00#, 16#3B#, 16#00#, 16#60#, 16#01#, 16#B0#,
16#06#, 16#00#, 16#0F#, 16#03#, 16#FE#, 16#00#, 16#F0#, 16#3F#, 16#E0#,
16#07#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#80#, 16#00#, 16#07#, 16#FE#, 16#00#, 16#01#, 16#E0#,
16#78#, 16#00#, 16#38#, 16#01#, 16#C0#, 16#07#, 16#00#, 16#0E#, 16#00#,
16#60#, 16#00#, 16#60#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#,
16#30#, 16#18#, 16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#,
16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#0C#, 16#30#, 16#00#, 16#00#,
16#C3#, 16#00#, 16#00#, 16#0C#, 16#30#, 16#00#, 16#00#, 16#C3#, 16#00#,
16#00#, 16#0C#, 16#18#, 16#00#, 16#00#, 16#C1#, 16#80#, 16#00#, 16#18#,
16#18#, 16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#0C#, 16#00#,
16#03#, 16#80#, 16#C0#, 16#00#, 16#30#, 16#06#, 16#00#, 16#06#, 16#00#,
16#70#, 16#00#, 16#E0#, 16#03#, 16#80#, 16#1C#, 16#00#, 16#1E#, 16#07#,
16#80#, 16#00#, 16#7F#, 16#E0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#FC#,
16#00#, 16#3F#, 16#FF#, 16#F0#, 16#00#, 16#30#, 16#03#, 16#80#, 16#03#,
16#00#, 16#1C#, 16#00#, 16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#06#,
16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#02#, 16#00#, 16#30#,
16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#E0#,
16#03#, 16#00#, 16#1C#, 16#00#, 16#30#, 16#07#, 16#80#, 16#03#, 16#FF#,
16#F0#, 16#00#, 16#3F#, 16#F8#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#03#, 16#FF#, 16#E0#, 16#00#, 16#3F#, 16#FE#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#80#,
16#00#, 16#07#, 16#FE#, 16#00#, 16#01#, 16#E0#, 16#78#, 16#00#, 16#38#,
16#01#, 16#C0#, 16#07#, 16#00#, 16#0E#, 16#00#, 16#60#, 16#00#, 16#60#,
16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#, 16#30#, 16#18#, 16#00#,
16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#, 16#00#, 16#01#, 16#81#,
16#80#, 16#00#, 16#0C#, 16#30#, 16#00#, 16#00#, 16#C3#, 16#00#, 16#00#,
16#0C#, 16#30#, 16#00#, 16#00#, 16#C3#, 16#00#, 16#00#, 16#0C#, 16#18#,
16#00#, 16#00#, 16#C1#, 16#80#, 16#00#, 16#18#, 16#18#, 16#00#, 16#01#,
16#81#, 16#80#, 16#00#, 16#18#, 16#0C#, 16#00#, 16#03#, 16#80#, 16#C0#,
16#00#, 16#30#, 16#06#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#E0#,
16#01#, 16#80#, 16#1C#, 16#00#, 16#0E#, 16#07#, 16#80#, 16#00#, 16#3F#,
16#F0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#0F#, 16#FE#, 16#1C#, 16#01#, 16#FF#, 16#FF#, 16#80#, 16#1C#, 16#03#,
16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#FC#, 16#00#, 16#3F#, 16#FF#,
16#F0#, 16#00#, 16#30#, 16#03#, 16#80#, 16#03#, 16#00#, 16#1C#, 16#00#,
16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#,
16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#,
16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#1C#,
16#00#, 16#30#, 16#07#, 16#80#, 16#03#, 16#FF#, 16#E0#, 16#00#, 16#3F#,
16#F8#, 16#00#, 16#03#, 16#01#, 16#C0#, 16#00#, 16#30#, 16#06#, 16#00#,
16#03#, 16#00#, 16#30#, 16#00#, 16#30#, 16#01#, 16#80#, 16#03#, 16#00#,
16#0C#, 16#00#, 16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#06#, 16#00#,
16#30#, 16#00#, 16#30#, 16#03#, 16#00#, 16#03#, 16#83#, 16#FF#, 16#00#,
16#1F#, 16#3F#, 16#F0#, 16#01#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#07#, 16#FE#,
16#60#, 16#01#, 16#E0#, 16#7E#, 16#00#, 16#18#, 16#01#, 16#E0#, 16#03#,
16#00#, 16#0E#, 16#00#, 16#30#, 16#00#, 16#60#, 16#07#, 16#00#, 16#06#,
16#00#, 16#60#, 16#00#, 16#60#, 16#07#, 16#00#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#00#, 16#FC#, 16#00#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#03#, 16#00#, 16#40#, 16#00#,
16#30#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#, 16#30#, 16#0E#,
16#00#, 16#07#, 16#00#, 16#F0#, 16#00#, 16#E0#, 16#0F#, 16#80#, 16#1C#,
16#00#, 16#DE#, 16#07#, 16#80#, 16#0C#, 16#FF#, 16#F0#, 16#00#, 16#01#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#FF#, 16#FF#, 16#F8#, 16#1F#, 16#FF#, 16#FF#, 16#81#, 16#80#,
16#60#, 16#18#, 16#18#, 16#06#, 16#01#, 16#81#, 16#80#, 16#60#, 16#18#,
16#18#, 16#06#, 16#01#, 16#80#, 16#80#, 16#60#, 16#18#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#1F#, 16#FF#, 16#80#, 16#01#, 16#FF#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#03#, 16#FE#, 16#07#, 16#FC#, 16#3F#, 16#E0#,
16#7F#, 16#C0#, 16#60#, 16#00#, 16#20#, 16#06#, 16#00#, 16#02#, 16#00#,
16#60#, 16#00#, 16#20#, 16#06#, 16#00#, 16#02#, 16#00#, 16#60#, 16#00#,
16#20#, 16#06#, 16#00#, 16#02#, 16#00#, 16#60#, 16#00#, 16#20#, 16#06#,
16#00#, 16#02#, 16#00#, 16#60#, 16#00#, 16#20#, 16#06#, 16#00#, 16#02#,
16#00#, 16#60#, 16#00#, 16#20#, 16#06#, 16#00#, 16#02#, 16#00#, 16#60#,
16#00#, 16#20#, 16#06#, 16#00#, 16#02#, 16#00#, 16#60#, 16#00#, 16#20#,
16#06#, 16#00#, 16#02#, 16#00#, 16#60#, 16#00#, 16#60#, 16#06#, 16#00#,
16#06#, 16#00#, 16#60#, 16#00#, 16#60#, 16#07#, 16#00#, 16#0E#, 16#00#,
16#30#, 16#00#, 16#C0#, 16#01#, 16#C0#, 16#18#, 16#00#, 16#0E#, 16#07#,
16#80#, 16#00#, 16#7F#, 16#E0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#FC#, 16#03#,
16#FF#, 16#7F#, 16#C0#, 16#3F#, 16#F1#, 16#80#, 16#00#, 16#18#, 16#0C#,
16#00#, 16#03#, 16#00#, 16#C0#, 16#00#, 16#30#, 16#06#, 16#00#, 16#03#,
16#00#, 16#60#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#, 16#00#, 16#30#,
16#00#, 16#C0#, 16#03#, 16#00#, 16#0C#, 16#00#, 16#38#, 16#00#, 16#C0#,
16#01#, 16#80#, 16#18#, 16#00#, 16#18#, 16#01#, 16#80#, 16#00#, 16#C0#,
16#30#, 16#00#, 16#0C#, 16#03#, 16#00#, 16#00#, 16#E0#, 16#30#, 16#00#,
16#06#, 16#06#, 16#00#, 16#00#, 16#60#, 16#60#, 16#00#, 16#03#, 16#0C#,
16#00#, 16#00#, 16#30#, 16#C0#, 16#00#, 16#03#, 16#08#, 16#00#, 16#00#,
16#19#, 16#80#, 16#00#, 16#01#, 16#98#, 16#00#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#FC#, 16#03#, 16#FE#, 16#7F#, 16#C0#, 16#3F#, 16#E1#, 16#80#,
16#00#, 16#18#, 16#18#, 16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#,
16#18#, 16#07#, 16#01#, 16#81#, 16#80#, 16#F0#, 16#18#, 16#0C#, 16#0F#,
16#01#, 16#80#, 16#C0#, 16#F8#, 16#18#, 16#0C#, 16#09#, 16#81#, 16#00#,
16#C1#, 16#98#, 16#30#, 16#0C#, 16#19#, 16#83#, 16#00#, 16#C1#, 16#8C#,
16#30#, 16#0C#, 16#30#, 16#C3#, 16#00#, 16#C3#, 16#0C#, 16#30#, 16#0C#,
16#30#, 16#C3#, 16#00#, 16#62#, 16#06#, 16#30#, 16#06#, 16#60#, 16#62#,
16#00#, 16#66#, 16#06#, 16#60#, 16#06#, 16#60#, 16#36#, 16#00#, 16#6C#,
16#03#, 16#60#, 16#06#, 16#C0#, 16#36#, 16#00#, 16#6C#, 16#03#, 16#60#,
16#06#, 16#80#, 16#1E#, 16#00#, 16#38#, 16#01#, 16#E0#, 16#03#, 16#80#,
16#1C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#FC#, 16#03#, 16#FC#, 16#1F#, 16#C0#,
16#3F#, 16#C0#, 16#60#, 16#00#, 16#60#, 16#03#, 16#00#, 16#0E#, 16#00#,
16#38#, 16#01#, 16#C0#, 16#01#, 16#C0#, 16#18#, 16#00#, 16#0C#, 16#03#,
16#00#, 16#00#, 16#60#, 16#60#, 16#00#, 16#07#, 16#0E#, 16#00#, 16#00#,
16#39#, 16#C0#, 16#00#, 16#01#, 16#D8#, 16#00#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#19#, 16#80#, 16#00#, 16#03#, 16#0C#, 16#00#,
16#00#, 16#60#, 16#60#, 16#00#, 16#0E#, 16#07#, 16#00#, 16#01#, 16#C0#,
16#38#, 16#00#, 16#18#, 16#01#, 16#80#, 16#03#, 16#00#, 16#0C#, 16#00#,
16#60#, 16#00#, 16#60#, 16#0E#, 16#00#, 16#07#, 16#03#, 16#FC#, 16#03#,
16#FC#, 16#3F#, 16#C0#, 16#3F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FC#, 16#03#,
16#FC#, 16#1F#, 16#C0#, 16#3F#, 16#C0#, 16#60#, 16#00#, 16#60#, 16#03#,
16#00#, 16#0C#, 16#00#, 16#18#, 16#00#, 16#C0#, 16#01#, 16#C0#, 16#18#,
16#00#, 16#0C#, 16#03#, 16#00#, 16#00#, 16#60#, 16#30#, 16#00#, 16#07#,
16#06#, 16#00#, 16#00#, 16#30#, 16#C0#, 16#00#, 16#01#, 16#9C#, 16#00#,
16#00#, 16#1D#, 16#80#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#07#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#1F#, 16#FF#, 16#80#, 16#01#, 16#FF#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#3F#, 16#FF#, 16#C0#, 16#03#, 16#FF#, 16#FC#, 16#00#, 16#30#,
16#00#, 16#C0#, 16#03#, 16#00#, 16#1C#, 16#00#, 16#30#, 16#03#, 16#80#,
16#03#, 16#00#, 16#30#, 16#00#, 16#30#, 16#06#, 16#00#, 16#02#, 16#00#,
16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#07#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#,
16#38#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#60#, 16#02#,
16#00#, 16#0E#, 16#00#, 16#60#, 16#00#, 16#C0#, 16#06#, 16#00#, 16#18#,
16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#70#, 16#00#, 16#60#,
16#06#, 16#00#, 16#06#, 16#00#, 16#7F#, 16#FF#, 16#E0#, 16#07#, 16#FF#,
16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#80#,
16#00#, 16#07#, 16#F8#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#7F#, 16#80#, 16#00#, 16#07#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#07#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#01#, 16#FE#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#1F#, 16#E0#,
16#00#, 16#01#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#02#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#0F#, 16#00#, 16#00#, 16#01#, 16#D8#, 16#00#, 16#00#, 16#39#,
16#C0#, 16#00#, 16#03#, 16#0E#, 16#00#, 16#00#, 16#60#, 16#60#, 16#00#,
16#0C#, 16#03#, 16#00#, 16#01#, 16#C0#, 16#18#, 16#00#, 16#38#, 16#01#,
16#C0#, 16#03#, 16#00#, 16#0E#, 16#00#, 16#60#, 16#00#, 16#60#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#0F#, 16#FF#, 16#FF#, 16#FF#, 16#FF#, 16#FF#,
16#FF#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#3F#, 16#FE#,
16#00#, 16#03#, 16#80#, 16#70#, 16#00#, 16#00#, 16#03#, 16#80#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#07#,
16#F8#, 16#C0#, 16#01#, 16#FF#, 16#FC#, 16#00#, 16#7C#, 16#01#, 16#C0#,
16#0E#, 16#00#, 16#0C#, 16#00#, 16#C0#, 16#00#, 16#C0#, 16#0C#, 16#00#,
16#0C#, 16#01#, 16#80#, 16#00#, 16#C0#, 16#18#, 16#00#, 16#1C#, 16#00#,
16#C0#, 16#03#, 16#C0#, 16#0C#, 16#00#, 16#EC#, 16#00#, 16#70#, 16#3C#,
16#F8#, 16#03#, 16#FF#, 16#0F#, 16#80#, 16#0F#, 16#C0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#E0#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#0F#, 16#C0#,
16#00#, 16#63#, 16#FF#, 16#00#, 16#06#, 16#70#, 16#3C#, 16#00#, 16#6C#,
16#00#, 16#E0#, 16#07#, 16#80#, 16#07#, 16#00#, 16#70#, 16#00#, 16#30#,
16#07#, 16#00#, 16#03#, 16#80#, 16#60#, 16#00#, 16#18#, 16#06#, 16#00#,
16#01#, 16#80#, 16#60#, 16#00#, 16#18#, 16#06#, 16#00#, 16#01#, 16#80#,
16#60#, 16#00#, 16#18#, 16#06#, 16#00#, 16#01#, 16#80#, 16#60#, 16#00#,
16#18#, 16#06#, 16#00#, 16#01#, 16#80#, 16#70#, 16#00#, 16#38#, 16#07#,
16#80#, 16#03#, 16#00#, 16#78#, 16#00#, 16#60#, 16#06#, 16#E0#, 16#0E#,
16#07#, 16#E7#, 16#03#, 16#C0#, 16#7E#, 16#3F#, 16#F0#, 16#00#, 16#00#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#C0#, 16#00#, 16#07#, 16#FF#, 16#30#, 16#00#, 16#F0#,
16#3F#, 16#00#, 16#1C#, 16#00#, 16#F0#, 16#03#, 16#00#, 16#07#, 16#00#,
16#70#, 16#00#, 16#30#, 16#06#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#,
16#30#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#18#,
16#03#, 16#80#, 16#03#, 16#80#, 16#1E#, 16#01#, 16#E0#, 16#00#, 16#7F#,
16#FC#, 16#00#, 16#01#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#F0#,
16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#,
16#00#, 16#00#, 16#30#, 16#00#, 16#3F#, 16#03#, 16#00#, 16#0F#, 16#FC#,
16#30#, 16#01#, 16#E0#, 16#E3#, 16#00#, 16#38#, 16#03#, 16#30#, 16#06#,
16#00#, 16#1B#, 16#00#, 16#E0#, 16#00#, 16#F0#, 16#0C#, 16#00#, 16#07#,
16#01#, 16#80#, 16#00#, 16#70#, 16#18#, 16#00#, 16#07#, 16#01#, 16#80#,
16#00#, 16#30#, 16#18#, 16#00#, 16#03#, 16#01#, 16#80#, 16#00#, 16#30#,
16#18#, 16#00#, 16#03#, 16#01#, 16#80#, 16#00#, 16#70#, 16#0C#, 16#00#,
16#07#, 16#00#, 16#C0#, 16#00#, 16#70#, 16#0E#, 16#00#, 16#0F#, 16#00#,
16#60#, 16#01#, 16#B0#, 16#03#, 16#80#, 16#33#, 16#00#, 16#1C#, 16#0E#,
16#3E#, 16#00#, 16#FF#, 16#C3#, 16#E0#, 16#03#, 16#F0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#80#,
16#00#, 16#0F#, 16#FE#, 16#00#, 16#03#, 16#C0#, 16#78#, 16#00#, 16#70#,
16#01#, 16#C0#, 16#06#, 16#00#, 16#0E#, 16#00#, 16#C0#, 16#00#, 16#60#,
16#0C#, 16#00#, 16#03#, 16#01#, 16#80#, 16#00#, 16#30#, 16#18#, 16#00#,
16#03#, 16#01#, 16#FF#, 16#FF#, 16#F0#, 16#1F#, 16#FF#, 16#FF#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#70#, 16#00#, 16#30#, 16#03#, 16#80#, 16#07#,
16#00#, 16#1E#, 16#03#, 16#E0#, 16#00#, 16#7F#, 16#F8#, 16#00#, 16#01#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#F8#, 16#00#, 16#07#, 16#FF#,
16#80#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#3F#, 16#FF#, 16#E0#, 16#03#, 16#FF#,
16#FE#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#7F#, 16#FF#, 16#C0#, 16#07#, 16#FF#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#0F#, 16#F8#,
16#7C#, 16#03#, 16#C1#, 16#E7#, 16#C0#, 16#30#, 16#07#, 16#60#, 16#06#,
16#00#, 16#36#, 16#00#, 16#C0#, 16#01#, 16#E0#, 16#0C#, 16#00#, 16#0E#,
16#01#, 16#80#, 16#00#, 16#E0#, 16#18#, 16#00#, 16#0E#, 16#01#, 16#80#,
16#00#, 16#60#, 16#18#, 16#00#, 16#06#, 16#01#, 16#80#, 16#00#, 16#60#,
16#18#, 16#00#, 16#0E#, 16#01#, 16#80#, 16#00#, 16#E0#, 16#0C#, 16#00#,
16#0E#, 16#00#, 16#C0#, 16#01#, 16#E0#, 16#06#, 16#00#, 16#3E#, 16#00#,
16#70#, 16#07#, 16#60#, 16#03#, 16#C1#, 16#E6#, 16#00#, 16#0F#, 16#FC#,
16#60#, 16#00#, 16#3F#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#07#, 16#80#, 16#00#, 16#FF#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#,
16#F0#, 16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#0F#, 16#C0#,
16#00#, 16#33#, 16#FF#, 16#00#, 16#03#, 16#70#, 16#78#, 16#00#, 16#3E#,
16#01#, 16#C0#, 16#03#, 16#C0#, 16#0C#, 16#00#, 16#38#, 16#00#, 16#C0#,
16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#,
16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#,
16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#,
16#40#, 16#03#, 16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#,
16#00#, 16#04#, 16#00#, 16#30#, 16#00#, 16#40#, 16#03#, 16#00#, 16#04#,
16#01#, 16#FE#, 16#07#, 16#FC#, 16#1F#, 16#E0#, 16#7F#, 16#C0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#03#, 16#FE#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#F0#, 16#0F#, 16#FF#,
16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#01#,
16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#FF#,
16#00#, 16#03#, 16#FF#, 16#F0#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#07#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#03#, 16#FF#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#18#, 16#1F#, 16#E0#, 16#01#, 16#81#, 16#FE#, 16#00#, 16#18#,
16#0E#, 16#00#, 16#01#, 16#81#, 16#C0#, 16#00#, 16#18#, 16#38#, 16#00#,
16#01#, 16#87#, 16#00#, 16#00#, 16#18#, 16#C0#, 16#00#, 16#01#, 16#B8#,
16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#,
16#1C#, 16#E0#, 16#00#, 16#01#, 16#87#, 16#00#, 16#00#, 16#18#, 16#38#,
16#00#, 16#01#, 16#81#, 16#C0#, 16#00#, 16#18#, 16#0E#, 16#00#, 16#01#,
16#80#, 16#70#, 16#00#, 16#18#, 16#03#, 16#80#, 16#01#, 16#80#, 16#1C#,
16#01#, 16#F8#, 16#07#, 16#F8#, 16#1F#, 16#80#, 16#7F#, 16#80#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#03#, 16#FE#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#F0#, 16#0F#, 16#FF#,
16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#3C#, 16#07#, 16#9F#, 16#87#,
16#E0#, 16#7B#, 16#8C#, 16#C3#, 16#01#, 16#E0#, 16#78#, 16#38#, 16#1C#,
16#07#, 16#01#, 16#81#, 16#C0#, 16#70#, 16#18#, 16#18#, 16#06#, 16#01#,
16#81#, 16#80#, 16#60#, 16#18#, 16#18#, 16#06#, 16#01#, 16#81#, 16#80#,
16#60#, 16#18#, 16#18#, 16#06#, 16#01#, 16#81#, 16#80#, 16#60#, 16#18#,
16#18#, 16#06#, 16#01#, 16#81#, 16#80#, 16#60#, 16#18#, 16#18#, 16#06#,
16#01#, 16#81#, 16#80#, 16#60#, 16#18#, 16#18#, 16#06#, 16#01#, 16#81#,
16#80#, 16#60#, 16#18#, 16#18#, 16#06#, 16#01#, 16#87#, 16#F0#, 16#7C#,
16#1F#, 16#7F#, 16#07#, 16#C1#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#,
16#01#, 16#F1#, 16#FF#, 16#00#, 16#1F#, 16#70#, 16#38#, 16#00#, 16#36#,
16#01#, 16#C0#, 16#03#, 16#C0#, 16#0C#, 16#00#, 16#38#, 16#00#, 16#C0#,
16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#,
16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#,
16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#,
16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#,
16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#,
16#01#, 16#FE#, 16#03#, 16#F8#, 16#1F#, 16#E0#, 16#3F#, 16#80#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#80#, 16#00#, 16#07#, 16#FF#, 16#00#, 16#01#, 16#E0#,
16#78#, 16#00#, 16#38#, 16#01#, 16#C0#, 16#07#, 16#00#, 16#0E#, 16#00#,
16#60#, 16#00#, 16#60#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#,
16#30#, 16#0C#, 16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#,
16#00#, 16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#18#, 16#00#, 16#01#,
16#80#, 16#C0#, 16#00#, 16#18#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#,
16#00#, 16#30#, 16#06#, 16#00#, 16#06#, 16#00#, 16#70#, 16#00#, 16#E0#,
16#03#, 16#80#, 16#1C#, 16#00#, 16#1E#, 16#07#, 16#80#, 16#00#, 16#7F#,
16#F0#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#07#, 16#E3#, 16#FF#,
16#00#, 16#7E#, 16#70#, 16#3C#, 16#00#, 16#6C#, 16#00#, 16#E0#, 16#07#,
16#80#, 16#07#, 16#00#, 16#70#, 16#00#, 16#30#, 16#07#, 16#00#, 16#01#,
16#80#, 16#60#, 16#00#, 16#18#, 16#06#, 16#00#, 16#01#, 16#80#, 16#60#,
16#00#, 16#18#, 16#06#, 16#00#, 16#01#, 16#80#, 16#60#, 16#00#, 16#18#,
16#06#, 16#00#, 16#01#, 16#80#, 16#60#, 16#00#, 16#18#, 16#07#, 16#00#,
16#01#, 16#80#, 16#70#, 16#00#, 16#30#, 16#07#, 16#80#, 16#07#, 16#00#,
16#6C#, 16#00#, 16#E0#, 16#06#, 16#70#, 16#3C#, 16#00#, 16#63#, 16#FF#,
16#80#, 16#06#, 16#0F#, 16#E0#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#7F#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#00#,
16#00#, 16#0F#, 16#FC#, 16#3E#, 16#01#, 16#E0#, 16#F3#, 16#E0#, 16#38#,
16#03#, 16#B0#, 16#06#, 16#00#, 16#1B#, 16#00#, 16#E0#, 16#00#, 16#F0#,
16#0C#, 16#00#, 16#07#, 16#01#, 16#80#, 16#00#, 16#70#, 16#18#, 16#00#,
16#07#, 16#01#, 16#80#, 16#00#, 16#30#, 16#18#, 16#00#, 16#03#, 16#01#,
16#80#, 16#00#, 16#30#, 16#18#, 16#00#, 16#07#, 16#01#, 16#80#, 16#00#,
16#70#, 16#0C#, 16#00#, 16#07#, 16#00#, 16#C0#, 16#00#, 16#F0#, 16#06#,
16#00#, 16#1F#, 16#00#, 16#70#, 16#03#, 16#B0#, 16#03#, 16#C0#, 16#F3#,
16#00#, 16#0F#, 16#FE#, 16#30#, 16#00#, 16#3F#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#FF#, 16#E0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#03#, 16#E0#, 16#07#, 16#F0#,
16#FF#, 16#80#, 16#03#, 16#1C#, 16#38#, 16#00#, 16#37#, 16#80#, 16#80#,
16#03#, 16#E0#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#03#, 16#80#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#,
16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#80#, 16#0F#, 16#FF#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#0F#, 16#FE#,
16#C0#, 16#01#, 16#E0#, 16#7C#, 16#00#, 16#38#, 16#01#, 16#C0#, 16#03#,
16#00#, 16#0C#, 16#00#, 16#30#, 16#00#, 16#C0#, 16#03#, 16#00#, 16#04#,
16#00#, 16#30#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#,
16#06#, 16#00#, 16#60#, 16#00#, 16#60#, 16#06#, 16#00#, 16#06#, 16#00#,
16#60#, 16#00#, 16#60#, 16#07#, 16#00#, 16#0C#, 16#00#, 16#7E#, 16#07#,
16#C0#, 16#06#, 16#FF#, 16#F0#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#,
16#03#, 16#FF#, 16#FF#, 16#00#, 16#3F#, 16#FF#, 16#F0#, 16#00#, 16#18#,
16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#06#,
16#00#, 16#0E#, 16#03#, 16#E0#, 16#00#, 16#7F#, 16#F8#, 16#00#, 16#01#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#03#, 16#F0#, 16#0F#, 16#E0#, 16#3F#, 16#00#,
16#FE#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#,
16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#,
16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#,
16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#,
16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#, 16#00#, 16#30#,
16#00#, 16#60#, 16#03#, 16#00#, 16#0E#, 16#00#, 16#30#, 16#01#, 16#E0#,
16#03#, 16#80#, 16#76#, 16#00#, 16#1C#, 16#1E#, 16#78#, 16#00#, 16#FF#,
16#87#, 16#80#, 16#07#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FE#, 16#07#,
16#FE#, 16#3F#, 16#E0#, 16#7F#, 16#E0#, 16#60#, 16#00#, 16#60#, 16#06#,
16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#E0#, 16#03#, 16#00#, 16#0C#,
16#00#, 16#18#, 16#00#, 16#C0#, 16#01#, 16#80#, 16#18#, 16#00#, 16#1C#,
16#01#, 16#80#, 16#00#, 16#C0#, 16#30#, 16#00#, 16#0C#, 16#03#, 16#00#,
16#00#, 16#60#, 16#60#, 16#00#, 16#06#, 16#06#, 16#00#, 16#00#, 16#30#,
16#60#, 16#00#, 16#03#, 16#0C#, 16#00#, 16#00#, 16#18#, 16#C0#, 16#00#,
16#01#, 16#98#, 16#00#, 16#00#, 16#1D#, 16#80#, 16#00#, 16#00#, 16#F0#,
16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#F8#, 16#01#, 16#FE#, 16#3F#, 16#80#, 16#1F#, 16#E0#, 16#C0#,
16#00#, 16#18#, 16#0C#, 16#00#, 16#03#, 16#00#, 16#C0#, 16#00#, 16#30#,
16#0C#, 16#06#, 16#03#, 16#00#, 16#40#, 16#F0#, 16#30#, 16#06#, 16#0F#,
16#06#, 16#00#, 16#60#, 16#F0#, 16#60#, 16#06#, 16#19#, 16#86#, 16#00#,
16#61#, 16#98#, 16#60#, 16#02#, 16#19#, 16#86#, 16#00#, 16#33#, 16#0C#,
16#C0#, 16#03#, 16#30#, 16#CC#, 16#00#, 16#33#, 16#0C#, 16#C0#, 16#01#,
16#60#, 16#6C#, 16#00#, 16#1E#, 16#06#, 16#C0#, 16#01#, 16#E0#, 16#38#,
16#00#, 16#1C#, 16#03#, 16#80#, 16#01#, 16#C0#, 16#38#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#FE#, 16#07#, 16#F8#, 16#0F#, 16#E0#,
16#7F#, 16#80#, 16#30#, 16#00#, 16#E0#, 16#01#, 16#80#, 16#1C#, 16#00#,
16#0C#, 16#03#, 16#80#, 16#00#, 16#60#, 16#70#, 16#00#, 16#03#, 16#0E#,
16#00#, 16#00#, 16#19#, 16#C0#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#19#, 16#C0#,
16#00#, 16#03#, 16#0E#, 16#00#, 16#00#, 16#60#, 16#70#, 16#00#, 16#0C#,
16#03#, 16#80#, 16#01#, 16#80#, 16#1C#, 16#00#, 16#30#, 16#00#, 16#E0#,
16#06#, 16#00#, 16#07#, 16#01#, 16#FE#, 16#07#, 16#FC#, 16#1F#, 16#E0#,
16#7F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FC#, 16#03#,
16#FC#, 16#1F#, 16#C0#, 16#3F#, 16#C0#, 16#60#, 16#00#, 16#30#, 16#06#,
16#00#, 16#06#, 16#00#, 16#30#, 16#00#, 16#60#, 16#03#, 16#00#, 16#0C#,
16#00#, 16#18#, 16#00#, 16#C0#, 16#01#, 16#80#, 16#18#, 16#00#, 16#0C#,
16#01#, 16#80#, 16#00#, 16#C0#, 16#30#, 16#00#, 16#06#, 16#03#, 16#00#,
16#00#, 16#60#, 16#60#, 16#00#, 16#03#, 16#06#, 16#00#, 16#00#, 16#30#,
16#C0#, 16#00#, 16#01#, 16#8C#, 16#00#, 16#00#, 16#19#, 16#80#, 16#00#,
16#00#, 16#D8#, 16#00#, 16#00#, 16#0D#, 16#00#, 16#00#, 16#00#, 16#F0#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#03#,
16#00#, 16#00#, 16#1F#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#3F#, 16#FF#, 16#C0#, 16#03#, 16#FF#, 16#FC#, 16#00#, 16#30#,
16#01#, 16#C0#, 16#03#, 16#00#, 16#38#, 16#00#, 16#30#, 16#07#, 16#00#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#07#, 16#00#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#03#, 16#80#,
16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#C0#, 16#06#, 16#00#, 16#18#, 16#00#, 16#60#, 16#03#, 16#00#, 16#06#,
16#00#, 16#7F#, 16#FF#, 16#E0#, 16#07#, 16#FF#, 16#FE#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#03#, 16#E0#,
16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#3E#,
16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#,
16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#,
16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#00#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#03#,
16#80#, 16#00#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#00#, 16#F8#, 16#00#,
16#00#, 16#3C#, 16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#,
16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#,
16#00#, 16#00#, 16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#,
16#60#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#00#, 16#70#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#0F#, 16#00#, 16#00#, 16#03#, 16#FC#, 16#03#, 16#00#, 16#70#, 16#E0#,
16#70#, 16#06#, 16#07#, 16#8E#, 16#00#, 16#C0#, 16#1F#, 16#C0#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#);
Font_D : aliased constant Bitmap_Font :=
(
Bytes_Per_Glyph => 165,
Glyph_Width => 28,
Glyph_Height => 47,
Data => FreeMono24pt7bBitmaps'Access);
Font : constant Bitmap_Font_Ref := Font_D'Access;
end GESTE_Fonts.FreeMono24pt7b;
|
clairvoyant/anagram | Ada | 5,842 | adb | -- Check GLR parser
with Ada.Text_IO;
with Ada.Containers.Doubly_Linked_Lists;
with Ada.Wide_Text_IO;
with AST; use AST;
with Anagram.Grammars;
with Anagram.Grammars.Constructors;
with Anagram.Grammars_Convertors;
with Anagram.Grammars_Debug;
with Anagram.Grammars.Reader;
with Anagram.Grammars.LR_Tables;
with Anagram.Grammars.LR.LALR;
with Anagram.Grammars.RNGLR;
with Anagram.Grammars.Lexers;
procedure TS_00022 is
procedure Print_Action
(Table : Anagram.Grammars.LR_Tables.Table;
State : Anagram.Grammars.LR.State_Index;
T : Anagram.Grammars.Terminal_Count);
package Node_Lists is new Ada.Containers.Doubly_Linked_Lists
(AST.Node_Access);
procedure Print_Tree
(Printed : in out Node_Lists.List;
Tree : AST.Node_Access;
Input : Anagram.Grammars.Grammar;
Prefix : Wide_Wide_String := "");
package RNGLR is new Anagram.Grammars.RNGLR
(AST.Node_Access, null, AST.Node_Fabric);
type Lexer is new Anagram.Grammars.Lexers.Lexer with null record;
function Next (Self : in out Lexer) return Anagram.Grammars.Terminal_Count;
Last : Natural := 0;
-- Token list for "2 * 2 + 2"
List : constant
array (Positive range <>) of Anagram.Grammars.Terminal_Count :=
(1, -- int
3, -- star
1, -- int
2, -- plus
1, -- int
0); -- EOF
----------
-- Next --
----------
function Next (Self : in out Lexer)
return Anagram.Grammars.Terminal_Count
is
pragma Unreferenced (Self);
begin
Last := Last + 1;
return List (Last);
end Next;
------------------
-- Print_Action --
------------------
procedure Print_Action
(Table : Anagram.Grammars.LR_Tables.Table;
State : Anagram.Grammars.LR.State_Index;
T : Anagram.Grammars.Terminal_Count)
is
use Anagram.Grammars.LR_Tables;
use type Anagram.Grammars.Terminal_Count;
use type Anagram.Grammars.LR.State_Count;
S : constant Anagram.Grammars.LR.State_Count :=
Shift (Table, State, T);
R : Reduce_Iterator := Reduce (Table, State, T);
begin
Ada.Text_IO.Put (' ');
if T = 0 and then Finish (Table, State) then
Ada.Text_IO.Put ("FINISH ");
end if;
if S /= 0 then
Ada.Text_IO.Put ("SHIFT ");
Ada.Text_IO.Put (Anagram.Grammars.LR.State_Count'Image (S));
if S in 1 .. 9 then
Ada.Text_IO.Put (' ');
end if;
end if;
if not Is_Empty (R) then
Ada.Text_IO.Put ("REDU");
while not Is_Empty (R) loop
Ada.Text_IO.Put
(Anagram.Grammars.Production_Index'Image (Production (R)));
Ada.Text_IO.Put
(Anagram.Grammars.Part_Index'Image (Part (R)));
Next (Table, R);
end loop;
else
Ada.Text_IO.Put ("Error ");
end if;
end Print_Action;
----------------
-- Print_Tree --
----------------
procedure Print_Tree
(Printed : in out Node_Lists.List;
Tree : AST.Node_Access;
Input : Anagram.Grammars.Grammar;
Prefix : Wide_Wide_String := "")
is
Node : constant AST.Node := Tree.all;
begin
if Printed.Contains (Tree) then
return;
else
Printed.Append (Tree);
end if;
AST.Print (Node, Input);
Ada.Wide_Text_IO.Put (" [");
for Child of Node.Children loop
if Child /= null then
AST.Print (Child.all, Input);
end if;
end loop;
Ada.Wide_Text_IO.Put_Line (" ]");
for Child of Node.Children loop
if Child /= null then
Print_Tree (Printed, Child, Input, Prefix & " ");
end if;
end loop;
end Print_Tree;
Fabric : aliased AST.Node_Fabric;
X : constant Anagram.Grammars.Grammar :=
Anagram.Grammars.Reader.Read ("test.ag");
G : constant Anagram.Grammars.Grammar :=
Anagram.Grammars_Convertors.Convert_With_Empty (X);
AG : constant Anagram.Grammars.Grammar :=
Anagram.Grammars.Constructors.To_Augmented (G);
use Anagram.Grammars;
begin
-- Anagram.Grammars.AYACC.Write (Plain);
Anagram.Grammars_Debug.Print (AG);
Ada.Text_IO.Put ("Terminals" & Terminal_Count'Image (G.Last_Terminal));
Ada.Text_IO.Put
(" Non_Terminals" & Non_Terminal_Count'Image (G.Last_Non_Terminal));
Ada.Text_IO.Put
(" Production" & Production_Count'Image (G.Last_Production));
Ada.Text_IO.Put_Line (" Parts" & Part_Count'Image (G.Last_Part));
declare
use Anagram.Grammars.LR;
Table : LR_Tables.Table_Access := LALR.Build (AG, True);
Tree : AST.Node_Access;
Printed : Node_Lists.List;
L : Lexer;
begin
Ada.Text_IO.Put_Line
("Last_State=" & State_Index'Image (LR_Tables.Last_State (Table.all)));
Anagram.Grammars_Debug.Print_Conflicts (AG, Table.all);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("Table:");
for S in 1 .. LR_Tables.Last_State (Table.all) loop
Ada.Text_IO.Put (State_Index'Image (S));
if S <= 9 then
Ada.Text_IO.Put (' ');
end if;
for T in 0 .. AG.Last_Terminal loop
Print_Action (Table.all, S, T);
end loop;
Ada.Text_IO.Put (ASCII.HT);
for NT in 1 .. AG.Last_Non_Terminal loop
Ada.Text_IO.Put
(State_Count'Image (LR_Tables.Shift (Table.all, S, NT)));
end loop;
Ada.Text_IO.New_Line;
end loop;
RNGLR.Parse
(G => AG, T => Table.all, L => L, F => Fabric'Access, Tree => Tree);
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("Print Tree:");
Print_Tree (Printed, Tree, G);
AST.Dereference (Fabric'Access, Tree);
LR_Tables.Free (Table);
end;
end TS_00022;
|
google-code/ada-security | Ada | 7,941 | adb | -----------------------------------------------------------------------
-- auth_cb -- Authentication callback examples
-- Copyright (C) 2013 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Fixed;
with AWS.Session;
with AWS.Messages;
with AWS.Templates;
with AWS.Services.Web_Block.Registry;
with Util.Log.Loggers;
package body Auth_CB is
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Auth_CB");
-- Name of the session attribute which holds information about the active authentication.
OPENID_ASSOC_ATTRIBUTE : constant String := "openid-assoc";
USER_INFO_ATTRIBUTE : constant String := "user-info";
Null_Association : Security.Auth.Association;
Null_Auth : Security.Auth.Authentication;
package Auth_Session is
new AWS.Session.Generic_Data (Security.Auth.Association, Null_Association);
package User_Session is
new AWS.Session.Generic_Data (Security.Auth.Authentication, Null_Auth);
overriding
function Get_Parameter (Params : in Auth_Config;
Name : in String) return String is
begin
if Params.Exists (Name) then
return Params.Get (Name);
else
return "";
end if;
end Get_Parameter;
function Get_Auth_Name (Request : in AWS.Status.Data) return String is
URI : constant String := AWS.Status.URI (Request);
Pos : constant Natural := Ada.Strings.Fixed.Index (URI, "/", Ada.Strings.Backward);
begin
if Pos = 0 then
return "";
else
Log.Info ("OpenID authentication with {0}", URI);
return URI (Pos + 1 .. URI'Last);
end if;
end Get_Auth_Name;
-- ------------------------------
-- Implement the first step of authentication: discover the OpenID (if any) provider,
-- create the authorization request and redirect the user to the authorization server.
-- Some authorization data is saved in the session for the verify process.
-- ------------------------------
function Get_Authorization (Request : in AWS.Status.Data) return AWS.Response.Data is
Name : constant String := Get_Auth_Name (Request);
URL : constant String := Config.Get_Parameter ("auth.url." & Name);
Mgr : Security.Auth.Manager;
OP : Security.Auth.End_Point;
Assoc : Security.Auth.Association;
begin
if URL'Length = 0 or Name'Length = 0 then
return AWS.Response.URL (Location => "/login.html");
end if;
Mgr.Initialize (Config, Name);
-- Yadis discovery (get the XRDS file). This step does nothing for OAuth.
Mgr.Discover (URL, OP);
-- Associate to the OpenID provider and get an end-point with a key.
Mgr.Associate (OP, Assoc);
-- Save the association in the HTTP session and
-- redirect the user to the OpenID provider.
declare
Auth_URL : constant String := Mgr.Get_Authentication_URL (OP, Assoc);
SID : constant AWS.Session.Id := AWS.Status.Session (Request);
begin
Log.Info ("Redirect to auth URL: {0}", Auth_URL);
Auth_Session.Set (SID, OPENID_ASSOC_ATTRIBUTE, Assoc);
return AWS.Response.URL (Location => Auth_URL);
end;
end Get_Authorization;
-- ------------------------------
-- Second step of authentication: verify the authorization response. The authorization
-- data saved in the session is extracted and checked against the response. If it matches
-- the response is verified to check if the authentication succeeded or not.
-- The user is then redirected to the success page.
-- ------------------------------
function Verify_Authorization (Request : in AWS.Status.Data) return AWS.Response.Data is
use type Security.Auth.Auth_Result;
-- Give access to the request parameters.
type Auth_Params is limited new Security.Auth.Parameters with null record;
overriding
function Get_Parameter (Params : in Auth_Params;
Name : in String) return String;
overriding
function Get_Parameter (Params : in Auth_Params;
Name : in String) return String is
pragma Unreferenced (Params);
begin
return AWS.Status.Parameter (Request, Name);
end Get_Parameter;
Mgr : Security.Auth.Manager;
Assoc : Security.Auth.Association;
Credential : Security.Auth.Authentication;
Params : Auth_Params;
SID : constant AWS.Session.Id := AWS.Status.Session (Request);
begin
Log.Info ("Verify openid authentication");
if not AWS.Session.Exist (SID, OPENID_ASSOC_ATTRIBUTE) then
Log.Warn ("Session has expired during OpenID authentication process");
return AWS.Response.Build ("text/html", "Session has expired", AWS.Messages.S403);
end if;
Assoc := Auth_Session.Get (SID, OPENID_ASSOC_ATTRIBUTE);
-- Cleanup the session and drop the association end point.
AWS.Session.Remove (SID, OPENID_ASSOC_ATTRIBUTE);
Mgr.Initialize (Name => Security.Auth.Get_Provider (Assoc),
Params => Config);
-- Verify that what we receive through the callback matches the association key.
Mgr.Verify (Assoc, Params, Credential);
if Security.Auth.Get_Status (Credential) /= Security.Auth.AUTHENTICATED then
Log.Info ("Authentication has failed");
return AWS.Response.Build ("text/html", "Authentication failed", AWS.Messages.S403);
end if;
Log.Info ("Authentication succeeded for {0}", Security.Auth.Get_Email (Credential));
Log.Info ("Claimed id: {0}", Security.Auth.Get_Claimed_Id (Credential));
Log.Info ("Email: {0}", Security.Auth.Get_Email (Credential));
Log.Info ("Name: {0}", Security.Auth.Get_Full_Name (Credential));
-- Save the user information in the session (for the purpose of this demo).
User_Session.Set (SID, USER_INFO_ATTRIBUTE, Credential);
declare
URL : constant String := Config.Get_Parameter ("openid.success_url");
begin
Log.Info ("Redirect user to success URL: {0}", URL);
return AWS.Response.URL (Location => URL);
end;
end Verify_Authorization;
function User_Info (Request : in AWS.Status.Data) return AWS.Response.Data is
URI : constant String := AWS.Status.URI (Request);
SID : constant AWS.Session.Id := AWS.Status.Session (Request);
Credential : Security.Auth.Authentication;
Set : AWS.Templates.Translate_Set;
begin
if AWS.Session.Exist (SID, USER_INFO_ATTRIBUTE) then
Credential := User_Session.Get (SID, USER_INFO_ATTRIBUTE);
AWS.Templates.Insert (Set,
AWS.Templates.Assoc ("ID",
Security.Auth.Get_Claimed_Id (Credential)));
AWS.Templates.Insert (Set, AWS.Templates.Assoc ("EMAIL",
Security.Auth.Get_Email (Credential)));
AWS.Templates.Insert (Set, AWS.Templates.Assoc ("NAME",
Security.Auth.Get_Full_Name (Credential)));
end if;
return AWS.Services.Web_Block.Registry.Build ("success", Request, Set);
end User_Info;
end Auth_CB;
|
reznikmm/matreshka | Ada | 4,804 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- Specifies a trace relationship between model elements or sets of model
-- elements that represent the same concept in different models. Traces are
-- mainly used for tracking requirements and changes across models. Since
-- model changes can occur in both directions, the directionality of the
-- dependency can often be ignored. The mapping specifies the relationship
-- between the two, but it is rarely computable and is usually informal.
------------------------------------------------------------------------------
limited with AMF.UML.Abstractions;
package AMF.Standard_Profile_L2.Traces is
pragma Preelaborate;
type Standard_Profile_L2_Trace is limited interface;
type Standard_Profile_L2_Trace_Access is
access all Standard_Profile_L2_Trace'Class;
for Standard_Profile_L2_Trace_Access'Storage_Size use 0;
not overriding function Get_Base_Abstraction
(Self : not null access constant Standard_Profile_L2_Trace)
return AMF.UML.Abstractions.UML_Abstraction_Access is abstract;
-- Getter of Trace::base_Abstraction.
--
not overriding procedure Set_Base_Abstraction
(Self : not null access Standard_Profile_L2_Trace;
To : AMF.UML.Abstractions.UML_Abstraction_Access) is abstract;
-- Setter of Trace::base_Abstraction.
--
end AMF.Standard_Profile_L2.Traces;
|
persan/AdaYaml | Ada | 5,635 | adb | with Yaml.Dom.Node;
package body Yaml.Dom.Mapping_Data is
function Hash (Object : Node_Pointer) return Ada.Containers.Hash_Type is
(Node.Hash (Object.all));
function Length (Object : Instance) return Count_Type is
(Object.Data.Length);
function Is_Empty (Container : Instance) return Boolean is
(Container.Data.Is_Empty);
procedure Clear (Container : in out Instance) is
begin
Container.Data.Clear;
end Clear;
function Has_Element (Position : Cursor) return Boolean is
(Position.Container /= null and then
Node_Maps.Has_Element (Position.Position));
function First (Object : Instance) return Cursor is
((Container => Object'Unrestricted_Access,
Position => Object.Data.First));
function Next (Position : Cursor) return Cursor is
((Container => Position.Container,
Position => Node_Maps.Next (Position.Position)));
procedure Iterate (Object : Instance;
Process : not null access procedure
(Key, Value : not null access Node.Instance)) is
Cur : Node_Maps.Cursor := Object.Data.First;
begin
while Node_Maps.Has_Element (Cur) loop
Process.all (Node_Maps.Key (Cur), Node_Maps.Element (Cur));
Cur := Node_Maps.Next (Cur);
end loop;
end Iterate;
function Key (Position : Cursor) return Node_Reference is
begin
Increase_Refcount (Position.Container.Document);
return ((Ada.Finalization.Controlled with
Data => Node_Maps.Key (Position.Position),
Document => Document_Instance_Access (Position.Container.Document)));
end Key;
function Value (Position : Cursor) return Node_Reference is
begin
Increase_Refcount (Position.Container.Document);
return ((Ada.Finalization.Controlled with
Data => Node_Maps.Element (Position.Position),
Document => Document_Instance_Access (Position.Container.Document)));
end Value;
function Find (Object : Instance; Key : Node_Reference) return Cursor is
Found : constant Node_Maps.Cursor := Object.Data.Find (Key.Value.Data);
begin
return (Container => Object'Unrestricted_Access, Position => Found);
end Find;
function Element (Object : Instance; Key : Node_Reference)
return Node_Reference is
Found : constant Node_Maps.Cursor := Object.Data.Find (Key.Value.Data);
begin
if Node_Maps.Has_Element (Found) then
Increase_Refcount (Object.Document);
return (Ada.Finalization.Controlled with
Data => Node_Maps.Element (Found),
Document => Object.Document);
else
raise Constraint_Error with "No such key";
end if;
end Element;
function Element (Object : Instance; Key : String) return Node_Reference is
Holder : constant Text.Constant_Instance := Text.Hold (Key);
As_Node : aliased Node.Instance := (Kind => Scalar, Tag => Tags.String,
Content => Text.Held (Holder),
Scalar_Style => Any);
begin
Increase_Refcount (Object.Document);
return Object.Element (Node_Reference'(Ada.Finalization.Controlled with
Data => As_Node'Unrestricted_Access,
Document => Object.Document));
end Element;
procedure Insert (Container : in out Instance;
Key : in Node_Reference;
New_Item : in Node_Reference;
Position : out Cursor;
Inserted : out Boolean) is
begin
Position.Container := Container'Unrestricted_Access;
Container.Data.Insert (Key.Data, New_Item.Data, Position.Position,
Inserted);
end Insert;
procedure Insert (Container : in out Instance;
Key : in Node_Reference;
New_Item : in Node_Reference) is
begin
Container.Data.Insert (Key.Data, New_Item.Data);
end Insert;
procedure Include (Container : in out Instance;
Key : in Node_Reference;
New_Item : in Node_Reference) is
begin
Container.Data.Include (Key.Data, New_Item.Data);
end Include;
procedure Replace (Container : in out Instance;
Key : in Node_Reference;
New_Item : in Node_Reference) is
begin
Container.Data.Replace (Key.Data, New_Item.Data);
end Replace;
procedure Exclude (Container : in out Instance;
Key : in Node_Reference) is
begin
Container.Data.Exclude (Key.Data);
end Exclude;
procedure Delete (Container : in out Instance;
Key : in Node_Reference) is
begin
Container.Data.Delete (Key.Data);
end Delete;
procedure Delete (Container : in out Instance;
Position : in out Cursor) is
begin
Container.Data.Delete (Position.Position);
end Delete;
package body Friend_Interface is
function For_Document (Document : not null access Document_Instance)
return Instance is
(Document => Document, Data => <>);
procedure Raw_Insert (Container : in out Instance;
Key, Value : not null access Node.Instance) is
begin
Container.Data.Insert (Node_Pointer (Key), Node_Pointer (Value));
end Raw_Insert;
end Friend_Interface;
end Yaml.Dom.Mapping_Data;
|
zhmu/ananas | Ada | 273 | adb | -- { dg-do run }
-- { dg-options "-gnata" }
with Default_Initial_Condition_Pack; use Default_Initial_Condition_Pack;
procedure Default_Initial_Condition is
Obj : T;
begin
if not DIC_Called then
raise Program_Error;
end if;
end Default_Initial_Condition;
|
twdroeger/ada-awa | Ada | 6,815 | adb | -----------------------------------------------------------------------
-- awa-mail-clients-aws_smtp -- Mail client implementation on top of AWS SMTP client
-- Copyright (C) 2012, 2016, 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with AWS.SMTP.Client;
with Util.Log.Loggers;
package body AWA.Mail.Clients.AWS_SMTP is
use Ada.Strings.Unbounded;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Mail.Clients.AWS_SMTP");
procedure Free is
new Ada.Unchecked_Deallocation (Object => AWS.SMTP.Recipients,
Name => Recipients_Access);
-- Get a printable representation of the email recipients.
function Image (Recipients : in AWS.SMTP.Recipients) return String;
-- ------------------------------
-- Set the <tt>From</tt> part of the message.
-- ------------------------------
overriding
procedure Set_From (Message : in out AWS_Mail_Message;
Name : in String;
Address : in String) is
begin
Message.From := AWS.SMTP.E_Mail (Name => Name,
Address => Address);
end Set_From;
-- ------------------------------
-- Add a recipient for the message.
-- ------------------------------
overriding
procedure Add_Recipient (Message : in out AWS_Mail_Message;
Kind : in Recipient_Type;
Name : in String;
Address : in String) is
pragma Unreferenced (Kind);
begin
if Message.To = null then
Message.To := new AWS.SMTP.Recipients (1 .. 1);
else
declare
To : constant Recipients_Access := new AWS.SMTP.Recipients (1 .. Message.To'Last + 1);
begin
To (Message.To'Range) := Message.To.all;
Free (Message.To);
Message.To := To;
end;
end if;
Message.To (Message.To'Last) := AWS.SMTP.E_Mail (Name => Name,
Address => Address);
end Add_Recipient;
-- ------------------------------
-- Set the subject of the message.
-- ------------------------------
overriding
procedure Set_Subject (Message : in out AWS_Mail_Message;
Subject : in String) is
begin
Message.Subject := To_Unbounded_String (Subject);
end Set_Subject;
-- ------------------------------
-- Set the body of the message.
-- ------------------------------
overriding
procedure Set_Body (Message : in out AWS_Mail_Message;
Content : in String) is
begin
Message.Content := To_Unbounded_String (Content);
end Set_Body;
-- ------------------------------
-- Get a printable representation of the email recipients.
-- ------------------------------
function Image (Recipients : in AWS.SMTP.Recipients) return String is
Result : Unbounded_String;
begin
for I in Recipients'Range loop
Append (Result, AWS.SMTP.Image (Recipients (I)));
end loop;
return To_String (Result);
end Image;
-- ------------------------------
-- Send the email message.
-- ------------------------------
overriding
procedure Send (Message : in out AWS_Mail_Message) is
Result : AWS.SMTP.Status;
begin
if Message.To = null then
return;
end if;
if Message.Manager.Enable then
Log.Info ("Send email from {0} to {1}",
AWS.SMTP.Image (Message.From), Image (Message.To.all));
AWS.SMTP.Client.Send (Server => Message.Manager.Server,
From => Message.From,
To => Message.To.all,
Subject => To_String (Message.Subject),
Message => To_String (Message.Content),
Status => Result);
if not AWS.SMTP.Is_Ok (Result) then
Log.Error ("Cannot send email: {0}",
AWS.SMTP.Status_Message (Result));
end if;
else
Log.Info ("Disable send email from {0} to {1}",
AWS.SMTP.Image (Message.From), Image (Message.To.all));
end if;
end Send;
-- ------------------------------
-- Deletes the mail message.
-- ------------------------------
overriding
procedure Finalize (Message : in out AWS_Mail_Message) is
begin
Log.Info ("Finalize mail message");
Free (Message.To);
end Finalize;
procedure Initialize (Client : in out AWS_Mail_Manager'Class;
Props : in Util.Properties.Manager'Class) is separate;
-- ------------------------------
-- Create a SMTP based mail manager and configure it according to the properties.
-- ------------------------------
function Create_Manager (Props : in Util.Properties.Manager'Class) return Mail_Manager_Access is
Server : constant String := Props.Get (Name => "smtp.host", Default => "localhost");
Port : constant String := Props.Get (Name => "smtp.port", Default => "25");
Enable : constant String := Props.Get (Name => "smtp.enable", Default => "1");
Result : constant AWS_Mail_Manager_Access := new AWS_Mail_Manager;
begin
Log.Info ("Creating SMTP mail manager to server {0}:{1}", Server, Port);
Result.Port := Positive'Value (Port);
Result.Enable := Enable = "1" or Enable = "yes" or Enable = "true";
Result.Self := Result;
Initialize (Result.all, Props);
return Result.all'Access;
end Create_Manager;
-- ------------------------------
-- Create a new mail message.
-- ------------------------------
overriding
function Create_Message (Manager : in AWS_Mail_Manager) return Mail_Message_Access is
Result : constant AWS_Mail_Message_Access := new AWS_Mail_Message;
begin
Result.Manager := Manager.Self;
return Result.all'Access;
end Create_Message;
end AWA.Mail.Clients.AWS_SMTP;
|
tum-ei-rcs/StratoX | Ada | 461 | ads | -- Institution: Technische Universität München
-- Department: Realtime Computer Systems (RCS)
-- Project: StratoX
-- Module: Software Configuration
--
-- Authors: Emanuel Regnath ([email protected])
--
-- Description:
-- Configuration of the Software, adjust these parameters to your needs
package Config is
MAIN_TICK_RATE_MS : constant := 10; -- Tickrate in Milliseconds
With_SD_Log : constant Boolean := False;
end Config;
|
AdaCore/gpr | Ada | 4,266 | adb | --
-- Copyright (C) 2019-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0
--
with Ada.Text_IO;
with Ada.Directories;
with Ada.Exceptions;
with Ada.Strings.Fixed;
with GPR2.Context;
with GPR2.KB;
with GPR2.Log;
with GPR2.Context;
with GPR2.Path_Name;
with GPR2.Project.Attribute.Set;
with GPR2.Project.Configuration;
with GPR2.Project.Tree;
with GPR2.Project.Variable.Set;
with GPR2.Project.View;
procedure Main is
use Ada;
use Ada.Exceptions;
use GPR2;
use GPR2.Project;
procedure Display (Prj : Project.View.Object; Full : Boolean := True);
procedure Display (Att : Project.Attribute.Object);
-------------
-- Display --
-------------
procedure Display (Att : Project.Attribute.Object) is
begin
Text_IO.Put (" " & Image (Att.Name.Id.Attr));
if Att.Has_Index then
Text_IO.Put (" (" & Att.Index.Text & ")");
end if;
Text_IO.Put (" ->");
for V of Att.Values loop
Text_IO.Put (" " & V.Text);
end loop;
Text_IO.New_Line;
end Display;
procedure Display (Prj : Project.View.Object; Full : Boolean := True) is
use GPR2.Project.Attribute.Set;
use GPR2.Project.Variable.Set.Set;
begin
Text_IO.Put (String (Prj.Name) & " ");
Text_IO.Set_Col (10);
Text_IO.Put_Line (Prj.Qualifier'Img);
if Full then
for A in Prj.Attributes (With_Defaults => False,
With_Config => False).Iterate loop
Text_IO.Put
("A: " & Image (Attribute.Set.Element (A).Name.Id.Attr));
Text_IO.Put (" ->");
for V of Element (A).Values loop
Text_IO.Put (" " & V.Text);
end loop;
Text_IO.New_Line;
end loop;
if Prj.Has_Variables then
for V in Prj.Variables.Iterate loop
Text_IO.Put ("V: " & String (Key (V)));
Text_IO.Put (" -> ");
Text_IO.Put (Element (V).Value.Text);
Text_IO.New_Line;
end loop;
end if;
Text_IO.New_Line;
for Pck of Prj.Packages (With_Defaults => False,
With_Config => False)
loop
Text_IO.Put_Line (" " & Image (Pck));
for A of Prj.Attributes (Pack => Pck,
With_Defaults => False,
With_Config => False)
loop
Display (A);
end loop;
end loop;
end if;
end Display;
Gpr : constant GPR2.Path_Name.Object := Create ("demo.gpr");
Prj : Project.Tree.Object;
Ctx : Context.Object;
Des : Configuration.Description :=
Configuration.Create (Language => Ada_Language);
KB : GPR2.KB.Object := GPR2.KB.Create (GPR2.KB.Default_Flags);
Cnf : Configuration.Object :=
Configuration.Create
(Configuration.Description_Set'(1 => Des), "all", Gpr,
Base => KB);
begin
if Cnf.Has_Messages then
for M of Cnf.Log_Messages loop
declare
F : constant String := M.Sloc.Filename;
I : constant Natural := Strings.Fixed.Index (F, "config-api");
begin
Text_IO.Put_Line ("> " & F (I - 1 .. F'Last));
Text_IO.Put_Line (M.Level'Img);
Text_IO.Put_Line (M.Format);
end;
end loop;
end if;
Ctx.Include ("OS", "Linux");
Project.Tree.Load (Prj, Gpr, Ctx, Config => Cnf);
Display (Prj.Root_Project);
if Prj.Has_Configuration then
Display (Prj.Configuration.Corresponding_View, Full => False);
end if;
exception
when E : GPR2.Project_Error =>
Text_IO.Put_Line (Exception_Information (E));
if Prj.Has_Messages then
Text_IO.Put_Line ("Messages found:");
for M of Prj.Log_Messages.all loop
declare
F : constant String := M.Sloc.Filename;
I : constant Natural := Strings.Fixed.Index (F, "config-api");
begin
Text_IO.Put_Line ("> " & F (I - 1 .. F'Last));
Text_IO.Put_Line (M.Level'Img);
Text_IO.Put_Line (M.Format);
end;
end loop;
end if;
end Main;
|
reznikmm/matreshka | Ada | 4,043 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Chart_Interval_Major_Attributes;
package Matreshka.ODF_Chart.Interval_Major_Attributes is
type Chart_Interval_Major_Attribute_Node is
new Matreshka.ODF_Chart.Abstract_Chart_Attribute_Node
and ODF.DOM.Chart_Interval_Major_Attributes.ODF_Chart_Interval_Major_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Chart_Interval_Major_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Chart_Interval_Major_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Chart.Interval_Major_Attributes;
|
osannolik/ada-canopen | Ada | 1,003 | ads | with Interfaces;
package ACO.Utils.Byte_Order is
pragma Preelaborate;
use Interfaces;
type Octets is array (Natural range <>) of Unsigned_8;
type Octets_2 is array (0 .. 1) of Unsigned_8;
type Octets_4 is array (0 .. 3) of Unsigned_8;
type Octets_8 is array (0 .. 7) of Unsigned_8;
function Swap_Bus (X : Unsigned_16) return Unsigned_16;
pragma Inline (Swap_Bus);
function Swap_Bus (X : Unsigned_32) return Unsigned_32;
pragma Inline (Swap_Bus);
function Swap_Bus (X : Octets_2) return Unsigned_16;
pragma Inline (Swap_Bus);
function Swap_Bus (X : Octets_4) return Unsigned_32;
pragma Inline (Swap_Bus);
function Swap_Bus (X : Unsigned_16) return Octets_2;
pragma Inline (Swap_Bus);
function Swap_Bus (X : Unsigned_32) return Octets_4;
pragma Inline (Swap_Bus);
procedure Swap (X : in out Octets);
pragma Inline (Swap);
function Swap_Bus (X : in Octets) return Octets;
pragma Inline (Swap_Bus);
end ACO.Utils.Byte_Order;
|
zhmu/ananas | Ada | 150 | ads | package ICE_Types is
type Float_View_T is private;
procedure Initialize (X : out Float_View_T);
private
type Float_View_T is new Float;
end;
|
zhmu/ananas | Ada | 376 | ads | package Inline15_Types is
type Enum is (One, Two, Three, Four);
type Rec (Discr : Enum) is record
Comp_1 : Integer;
case Discr is
when One =>
Comp_2 : Float;
when Two =>
Comp_3 : Boolean;
Comp_4 : Long_Float;
when others =>
null;
end case;
end record;
end Inline15_Types;
|
ecofast/asphyre-cpp | Ada | 13,929 | ads | ------------------------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under the terms of the GNU General Public License as published by --
-- the Free Software Foundation; either version 2 of the License, or (at --
-- your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, but --
-- WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public License --
-- along with this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
------------------------------------------------------------------------------
-- $Id: zlib.ads,v 1.1 2010/08/18 14:11:29 Administrator Exp $
with Ada.Streams;
with Interfaces;
package ZLib is
ZLib_Error : exception;
Status_Error : exception;
type Compression_Level is new Integer range -1 .. 9;
type Flush_Mode is private;
type Compression_Method is private;
type Window_Bits_Type is new Integer range 8 .. 15;
type Memory_Level_Type is new Integer range 1 .. 9;
type Unsigned_32 is new Interfaces.Unsigned_32;
type Strategy_Type is private;
type Header_Type is (None, Auto, Default, GZip);
-- Header type usage have a some limitation for inflate.
-- See comment for Inflate_Init.
subtype Count is Ada.Streams.Stream_Element_Count;
Default_Memory_Level : constant Memory_Level_Type := 8;
Default_Window_Bits : constant Window_Bits_Type := 15;
----------------------------------
-- Compression method constants --
----------------------------------
Deflated : constant Compression_Method;
-- Only one method allowed in this ZLib version
---------------------------------
-- Compression level constants --
---------------------------------
No_Compression : constant Compression_Level := 0;
Best_Speed : constant Compression_Level := 1;
Best_Compression : constant Compression_Level := 9;
Default_Compression : constant Compression_Level := -1;
--------------------------
-- Flush mode constants --
--------------------------
No_Flush : constant Flush_Mode;
-- Regular way for compression, no flush
Partial_Flush : constant Flush_Mode;
-- Will be removed, use Z_SYNC_FLUSH instead
Sync_Flush : constant Flush_Mode;
-- All pending output is flushed to the output buffer and the output
-- is aligned on a byte boundary, so that the decompressor can get all
-- input data available so far. (In particular avail_in is zero after the
-- call if enough output space has been provided before the call.)
-- Flushing may degrade compression for some compression algorithms and so
-- it should be used only when necessary.
Block_Flush : constant Flush_Mode;
-- Z_BLOCK requests that inflate() stop
-- if and when it get to the next deflate block boundary. When decoding the
-- zlib or gzip format, this will cause inflate() to return immediately
-- after the header and before the first block. When doing a raw inflate,
-- inflate() will go ahead and process the first block, and will return
-- when it gets to the end of that block, or when it runs out of data.
Full_Flush : constant Flush_Mode;
-- All output is flushed as with SYNC_FLUSH, and the compression state
-- is reset so that decompression can restart from this point if previous
-- compressed data has been damaged or if random access is desired. Using
-- Full_Flush too often can seriously degrade the compression.
Finish : constant Flush_Mode;
-- Just for tell the compressor that input data is complete.
------------------------------------
-- Compression strategy constants --
------------------------------------
-- RLE stategy could be used only in version 1.2.0 and later.
Filtered : constant Strategy_Type;
Huffman_Only : constant Strategy_Type;
RLE : constant Strategy_Type;
Default_Strategy : constant Strategy_Type;
Default_Buffer_Size : constant := 4096;
type Filter_Type is tagged limited private;
-- The filter is for compression and for decompression.
-- The usage of the type is depend of its initialization.
function Version return String;
pragma Inline (Version);
-- Return string representation of the ZLib version.
procedure Deflate_Init
(Filter : in out Filter_Type;
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Method : in Compression_Method := Deflated;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Memory_Level : in Memory_Level_Type := Default_Memory_Level;
Header : in Header_Type := Default);
-- Compressor initialization.
-- When Header parameter is Auto or Default, then default zlib header
-- would be provided for compressed data.
-- When Header is GZip, then gzip header would be set instead of
-- default header.
-- When Header is None, no header would be set for compressed data.
procedure Inflate_Init
(Filter : in out Filter_Type;
Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Header : in Header_Type := Default);
-- Decompressor initialization.
-- Default header type mean that ZLib default header is expecting in the
-- input compressed stream.
-- Header type None mean that no header is expecting in the input stream.
-- GZip header type mean that GZip header is expecting in the
-- input compressed stream.
-- Auto header type mean that header type (GZip or Native) would be
-- detected automatically in the input stream.
-- Note that header types parameter values None, GZip and Auto are
-- supported for inflate routine only in ZLib versions 1.2.0.2 and later.
-- Deflate_Init is supporting all header types.
function Is_Open (Filter : in Filter_Type) return Boolean;
pragma Inline (Is_Open);
-- Is the filter opened for compression or decompression.
procedure Close
(Filter : in out Filter_Type;
Ignore_Error : in Boolean := False);
-- Closing the compression or decompressor.
-- If stream is closing before the complete and Ignore_Error is False,
-- The exception would be raised.
generic
with procedure Data_In
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
with procedure Data_Out
(Item : in Ada.Streams.Stream_Element_Array);
procedure Generic_Translate
(Filter : in out Filter_Type;
In_Buffer_Size : in Integer := Default_Buffer_Size;
Out_Buffer_Size : in Integer := Default_Buffer_Size);
-- Compress/decompress data fetch from Data_In routine and pass the result
-- to the Data_Out routine. User should provide Data_In and Data_Out
-- for compression/decompression data flow.
-- Compression or decompression depend on Filter initialization.
function Total_In (Filter : in Filter_Type) return Count;
pragma Inline (Total_In);
-- Returns total number of input bytes read so far
function Total_Out (Filter : in Filter_Type) return Count;
pragma Inline (Total_Out);
-- Returns total number of bytes output so far
function CRC32
(CRC : in Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array)
return Unsigned_32;
pragma Inline (CRC32);
-- Compute CRC32, it could be necessary for make gzip format
procedure CRC32
(CRC : in out Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array);
pragma Inline (CRC32);
-- Compute CRC32, it could be necessary for make gzip format
-------------------------------------------------
-- Below is more complex low level routines. --
-------------------------------------------------
procedure Translate
(Filter : in out Filter_Type;
In_Data : in Ada.Streams.Stream_Element_Array;
In_Last : out Ada.Streams.Stream_Element_Offset;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
-- Compress/decompress the In_Data buffer and place the result into
-- Out_Data. In_Last is the index of last element from In_Data accepted by
-- the Filter. Out_Last is the last element of the received data from
-- Filter. To tell the filter that incoming data are complete put the
-- Flush parameter to Finish.
function Stream_End (Filter : in Filter_Type) return Boolean;
pragma Inline (Stream_End);
-- Return the true when the stream is complete.
procedure Flush
(Filter : in out Filter_Type;
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
pragma Inline (Flush);
-- Flushing the data from the compressor.
generic
with procedure Write
(Item : in Ada.Streams.Stream_Element_Array);
-- User should provide this routine for accept
-- compressed/decompressed data.
Buffer_Size : in Ada.Streams.Stream_Element_Offset
:= Default_Buffer_Size;
-- Buffer size for Write user routine.
procedure Write
(Filter : in out Filter_Type;
Item : in Ada.Streams.Stream_Element_Array;
Flush : in Flush_Mode := No_Flush);
-- Compress/Decompress data from Item to the generic parameter procedure
-- Write. Output buffer size could be set in Buffer_Size generic parameter.
generic
with procedure Read
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- User should provide data for compression/decompression
-- thru this routine.
Buffer : in out Ada.Streams.Stream_Element_Array;
-- Buffer for keep remaining data from the previous
-- back read.
Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset;
-- Rest_First have to be initialized to Buffer'Last + 1
-- Rest_Last have to be initialized to Buffer'Last
-- before usage.
Allow_Read_Some : in Boolean := False;
-- Is it allowed to return Last < Item'Last before end of data.
procedure Read
(Filter : in out Filter_Type;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode := No_Flush);
-- Compress/Decompress data from generic parameter procedure Read to the
-- Item. User should provide Buffer and initialized Rest_First, Rest_Last
-- indicators. If Allow_Read_Some is True, Read routines could return
-- Last < Item'Last only at end of stream.
private
use Ada.Streams;
pragma Assert (Ada.Streams.Stream_Element'Size = 8);
pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8);
type Flush_Mode is new Integer range 0 .. 5;
type Compression_Method is new Integer range 8 .. 8;
type Strategy_Type is new Integer range 0 .. 3;
No_Flush : constant Flush_Mode := 0;
Partial_Flush : constant Flush_Mode := 1;
Sync_Flush : constant Flush_Mode := 2;
Full_Flush : constant Flush_Mode := 3;
Finish : constant Flush_Mode := 4;
Block_Flush : constant Flush_Mode := 5;
Filtered : constant Strategy_Type := 1;
Huffman_Only : constant Strategy_Type := 2;
RLE : constant Strategy_Type := 3;
Default_Strategy : constant Strategy_Type := 0;
Deflated : constant Compression_Method := 8;
type Z_Stream;
type Z_Stream_Access is access all Z_Stream;
type Filter_Type is tagged limited record
Strm : Z_Stream_Access;
Compression : Boolean;
Stream_End : Boolean;
Header : Header_Type;
CRC : Unsigned_32;
Offset : Stream_Element_Offset;
-- Offset for gzip header/footer output.
end record;
end ZLib;
|
AdaCore/libadalang | Ada | 231 | adb | procedure Test is
package Pouet is
type Foo is abstract tagged;
procedure Do_Stuff (X : Foo) is null;
type Foo is interface;
end Pouet;
X : Pouet.Foo;
begin
X.Do_Stuff;
end Test;
pragma Test_Block;
|
Componolit/libsparkcrypto | Ada | 2,760 | adb | -------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, Alexander Senier
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.Byteswap64;
package body LSC.Internal.Byteorder64 is
function Native_To_BE (Item : Types.Word64) return Types.Word64
is
begin
return Item;
end Native_To_BE;
---------------------------------------------------------------------------
function Native_To_LE (Item : Types.Word64) return Types.Word64
is
begin
return Byteswap64.Swap (Item);
end Native_To_LE;
---------------------------------------------------------------------------
function BE_To_Native (Item : Types.Word64) return Types.Word64
is
begin
return Item;
end BE_To_Native;
---------------------------------------------------------------------------
function LE_To_Native (Item : Types.Word64) return Types.Word64
is
begin
return Byteswap64.Swap (Item);
end LE_To_Native;
end LSC.Internal.Byteorder64;
|
apple-oss-distributions/old_ncurses | Ada | 3,418 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Alpha --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <[email protected]> 1996
-- Version Control:
-- $Revision: 1.1.1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha);
type Alpha_Field is new Field_Type
with record
Minimum_Field_Width : Natural := 0;
end record;
procedure Set_Field_Type (Fld : in Field;
Typ : in Alpha_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
|
AdaCore/Ada_Drivers_Library | Ada | 46,298 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on: --
-- --
-- @file stm32f4xx_hal_tim.c --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief timers HAL module driver. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
package body STM32.Timers is
---------------
-- Configure --
---------------
procedure Configure
(This : in out Timer;
Prescaler : UInt16;
Period : UInt32)
is
begin
This.ARR := Period;
This.Prescaler := Prescaler;
end Configure;
---------------
-- Configure --
---------------
procedure Configure
(This : in out Timer;
Prescaler : UInt16;
Period : UInt32;
Clock_Divisor : Timer_Clock_Divisor;
Counter_Mode : Timer_Counter_Alignment_Mode)
is
begin
This.ARR := Period;
This.Prescaler := Prescaler;
This.CR1.Clock_Division := Clock_Divisor;
This.CR1.Mode_And_Dir := Counter_Mode;
end Configure;
----------------------
-- Set_Counter_Mode --
----------------------
procedure Set_Counter_Mode
(This : in out Timer;
Value : Timer_Counter_Alignment_Mode)
is
begin
This.CR1.Mode_And_Dir := Value;
end Set_Counter_Mode;
------------------------
-- Set_Clock_Division --
------------------------
procedure Set_Clock_Division
(This : in out Timer;
Value : Timer_Clock_Divisor)
is
begin
This.CR1.Clock_Division := Value;
end Set_Clock_Division;
----------------------------
-- Current_Clock_Division --
----------------------------
function Current_Clock_Division (This : Timer) return Timer_Clock_Divisor is
begin
return This.CR1.Clock_Division;
end Current_Clock_Division;
---------------
-- Configure --
---------------
procedure Configure
(This : in out Timer;
Prescaler : UInt16;
Period : UInt32;
Clock_Divisor : Timer_Clock_Divisor;
Counter_Mode : Timer_Counter_Alignment_Mode;
Repetitions : UInt8)
is
begin
This.ARR := Period;
This.Prescaler := Prescaler;
This.CR1.Clock_Division := Clock_Divisor;
This.CR1.Mode_And_Dir := Counter_Mode;
This.RCR := UInt32 (Repetitions);
This.EGR := Immediate'Enum_Rep;
end Configure;
------------
-- Enable --
------------
procedure Enable (This : in out Timer) is
begin
This.CR1.Timer_Enabled := True;
end Enable;
-------------
-- Enabled --
-------------
function Enabled (This : Timer) return Boolean is
begin
return This.CR1.Timer_Enabled;
end Enabled;
------------------------
-- No_Outputs_Enabled --
------------------------
function No_Outputs_Enabled (This : Timer) return Boolean is
begin
for C in Channel_1 .. Channel_3 loop
if This.CCER (C).CCxE = Enable or This.CCER (C).CCxNE = Enable then
return False;
end if;
end loop;
-- Channel_4 doesn't have the complementary enabler and polarity bits.
-- If it did they would be in the reserved area, which is zero, so we
-- could be tricky and pretend that they exist for this function but
-- doing that would be unnecessarily subtle. The money is on clarity.
if This.CCER (Channel_4).CCxE = Enable then
return False;
end if;
return True;
end No_Outputs_Enabled;
-------------
-- Disable --
-------------
procedure Disable (This : in out Timer) is
begin
if No_Outputs_Enabled (This) then
This.CR1.Timer_Enabled := False;
end if;
end Disable;
------------------------
-- Enable_Main_Output --
------------------------
procedure Enable_Main_Output (This : in out Timer) is
begin
This.BDTR.Main_Output_Enabled := True;
end Enable_Main_Output;
-------------------------
-- Disable_Main_Output --
-------------------------
procedure Disable_Main_Output (This : in out Timer) is
begin
if No_Outputs_Enabled (This) then
This.BDTR.Main_Output_Enabled := False;
end if;
end Disable_Main_Output;
-------------------------
-- Main_Output_Enabled --
-------------------------
function Main_Output_Enabled (This : Timer) return Boolean is
begin
return This.BDTR.Main_Output_Enabled;
end Main_Output_Enabled;
-----------------
-- Set_Counter --
-----------------
procedure Set_Counter (This : in out Timer; Value : UInt16) is
begin
This.Counter := UInt32 (Value);
end Set_Counter;
-----------------
-- Set_Counter --
-----------------
procedure Set_Counter (This : in out Timer; Value : UInt32) is
begin
This.Counter := Value;
end Set_Counter;
---------------------
-- Current_Counter --
---------------------
function Current_Counter (This : Timer) return UInt32 is
begin
return This.Counter;
end Current_Counter;
--------------------
-- Set_Autoreload --
--------------------
procedure Set_Autoreload (This : in out Timer; Value : UInt32) is
begin
This.ARR := Value;
end Set_Autoreload;
------------------------
-- Current_Autoreload --
------------------------
function Current_Autoreload (This : Timer) return UInt32 is
begin
return This.ARR;
end Current_Autoreload;
----------------------
-- Enable_Interrupt --
----------------------
procedure Enable_Interrupt
(This : in out Timer;
Source : Timer_Interrupt)
is
begin
This.DIER := This.DIER or Source'Enum_Rep;
end Enable_Interrupt;
----------------------
-- Enable_Interrupt --
----------------------
procedure Enable_Interrupt
(This : in out Timer;
Sources : Timer_Interrupt_List)
is
begin
for Source of Sources loop
This.DIER := This.DIER or Source'Enum_Rep;
end loop;
end Enable_Interrupt;
-----------------------
-- Disable_Interrupt --
-----------------------
procedure Disable_Interrupt
(This : in out Timer;
Source : Timer_Interrupt)
is
begin
This.DIER := This.DIER and not Source'Enum_Rep;
end Disable_Interrupt;
-----------------------------
-- Clear_Pending_Interrupt --
-----------------------------
procedure Clear_Pending_Interrupt
(This : in out Timer;
Source : Timer_Interrupt)
is
begin
This.SR := not Source'Enum_Rep;
-- We do not, and must not, use the read-modify-write pattern because
-- it leaves a window of vulnerability open to changes to the state
-- after the read but before the write. The hardware for this register
-- is designed so that writing other bits will not change them. This is
-- indicated by the "rc_w0" notation in the status register definition.
-- See the RM, page 57 for that notation explanation.
end Clear_Pending_Interrupt;
-----------------------
-- Interrupt_Enabled --
-----------------------
function Interrupt_Enabled
(This : Timer;
Source : Timer_Interrupt)
return Boolean
is
begin
return (This.DIER and Source'Enum_Rep) = Source'Enum_Rep;
end Interrupt_Enabled;
------------
-- Status --
------------
function Status (This : Timer; Flag : Timer_Status_Flag) return Boolean is
begin
return (This.SR and Flag'Enum_Rep) = Flag'Enum_Rep;
end Status;
------------------
-- Clear_Status --
------------------
procedure Clear_Status (This : in out Timer; Flag : Timer_Status_Flag) is
begin
This.SR := not Flag'Enum_Rep;
-- We do not, and must not, use the read-modify-write pattern because
-- it leaves a window of vulnerability open to changes to the state
-- after the read but before the write. The hardware for this register
-- is designed so that writing other bits will not change them. This is
-- indicated by the "rc_w0" notation in the status register definition.
-- See the RM, page 57 for that notation explanation.
end Clear_Status;
-----------------------
-- Enable_DMA_Source --
-----------------------
procedure Enable_DMA_Source
(This : in out Timer;
Source : Timer_DMA_Source)
is
begin
This.DIER := This.DIER or Source'Enum_Rep;
end Enable_DMA_Source;
------------------------
-- Disable_DMA_Source --
------------------------
procedure Disable_DMA_Source
(This : in out Timer;
Source : Timer_DMA_Source)
is
begin
This.DIER := This.DIER and not Source'Enum_Rep;
end Disable_DMA_Source;
------------------------
-- DMA_Source_Enabled --
------------------------
function DMA_Source_Enabled
(This : Timer;
Source : Timer_DMA_Source)
return Boolean
is
begin
return (This.DIER and Source'Enum_Rep) = Source'Enum_Rep;
end DMA_Source_Enabled;
-------------------------
-- Configure_Prescaler --
-------------------------
procedure Configure_Prescaler
(This : in out Timer;
Prescaler : UInt16;
Reload_Mode : Timer_Prescaler_Reload_Mode)
is
begin
This.Prescaler := Prescaler;
This.EGR := Reload_Mode'Enum_Rep;
end Configure_Prescaler;
-------------------
-- Configure_DMA --
-------------------
procedure Configure_DMA
(This : in out Timer;
Base_Address : Timer_DMA_Base_Address;
Burst_Length : Timer_DMA_Burst_Length)
is
begin
This.DCR.Base_Address := Base_Address;
This.DCR.Burst_Length := Burst_Length;
end Configure_DMA;
--------------------------------
-- Enable_Capture_Compare_DMA --
--------------------------------
procedure Enable_Capture_Compare_DMA
(This : in out Timer)
-- TODO: note that the CCDS field description in the RM, page 550, seems
-- to indicate other than simply enabled/disabled
is
begin
This.CR2.Capture_Compare_DMA_Selection := True;
end Enable_Capture_Compare_DMA;
---------------------------------
-- Disable_Capture_Compare_DMA --
---------------------------------
procedure Disable_Capture_Compare_DMA
(This : in out Timer)
-- TODO: note that the CCDS field description in the RM, page 550, seems
-- to indicate other than simply enabled/disabled
is
begin
This.CR2.Capture_Compare_DMA_Selection := False;
end Disable_Capture_Compare_DMA;
-----------------------
-- Current_Prescaler --
-----------------------
function Current_Prescaler (This : Timer) return UInt16 is
begin
return This.Prescaler;
end Current_Prescaler;
-----------------------
-- Set_UpdateDisable --
-----------------------
procedure Set_UpdateDisable
(This : in out Timer;
To : Boolean)
is
begin
This.CR1.Update_Disable := To;
end Set_UpdateDisable;
-----------------------
-- Set_UpdateRequest --
-----------------------
procedure Set_UpdateRequest
(This : in out Timer;
Source : Timer_Update_Source)
is
begin
This.CR1.Update_Request_Source := Source /= Global;
end Set_UpdateRequest;
---------------------------
-- Select_One_Pulse_Mode --
---------------------------
procedure Select_One_Pulse_Mode
(This : in out Timer;
Mode : Timer_One_Pulse_Mode)
is
begin
This.CR1.One_Pulse_Mode := Mode;
end Select_One_Pulse_Mode;
----------------------------
-- Set_Autoreload_Preload --
----------------------------
procedure Set_Autoreload_Preload
(This : in out Timer;
To : Boolean)
is
begin
This.CR1.ARPE := To;
end Set_Autoreload_Preload;
-----------------------
-- Counter_Direction --
-----------------------
function Current_Counter_Mode
(This : Timer)
return Timer_Counter_Alignment_Mode
is
begin
if Basic_Timer (This) then
return Up;
else
return This.CR1.Mode_And_Dir;
end if;
end Current_Counter_Mode;
--------------------
-- Generate_Event --
--------------------
procedure Generate_Event
(This : in out Timer;
Source : Timer_Event_Source)
is
Temp_EGR : UInt32 := This.EGR;
begin
Temp_EGR := Temp_EGR or Source'Enum_Rep;
This.EGR := Temp_EGR;
end Generate_Event;
---------------------------
-- Select_Output_Trigger --
---------------------------
procedure Select_Output_Trigger
(This : in out Timer;
Source : Timer_Trigger_Output_Source)
is
begin
This.CR2.Master_Mode_Selection := Source;
end Select_Output_Trigger;
-----------------------
-- Select_Slave_Mode --
-----------------------
procedure Select_Slave_Mode
(This : in out Timer;
Mode : Timer_Slave_Mode)
is
begin
This.SMCR.Slave_Mode_Selection := Mode;
end Select_Slave_Mode;
------------------------------
-- Enable_Master_Slave_Mode --
------------------------------
procedure Enable_Master_Slave_Mode (This : in out Timer) is
begin
This.SMCR.Master_Slave_Mode := True;
end Enable_Master_Slave_Mode;
-------------------------------
-- Disable_Master_Slave_Mode --
-------------------------------
procedure Disable_Master_Slave_Mode (This : in out Timer) is
begin
This.SMCR.Master_Slave_Mode := False;
end Disable_Master_Slave_Mode;
--------------------------------
-- Configure_External_Trigger --
--------------------------------
procedure Configure_External_Trigger
(This : in out Timer;
Polarity : Timer_External_Trigger_Polarity;
Prescaler : Timer_External_Trigger_Prescaler;
Filter : Timer_External_Trigger_Filter)
is
begin
This.SMCR.External_Trigger_Polarity := Polarity;
This.SMCR.External_Trigger_Prescaler := Prescaler;
This.SMCR.External_Trigger_Filter := Filter;
end Configure_External_Trigger;
---------------------------------
-- Configure_As_External_Clock --
---------------------------------
procedure Configure_As_External_Clock
(This : in out Timer;
Source : Timer_Internal_Trigger_Source)
is
begin
Select_Input_Trigger (This, Source);
Select_Slave_Mode (This, External_1);
end Configure_As_External_Clock;
---------------------------------
-- Configure_As_External_Clock --
---------------------------------
procedure Configure_As_External_Clock
(This : in out Timer;
Source : Timer_External_Clock_Source;
Polarity : Timer_Input_Capture_Polarity;
Filter : Timer_Input_Capture_Filter)
is
begin
if Source = Filtered_Timer_Input_2 then
Configure_Channel_Input
(This,
Channel_2,
Polarity,
Direct_TI,
Div1, -- default prescalar zero value
Filter);
else
Configure_Channel_Input
(This,
Channel_1,
Polarity,
Direct_TI,
Div1, -- default prescalar zero value
Filter);
end if;
Select_Input_Trigger (This, Source);
Select_Slave_Mode (This, External_1);
end Configure_As_External_Clock;
------------------------------------
-- Configure_External_Clock_Mode1 --
------------------------------------
procedure Configure_External_Clock_Mode1
(This : in out Timer;
Polarity : Timer_External_Trigger_Polarity;
Prescaler : Timer_External_Trigger_Prescaler;
Filter : Timer_External_Trigger_Filter)
is
begin
Configure_External_Trigger (This, Polarity, Prescaler, Filter);
Select_Slave_Mode (This, External_1);
Select_Input_Trigger (This, External_Trigger_Input);
end Configure_External_Clock_Mode1;
------------------------------------
-- Configure_External_Clock_Mode2 --
------------------------------------
procedure Configure_External_Clock_Mode2
(This : in out Timer;
Polarity : Timer_External_Trigger_Polarity;
Prescaler : Timer_External_Trigger_Prescaler;
Filter : Timer_External_Trigger_Filter)
is
begin
Configure_External_Trigger (This, Polarity, Prescaler, Filter);
This.SMCR.External_Clock_Enable := True;
end Configure_External_Clock_Mode2;
--------------------------
-- Select_Input_Trigger --
--------------------------
procedure Select_Input_Trigger
(This : in out Timer;
Source : Timer_Trigger_Input_Source)
is
begin
This.SMCR.Trigger_Selection := Source;
end Select_Input_Trigger;
------------------------------
-- Configure_Channel_Output --
------------------------------
procedure Configure_Channel_Output
(This : in out Timer;
Channel : Timer_Channel;
Mode : Timer_Output_Compare_And_PWM_Mode;
State : Timer_Capture_Compare_State;
Pulse : UInt32;
Polarity : Timer_Output_Compare_Polarity)
is
begin
-- first disable the channel
This.CCER (Channel).CCxE := Disable;
Set_Output_Compare_Mode (This, Channel, Mode);
This.CCER (Channel).CCxE := State;
This.CCER (Channel).CCxP := Polarity'Enum_Rep;
This.CCR1_4 (Channel) := Pulse;
-- Only timers 2 and 5 have 32-bit CCR registers. The others must
-- maintain the upper half at zero. We use a precondition to ensure
-- values greater than a half-word are only specified for the proper
-- timers.
end Configure_Channel_Output;
------------------------------
-- Configure_Channel_Output --
------------------------------
procedure Configure_Channel_Output
(This : in out Timer;
Channel : Timer_Channel;
Mode : Timer_Output_Compare_And_PWM_Mode;
State : Timer_Capture_Compare_State;
Pulse : UInt32;
Polarity : Timer_Output_Compare_Polarity;
Idle_State : Timer_Capture_Compare_State;
Complementary_Polarity : Timer_Output_Compare_Polarity;
Complementary_Idle_State : Timer_Capture_Compare_State)
is
begin
-- first disable the channel
This.CCER (Channel).CCxE := Disable;
Set_Output_Compare_Mode (This, Channel, Mode);
This.CCER (Channel).CCxE := State;
This.CCER (Channel).CCxNP := Complementary_Polarity'Enum_Rep;
This.CCER (Channel).CCxP := Polarity'Enum_Rep;
case Channel is
when Channel_1 =>
This.CR2.Channel_1_Output_Idle_State := Idle_State;
This.CR2.Channel_1_Complementary_Output_Idle_State :=
Complementary_Idle_State;
when Channel_2 =>
This.CR2.Channel_2_Output_Idle_State := Idle_State;
This.CR2.Channel_2_Complementary_Output_Idle_State :=
Complementary_Idle_State;
when Channel_3 =>
This.CR2.Channel_3_Output_Idle_State := Idle_State;
This.CR2.Channel_3_Complementary_Output_Idle_State :=
Complementary_Idle_State;
when Channel_4 =>
This.CR2.Channel_4_Output_Idle_State := Idle_State;
end case;
This.CCR1_4 (Channel) := Pulse;
-- Only timers 2 and 5 have 32-bit CCR registers. The others must
-- maintain the upper half at zero. We use a precondition to ensure
-- values greater than a half-word are only specified for the proper
-- timers.
end Configure_Channel_Output;
-----------------------
-- Set_Single_Output --
-----------------------
procedure Set_Single_Output
(This : in out Timer;
Channel : Timer_Channel;
Mode : Timer_Output_Compare_And_PWM_Mode;
OC_Clear_Enabled : Boolean;
Preload_Enabled : Boolean;
Fast_Enabled : Boolean)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
Description : Channel_Output_Descriptor;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Description := (OCxMode => Mode,
OCxFast_Enable => Fast_Enabled,
OCxPreload_Enable => Preload_Enabled,
OCxClear_Enable => OC_Clear_Enabled);
Temp.Descriptors (Descriptor_Index) := (Output, Description);
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Single_Output;
-----------------------------
-- Set_Output_Compare_Mode --
-----------------------------
procedure Set_Output_Compare_Mode
(This : in out Timer;
Channel : Timer_Channel;
Mode : Timer_Output_Compare_And_PWM_Mode)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
if Temp.Descriptors (Descriptor_Index).CCxSelection /= Output then
raise Timer_Channel_Access_Error;
end if;
Temp.Descriptors (Descriptor_Index).Compare.OCxMode := Mode;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Output_Compare_Mode;
----------------------------------
-- Current_Capture_Compare_Mode --
----------------------------------
function Current_Capture_Compare_Mode
(This : Timer;
Channel : Timer_Channel)
return Timer_Capture_Compare_Modes
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
return Temp.Descriptors (Descriptor_Index).CCxSelection;
end Current_Capture_Compare_Mode;
------------------------------
-- Set_Output_Forced_Action --
------------------------------
procedure Set_Output_Forced_Action
(This : in out Timer;
Channel : Timer_Channel;
Active : Boolean)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
if Temp.Descriptors (Descriptor_Index).CCxSelection /= Output then
raise Timer_Channel_Access_Error;
end if;
if Active then
Temp.Descriptors (Descriptor_Index).Compare.OCxMode := Force_Active;
else
Temp.Descriptors (Descriptor_Index).Compare.OCxMode := Force_Inactive;
end if;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Output_Forced_Action;
-------------------------------
-- Set_Output_Preload_Enable --
-------------------------------
procedure Set_Output_Preload_Enable
(This : in out Timer;
Channel : Timer_Channel;
Enabled : Boolean)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Temp.Descriptors (Descriptor_Index).Compare.OCxPreload_Enable := Enabled;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Output_Preload_Enable;
----------------------------
-- Set_Output_Fast_Enable --
----------------------------
procedure Set_Output_Fast_Enable
(This : in out Timer;
Channel : Timer_Channel;
Enabled : Boolean)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Temp.Descriptors (Descriptor_Index).Compare.OCxFast_Enable := Enabled;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Output_Fast_Enable;
-----------------------
-- Set_Clear_Control --
-----------------------
procedure Set_Clear_Control
(This : in out Timer;
Channel : Timer_Channel;
Enabled : Boolean)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Temp.Descriptors (Descriptor_Index).Compare.OCxClear_Enable := Enabled;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Clear_Control;
--------------------
-- Enable_Channel --
--------------------
procedure Enable_Channel
(This : in out Timer;
Channel : Timer_Channel)
is
Temp_EGR : UInt32 := This.EGR;
begin
This.CCER (Channel).CCxE := Enable;
-- Trigger an event to initialize preload register
Temp_EGR := Temp_EGR or (2 ** (Timer_Channel'Pos (Channel) + 1));
This.EGR := Temp_EGR;
end Enable_Channel;
-------------------------
-- Set_Output_Polarity --
-------------------------
procedure Set_Output_Polarity
(This : in out Timer;
Channel : Timer_Channel;
Polarity : Timer_Output_Compare_Polarity)
is
begin
This.CCER (Channel).CCxP := Polarity'Enum_Rep;
end Set_Output_Polarity;
---------------------------------------
-- Set_Output_Complementary_Polarity --
---------------------------------------
procedure Set_Output_Complementary_Polarity
(This : in out Timer;
Channel : Timer_Channel;
Polarity : Timer_Output_Compare_Polarity)
is
begin
This.CCER (Channel).CCxNP := Polarity'Enum_Rep;
end Set_Output_Complementary_Polarity;
---------------------
-- Disable_Channel --
---------------------
procedure Disable_Channel
(This : in out Timer;
Channel : Timer_Channel)
is
begin
This.CCER (Channel).CCxE := Disable;
end Disable_Channel;
---------------------
-- Channel_Enabled --
---------------------
function Channel_Enabled
(This : Timer;
Channel : Timer_Channel)
return Boolean
is
begin
return This.CCER (Channel).CCxE = Enable;
end Channel_Enabled;
----------------------------------
-- Enable_Complementary_Channel --
----------------------------------
procedure Enable_Complementary_Channel
(This : in out Timer;
Channel : Timer_Channel)
is
begin
This.CCER (Channel).CCxNE := Enable;
end Enable_Complementary_Channel;
-----------------------------------
-- Disable_Complementary_Channel --
-----------------------------------
procedure Disable_Complementary_Channel
(This : in out Timer;
Channel : Timer_Channel)
is
begin
This.CCER (Channel).CCxNE := Disable;
end Disable_Complementary_Channel;
-----------------------------------
-- Complementary_Channel_Enabled --
-----------------------------------
function Complementary_Channel_Enabled
(This : Timer; Channel : Timer_Channel)
return Boolean
is
begin
return This.CCER (Channel).CCxNE = Enable;
end Complementary_Channel_Enabled;
-----------------------
-- Set_Compare_Value --
-----------------------
procedure Set_Compare_Value
(This : in out Timer;
Channel : Timer_Channel;
Word_Value : UInt32)
is
begin
This.CCR1_4 (Channel) := Word_Value;
-- Timers 2 and 5 really do have 32-bit capture/compare registers so we
-- don't need to require half-words as inputs.
end Set_Compare_Value;
-----------------------
-- Set_Compare_Value --
-----------------------
procedure Set_Compare_Value
(This : in out Timer;
Channel : Timer_Channel;
Value : UInt16)
is
begin
This.CCR1_4 (Channel) := UInt32 (Value);
-- These capture/compare registers are really only 15-bits wide, except
-- for those of timers 2 and 5. For the sake of simplicity we represent
-- all of them with full words, but only write word values when
-- appropriate. The caller has to treat them as half-word values, since
-- that's the type for the formal parameter, therefore our casting up to
-- a word value will retain the reserved upper half-word value of zero.
end Set_Compare_Value;
---------------------------
-- Current_Capture_Value --
---------------------------
function Current_Capture_Value
(This : Timer;
Channel : Timer_Channel)
return UInt32
is
begin
return This.CCR1_4 (Channel);
end Current_Capture_Value;
---------------------------
-- Current_Capture_Value --
---------------------------
function Current_Capture_Value
(This : Timer;
Channel : Timer_Channel)
return UInt16
is
begin
return UInt16 (This.CCR1_4 (Channel));
end Current_Capture_Value;
-------------------------------------
-- Write_Channel_Input_Description --
-------------------------------------
procedure Write_Channel_Input_Description
(This : in out Timer;
Channel : Timer_Channel;
Kind : Timer_Input_Capture_Selection;
Description : Channel_Input_Descriptor)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
New_Value : IO_Descriptor;
begin
case Kind is
when Direct_TI =>
New_Value := (CCxSelection => Direct_TI, Capture => Description);
when Indirect_TI =>
New_Value := (CCxSelection => Indirect_TI, Capture => Description);
when TRC =>
New_Value := (CCxSelection => TRC, Capture => Description);
end case;
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Temp.Descriptors (Descriptor_Index) := New_Value;
This.CCMR1_2 (CCMR_Index) := Temp;
end Write_Channel_Input_Description;
-------------------------
-- Set_Input_Prescaler --
-------------------------
procedure Set_Input_Prescaler
(This : in out Timer;
Channel : Timer_Channel;
Value : Timer_Input_Capture_Prescaler)
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
Temp.Descriptors (Descriptor_Index).Capture.ICxPrescaler := Value;
This.CCMR1_2 (CCMR_Index) := Temp;
end Set_Input_Prescaler;
-----------------------------
-- Current_Input_Prescaler --
-----------------------------
function Current_Input_Prescaler
(This : Timer;
Channel : Timer_Channel)
return Timer_Input_Capture_Prescaler
is
CCMR_Index : CCMRx_Index;
Descriptor_Index : Lower_Half_Index;
Temp : TIMx_CCMRx;
begin
case Channel is
when Channel_1 =>
CCMR_Index := 1;
Descriptor_Index := 1;
when Channel_2 =>
CCMR_Index := 1;
Descriptor_Index := 2;
when Channel_3 =>
CCMR_Index := 2;
Descriptor_Index := 1;
when Channel_4 =>
CCMR_Index := 2;
Descriptor_Index := 2;
end case;
Temp := This.CCMR1_2 (CCMR_Index); -- effectively get CCMR1 or CCMR2
return Temp.Descriptors (Descriptor_Index).Capture.ICxPrescaler;
end Current_Input_Prescaler;
-----------------------------
-- Configure_Channel_Input --
-----------------------------
procedure Configure_Channel_Input
(This : in out Timer;
Channel : Timer_Channel;
Polarity : Timer_Input_Capture_Polarity;
Selection : Timer_Input_Capture_Selection;
Prescaler : Timer_Input_Capture_Prescaler;
Filter : Timer_Input_Capture_Filter)
is
Input : Channel_Input_Descriptor;
begin
-- first disable the channel
This.CCER (Channel).CCxE := Disable;
Input := (ICxFilter => Filter, ICxPrescaler => Prescaler);
Write_Channel_Input_Description
(This => This,
Channel => Channel,
Kind => Selection,
Description => Input);
case Polarity is
when Rising =>
This.CCER (Channel).CCxNP := 0;
This.CCER (Channel).CCxP := 0;
when Falling =>
This.CCER (Channel).CCxNP := 0;
This.CCER (Channel).CCxP := 1;
when Both_Edges =>
This.CCER (Channel).CCxNP := 1;
This.CCER (Channel).CCxP := 1;
end case;
This.CCER (Channel).CCxE := Enable;
end Configure_Channel_Input;
---------------------------------
-- Configure_Channel_Input_PWM --
---------------------------------
procedure Configure_Channel_Input_PWM
(This : in out Timer;
Channel : Timer_Channel;
Selection : Timer_Input_Capture_Selection;
Polarity : Timer_Input_Capture_Polarity;
Prescaler : Timer_Input_Capture_Prescaler;
Filter : Timer_Input_Capture_Filter)
is
Opposite_Polarity : Timer_Input_Capture_Polarity;
Opposite_Selection : Timer_Input_Capture_Selection;
begin
Disable_Channel (This, Channel);
if Polarity = Rising then
Opposite_Polarity := Falling;
else
Opposite_Polarity := Rising;
end if;
if Selection = Indirect_TI then
Opposite_Selection := Direct_TI;
else
Opposite_Selection := Indirect_TI;
end if;
if Channel = Channel_1 then
Configure_Channel_Input
(This, Channel_1, Polarity, Selection, Prescaler, Filter);
Configure_Channel_Input (This,
Channel_2,
Opposite_Polarity,
Opposite_Selection,
Prescaler,
Filter);
else
Configure_Channel_Input
(This, Channel_2, Polarity, Selection, Prescaler, Filter);
Configure_Channel_Input (This,
Channel_1,
Opposite_Polarity,
Opposite_Selection,
Prescaler,
Filter);
end if;
Enable_Channel (This, Channel);
end Configure_Channel_Input_PWM;
-------------------------------
-- Enable_CC_Preload_Control --
-------------------------------
procedure Enable_CC_Preload_Control (This : in out Timer) is
begin
This.CR2.Capture_Compare_Preloaded_Control := True;
end Enable_CC_Preload_Control;
--------------------------------
-- Disable_CC_Preload_Control --
--------------------------------
procedure Disable_CC_Preload_Control (This : in out Timer) is
begin
This.CR2.Capture_Compare_Preloaded_Control := False;
end Disable_CC_Preload_Control;
------------------------
-- Select_Commutation --
------------------------
procedure Select_Commutation (This : in out Timer) is
begin
This.CR2.Capture_Compare_Control_Update_Selection := True;
end Select_Commutation;
--------------------------
-- Deselect_Commutation --
--------------------------
procedure Deselect_Commutation (This : in out Timer) is
begin
This.CR2.Capture_Compare_Control_Update_Selection := False;
end Deselect_Commutation;
--------------------
-- Configure_BDTR --
--------------------
procedure Configure_BDTR
(This : in out Timer;
Automatic_Output_Enabled : Boolean;
Break_Polarity : Timer_Break_Polarity;
Break_Enabled : Boolean;
Off_State_Selection_Run_Mode : Bit;
Off_State_Selection_Idle_Mode : Bit;
Lock_Configuration : Timer_Lock_Level;
Deadtime_Generator : UInt8)
is
begin
This.BDTR.Automatic_Output_Enabled := Automatic_Output_Enabled;
This.BDTR.Break_Polarity := Break_Polarity;
This.BDTR.Break_Enable := Break_Enabled;
This.BDTR.Off_State_Selection_Run_Mode := Off_State_Selection_Run_Mode;
This.BDTR.Off_State_Selection_Idle_Mode := Off_State_Selection_Idle_Mode;
This.BDTR.Lock := Lock_Configuration;
This.BDTR.Deadtime_Generator := Deadtime_Generator;
end Configure_BDTR;
---------------------------------
-- Configure_Timer_2_Remapping --
---------------------------------
procedure Configure_Timer_2_Remapping
(This : in out Timer;
Option : Timer_2_Remapping_Options)
is
begin
This.Options.ITR1_RMP := Option;
end Configure_Timer_2_Remapping;
---------------------------------
-- Configure_Timer_5_Remapping --
---------------------------------
procedure Configure_Timer_5_Remapping
(This : in out Timer;
Option : Timer_5_Remapping_Options)
is
begin
This.Options.TI4_RMP := Option;
end Configure_Timer_5_Remapping;
----------------------------------
-- Configure_Timer_11_Remapping --
----------------------------------
procedure Configure_Timer_11_Remapping
(This : in out Timer;
Option : Timer_11_Remapping_Options)
is
begin
This.Options.TI1_RMP := Option;
end Configure_Timer_11_Remapping;
---------------------------------
-- Configure_Encoder_Interface --
---------------------------------
procedure Configure_Encoder_Interface
(This : in out Timer;
Mode : Timer_Encoder_Mode;
IC1_Polarity : Timer_Input_Capture_Polarity;
IC2_Polarity : Timer_Input_Capture_Polarity)
is
begin
This.SMCR.Slave_Mode_Selection := Mode;
Write_Channel_Input_Description
(This,
Channel => Channel_1,
Kind => Direct_TI,
Description => Channel_Input_Descriptor'(ICxFilter => 0,
ICxPrescaler => Div1));
Write_Channel_Input_Description
(This,
Channel => Channel_2,
Kind => Direct_TI,
Description => Channel_Input_Descriptor'(ICxFilter => 0,
ICxPrescaler => Div1));
case IC1_Polarity is
when Rising =>
This.CCER (Channel_1).CCxNP := 0;
This.CCER (Channel_1).CCxP := 0;
when Falling =>
This.CCER (Channel_1).CCxNP := 0;
This.CCER (Channel_1).CCxP := 1;
when Both_Edges =>
This.CCER (Channel_1).CCxNP := 1;
This.CCER (Channel_1).CCxP := 1;
end case;
case IC2_Polarity is
when Rising =>
This.CCER (Channel_2).CCxNP := 0;
This.CCER (Channel_2).CCxP := 0;
when Falling =>
This.CCER (Channel_2).CCxNP := 0;
This.CCER (Channel_2).CCxP := 1;
when Both_Edges =>
This.CCER (Channel_2).CCxNP := 1;
This.CCER (Channel_2).CCxP := 1;
end case;
end Configure_Encoder_Interface;
------------------------
-- Enable_Hall_Sensor --
------------------------
procedure Enable_Hall_Sensor
(This : in out Timer)
is
begin
This.CR2.TI1_Selection := True;
end Enable_Hall_Sensor;
-------------------------
-- Disable_Hall_Sensor --
-------------------------
procedure Disable_Hall_Sensor
(This : in out Timer)
is
begin
This.CR2.TI1_Selection := False;
end Disable_Hall_Sensor;
end STM32.Timers;
|
AdaCore/Ada_Drivers_Library | Ada | 12,228 | adb | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2020, AdaCore --
-- Copyright (C) 2020-2021, Simon Wright ([email protected]) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- The algorithms used here are derived from Pimoroni's code at
-- https://github.com/pimoroni/pmw3901-python.
-- Calibration data from PX4: https://github.com/PX4/PX4-Autopilot/
-- blob/master/src/drivers/optical_flow/pmw3901/PMW3901.cpp
with Ada.Unchecked_Conversion;
package body PMW3901 is
-- Some registers
Reg_ID : constant := 16#00#;
Reg_ID_Inverted : constant := 16#5f#;
Reg_Data_Ready : constant := 16#02#;
Reg_Motion_Burst : constant := 16#16#;
Reg_Power_Up_Reset : constant := 16#3a#;
-- Reg_Orientation : constant := 16#5b#;
Power_Up_Reset_Key : constant := 16#5a#;
function Read (This : in out PMW3901_Flow_Sensor;
Register : HAL.UInt8) return HAL.UInt8;
procedure Write (This : in out PMW3901_Flow_Sensor;
Register : HAL.UInt8;
Value : HAL.UInt8);
--------------
-- Is_Valid --
--------------
function Is_Valid (M : Motion) return Boolean
is
use type HAL.UInt8;
begin
return M.Motion_Occurred
and not (M.S_Qual < 19 and M.Shutter_Upper = 16#1f#);
end Is_Valid;
----------------
-- Initialize --
----------------
procedure Initialize (This : in out PMW3901_Flow_Sensor)
is
begin
This.CS.Clear;
This.Timing.Delay_Milliseconds (50);
This.CS.Set;
declare
Chip_ID : HAL.UInt8;
Revision : HAL.UInt8;
Inverted_Chip_ID : HAL.UInt8;
use type HAL.UInt8;
begin
Chip_ID := Read (This, Reg_ID);
Revision := Read (This, Reg_ID + 1);
Inverted_Chip_ID := Read (This, Reg_ID_Inverted);
if Chip_ID /= 16#49#
or Revision /= 16#00#
or Inverted_Chip_ID /= 16#b6#
then
-- Can't initialize the wrong sort of chip!
raise SPI_Error with "no PMW3901 found";
end if;
end;
Write (This, Reg_Power_Up_Reset, Power_Up_Reset_Key);
This.Timing.Delay_Milliseconds (5);
-- Read the registers once
declare
Buff : HAL.SPI.SPI_Data_8b (0 .. 4);
use type HAL.UInt8;
begin
for J in Buff'Range loop
Buff (J) := Read (This, Reg_Data_Ready + HAL.UInt8 (J));
end loop;
end;
This.Timing.Delay_Milliseconds (1);
This.Initialized := True;
end Initialize;
---------------
-- Calibrate --
---------------
procedure Calibrate (This : in out PMW3901_Flow_Sensor)
is
type Magic is record
Register : HAL.UInt8;
Value : HAL.UInt8;
end record;
type Magics is array (Natural range <>) of Magic;
procedure Write_Magics (Data : Magics);
procedure Write_Magics (Data : Magics) is
begin
for J in Data'Range loop
Write (This, Data (J).Register, Data (J).Value);
end loop;
end Write_Magics;
use type HAL.UInt8;
begin
Write_Magics (((16#7f#, 16#00#),
(16#55#, 16#01#),
(16#50#, 16#07#),
(16#7f#, 16#0e#),
(16#43#, 16#10#)));
declare
Check : constant HAL.UInt8 := Read (This, 16#67#);
begin
if (Check and 2#1000_0000#) /= 0 then
Write (This, 16#48#, 16#04#);
else
Write (This, 16#48#, 16#02#);
end if;
end;
Write_Magics (((16#7f#, 16#00#),
(16#51#, 16#7b#),
(16#50#, 16#00#),
(16#55#, 16#00#),
(16#7f#, 16#0e#)));
if Read (This, 16#73#) = 0 then
declare
C1, C2 : HAL.UInt8;
begin
C1 := Read (This, 16#70#);
if C1 <= 28 then
C1 := C1 + 14;
else
C1 := C1 + 11;
end if;
C1 := HAL.UInt8'Min (16#3f#, C1);
C2 := Read (This, 16#71#);
C2 := (C2 * 45) / 100;
Write_Magics (((16#7f#, 16#00#),
(16#61#, 16#ad#),
(16#51#, 16#70#),
(16#7f#, 16#0E#),
(16#70#, C1),
(16#71#, C2)));
end;
end if;
Write_Magics (((16#7F#, 16#00#),
(16#61#, 16#AD#),
(16#7F#, 16#03#),
(16#40#, 16#00#),
(16#7F#, 16#05#),
(16#41#, 16#B3#),
(16#43#, 16#F1#),
(16#45#, 16#14#),
(16#5B#, 16#32#),
(16#5F#, 16#34#),
(16#7B#, 16#08#),
(16#7F#, 16#06#),
(16#44#, 16#1B#),
(16#40#, 16#BF#),
(16#4E#, 16#3F#),
(16#7F#, 16#08#),
(16#65#, 16#20#),
(16#6A#, 16#18#),
(16#7F#, 16#09#),
(16#4F#, 16#AF#),
(16#5F#, 16#40#),
(16#48#, 16#80#),
(16#49#, 16#80#),
(16#57#, 16#77#),
(16#60#, 16#78#),
(16#61#, 16#78#),
(16#62#, 16#08#),
(16#63#, 16#50#),
(16#7F#, 16#0A#),
(16#45#, 16#60#),
(16#7F#, 16#00#),
(16#4D#, 16#11#),
(16#55#, 16#80#),
(16#74#, 16#21#),
(16#75#, 16#1F#),
(16#4A#, 16#78#),
(16#4B#, 16#78#),
(16#44#, 16#08#),
(16#45#, 16#50#),
(16#64#, 16#FF#),
(16#65#, 16#1F#),
(16#7F#, 16#14#),
(16#65#, 16#67#),
(16#66#, 16#08#),
(16#63#, 16#70#),
(16#7F#, 16#15#),
(16#48#, 16#48#),
(16#7F#, 16#07#),
(16#41#, 16#0D#),
(16#43#, 16#14#),
(16#4B#, 16#0E#),
(16#45#, 16#0F#),
(16#44#, 16#42#),
(16#4C#, 16#80#),
(16#7F#, 16#10#),
(16#5B#, 16#02#),
(16#7F#, 16#07#),
(16#40#, 16#41#),
(16#70#, 16#00#)));
This.Timing.Delay_Milliseconds (10);
Write_Magics (((16#32#, 16#44#),
(16#7F#, 16#07#),
(16#40#, 16#40#),
(16#7F#, 16#06#),
(16#62#, 16#F0#),
(16#63#, 16#00#),
(16#7F#, 16#0D#),
(16#48#, 16#C0#),
(16#6F#, 16#D5#),
(16#7F#, 16#00#),
(16#5B#, 16#A0#),
(16#4E#, 16#A8#),
(16#5A#, 16#50#),
(16#40#, 16#80#)));
end Calibrate;
-----------------
-- Read_Motion --
-----------------
function Read_Motion (This : in out PMW3901_Flow_Sensor) return Motion is
subtype Buffer is HAL.SPI.SPI_Data_8b (1 .. 12);
function Convert is new Ada.Unchecked_Conversion (Buffer, Motion);
Buff : Buffer := (others => 0);
Status : HAL.SPI.SPI_Status;
use all type HAL.SPI.SPI_Status;
begin
This.CS.Clear;
This.Port.Transmit (HAL.SPI.SPI_Data_8b'((1 => Reg_Motion_Burst)),
Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI transmit failure";
end if;
This.Port.Receive (Buff, Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI receive burst failure";
end if;
This.CS.Set;
return Convert (Buff);
end Read_Motion;
----------
-- Read --
----------
function Read (This : in out PMW3901_Flow_Sensor;
Register : HAL.UInt8) return HAL.UInt8
is
use type HAL.UInt8;
Register_For_Read : constant HAL.UInt8 := Register and 16#7f#;
Data : HAL.SPI.SPI_Data_8b (0 .. 0);
Status : HAL.SPI.SPI_Status;
use all type HAL.SPI.SPI_Status;
begin
This.CS.Clear;
This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Register_For_Read),
Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI transmit failure";
end if;
This.Port.Receive (Data, Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI receive failure";
end if;
This.CS.Set;
return Data (Data'First);
end Read;
-----------
-- Write --
-----------
procedure Write (This : in out PMW3901_Flow_Sensor;
Register : HAL.UInt8;
Value : HAL.UInt8)
is
use type HAL.UInt8;
Register_For_Write : constant HAL.UInt8 := Register or 16#80#;
Status : HAL.SPI.SPI_Status;
use all type HAL.SPI.SPI_Status;
begin
This.CS.Clear;
This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Register_For_Write),
Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI transmit failure";
end if;
This.Port.Transmit (HAL.SPI.SPI_Data_8b'(1 => Value),
Status);
if Status /= Ok then
raise SPI_Error with "PMW3901 SPI transmit failure";
end if;
This.CS.Set;
end Write;
end PMW3901;
|
MinimSecure/unum-sdk | Ada | 875 | ads | -- Copyright 2008-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
First : Character := ASCII.NUL;
Last : Character := ASCII.NUL;
Length : Integer := 0;
procedure Call_Me (Str : String);
end Pck;
|
reznikmm/matreshka | Ada | 3,694 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Draw_Area_Rectangle_Elements is
pragma Preelaborate;
type ODF_Draw_Area_Rectangle is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Draw_Area_Rectangle_Access is
access all ODF_Draw_Area_Rectangle'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Area_Rectangle_Elements;
|
kisom/rover-mk1 | Ada | 1,558 | ads | with AVR, AVR.MCU; use AVR;
with Interfaces;
use Interfaces;
package Hardware.PWM is
-- Set Servo_ISR as the TIMER1 COMPA handler. See page 101 of the
-- ATmega2560 datasheet for more details.
procedure Servo_ISR;
pragma Machine_Attribute (Entity => Servo_ISR,
Attribute_Name => "interrupt");
pragma Export (C, Servo_ISR, MCU.Sig_Timer1_COMPA_String);
Max_Servos : constant := 4; -- Board has 4 PWM connectors.
type Servo_Index is range 1 .. Max_Servos;
procedure Connect (pin : in AVR.Bit_Number; which : out Servo_Index);
procedure Trim (which : in Servo_Index; trim : in Integer_16);
procedure Set (which : in Servo_Index; us : in Unsigned_16);
private
Duty_Cycle : constant := 20000; -- 20ms pulse width
Update_Interval : constant := 40000;
Update_Wait : constant := 5; -- Allow for minor interrupt delays.
-- Specified in the servo datasheet and common to this hardware
-- configuration.
Min_Pulse : constant := 1300;
Mid_Pulse : constant := 1500;
Max_Pulse : constant := 1700;
type Servo is
record
Pin : AVR.Bit_Number;
Ticks : Unsigned_16;
Min : Unsigned_16;
Max : Unsigned_16;
Trim : Integer_16;
end record;
type Servo_ptr is access Servo;
Servos : array (1 .. Max_Servos) of Servo_ptr;
-- 0 is used to indicate the refresh cycle has completed.
Active_Servos : Integer range 0 .. Max_Servos := 0;
Current_Servo : Integer range 0 .. Max_Servos := 1;
end Hardware.PWM;
|
DrenfongWong/tkm-rpc | Ada | 449 | ads | with Ada.Unchecked_Conversion;
package Tkmrpc.Request.Ike.Cc_Set_User_Certificate.Convert is
function To_Request is new Ada.Unchecked_Conversion (
Source => Cc_Set_User_Certificate.Request_Type,
Target => Request.Data_Type);
function From_Request is new Ada.Unchecked_Conversion (
Source => Request.Data_Type,
Target => Cc_Set_User_Certificate.Request_Type);
end Tkmrpc.Request.Ike.Cc_Set_User_Certificate.Convert;
|
DrenfongWong/tkm-rpc | Ada | 409 | ads | with Ada.Unchecked_Conversion;
package Tkmrpc.Response.Ike.Tkm_Version.Convert is
function To_Response is new Ada.Unchecked_Conversion (
Source => Tkm_Version.Response_Type,
Target => Response.Data_Type);
function From_Response is new Ada.Unchecked_Conversion (
Source => Response.Data_Type,
Target => Tkm_Version.Response_Type);
end Tkmrpc.Response.Ike.Tkm_Version.Convert;
|
tum-ei-rcs/StratoX | Ada | 11,249 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- ADA.NUMERICS.GENERIC_ELEMENTARY_FUNCTIONS --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- StratoX --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- @llrset a-ngelfu.ads
-- Generic_Elementary_Functions
-- ============================
-- This is the Ada Cert Math version of a-ngelfu.ads
generic
type Float_Type is digits <>;
package Ada.Numerics.Generic_Elementary_Functions
with SPARK_Mode
is
pragma Pure (Generic_Elementary_Functions);
function Sqrt (X : Float_Type'Base) return Float_Type'Base with
-- @llr Sqrt (Float_Type)
-- This function shall return the square root of <X>.
Post => Sqrt'Result >= 0.0
and then (if X = 0.0 then Sqrt'Result = 0.0)
and then (if X = 1.0 then Sqrt'Result = 1.0)
-- Finally if X is positive, the result of Sqrt is positive (because
-- the sqrt of numbers greater than 1 is greater than or equal to 1,
-- and the sqrt of numbers less than 1 is greater than the argument).
-- This property is useful in particular for static analysis. The
-- property that X is positive is not expressed as (X > 0.0), as
-- the value X may be held in registers that have larger range and
-- precision on some architecture (for example, on x86 using x387
-- FPU, as opposed to SSE2). So, it might be possible for X to be
-- 2.0**(-5000) or so, which could cause the number to compare as
-- greater than 0, but Sqrt would still return a zero result.
-- Note: we use the comparison with Succ (0.0) here because this is
-- more amenable to CodePeer analysis than the use of 'Machine.
and then (if X >= Float_Type'Succ (0.0) then Sqrt'Result > 0.0);
function Log (X : Float_Type'Base) return Float_Type'Base with
-- @llr Log (Float_Type)
-- This function shall return the logarithm of <X>.
Post => (if X = 1.0 then Log'Result = 0.0);
function Log (X, Base : Float_Type'Base) return Float_Type'Base with
-- @llr Log (Float_Type; Float_Type)
-- This function shall compute the logarithm of <X> with the specified
-- base.
Post => (if X = 1.0 then Log'Result = 0.0);
function Exp (X : Float_Type'Base) return Float_Type'Base with
-- @llr Exp (Float_Type)
-- This function shall compute the exponent of <X>.
Post => (if X = 0.0 then Exp'Result = 1.0);
function "**" (Left, Right : Float_Type'Base) return Float_Type'Base with
-- @llr "**" (Float_Type; Float_Type)
-- This function shall compute <Left> to the power of <Right>.
Post => "**"'Result >= 0.0
and then (if Right = 0.0 then "**"'Result = 1.0)
and then (if Right = 1.0 then "**"'Result = Left)
and then (if Left = 1.0 then "**"'Result = 1.0)
and then (if Left = 0.0 then "**"'Result = 0.0);
function Sin (X : Float_Type'Base) return Float_Type'Base with
-- @llr Sin (Float_Type)
-- This function shall return the sine of <X>.
Post => Sin'Result in -1.0 .. 1.0
and then (if X = 0.0 then Sin'Result = 0.0);
function Sin (X, Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Sin (Float_Type; Float_Type)
-- This function shall return the sine of <X> with the specified base.
Post => Sin'Result in -1.0 .. 1.0
and then (if X = 0.0 then Sin'Result = 0.0);
function Cos (X : Float_Type'Base) return Float_Type'Base with
-- @llr Cos (Float_Type)
-- This function shall return the cosine of <X>.
Post => Cos'Result in -1.0 .. 1.0
and then (if X = 0.0 then Cos'Result = 1.0);
function Cos (X, Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Cos (Float_Type; Float_Type)
-- This funtion shall return the cosine of <X> with the sepcified base.
Post => Cos'Result in -1.0 .. 1.0
and then (if X = 0.0 then Cos'Result = 1.0);
function Tan (X : Float_Type'Base) return Float_Type'Base with
-- @llr Tan (Float_Type)
-- This function shall return the tangent of <X>.
Post => (if X = 0.0 then Tan'Result = 0.0);
function Tan (X, Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Tan (Float_Type; Float_Type)
-- This funtion shall return the tangent of <X> with the sepcified base.
Post => (if X = 0.0 then Tan'Result = 0.0);
function Cot (X : Float_Type'Base) return Float_Type'Base;
-- @llr Cot (Float_Type)
-- This function shall return the cotangent of <X>.
function Cot (X, Cycle : Float_Type'Base) return Float_Type'Base;
-- @llr Cot (Float_Type; Float_Type)
-- This funtion shall return the cotangent of <X> with the sepcified base.
function Arcsin (X : Float_Type'Base) return Float_Type'Base with
-- @llr Arcsin (Float_Type)
-- This function shall return the inverse sine of <X>.
Post => (if X = 0.0 then Arcsin'Result = 0.0);
function Arcsin (X, Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Arcsin (Float_Type; Float_Type)
-- This funtion shall return the inverse sine of <X> with the specified
-- base.
Post => (if X = 0.0 then Arcsin'Result = 0.0);
function Arccos (X : Float_Type'Base) return Float_Type'Base with
-- @llr Arccos (Float_Type)
-- This function shall return the inverse cosine of <X>.
Post => (if X = 1.0 then Arccos'Result = 0.0);
function Arccos (X, Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Arccos (Float_Type; Float_Type)
-- This funtion shall return the inverse cosine of <X> with the specified
-- base.
Post => (if X = 1.0 then Arccos'Result = 0.0);
function Arctan
(Y : Float_Type'Base;
X : Float_Type'Base := 1.0) return Float_Type'Base with
-- @llr Arctan (Float_Type; Float_Type)
-- This function shall compute the principal value of the inverse tangent
-- of <Y> / <X>.
Post => (if X > 0.0 and then Y = 0.0 then Arctan'Result = 0.0);
function Arctan
(Y : Float_Type'Base;
X : Float_Type'Base := 1.0;
Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Arctan (Float_Type; Float_Type; FLoat_Type)
-- This function shall compute the principal value of the inverse tangent
-- of <Y> / <X> with the specified base.
Post => (if X > 0.0 and then Y = 0.0 then Arctan'Result = 0.0);
function Arccot
(X : Float_Type'Base;
Y : Float_Type'Base := 1.0) return Float_Type'Base with
-- @llr Arccot (Float_Type; Float_Type)
-- This function shall compute the principal value of the inverse cotangent
-- of <Y> / <X>.
Post => (if X > 0.0 and then Y = 0.0 then Arccot'Result = 0.0);
function Arccot
(X : Float_Type'Base;
Y : Float_Type'Base := 1.0;
Cycle : Float_Type'Base) return Float_Type'Base with
-- @llr Arccot (Float_Type; Float_Type; FLoat_Type)
-- This function shall compute the principal value of the inverse cotangent
-- of <Y> / <X> with the specified base.
Post => (if X > 0.0 and then Y = 0.0 then Arccot'Result = 0.0);
function Sinh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Sinh (Float_Type)
-- This function shall return the hyperbolic sine of <X>.
Post => (if X = 0.0 then Sinh'Result = 0.0);
function Cosh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Cosh (Float_Type)
-- This function shall return the hyperbolic cosine of <X>.
Post => Cosh'Result >= 1.0
and then (if X = 0.0 then Cosh'Result = 1.0);
function Tanh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Tanh (Float_Type)
-- This function shall return the hyperbolic tangent of <X>.
Post => Tanh'Result in -1.0 .. 1.0
and then (if X = 0.0 then Tanh'Result = 0.0);
function Coth (X : Float_Type'Base) return Float_Type'Base with
-- @llr Coth (Float_Type)
-- This function shall return the hyperbolic cotangent of <X>.
Post => abs Coth'Result >= 1.0;
function Arcsinh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Arcsinh (Float_Type)
-- This function shall return the inverse hyperbolic sine of <X>.
Post => (if X = 0.0 then Arcsinh'Result = 0.0);
function Arccosh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Arccosh (Float_Type)
-- This function shall return the inverse hyperbolic cosine of <X>.
Post => Arccosh'Result >= 0.0
and then (if X = 1.0 then Arccosh'Result = 0.0);
function Arctanh (X : Float_Type'Base) return Float_Type'Base with
-- @llr Arctanh (Float_Type)
-- This function shall return the inverse hyperbolic tangent of <X>.
Post => (if X = 0.0 then Arctanh'Result = 0.0);
function Arccoth (X : Float_Type'Base) return Float_Type'Base;
-- @llr Arccoth (Float_Type)
-- This function shall return the inverse hyperbolic cotangent of <X>.
private
pragma Assert
(Float_Type'Machine_Radix = 2,
"only binary floating-point types supported");
-- Why not Compile_Time_Error??? here
end Ada.Numerics.Generic_Elementary_Functions;
|
ohenley/ada-util | Ada | 2,442 | ads | -----------------------------------------------------------------------
-- util-commands-consoles-text -- Text console interface
-- Copyright (C) 2014, 2017, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Text_IO;
generic
package Util.Commands.Consoles.Text is
type Console_Type is new Util.Commands.Consoles.Console_Type with private;
-- Report an error message.
overriding
procedure Error (Console : in out Console_Type;
Message : in String);
-- Report a notice message.
overriding
procedure Notice (Console : in out Console_Type;
Kind : in Notice_Type;
Message : in String);
-- Print the field value for the given field.
overriding
procedure Print_Field (Console : in out Console_Type;
Field : in Field_Type;
Value : in String;
Justify : in Justify_Type := J_LEFT);
-- Print the title for the given field.
overriding
procedure Print_Title (Console : in out Console_Type;
Field : in Field_Type;
Title : in String);
-- Start a new title in a report.
overriding
procedure Start_Title (Console : in out Console_Type);
-- Finish a new title in a report.
procedure End_Title (Console : in out Console_Type);
-- Start a new row in a report.
overriding
procedure Start_Row (Console : in out Console_Type);
-- Finish a new row in a report.
overriding
procedure End_Row (Console : in out Console_Type);
private
type Console_Type is new Util.Commands.Consoles.Console_Type with record
File : Ada.Text_IO.File_Type;
end record;
end Util.Commands.Consoles.Text;
|
reznikmm/spawn | Ada | 527 | ads | --
-- Copyright (C) 2018-2019, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
with Ada.Containers.Indefinite_Vectors;
package Spawn.String_Vectors is
pragma Preelaborate;
package Vectors is new Ada.Containers.Indefinite_Vectors
(Index_Type => Positive,
Element_Type => UTF_8_String);
type UTF_8_String_Vector is new Vectors.Vector with null record;
Empty_Vector : constant UTF_8_String_Vector :=
(Vectors.Empty_Vector with null record);
end Spawn.String_Vectors;
|
AdaCore/libadalang | Ada | 1,211 | ads | -- Test name resolution on various CallExpr nodes. In particular, this tests
-- the filtering of subprogram specifications depending on the arguments
-- provided to the CallExpr.
pragma Config (Display_Slocs => True);
package Foo is
type Integer is range 1 .. 100;
type String is array (Positive range <>) of Character;
procedure Proc (I : Integer);
procedure Proc (I, J : Integer);
package Pack is
procedure Proc;
procedure Proc (I : Integer);
procedure Proc (S : String);
package Local is
pragma Section ("Local");
pragma Test (Proc);
pragma Test (Proc (1));
pragma Test (Proc (S => "foo"));
pragma Test (Foo.Pack.Proc (I => 1));
end Local;
package Global is
pragma Section ("Global");
pragma Test (Proc (1, 2));
pragma Test (Foo.Proc (1));
end Global;
package None is
pragma Section ("None");
pragma Test (Proc (1, 2, 3));
pragma Test (Foo.Pack.Proc (1));
end Bar;
end Pack;
package No_Local is
pragma Section ("No_Local");
pragma Test (Proc);
pragma Test (Proc (S => "foo"));
end No_Local;
end Foo;
|
reznikmm/matreshka | Ada | 3,591 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.UML.Images.Hash is
new AMF.Elements.Generic_Hash (UML_Image, UML_Image_Access);
|
LionelDraghi/smk | Ada | 4,649 | adb | with File_Utilities; use File_Utilities;
with Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
procedure Test_File_Utilities is
Failure_Count : Natural := 0;
Check_Idx : Positive := 1;
-- --------------------------------------------------------------------------
procedure New_Test (Title : String) is
begin
New_Line;
Put_Line ("## " & Title);
New_Line;
end New_Test;
-- --------------------------------------------------------------------------
procedure Check (Title : String;
Result : String;
Expected : String) is
Tmp : constant String := Positive'Image (Check_Idx);
Idx : constant String := Tmp (2 .. Tmp'Last);
begin
New_Line;
Put_Line (Idx & ". " & Title);
Put_Line ("Expected :");
Put_Line ("""" & Expected & """");
if Result = Expected then
Put_Line ("OK");
else
Put_Line ("**Failed**, got """ & Result & """");
Failure_Count := Failure_Count + 1;
end if;
Check_Idx := Check_Idx + 1;
end Check;
begin
New_Line;
Put_Line ("# File_Utilities unit tests");
New_Line;
-- --------------------------------------------------------------------------
New_Test ("Short_Path");
Check (Title => "Subdir with default Prefix",
Result => Short_Path
(From_Dir => "/home/tests",
To_File => "/home/tests/mysite/site/d1/idx.txt"),
Expected => "mysite/site/d1/idx.txt");
Check (Title => "Dir with final /",
Result => Short_Path
(From_Dir => "/home/tests/",
To_File => "/home/tests/mysite/site/d1/idx.txt"),
Expected => "mysite/site/d1/idx.txt");
Check (Title => "subdir with Prefix",
Result => Short_Path
(From_Dir => "/home/tests",
To_File => "/home/tests/mysite/site/d1/idx.txt",
Prefix => "." & Separator),
Expected => "./mysite/site/d1/idx.txt");
Check (Title => "Sibling subdir",
Result => Short_Path
(From_Dir => "/home/tests/12/34",
To_File => "/home/tests/mysite/site/d1/idx.txt"),
Expected => "../../mysite/site/d1/idx.txt");
Check (Title => "Parent dir",
Result => Short_Path
(From_Dir => "/home/tests/12/34",
To_File => "/home/tests/idx.txt"),
Expected => "../../idx.txt");
Check (Title => "Other Prefix",
Result => Short_Path
(From_Dir => "/home/tests/12/",
To_File => "/home/tests/mysite/site/d1/idx.txt",
Prefix => "$PWD/"),
Expected => "$PWD/../mysite/site/d1/idx.txt");
Check (Title => "Root dir",
Result => Short_Path
(From_Dir => "/",
To_File => "/home/tests/mysite/site/d1/idx.txt"),
Expected => "/home/tests/mysite/site/d1/idx.txt");
Check (Title => "File is over dir",
Result => Short_Path
(From_Dir => "/home/tests/mysite/site/d1",
To_File => "/home/readme.txt"),
Expected => "../../../../readme.txt");
Check (Title => "File is over Dir, Dir with final /",
Result => Short_Path
(From_Dir => "/home/tests/mysite/site/d1/",
To_File => "/home/readme.txt"),
Expected => "../../../../readme.txt");
Check (Title => "File is the current dir",
Result => Short_Path
(From_Dir => "/home/tests/",
To_File => "/home/tests"),
Expected => "./");
Check (Title => "File is over Dir, Dir and File with final /",
Result => Short_Path
(From_Dir => "/home/tests/",
To_File => "/home/tests/"),
Expected => "./");
Check (Title => "No common part",
Result => Short_Path
(From_Dir => "/home/toto/src/tests/",
To_File => "/opt/GNAT/2018/lib64/libgcc_s.so"),
Expected => "/opt/GNAT/2018/lib64/libgcc_s.so");
-- --------------------------------------------------------------------------
New_Line;
if Failure_Count /= 0 then
Put_Line (Natural'Image (Failure_Count)
& " tests fails [Failed](tests_status.md#failed)");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
else
Put_Line ("All tests OK [Successful](tests_status.md#successful)");
end if;
end Test_File_Utilities;
|
reznikmm/matreshka | Ada | 3,793 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.Constants;
package body Matreshka.ODF_Attributes.Style.Font_Name_Complex is
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Style_Font_Name_Complex_Node)
return League.Strings.Universal_String is
begin
return ODF.Constants.Font_Name_Complex_Name;
end Get_Local_Name;
end Matreshka.ODF_Attributes.Style.Font_Name_Complex;
|
PThierry/ewok-kernel | Ada | 1,464 | ads | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with system; use system;
package m4.layout
with spark_mode => on
is
--------------------
-- Base addresses --
--------------------
SCB_BASE : constant address := system'to_address (16#E000_E008#);
SYS_TIMER_BASE : constant address := system'to_address (16#E000_E010#);
NVIC_BASE : constant address := system'to_address (16#E000_E100#);
SCB_BASE2 : constant address := system'to_address (16#E000_ED00#);
MPU_BASE : constant address := system'to_address (16#E000_ED90#);
NVIC_BASE2 : constant address := system'to_address (16#E000_EF00#);
FPU_BASE : constant address := system'to_address (16#E000_EF30#);
end m4.layout;
|
jrmarino/zstd-ada | Ada | 15,646 | ads | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with System;
with Interfaces.C.Strings;
package Zstandard.Thin_Binding is
package IC renames Interfaces.C;
package ICS renames Interfaces.C.Strings;
------------------
-- Data Types --
------------------
type Zstd_uint64 is mod 2 ** 64;
type Zstd_uint32 is mod 2 ** 32;
type ZSTD_CCtx_ptr is new System.Address;
type ZSTD_DCtx_ptr is new System.Address;
type ZSTD_CDict_ptr is new System.Address;
type ZSTD_DDict_ptr is new System.Address;
------------------
-- Constants --
------------------
Null_CDict_pointer : constant ZSTD_CDict_ptr := ZSTD_CDict_ptr (System.Null_Address);
Null_DDict_pointer : constant ZSTD_DDict_ptr := ZSTD_DDict_ptr (System.Null_Address);
---------------
-- Version --
---------------
function ZSTD_versionNumber return IC.unsigned;
pragma Import (C, ZSTD_versionNumber, "ZSTD_versionNumber");
------------------------
-- Helper functions --
------------------------
-- tells if a `size_t` function result is an error code
function ZSTD_isError (code : IC.size_t) return IC.unsigned;
pragma Import (C, ZSTD_isError, "ZSTD_isError");
-- provides readable string for an error code
function ZSTD_getErrorName (code : IC.size_t) return ICS.chars_ptr;
pragma Import (C, ZSTD_getErrorName, "ZSTD_getErrorName");
-- maximum compressed size (worst case scenario)
function ZSTD_compressBound (srcSize : IC.size_t) return IC.size_t;
pragma Import (C, ZSTD_compressBound, "ZSTD_compressBound");
-- maximum compression level available
function ZSTD_maxCLevel return IC.int;
pragma Import (C, ZSTD_maxCLevel, "ZSTD_maxCLevel");
------------------------
-- Simple functions --
------------------------
-- Compresses `src` buffer into already allocated `dst`.
-- Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`.
-- @return : the number of bytes written into `dst` (<= `dstCapacity),
-- or an error code if it fails (which can be tested using ZSTD_isError())
function ZSTD_compress
(dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
compressionLevel : IC.int) return IC.size_t;
pragma Import (C, ZSTD_compress, "ZSTD_compress");
-- @return : decompressed size as a 64-bits value _if known_, 0 otherwise.
-- note 1 : decompressed size can be very large (64-bits value),
-- potentially larger than what local system can handle as a single memory segment.
-- In which case, it's necessary to use streaming mode to decompress data.
-- note 2 : decompressed size is an optional field, that may not be present.
-- When `return==0`, consider data to decompress could have any size.
-- In which case, it's necessary to use streaming mode to decompress data,
-- or rely on application's implied limits.
-- (e.g., it may know that its own data is necessarily cut into blocks <= 16 KB).
-- note 3 : decompressed size could be wrong or intentionally modified !
-- Always ensure result fits within application's authorized limits !
-- Each application can have its own set of conditions.
-- If the intention is to decompress public data compressed by zstd command line
-- utility, it is recommended to support at least 8 MB for extended compatibility.
-- note 4 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameParams()
-- to know more.
function ZSTD_getDecompressedSize
(src : ICS.chars_ptr;
srcSize : IC.size_t) return Zstd_uint64;
pragma Import (C, ZSTD_getDecompressedSize, "ZSTD_getDecompressedSize");
-- `compressedSize` : is the _exact_ size of compressed input, else decompression will fail.
-- `dstCapacity` must be equal or larger than originalSize (see ZSTD_getDecompressedSize() ).
-- If originalSize is unknown, and if there is no implied application-specific limitations,
-- it's necessary to use streaming mode to decompress data.
-- @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
-- or an errorCode if it fails (which can be tested using ZSTD_isError())
function ZSTD_decompress
(dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; compressedSize : IC.size_t) return IC.size_t;
pragma Import (C, ZSTD_decompress, "ZSTD_decompress");
-----------------------------
-- Simple dictionary API --
-----------------------------
-- Compression using a predefined Dictionary (see dictBuilder/zdict.h).
-- Note : This function load the dictionary, resulting in a significant startup time.
function ZSTD_compress_usingDict
(ctx : ZSTD_CCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
dict : ICS.chars_ptr; dictSize : IC.size_t;
compressionLevel : IC.int) return IC.size_t;
pragma Import (C, ZSTD_compress_usingDict, "ZSTD_compress_usingDict");
-- Decompression using a predefined Dictionary (see dictBuilder/zdict.h).
-- Dictionary must be identical to the one used during compression.
-- Note : This function load the dictionary, resulting in a significant startup time
function ZSTD_decompress_usingDict
(dctx : ZSTD_DCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
dict : ICS.chars_ptr; dictSize : IC.size_t) return IC.size_t;
pragma Import (C, ZSTD_decompress_usingDict, "ZSTD_decompress_usingDict");
---------------------------
-- Fast Dictionary API --
---------------------------
-- Create a digested dictionary, ready to start compression operation without startup delay.
-- `dict` can be released after creation
function ZSTD_createCDict
(dict : ICS.chars_ptr; dictSize : IC.size_t;
compressionLevel : IC.int) return ZSTD_CDict_ptr;
pragma Import (C, ZSTD_createCDict, "ZSTD_createCDict");
function ZSTD_freeCDict (CDict : ZSTD_CDict_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeCDict, "ZSTD_freeCDict");
-- Compression using a pre-digested Dictionary.
-- Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is
-- used multiple times. Note that compression level is decided during dictionary creation.
function ZSTD_compress_usingCDict
(ctx : ZSTD_CCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
CDict : ZSTD_CDict_ptr) return IC.size_t;
pragma Import (C, ZSTD_compress_usingCDict, "ZSTD_compress_usingCDict");
-- Create a digested dictionary, ready to start decompression operation without startup delay.
-- `dict` can be released after creation
function ZSTD_createDDict (dict : ICS.chars_ptr; dictSize : IC.size_t) return ZSTD_DDict_ptr;
pragma Import (C, ZSTD_createDDict, "ZSTD_createDDict");
function ZSTD_freeDDict (ddict : ZSTD_DDict_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeDDict, "ZSTD_freeDDict");
-- Decompression using a digested Dictionary
-- Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is
-- used multiple times.
function ZSTD_decompress_usingDDict
(dctx : ZSTD_DCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
ddict : ZSTD_DDict_ptr) return IC.size_t;
pragma Import (C, ZSTD_decompress_usingDDict, "ZSTD_decompress_usingDDict");
----------------------------------
-- Explicit memory management --
----------------------------------
-- Compression context
function ZSTD_createCCtx return ZSTD_CCtx_ptr;
pragma Import (C, ZSTD_createCCtx, "ZSTD_createCCtx");
function ZSTD_freeCCtx (cctx : ZSTD_CCtx_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeCCtx, "ZSTD_freeCCtx");
-- Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx())
function ZSTD_compressCCtx
(ctx : ZSTD_CCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t;
compressionLevel : IC.int) return IC.size_t;
pragma Import (C, ZSTD_compressCCtx, "ZSTD_compressCCtx");
-- Decompression context
function ZSTD_createDCtx return ZSTD_DCtx_ptr;
pragma Import (C, ZSTD_createDCtx, "ZSTD_createDCtx");
function ZSTD_freeDCtx (dctx : ZSTD_DCtx_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeDCtx, "ZSTD_freeDCtx");
-- Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx())
function ZSTD_decompressDCtx
(ctx : ZSTD_DCtx_ptr;
dst : ICS.chars_ptr; dstCapacity : IC.size_t;
src : ICS.chars_ptr; srcSize : IC.size_t) return IC.size_t;
pragma Import (C, ZSTD_decompressDCtx, "ZSTD_decompressDCtx");
---------------------------
-- Streaming Data Types --
----------------------------
type ZSTD_CStream_ptr is new System.Address;
type ZSTD_DStream_ptr is new System.Address;
Null_CStream_pointer : constant ZSTD_CStream_ptr := ZSTD_CStream_ptr (System.Null_Address);
Null_DStream_pointer : constant ZSTD_DStream_ptr := ZSTD_DStream_ptr (System.Null_Address);
-- *src <start of input buffer>
-- size <size of input buffer>
-- pos <position where reading stopped. Will be updated. Necessarily 0 <= pos <= size>
type ZSTD_inBuffer_s is record
src : ICS.chars_ptr;
size : IC.size_t;
pos : IC.size_t;
end record;
-- *dst <start of output buffer>
-- size <size of output buffer>
-- pos <position where reading stopped. Will be updated. Necessarily 0 <= pos <= size>
type ZSTD_outBuffer_s is record
dst : ICS.chars_ptr;
size : IC.size_t;
pos : IC.size_t;
end record;
type ZSTD_inBuffer_s_Access is access all ZSTD_inBuffer_s;
pragma Convention (C, ZSTD_inBuffer_s_Access);
type ZSTD_outBuffer_s_Access is access all ZSTD_outBuffer_s;
pragma Convention (C, ZSTD_outBuffer_s_Access);
-----------------------------
-- Streaming Compression --
-----------------------------
-- A ZSTD_CStream object is required to track streaming operation.
-- Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
-- ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
function ZSTD_createCStream return ZSTD_CStream_ptr;
pragma Import (C, ZSTD_createCStream, "ZSTD_createCStream");
function ZSTD_freeCStream (zcs : ZSTD_CStream_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeCStream, "ZSTD_freeCStream");
-- Start by initializing ZSTD_CStream.
-- Use ZSTD_initCStream() to start a new compression operation.
function ZSTD_initCStream
(zcs : ZSTD_CStream_ptr;
compressionLevel : IC.int) return IC.size_t;
pragma Import (C, ZSTD_initCStream, "ZSTD_initCStream");
-- Use ZSTD_compressStream() repetitively to consume input stream.
-- The function will automatically update both `pos`.
-- Note that it may not consume the entire input, in which case `pos < size`,
-- and it's up to the caller to present again remaining data.
-- @return : a size hint, preferred nb of bytes to use as input for next function call
-- (it's just a hint, to help latency a little, any other value will work fine)
-- (note : the size hint is guaranteed to be <= ZSTD_CStreamInSize() )
-- or an error code, which can be tested using ZSTD_isError().
-- recommended size for input buffer
function ZSTD_CStreamInSize return IC.size_t;
pragma Import (C, ZSTD_CStreamInSize, "ZSTD_CStreamInSize");
-- recommended size for output buffer
function ZSTD_CStreamOutSize return IC.size_t;
pragma Import (C, ZSTD_CStreamOutSize, "ZSTD_CStreamOutSize");
function ZSTD_compressStream
(zcs : ZSTD_CStream_ptr;
output : ZSTD_outBuffer_s_Access;
input : ZSTD_inBuffer_s_Access) return IC.size_t;
pragma Import (C, ZSTD_compressStream, "ZSTD_compressStream");
-- At any moment, it's possible to flush whatever data remains within buffer,
-- using ZSTD_flushStream(). `output->pos` will be updated.
-- Note some content might still be left within internal buffer if `output->size` is too small.
-- @return : nb of bytes still present within internal buffer (0 if it's empty)
-- or an error code, which can be tested using ZSTD_isError().
function ZSTD_flushStream
(zcs : ZSTD_CStream_ptr;
output : ZSTD_outBuffer_s_Access) return IC.size_t;
pragma Import (C, ZSTD_flushStream, "ZSTD_flushStream");
-- ZSTD_endStream() instructs to finish a frame.
-- It will perform a flush and write frame epilogue.
-- The epilogue is required for decoders to consider a frame completed.
-- Similar to ZSTD_flushStream(), it may not be able to flush the full content if
-- `output->size` is too small so call again ZSTD_endStream() to complete the flush.
-- @return : nb of bytes still present within internal buffer (0 if it's empty)
-- or an error code, which can be tested using ZSTD_isError().
function ZSTD_endStream
(zcs : ZSTD_CStream_ptr;
output : ZSTD_outBuffer_s_Access) return IC.size_t;
pragma Import (C, ZSTD_endStream, "ZSTD_endStream");
-------------------------------
-- Streaming Decompression --
-------------------------------
-- A ZSTD_DStream object is required to track streaming operations.
-- Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
-- ZSTD_DStream objects can be re-used multiple times.
function ZSTD_createDStream return ZSTD_DStream_ptr;
pragma Import (C, ZSTD_createDStream, "ZSTD_createDStream");
function ZSTD_freeDStream (zds : ZSTD_DStream_ptr) return IC.size_t;
pragma Import (C, ZSTD_freeDStream, "ZSTD_freeDStream");
-- Use ZSTD_initDStream() to start a new decompression operation,
function ZSTD_initDStream (zds : ZSTD_DStream_ptr) return IC.size_t;
pragma Import (C, ZSTD_initDStream, "ZSTD_initDStream");
-- Use ZSTD_decompressStream() repetitively to consume your input.
-- The function will update both `pos`.
-- Note that it may not consume the entire input (pos < size),
-- in which case it's up to the caller to present remaining input again.
-- @return : 0 when a frame is completely decoded and fully flushed,
-- 1 when there is still some data left within internal buffer to flush,
-- >1 when more data is expected, with value being a suggested next input size
-- (it's just a hint, which helps latency, any size is accepted),
-- or an error code, which can be tested using ZSTD_isError().
function ZSTD_DStreamInSize return IC.size_t;
pragma Import (C, ZSTD_DStreamInSize, "ZSTD_DStreamInSize");
function ZSTD_DStreamOutSize return IC.size_t;
pragma Import (C, ZSTD_DStreamOutSize, "ZSTD_DStreamOutSize");
function ZSTD_decompressStream
(zds : ZSTD_DStream_ptr;
output : ZSTD_outBuffer_s_Access;
input : ZSTD_inBuffer_s_Access) return IC.size_t;
pragma Import (C, ZSTD_decompressStream, "ZSTD_decompressStream");
end Zstandard.Thin_Binding;
|
tum-ei-rcs/StratoX | Ada | 38 | ads | ../../../../software/lib/mystrings.ads |
AdaCore/training_material | Ada | 572 | ads | package Pixels is
Pixel_Bits : constant Positive := 8;
type Pixel_Component_T
-- TODO: Declare integer 0 to 2^(Pixel_Bits)
is new Integer;
type Pixel_T is record
-- TODO: At least R, G, B pixel components
-- replace those dummy variables with the proper name and type
DUMMY1, DUMMY2, DUMMY3, DUMMY4 : Integer;
end record;
function "+" (A, B : Pixel_T) return Pixel_T;
function Luminosity (P : Pixel_T) return Pixel_Component_T;
-- Returns the pixel luminosity as the mean of its components
end Pixels;
|
charlie5/lace | Ada | 12,321 | ads | with
physics.Joint.DoF6,
physics.Joint.cone_twist,
physics.Joint.slider,
physics.Joint.hinge,
physics.Joint.ball,
physics.Object,
box2d_C.Pointers,
lace.Any;
package box2d_Physics.Joint
--
-- Provides glue between a physics joint and a Box2D joint.
--
is
type Item is abstract limited new physics.Joint.item with -- TODO: Make private.
record
C : box2d_c.Pointers.Joint_Pointer;
user_Data : access lace.Any.limited_item'Class;
end record;
type View is access all Item'Class;
use Math;
function new_Dof6_Joint (Object_A, Object_B : in physics.Object.view;
Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.DoF6.view;
function new_ball_Joint (Object_A, Object_B : in physics.Object.view;
Pivot_in_A, Pivot_in_B : in Vector_3) return physics.Joint.ball.view;
function new_slider_Joint (Object_A, Object_B : in physics.Object.view;
Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.slider.view;
function new_cone_twist_Joint (Object_A, Object_B : in physics.Object.view;
Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.cone_twist.view;
function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A, Object_B : in physics.Object.view;
Anchor_in_A, Anchor_in_B : in Vector_3;
low_Limit, high_Limit : in math.Real;
collide_Conected : in Boolean) return physics.Joint.hinge.view;
function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A, Object_B : in physics.Object.view;
Frame_A, Frame_B : in Matrix_4x4;
low_Limit, high_Limit : in math.Real;
collide_Conected : in Boolean) return physics.Joint.hinge.view;
function new_hinge_Joint (Object_A : in physics.Object.view;
Frame_A : in Matrix_4x4) return physics.Joint.hinge.view;
procedure free (the_Joint : in out physics.Joint.view);
-- procedure set_b2d_user_Data (Self : in View);
private
overriding
function reaction_Force (Self : in Item) return Vector_3;
overriding
function reaction_Torque (Self : in Item) return Real;
overriding
procedure user_Data_is (Self : in out Item; Now : access lace.Any.limited_Item'Class);
overriding
function user_Data (Self : in Item) return access lace.Any.limited_Item'Class;
use physics.Joint;
--------
-- DoF6
--
type DoF6 is new Item
and physics.Joint.DoF6.item with
record
null;
end record;
type DoF6_view is access DoF6;
overriding
procedure destruct (Self : in out DoF6);
overriding
function Object_A (Self : in DoF6) return physics.Object.view;
overriding
function Object_B (Self : in DoF6) return physics.Object.view;
overriding
function Frame_A (Self : in DoF6) return Matrix_4x4;
overriding
function Frame_B (Self : in DoF6) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out DoF6; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out DoF6; Now : in Matrix_4x4);
overriding
function is_Limited (Self : in DoF6; DoF : Degree_of_freedom) return Boolean;
overriding
procedure Velocity_is (Self : in out DoF6; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function Extent (Self : in DoF6; DoF : in Degree_of_freedom) return Real;
overriding
procedure desired_Extent_is (Self : in out DoF6; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function lower_Limit (Self : in DoF6; DoF : in Degree_of_freedom) return Real;
overriding
function upper_Limit (Self : in DoF6; DoF : in Degree_of_freedom) return Real;
overriding
procedure lower_Limit_is (Self : in out DoF6; Now : in Real;
DoF : in Degree_of_freedom);
overriding
procedure upper_Limit_is (Self : in out DoF6; Now : in Real;
DoF : in Degree_of_freedom);
----------
-- Slider
--
type Slider is new Item
and physics.Joint.Slider.item with
record
null;
end record;
type Slider_view is access Slider;
overriding
procedure destruct (Self : in out Slider);
overriding
function Object_A (Self : in Slider) return physics.Object.view;
overriding
function Object_B (Self : in Slider) return physics.Object.view;
overriding
function Frame_A (Self : in Slider) return Matrix_4x4;
overriding
function Frame_B (Self : in Slider) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out Slider; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out Slider; Now : in Matrix_4x4);
overriding
function is_Limited (Self : in Slider; DoF : Degree_of_freedom) return Boolean;
overriding
procedure Velocity_is (Self : in out Slider; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function Extent (Self : in Slider; DoF : in Degree_of_freedom) return Real;
overriding
procedure desired_Extent_is (Self : in out Slider; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function lower_Limit (Self : in Slider; DoF : in Degree_of_freedom) return Real;
overriding
function upper_Limit (Self : in Slider; DoF : in Degree_of_freedom) return Real;
overriding
procedure lower_Limit_is (Self : in out Slider; Now : in Real;
DoF : in Degree_of_freedom);
overriding
procedure upper_Limit_is (Self : in out Slider; Now : in Real;
DoF : in Degree_of_freedom);
--------------
-- cone_Twist
--
type cone_Twist is new Item
and physics.Joint.cone_Twist.item with
record
null;
end record;
type cone_Twist_view is access cone_Twist;
overriding
procedure destruct (Self : in out cone_Twist);
overriding
function Object_A (Self : in cone_Twist) return physics.Object.view;
overriding
function Object_B (Self : in cone_Twist) return physics.Object.view;
overriding
function Frame_A (Self : in cone_Twist) return Matrix_4x4;
overriding
function Frame_B (Self : in cone_Twist) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out cone_Twist; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out cone_Twist; Now : in Matrix_4x4);
overriding
function is_Limited (Self : in cone_Twist; DoF : Degree_of_freedom) return Boolean;
overriding
procedure Velocity_is (Self : in out cone_Twist; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function Extent (Self : in cone_Twist; DoF : in Degree_of_freedom) return Real;
overriding
procedure desired_Extent_is (Self : in out cone_Twist; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function lower_Limit (Self : in cone_Twist; DoF : in Degree_of_freedom) return Real;
overriding
function upper_Limit (Self : in cone_Twist; DoF : in Degree_of_freedom) return Real;
overriding
procedure lower_Limit_is (Self : in out cone_Twist; Now : in Real;
DoF : in Degree_of_freedom);
overriding
procedure upper_Limit_is (Self : in out cone_Twist; Now : in Real;
DoF : in Degree_of_freedom);
--------
-- Ball
--
type Ball is new Item
and physics.Joint.Ball.item with
record
null;
end record;
type Ball_view is access Ball;
overriding
procedure destruct (Self : in out Ball);
overriding
function Object_A (Self : in Ball) return physics.Object.view;
overriding
function Object_B (Self : in Ball) return physics.Object.view;
overriding
function Frame_A (Self : in Ball) return Matrix_4x4;
overriding
function Frame_B (Self : in Ball) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out Ball; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out Ball; Now : in Matrix_4x4);
overriding
function is_Limited (Self : in Ball; DoF : Degree_of_freedom) return Boolean;
overriding
procedure Velocity_is (Self : in out Ball; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function Extent (Self : in Ball; DoF : in Degree_of_freedom) return Real;
overriding
procedure desired_Extent_is (Self : in out Ball; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function lower_Limit (Self : in Ball; DoF : in Degree_of_freedom) return Real;
overriding
function upper_Limit (Self : in Ball; DoF : in Degree_of_freedom) return Real;
overriding
procedure lower_Limit_is (Self : in out Ball; Now : in Real;
DoF : in Degree_of_freedom);
overriding
procedure upper_Limit_is (Self : in out Ball; Now : in Real;
DoF : in Degree_of_freedom);
---------
-- Hinge
--
type Hinge is new Item
and physics.Joint.hinge.item with
record
null;
end record;
type Hinge_view is access Hinge;
overriding
procedure destruct (Self : in out Hinge);
overriding
function Object_A (Self : in Hinge) return physics.Object.view;
overriding
function Object_B (Self : in Hinge) return physics.Object.view;
overriding
function Frame_A (Self : in Hinge) return Matrix_4x4;
overriding
function Frame_B (Self : in Hinge) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out Hinge; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out Hinge; Now : in Matrix_4x4);
overriding
function is_Limited (Self : in Hinge; DoF : Degree_of_freedom) return Boolean;
overriding
procedure Velocity_is (Self : in out Hinge; Now : in Real;
DoF : in Degree_of_freedom);
overriding
function Extent (Self : in Hinge; DoF : in Degree_of_freedom) return Real;
overriding
procedure desired_Extent_is (Self : in out Hinge; Now : in Real;
DoF : in Degree_of_freedom);
overriding
procedure Limits_are (Self : in out Hinge; Low, High : in Real;
Softness : in Real := 0.9;
biasFactor : in Real := 0.3;
relaxationFactor : in Real := 1.0);
overriding
function lower_Limit (Self : in Hinge) return Real;
overriding
function upper_Limit (Self : in Hinge) return Real;
overriding
function Angle (Self : in Hinge) return Real;
end box2d_Physics.Joint;
|
io7m/coreland-openal-ada | Ada | 1,904 | adb | with Test;
with OpenAL.Context;
with OpenAL.Context.Error;
procedure init_001 is
package ALC renames OpenAL.Context;
package ALC_Error renames OpenAL.Context.Error;
Device : ALC.Device_t;
Context : ALC.Context_t;
Current_OK : Boolean;
TC : Test.Context_t;
use type ALC.Device_t;
use type ALC.Context_t;
use type ALC_Error.Error_t;
begin
Test.Initialize
(Test_Context => TC,
Program => "init_001",
Test_DB => "TEST_DB",
Test_Results => "TEST_RESULTS");
Device := ALC.Open_Default_Device;
Test.Check (TC, 1, Device /= ALC.Invalid_Device, "Device /= ALC.Invalid_Device");
Test.Check (TC, 2, ALC_Error.Get_Error (Device) = ALC_Error.No_Error,
"ALC_Error.Get_Error (Device) = ALC_Error.No_Error");
pragma Assert (Device /= ALC.Invalid_Device);
Context := ALC.Create_Context (Device);
Test.Check (TC, 3, Context /= ALC.Invalid_Context, "Context /= ALC.Invalid_Context");
Test.Check (TC, 4, ALC_Error.Get_Error (Device) = ALC_Error.No_Error,
"ALC_Error.Get_Error (Device) = ALC_Error.No_Error");
pragma Assert (Context /= ALC.Invalid_Context);
Current_OK := ALC.Make_Context_Current (Context);
Test.Check (TC, 5, Current_OK, "Current_OK");
Test.Check (TC, 6, ALC_Error.Get_Error (Device) = ALC_Error.No_Error,
"ALC_Error.Get_Error (Device) = ALC_Error.No_Error");
Current_OK := ALC.Make_Context_Current (ALC.Null_Context);
Test.Check (TC, 7, Current_OK, "Current_OK");
Test.Check (TC, 8, ALC_Error.Get_Error (Device) = ALC_Error.No_Error,
"ALC_Error.Get_Error (Device) = ALC_Error.No_Error");
ALC.Destroy_Context (Context);
Test.Check (TC, 9, ALC_Error.Get_Error (Device) = ALC_Error.No_Error,
"ALC_Error.Get_Error (Device) = ALC_Error.No_Error");
ALC.Close_Device (Device);
Test.Check (TC, 10, Device = ALC.Invalid_Device,
"Device = ALC.Invalid_Device");
end init_001;
|
AdaCore/training_material | Ada | 410 | adb | --::::::::::
--diners.adb
--::::::::::
with Text_IO;
with Room;
procedure Diners is
-- Dining Philosophers - Ada 95 edition
-- This is the main program, responsible only for telling the
-- Maitre_D to get busy.
-- Michael B. Feldman, The George Washington University,
-- July, 1995.
begin
--Text_IO.New_Line; -- artifice to flush output buffer
Room.Maitre_D.Start_Serving;
end Diners;
|
reznikmm/matreshka | Ada | 4,259 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Nodes;
with XML.DOM.Attributes.Internals;
package body ODF.DOM.Attributes.FO.Margin_Bottom.Internals is
------------
-- Create --
------------
function Create
(Node : Matreshka.ODF_Attributes.FO.Margin_Bottom.FO_Margin_Bottom_Access)
return ODF.DOM.Attributes.FO.Margin_Bottom.ODF_FO_Margin_Bottom is
begin
return
(XML.DOM.Attributes.Internals.Create
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Create;
----------
-- Wrap --
----------
function Wrap
(Node : Matreshka.ODF_Attributes.FO.Margin_Bottom.FO_Margin_Bottom_Access)
return ODF.DOM.Attributes.FO.Margin_Bottom.ODF_FO_Margin_Bottom is
begin
return
(XML.DOM.Attributes.Internals.Wrap
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Wrap;
end ODF.DOM.Attributes.FO.Margin_Bottom.Internals;
|
apple-oss-distributions/old_ncurses | Ada | 5,742 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Rain --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet <[email protected]> 1997 (modified by J.Pfeifer)
-- Version Control
-- $Revision: 1.1.1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --
with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random;
with Status; use Status;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
procedure Rain is
Visibility : Cursor_Visibility;
subtype X_Position is Line_Position;
subtype Y_Position is Column_Position;
Xpos : array (1 .. 5) of X_Position;
Ypos : array (1 .. 5) of Y_Position;
N : Integer;
G : Generator;
Max_X, X : X_Position;
Max_Y, Y : Y_Position;
procedure Next (J : in out Integer);
procedure Cursor (X : X_Position; Y : Y_Position);
procedure Next (J : in out Integer) is
begin
if J = 5 then
J := 1;
else
J := J + 1;
end if;
end Next;
procedure Cursor (X : X_Position; Y : Y_Position) is
begin
Move_Cursor (Line => X, Column => Y);
end Cursor;
pragma Inline (Cursor);
begin
Init_Screen;
Set_NL_Mode;
Set_Echo_Mode (False);
Visibility := Invisible;
Set_Cursor_Visibility (Visibility);
Max_X := Lines - 5;
Max_Y := Columns - 5;
for I in Xpos'Range loop
Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2;
Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2;
end loop;
N := 1;
while Process.Continue loop
X := X_Position (Float (Max_X) * Random (G)) + 2;
Y := Y_Position (Float (Max_Y) * Random (G)) + 2;
Cursor (X, Y);
Add (Ch => '.');
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'o');
--
Next (N);
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'O');
--
Next (N);
Cursor (Xpos (N) - 1, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N), Ypos (N) - 1);
Add (Str => "|.|");
Cursor (Xpos (N) + 1, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => "/\\");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => "| O |");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => "\\/");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => ' ');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => " ");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => ' ');
Xpos (N) := X;
Ypos (N) := Y;
Refresh;
Nap_Milli_Seconds (50);
end loop;
Visibility := Normal;
Set_Cursor_Visibility (Visibility);
End_Windows;
end Rain;
|
NCommander/dnscatcher | Ada | 2,848 | ads | -- Copyright 2019 Michael Casadevall <[email protected]>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with DNSCatcher.DNS.Processor.Packet; use DNSCatcher.DNS.Processor.Packet;
-- @description
--
-- RData processor for A records
--
-- @summary
--
-- Processes an A record into a IPv4 string
--
package DNSCatcher.DNS.Processor.RData.A_Parser is
-- Parsed A RData Representation
type Parsed_A_RData is
new DNSCatcher.DNS.Processor.RData.Parsed_RData with private;
type Parsed_A_RData_Access is access all Parsed_A_RData;
-- Converts a RR record to logicial representation
--
-- @value This
-- Class object
--
-- @value DNS_Header
-- DNS Packet Header
--
-- @value Parsed_RR
-- A parsed Resource Record from Processor.Packet
--
procedure From_Parsed_RR
(This : in out Parsed_A_RData;
DNS_Header : DNS_Packet_Header;
Parsed_RR : Parsed_DNS_Resource_Record);
-- Represents RData as a String for debug logging
--
-- @value This
-- Class object
--
-- @returns
-- An IPv4 String
--
function RData_To_String
(This : in Parsed_A_RData)
return String;
-- Represents the resource record packet as a whole as a string
--
-- @value This
-- Class object
--
-- @returns
-- String in the format of "A *IPv4 String*
--
function Print_Packet
(This : in Parsed_A_RData)
return String;
-- Frees and deallocates the class object
--
-- @value This
-- Class object to deallocate
--
procedure Delete (This : in out Parsed_A_RData);
private
type Parsed_A_RData is new DNSCatcher.DNS.Processor.RData.Parsed_RData with
record
A_Record : Unbounded_String;
end record;
end DNSCatcher.DNS.Processor.RData.A_Parser;
|
AdaDoom3/wayland_ada_binding | Ada | 4,878 | ads | ------------------------------------------------------------------------------
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 3, or (at your option) any later --
-- version. This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
-- This package describes the underlying storage strategy for a vector.
-- There are mostly two such strategies (bounded and unbounded) depending on
-- whether the vector has a maximal number of elements.
pragma Ada_2012;
with Conts.Elements;
generic
with package Elements is new Conts.Elements.Traits (<>);
type Container_Base_Type is abstract tagged limited private;
with package Resize_Policy is new Conts.Vectors.Resize_Strategy (<>);
package Conts.Vectors.Storage.Unbounded with SPARK_Mode is
package Impl with SPARK_Mode is
type Container is abstract new Container_Base_Type with private;
function Max_Capacity (Self : Container'Class) return Count_Type
is (Count_Type'Last - Min_Index + 1) with Inline;
function Capacity (Self : Container'Class) return Count_Type
with Inline;
procedure Release_Element
(Self : in out Container'Class; Index : Count_Type) with Inline;
function Get_Element
(Self : Container'Class;
Index : Count_Type) return Elements.Stored_Type with Inline;
procedure Set_Element
(Self : in out Container'Class;
Index : Count_Type;
Element : Elements.Stored_Type) with Inline;
procedure Copy
(Self : in out Container'Class;
Source : Container'Class;
Source_From, Source_To : Count_Type;
Self_From : Count_Type) with Inline;
procedure Assign
(Self : in out Container'Class;
Source : Container'Class;
Last : Count_Type);
procedure Resize
(Self : in out Container'Class;
New_Size : Count_Type;
Last : Count_Type;
Force : Boolean)
with Pre => New_Size <= Self.Max_Capacity;
procedure Release (Self : in out Container'Class);
private
pragma SPARK_Mode (Off);
type Big_Nodes_Array is
array (Min_Index .. Count_Type'Last) of Elements.Stored_Type;
type Nodes_Array_Access is access Big_Nodes_Array;
for Nodes_Array_Access'Storage_Size use 0;
-- The nodes is a C-compatible pointer so that we can use realloc
type Container is abstract new Container_Base_Type with record
Nodes : Nodes_Array_Access;
Capacity : Count_Type := 0;
-- Last element in Nodes (since Nodes does not contain bounds
-- information).
end record;
function Capacity (Self : Container'Class) return Count_Type
is (Self.Capacity);
function Get_Element
(Self : Container'Class;
Index : Count_Type) return Elements.Stored_Type
is (Self.Nodes (Index));
end Impl;
package Traits is new Conts.Vectors.Storage.Traits
(Elements => Elements,
Container => Impl.Container,
Max_Capacity => Impl.Max_Capacity,
Capacity => Impl.Capacity,
Resize => Impl.Resize,
Release_Element => Impl.Release_Element,
Release => Impl.Release,
Set_Element => Impl.Set_Element,
Get_Element => Impl.Get_Element,
Assign => Impl.Assign,
Copy => Impl.Copy);
end Conts.Vectors.Storage.Unbounded;
|
jrmarino/AdaBase | Ada | 2,220 | adb | with AdaBase;
with CommonText;
with Connect;
with Ada.Text_IO;
with AdaBase.Results.Sets;
with AdaBase.Results.Converters;
procedure Bits is
package CON renames Connect;
package TIO renames Ada.Text_IO;
package ARS renames AdaBase.Results.Sets;
package ARC renames AdaBase.Results.Converters;
package CT renames CommonText;
cmd : constant String := "SELECT bit_type FROM all_types " &
"WHERE id_nbyte3 = 1";
begin
CON.connect_database;
declare
stmt : CON.Stmt_Type := CON.DR.query (sql => cmd);
row : ARS.Datarow;
begin
if stmt.successful then
row := stmt.fetch_next;
TIO.Put_Line ("type : " & row.column (1).native_type'Img);
TIO.Put_Line ("string : " & row.column (1).as_string);
declare
mybits : AdaBase.Results.Bits := row.column (1).as_bits;
mychain : AdaBase.Results.Chain := row.column (1).as_chain;
begin
for x in mybits'Range loop
TIO.Put_Line ("bit " & CT.zeropad (x, 2) & " :" &
mybits (x)'Img);
end loop;
for x in mychain'Range loop
TIO.Put_Line ("chain link" & x'Img & " : " &
CT.zeropad (Natural (mychain (x)), 2));
end loop;
end;
TIO.Put_Line ("nbyte2 : " & row.column (1).as_nbyte2'Img);
TIO.Put_Line ("nbyte3 : " & row.column (1).as_nbyte3'Img);
TIO.Put_Line ("nbyte4 : " & row.column (1).as_nbyte4'Img);
TIO.Put_Line ("nbyte8 : " & row.column (1).as_nbyte8'Img);
end if;
end;
CON.DR.disconnect;
declare
small_bits : AdaBase.Results.Bits (0 .. 6) := (1, 0, 1, 1, 0, 1, 0);
one_bit : AdaBase.Results.Bits (0 .. 0) := (0 => 1);
one_bitstr : String := ARC.convert (one_bit);
my_bytestr : String := ARC.convert (small_bits);
my_byte : AdaBase.Results.NByte1 := ARC.convert (small_bits);
begin
TIO.Put_Line ("====================================");
TIO.Put_Line ("one bit as boolean : " & one_bitstr);
TIO.Put_Line ("nbyte1 :" & my_byte'Img);
TIO.Put_Line ("nbyte1 : " & my_bytestr);
end;
end Bits;
|
sungyeon/drake | Ada | 912 | ads | pragma License (Unrestricted);
-- separated and auto-loaded by compiler
private generic
type Enum is (<>);
pragma Unreferenced (Enum);
package Ada.Wide_Text_IO.Enumeration_IO is
Default_Width : Field := 0;
Default_Setting : Type_Set := Upper_Case;
-- procedure Get (
-- File : File_Type; -- Input_File_Type
-- Item : out Enum);
-- procedure Get (
-- Item : out Enum);
-- procedure Put (
-- File : File_Type; -- Output_File_Type
-- Item : Enum;
-- Width : Field := Default_Width;
-- Set : Type_Set := Default_Setting);
-- procedure Put (
-- Item : Enum;
-- Width : Field := Default_Width;
-- Set : Type_Set := Default_Setting);
-- procedure Get (
-- From : String;
-- Item : out Enum;
-- Last : out Positive);
-- procedure Put (
-- To : out String;
-- Item : Enum;
-- Set : Type_Set := Default_Setting);
end Ada.Wide_Text_IO.Enumeration_IO;
|
AdaCore/gpr | Ada | 1,896 | ads |
--
-- Copyright (C) 2019-2023, AdaCore
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
with Gpr_Parser.Common; use Gpr_Parser.Common;
private package Gpr_Parser.Lexer_State_Machine is
use Support.Text;
type Lexer_State is limited private;
type Lexed_Token is record
Kind : Token_Kind;
-- Kind for the scanned token
Text_First : Positive;
Text_Last : Natural;
-- Index range in the lexer input for the text covered by this token
end record;
procedure Initialize
(Self : out Lexer_State;
Input : Text_Access;
Input_First : Positive;
Input_Last : Natural);
-- Create a lexer state to scan the given input. Self will keep a reference
-- to Input to be used for each call to Next_Token, so the caller must keep
-- it point to allocated memory.
function Last_Token (Self : Lexer_State) return Lexed_Token;
-- Return the last token that Self scanned. This is the termination token
-- with the Input'First - 1 .. Input'Last index range when Next_Token
-- wasn't called yet.
function Has_Next (Self : Lexer_State) return Boolean;
-- Return whether Self scanned the whole input buffer
procedure Next_Token
(Self : in out Lexer_State; Token : out Lexed_Token)
with Pre => Has_Next (Self);
-- Scan for the next token in Self. Store its kind and index range in the
-- Input respectively in Kind, Text_First and Text_Last.
private
type Lexer_State is limited record
Input : Text_Access;
Input_First : Positive;
Input_Last : Natural;
-- Input buffer and buffer bounds for the content to scan
Has_Next : Boolean;
Last_Token : Lexed_Token;
Last_Token_Kind : Token_Kind;
-- Kind of the last actual token (not trivia) emitted
end record;
end Gpr_Parser.Lexer_State_Machine;
|
zhmu/ananas | Ada | 3,036 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T O R A G E _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
package body Ada.Storage_IO is
type Buffer_Ptr is access all Buffer_Type;
type Elmt_Ptr is access all Element_Type;
function To_Buffer_Ptr is
new Ada.Unchecked_Conversion (Elmt_Ptr, Buffer_Ptr);
----------
-- Read --
----------
procedure Read (Buffer : Buffer_Type; Item : out Element_Type) is
begin
To_Buffer_Ptr (Item'Unrestricted_Access).all := Buffer;
end Read;
-----------
-- Write --
-----------
procedure Write (Buffer : out Buffer_Type; Item : Element_Type) is
begin
Buffer := To_Buffer_Ptr (Item'Unrestricted_Access).all;
end Write;
end Ada.Storage_IO;
|
psyomn/ash | Ada | 3,500 | adb | -- Copyright 2019 Simon Symeonidis (psyomn)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package body HTTP_Status is
function Message_Of_Code (C : Code) return String is
begin
case C is
when CONTINUE => return "Continue";
when SWITCHING_PROTOCOLS => return "Switching Protocols";
when OK => return "OK";
when CREATED => return "Created";
when ACCEPTED => return "Accepted";
when NON_AUTHORITATIVE_INFORMATION =>
return "Non Authoritative Information";
when NO_CONTENT => return "No Content";
when RESET_CONTENT => return "Reset Content";
when PARTIAL_CONTENT => return "Partial Content";
when MULTIPLE_CHOICES => return "Multiple Choices";
when MOVED_PERMANENTLY => return "Moved Permanently";
when FOUND => return "Found";
when SEE_OTHER => return "See Other";
when NOT_MODIFIED => return "Not Modified";
when USE_PROXY => return "Use Proxy";
when UNUSED => return "Unused";
when TEMPORARY_REDIRECT => return "Temporary Redirect";
when BAD_REQUEST => return "Bad Request";
when UNAUTHORIZED => return "Unauthorized";
when PAYMENT_REQUIRED => return "Payment Required";
when FORBIDDEN => return "Forbidden";
when NOT_FOUND => return "Not Found";
when METHOD_NOT_ALLOWED => return "Method Not Allowed";
when NOT_ACCEPTABLE => return "Not Acceptable";
when PROXY_AUTH_REQUIRED => return "Proxy Auth Required";
when REQUEST_TIMEOUT => return "Request Timeout";
when CONFLICT => return "Conflict";
when GONE => return "Gone";
when LENGTH_REQUIRED => return "Length Required";
when PRECONDITION_FAILED => return "Precondition Failed";
when REQUEST_ENTITY_TOO_LARGE => return "Request Entity Too Large";
when REQUEST_URI_TOO_LONG => return "Request Uri Too Long";
when UNSUPPORTED_MEDIA_TYPE => return "Unsupported Media Type";
when REQUESTED_RANGE_NOT_SATISFIABLE =>
return "Requested Range Not Satisfiable";
when EXPECTATION_FAILED => return "Expectation Failed";
when INTERNAL_ERROR => return "Internal Error";
when NOT_IMPLEMENTED => return "Not Implemented";
when BAD_GATEWAY => return "Bad Gateway";
when SERVICE_UNAVAILABLE => return "Service Unavailable";
when GATEWAY_TIMEOUT => return "Gateway Timeout";
when HTTP_VERSION_NOT_SUPPORTED =>
return "Http Version Not Supported";
when others => raise Bad_Code_Error;
end case;
end Message_Of_Code;
end HTTP_Status;
|
faelys/natools | Ada | 7,126 | adb | ------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Calendar.Arithmetic;
package body Natools.Time_IO.Human is
---------------------
-- Duration Images --
---------------------
function Difference_Image
(Left, Right : Ada.Calendar.Time;
Use_Weeks : Boolean := False)
return String
is
use type Ada.Calendar.Arithmetic.Day_Count;
Days, Rounded_Days : Ada.Calendar.Arithmetic.Day_Count;
Seconds : Duration;
Leap_Seconds : Ada.Calendar.Arithmetic.Leap_Seconds_Count;
begin
if Ada.Calendar."<" (Left, Right) then
return '-' & Difference_Image
(Left => Right,
Right => Left,
Use_Weeks => Use_Weeks);
end if;
Ada.Calendar.Arithmetic.Difference
(Left, Right,
Days, Seconds, Leap_Seconds);
Seconds := Seconds - 86400.0 + Duration (Leap_Seconds);
if Seconds >= 0.0 then
Days := Days + 1;
else
Seconds := Seconds + 86400.0;
end if;
if Seconds >= 43200.0 then
Rounded_Days := Days + 1;
else
Rounded_Days := Days;
end if;
if Use_Weeks and then Rounded_Days >= 7 then
declare
Weeks : constant Ada.Calendar.Arithmetic.Day_Count
:= Rounded_Days / 7;
begin
Rounded_Days := Rounded_Days - Weeks * 7;
if Weeks >= 10 or Rounded_Days = 0 then
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Weeks)) & 'w';
else
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Weeks)) & 'w'
& Ada.Calendar.Arithmetic.Day_Count'Image (Rounded_Days)
& 'd';
end if;
end;
elsif Rounded_Days >= 10 then
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Rounded_Days)) & 'd';
elsif Days > 0 then
declare
Hours : constant Natural := Natural (Seconds / 3600);
begin
case Hours is
when 0 =>
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Days)) & 'd';
when 1 .. 23 =>
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Days)) & 'd'
& Natural'Image (Hours) & 'h';
when 24 =>
return Trim_Image
(Ada.Calendar.Arithmetic.Day_Count'Image (Days + 1)) & 'd';
when others =>
raise Program_Error;
end case;
end;
else
return Image (Seconds);
end if;
end Difference_Image;
function Image (Value : Duration) return String is
function Local_Image
(Mul_1, Div : Positive;
Unit_1 : String;
Mul_2 : Positive;
Unit_2 : String)
return String;
function Scientific_Image (Mul : Positive; Unit : String) return String;
function Local_Image
(Mul_1, Div : Positive;
Unit_1 : String;
Mul_2 : Positive;
Unit_2 : String)
return String
is
Scaled : constant Duration := Value * Mul_1 / Div;
Main : constant Natural := Natural (Scaled - 0.5);
Secondary : constant Natural
:= Natural ((Scaled - Duration (Main)) * Mul_2);
begin
pragma Assert (Secondary <= Mul_2);
if Secondary = Mul_2 then
return Trim_Image (Natural'Image (Main + 1)) & Unit_1;
elsif Secondary = 0 then
return Trim_Image (Natural'Image (Main)) & Unit_1;
else
return Trim_Image (Natural'Image (Main)) & Unit_1
& Natural'Image (Secondary) & Unit_2;
end if;
end Local_Image;
function Scientific_Image (Mul : Positive; Unit : String)
return String
is
Scaled : constant Duration := Value * Mul;
I_Part : constant Natural := Natural (Scaled - 0.5);
F_Part : constant Natural
:= Natural ((Scaled - Duration (I_Part)) * 1000);
begin
if F_Part = 0 then
return Trim_Image (Natural'Image (I_Part)) & Unit;
elsif F_Part = 1000 then
return Trim_Image (Natural'Image (I_Part + 1)) & Unit;
else
return Trim_Image (Natural'Image (I_Part))
& ('.',
Image (F_Part / 100),
Image ((F_Part / 10) mod 10),
Image (F_Part mod 10))
& Unit;
end if;
end Scientific_Image;
begin
if Value < 0.0 then
return '-' & Image (-Value);
elsif Value = 0.0 then
return "0s";
elsif Value >= 86400.0 - 1800.0 then
return Local_Image (1, 86400, "d", 24, "h");
elsif Value >= 36000.0 then
return Trim_Image (Positive'Image (Positive (Value / 3600))) & 'h';
elsif Value >= 3600.0 - 30.0 then
return Local_Image (1, 3600, "h", 60, "m");
elsif Value >= 600.0 then
return Trim_Image (Positive'Image (Positive (Value / 60))) & " min";
elsif Value >= 60.0 - 0.5 then
return Local_Image (1, 60, " min", 60, "s");
elsif Value >= 10.0 then
return Trim_Image (Positive'Image (Positive (Value))) & 's';
elsif Value >= 1.0 then
return Scientific_Image (1, " s");
elsif Value >= 0.01 then
return Trim_Image (Positive'Image (Positive (Value * 1000))) & " ms";
elsif Value >= 0.001 then
return Scientific_Image (1_000, " ms");
elsif Value >= 0.000_01 then
return Trim_Image
(Positive'Image (Positive (Value * 1_000_000))) & " us";
elsif Value >= 0.000_001 then
return Scientific_Image (1_000_000, " us");
else
return Scientific_Image (1_000_000_000, " ns");
end if;
end Image;
end Natools.Time_IO.Human;
|
MinimSecure/unum-sdk | Ada | 815 | adb | -- Copyright 2008-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
begin
if Is_First then
Increment;
end if;
end Foo;
|
reznikmm/matreshka | Ada | 3,651 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.UML.Structural_Feature_Actions.Hash is
new AMF.Elements.Generic_Hash (UML_Structural_Feature_Action, UML_Structural_Feature_Action_Access);
|
adithyap/coursework | Ada | 1,241 | adb | with Text_Io;
with sort;
-- ------------------
procedure progmain is
-- Package usage declarations
use Text_Io;
use sort;
package Int_Io is new Integer_Io(Integer);
use Int_Io;
-- Variable declarations
A : m_array;
input_var : Integer;
array_sum : Integer;
-- Task declarations
task Reader is
entry start;
end Reader;
task Sum is
entry start;
end Sum;
task Printer is
entry start;
end Printer;
-- Task definitions
-- -----------------
task body Reader is
begin
accept start do
for i in 1..SIZE loop
Int_Io.Get(input_var);
A(i) := input_var;
end loop;
end start;
end Reader;
-- -----------------
-- -----------------
task body Sum is
begin
accept start do
null;
end start;
array_sum := 0;
for i in 1..SIZE loop
array_sum := array_sum + A(i);
end loop;
Put("Array sum: ");
Int_Io.Put(array_sum);
end Sum;
-- -----------------
-- -----------------
task body Printer is
begin
accept start do
null;
end start;
Put("Sorted array: ");
New_Line;
for i in 1..SIZE loop
Int_Io.Put(A(i));
end loop;
end Printer;
-- -----------------
begin
Reader.start;
MergeSort(A);
Sum.start;
Printer.start;
end progmain;
-- ------------------
|
godunko/adawebpack | Ada | 4,334 | ads | ------------------------------------------------------------------------------
-- --
-- AdaWebPack --
-- --
------------------------------------------------------------------------------
-- Copyright © 2021-2022, Vadim Godunko --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
------------------------------------------------------------------------------
with Web.HTML.Elements;
with Web.Strings;
package Web.HTML.Options is
pragma Preelaborate;
type HTML_Option_Element is
new Web.HTML.Elements.HTML_Element with null record;
-- [NamedConstructor=Option(optional DOMString text = "",
-- optional DOMString value, optional boolean defaultSelected = false,
-- optional boolean selected = false)]
-- interface HTMLOptionElement : HTMLElement {
-- readonly attribute HTMLFormElement? form;
-- attribute DOMString label;
-- attribute boolean defaultSelected;
-- attribute DOMString value;
--
-- attribute DOMString text;
-- readonly attribute long index;
-- };
function Get_Disabled (Self : HTML_Option_Element'Class) return Boolean;
procedure Set_Disabled
(Self : HTML_Option_Element'Class; To : Boolean);
function Get_Selected (Self : HTML_Option_Element'Class) return Boolean;
procedure Set_Selected
(Self : in out HTML_Option_Element'Class; To : Boolean);
-- Returns true if the element is selected, and false otherwise.
--
-- Can be set, to override the current state of the element.
function Get_Value
(Self : HTML_Option_Element'Class) return Web.Strings.Web_String;
procedure Set_Value
(Self : HTML_Option_Element'Class;
To : Web.Strings.Web_String);
-- The value attribute provides a value for element. The value of an
-- option element is the value of the value content attribute, if there
-- is one, or, if there is not, the value of the element's text IDL
-- attribute.
end Web.HTML.Options;
|
PThierry/ewok-kernel | Ada | 1,760 | ads | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
package ewok.debug
with spark_mode => off
is
type t_level is (DEBUG, INFO, WARNING, ERROR, ALERT);
BG_COLOR_BLACK : constant string := ASCII.ESC & "[37;40m";
BG_COLOR_RED : constant string := ASCII.ESC & "[37;41m";
BG_COLOR_ORANGE : constant string := ASCII.ESC & "[37;43m";
BG_COLOR_BLUE : constant string := ASCII.ESC & "[37;44m";
procedure init (usart : in unsigned_8);
procedure putc (c : character);
procedure log (s : string; nl : boolean := true);
procedure log (level : t_level; s : string);
-- Note: those procedures are exported to be used by the libgnat
-- 'last_chance_handler'
procedure alert (s : string)
with convention => ada,
export => true,
external_name => "ewok_debug_alert";
procedure newline
with convention => ada,
export => true,
external_name => "ewok_debug_newline";
procedure panic (s : string);
end ewok.debug;
|
reznikmm/matreshka | Ada | 3,821 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Holders.Elements;
package body AMF.Internals.Collections.Elements is
-------------
-- Element --
-------------
overriding function Element
(Self : not null access constant Shared_Element_Collection;
Index : Positive) return League.Holders.Holder is
begin
return
AMF.Holders.Elements.To_Holder
(Element (Shared_Element_Collection'Class (Self.all)'Access, Index));
end Element;
end AMF.Internals.Collections.Elements;
|
zhmu/ananas | Ada | 403,389 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C H E C K S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Debug; use Debug;
with Einfo; use Einfo;
with Einfo.Entities; use Einfo.Entities;
with Einfo.Utils; use Einfo.Utils;
with Elists; use Elists;
with Eval_Fat; use Eval_Fat;
with Exp_Ch11; use Exp_Ch11;
with Exp_Ch4; use Exp_Ch4;
with Exp_Pakd; use Exp_Pakd;
with Exp_Util; use Exp_Util;
with Expander; use Expander;
with Freeze; use Freeze;
with Lib; use Lib;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Ch3; use Sem_Ch3;
with Sem_Ch8; use Sem_Ch8;
with Sem_Cat; use Sem_Cat;
with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
with Sem_Mech; use Sem_Mech;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
with Sinfo.Nodes; use Sinfo.Nodes;
with Sinfo.Utils; use Sinfo.Utils;
with Sinput; use Sinput;
with Snames; use Snames;
with Sprint; use Sprint;
with Stand; use Stand;
with Stringt; use Stringt;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Validsw; use Validsw;
package body Checks is
-- General note: many of these routines are concerned with generating
-- checking code to make sure that constraint error is raised at runtime.
-- Clearly this code is only needed if the expander is active, since
-- otherwise we will not be generating code or going into the runtime
-- execution anyway.
-- We therefore disconnect most of these checks if the expander is
-- inactive. This has the additional benefit that we do not need to
-- worry about the tree being messed up by previous errors (since errors
-- turn off expansion anyway).
-- There are a few exceptions to the above rule. For instance routines
-- such as Apply_Scalar_Range_Check that do not insert any code can be
-- safely called even when the Expander is inactive (but Errors_Detected
-- is 0). The benefit of executing this code when expansion is off, is
-- the ability to emit constraint error warnings for static expressions
-- even when we are not generating code.
-- The above is modified in gnatprove mode to ensure that proper check
-- flags are always placed, even if expansion is off.
-------------------------------------
-- Suppression of Redundant Checks --
-------------------------------------
-- This unit implements a limited circuit for removal of redundant
-- checks. The processing is based on a tracing of simple sequential
-- flow. For any sequence of statements, we save expressions that are
-- marked to be checked, and then if the same expression appears later
-- with the same check, then under certain circumstances, the second
-- check can be suppressed.
-- Basically, we can suppress the check if we know for certain that
-- the previous expression has been elaborated (together with its
-- check), and we know that the exception frame is the same, and that
-- nothing has happened to change the result of the exception.
-- Let us examine each of these three conditions in turn to describe
-- how we ensure that this condition is met.
-- First, we need to know for certain that the previous expression has
-- been executed. This is done principally by the mechanism of calling
-- Conditional_Statements_Begin at the start of any statement sequence
-- and Conditional_Statements_End at the end. The End call causes all
-- checks remembered since the Begin call to be discarded. This does
-- miss a few cases, notably the case of a nested BEGIN-END block with
-- no exception handlers. But the important thing is to be conservative.
-- The other protection is that all checks are discarded if a label
-- is encountered, since then the assumption of sequential execution
-- is violated, and we don't know enough about the flow.
-- Second, we need to know that the exception frame is the same. We
-- do this by killing all remembered checks when we enter a new frame.
-- Again, that's over-conservative, but generally the cases we can help
-- with are pretty local anyway (like the body of a loop for example).
-- Third, we must be sure to forget any checks which are no longer valid.
-- This is done by two mechanisms, first the Kill_Checks_Variable call is
-- used to note any changes to local variables. We only attempt to deal
-- with checks involving local variables, so we do not need to worry
-- about global variables. Second, a call to any non-global procedure
-- causes us to abandon all stored checks, since such a all may affect
-- the values of any local variables.
-- The following define the data structures used to deal with remembering
-- checks so that redundant checks can be eliminated as described above.
-- Right now, the only expressions that we deal with are of the form of
-- simple local objects (either declared locally, or IN parameters) or
-- such objects plus/minus a compile time known constant. We can do
-- more later on if it seems worthwhile, but this catches many simple
-- cases in practice.
-- The following record type reflects a single saved check. An entry
-- is made in the stack of saved checks if and only if the expression
-- has been elaborated with the indicated checks.
type Saved_Check is record
Killed : Boolean;
-- Set True if entry is killed by Kill_Checks
Entity : Entity_Id;
-- The entity involved in the expression that is checked
Offset : Uint;
-- A compile time value indicating the result of adding or
-- subtracting a compile time value. This value is to be
-- added to the value of the Entity. A value of zero is
-- used for the case of a simple entity reference.
Check_Type : Character;
-- This is set to 'R' for a range check (in which case Target_Type
-- is set to the target type for the range check) or to 'O' for an
-- overflow check (in which case Target_Type is set to Empty).
Target_Type : Entity_Id;
-- Used only if Do_Range_Check is set. Records the target type for
-- the check. We need this, because a check is a duplicate only if
-- it has the same target type (or more accurately one with a
-- range that is smaller or equal to the stored target type of a
-- saved check).
end record;
-- The following table keeps track of saved checks. Rather than use an
-- extensible table, we just use a table of fixed size, and we discard
-- any saved checks that do not fit. That's very unlikely to happen and
-- this is only an optimization in any case.
Saved_Checks : array (Int range 1 .. 200) of Saved_Check;
-- Array of saved checks
Num_Saved_Checks : Nat := 0;
-- Number of saved checks
-- The following stack keeps track of statement ranges. It is treated
-- as a stack. When Conditional_Statements_Begin is called, an entry
-- is pushed onto this stack containing the value of Num_Saved_Checks
-- at the time of the call. Then when Conditional_Statements_End is
-- called, this value is popped off and used to reset Num_Saved_Checks.
-- Note: again, this is a fixed length stack with a size that should
-- always be fine. If the value of the stack pointer goes above the
-- limit, then we just forget all saved checks.
Saved_Checks_Stack : array (Int range 1 .. 100) of Nat;
Saved_Checks_TOS : Nat := 0;
-----------------------
-- Local Subprograms --
-----------------------
procedure Apply_Arithmetic_Overflow_Strict (N : Node_Id);
-- Used to apply arithmetic overflow checks for all cases except operators
-- on signed arithmetic types in MINIMIZED/ELIMINATED case (for which we
-- call Apply_Arithmetic_Overflow_Minimized_Eliminated below). N can be a
-- signed integer arithmetic operator (but not an if or case expression).
-- It is also called for types other than signed integers.
procedure Apply_Arithmetic_Overflow_Minimized_Eliminated (Op : Node_Id);
-- Used to apply arithmetic overflow checks for the case where the overflow
-- checking mode is MINIMIZED or ELIMINATED and we have a signed integer
-- arithmetic op (which includes the case of if and case expressions). Note
-- that Do_Overflow_Check may or may not be set for node Op. In these modes
-- we have work to do even if overflow checking is suppressed.
procedure Apply_Division_Check
(N : Node_Id;
Rlo : Uint;
Rhi : Uint;
ROK : Boolean);
-- N is an N_Op_Div, N_Op_Rem, or N_Op_Mod node. This routine applies
-- division checks as required if the Do_Division_Check flag is set.
-- Rlo and Rhi give the possible range of the right operand, these values
-- can be referenced and trusted only if ROK is set True.
procedure Apply_Float_Conversion_Check
(Expr : Node_Id;
Target_Typ : Entity_Id);
-- The checks on a conversion from a floating-point type to an integer
-- type are delicate. They have to be performed before conversion, they
-- have to raise an exception when the operand is a NaN, and rounding must
-- be taken into account to determine the safe bounds of the operand.
procedure Apply_Selected_Length_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean);
-- This is the subprogram that does all the work for Apply_Length_Check
-- and Apply_Static_Length_Check. Expr, Target_Typ and Source_Typ are as
-- described for the above routines. The Do_Static flag indicates that
-- only a static check is to be done.
procedure Compute_Range_For_Arithmetic_Op
(Op : Node_Kind;
Lo_Left : Uint;
Hi_Left : Uint;
Lo_Right : Uint;
Hi_Right : Uint;
OK : out Boolean;
Lo : out Uint;
Hi : out Uint);
-- Given an integer arithmetical operation Op and the range of values of
-- its operand(s), try to compute a conservative estimate of the possible
-- range of values for the result of the operation. Thus if OK is True on
-- return, the result is known to lie in the range Lo .. Hi (inclusive).
-- If OK is false, both Lo and Hi are set to No_Uint.
type Check_Type is new Check_Id range Access_Check .. Division_Check;
function Check_Needed (Nod : Node_Id; Check : Check_Type) return Boolean;
-- This function is used to see if an access or division by zero check is
-- needed. The check is to be applied to a single variable appearing in the
-- source, and N is the node for the reference. If N is not of this form,
-- True is returned with no further processing. If N is of the right form,
-- then further processing determines if the given Check is needed.
--
-- The particular circuit is to see if we have the case of a check that is
-- not needed because it appears in the right operand of a short circuited
-- conditional where the left operand guards the check. For example:
--
-- if Var = 0 or else Q / Var > 12 then
-- ...
-- end if;
--
-- In this example, the division check is not required. At the same time
-- we can issue warnings for suspicious use of non-short-circuited forms,
-- such as:
--
-- if Var = 0 or Q / Var > 12 then
-- ...
-- end if;
procedure Find_Check
(Expr : Node_Id;
Check_Type : Character;
Target_Type : Entity_Id;
Entry_OK : out Boolean;
Check_Num : out Nat;
Ent : out Entity_Id;
Ofs : out Uint);
-- This routine is used by Enable_Range_Check and Enable_Overflow_Check
-- to see if a check is of the form for optimization, and if so, to see
-- if it has already been performed. Expr is the expression to check,
-- and Check_Type is 'R' for a range check, 'O' for an overflow check.
-- Target_Type is the target type for a range check, and Empty for an
-- overflow check. If the entry is not of the form for optimization,
-- then Entry_OK is set to False, and the remaining out parameters
-- are undefined. If the entry is OK, then Ent/Ofs are set to the
-- entity and offset from the expression. Check_Num is the number of
-- a matching saved entry in Saved_Checks, or zero if no such entry
-- is located.
function Get_Discriminal (E : Entity_Id; Bound : Node_Id) return Node_Id;
-- If a discriminal is used in constraining a prival, Return reference
-- to the discriminal of the protected body (which renames the parameter
-- of the enclosing protected operation). This clumsy transformation is
-- needed because privals are created too late and their actual subtypes
-- are not available when analysing the bodies of the protected operations.
-- This function is called whenever the bound is an entity and the scope
-- indicates a protected operation. If the bound is an in-parameter of
-- a protected operation that is not a prival, the function returns the
-- bound itself.
-- To be cleaned up???
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
Expr : Node_Id) return Node_Id;
-- In the access type case, guard the test with a test to ensure
-- that the access value is non-null, since the checks do not
-- not apply to null access values.
procedure Install_Static_Check (R_Cno : Node_Id; Loc : Source_Ptr);
-- Called by Apply_{Length,Range}_Checks to rewrite the tree with the
-- Constraint_Error node.
function Is_Signed_Integer_Arithmetic_Op (N : Node_Id) return Boolean;
-- Returns True if node N is for an arithmetic operation with signed
-- integer operands. This includes unary and binary operators, and also
-- if and case expression nodes where the dependent expressions are of
-- a signed integer type. These are the kinds of nodes for which special
-- handling applies in MINIMIZED or ELIMINATED overflow checking mode.
function Range_Or_Validity_Checks_Suppressed
(Expr : Node_Id) return Boolean;
-- Returns True if either range or validity checks or both are suppressed
-- for the type of the given expression, or, if the expression is the name
-- of an entity, if these checks are suppressed for the entity.
function Selected_Length_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Selected_Length_Checks, except it doesn't modify
-- anything, just returns a list of nodes as described in the spec of
-- this package for the Range_Check function.
-- ??? In fact it does construct the test and insert it into the tree,
-- and insert actions in various ways (calling Insert_Action directly
-- in particular) so we do not call it in GNATprove mode, contrary to
-- Selected_Range_Checks.
function Selected_Range_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result;
-- Like Apply_Range_Check, except it does not modify anything, just
-- returns a list of nodes as described in the spec of this package
-- for the Range_Check function.
------------------------------
-- Access_Checks_Suppressed --
------------------------------
function Access_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Access_Check);
else
return Scope_Suppress.Suppress (Access_Check);
end if;
end Access_Checks_Suppressed;
-------------------------------------
-- Accessibility_Checks_Suppressed --
-------------------------------------
function Accessibility_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if No_Dynamic_Accessibility_Checks_Enabled (E) then
return True;
elsif Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Accessibility_Check);
else
return Scope_Suppress.Suppress (Accessibility_Check);
end if;
end Accessibility_Checks_Suppressed;
-----------------------------
-- Activate_Division_Check --
-----------------------------
procedure Activate_Division_Check (N : Node_Id) is
begin
Set_Do_Division_Check (N, True);
Possible_Local_Raise (N, Standard_Constraint_Error);
end Activate_Division_Check;
-----------------------------
-- Activate_Overflow_Check --
-----------------------------
procedure Activate_Overflow_Check (N : Node_Id) is
Typ : constant Entity_Id := Etype (N);
begin
-- Floating-point case. If Etype is not set (this can happen when we
-- activate a check on a node that has not yet been analyzed), then
-- we assume we do not have a floating-point type (as per our spec).
if Present (Typ) and then Is_Floating_Point_Type (Typ) then
-- Ignore call if we have no automatic overflow checks on the target
-- and Check_Float_Overflow mode is not set. These are the cases in
-- which we expect to generate infinities and NaN's with no check.
if not (Machine_Overflows_On_Target or Check_Float_Overflow) then
return;
-- Ignore for unary operations ("+", "-", abs) since these can never
-- result in overflow for floating-point cases.
elsif Nkind (N) in N_Unary_Op then
return;
-- Otherwise we will set the flag
else
null;
end if;
-- Discrete case
else
-- Nothing to do for Rem/Mod/Plus (overflow not possible, the check
-- for zero-divide is a divide check, not an overflow check).
if Nkind (N) in N_Op_Rem | N_Op_Mod | N_Op_Plus then
return;
end if;
end if;
-- Fall through for cases where we do set the flag
Set_Do_Overflow_Check (N);
Possible_Local_Raise (N, Standard_Constraint_Error);
end Activate_Overflow_Check;
--------------------------
-- Activate_Range_Check --
--------------------------
procedure Activate_Range_Check (N : Node_Id) is
begin
Set_Do_Range_Check (N);
Possible_Local_Raise (N, Standard_Constraint_Error);
end Activate_Range_Check;
---------------------------------
-- Alignment_Checks_Suppressed --
---------------------------------
function Alignment_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Alignment_Check);
else
return Scope_Suppress.Suppress (Alignment_Check);
end if;
end Alignment_Checks_Suppressed;
----------------------------------
-- Allocation_Checks_Suppressed --
----------------------------------
-- Note: at the current time there are no calls to this function, because
-- the relevant check is in the run-time, so it is not a check that the
-- compiler can suppress anyway, but we still have to recognize the check
-- name Allocation_Check since it is part of the standard.
function Allocation_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Allocation_Check);
else
return Scope_Suppress.Suppress (Allocation_Check);
end if;
end Allocation_Checks_Suppressed;
-------------------------
-- Append_Range_Checks --
-------------------------
procedure Append_Range_Checks
(Checks : Check_Result;
Stmts : List_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr)
is
Checks_On : constant Boolean :=
not Index_Checks_Suppressed (Suppress_Typ)
or else
not Range_Checks_Suppressed (Suppress_Typ);
begin
-- For now we just return if Checks_On is false, however this could be
-- enhanced to check for an always True value in the condition and to
-- generate a compilation warning.
if not Checks_On then
return;
end if;
for J in 1 .. 2 loop
exit when No (Checks (J));
if Nkind (Checks (J)) = N_Raise_Constraint_Error
and then Present (Condition (Checks (J)))
then
Append_To (Stmts, Checks (J));
else
Append_To
(Stmts,
Make_Raise_Constraint_Error (Static_Sloc,
Reason => CE_Range_Check_Failed));
end if;
end loop;
end Append_Range_Checks;
------------------------
-- Apply_Access_Check --
------------------------
procedure Apply_Access_Check (N : Node_Id) is
P : constant Node_Id := Prefix (N);
begin
-- We do not need checks if we are not generating code (i.e. the
-- expander is not active). This is not just an optimization, there
-- are cases (e.g. with pragma Debug) where generating the checks
-- can cause real trouble.
if not Expander_Active then
return;
end if;
-- No check if short circuiting makes check unnecessary
if not Check_Needed (P, Access_Check) then
return;
end if;
-- No check if accessing the Offset_To_Top component of a dispatch
-- table. They are safe by construction.
if Tagged_Type_Expansion
and then Present (Etype (P))
and then Is_RTE (Etype (P), RE_Offset_To_Top_Ptr)
then
return;
end if;
-- Otherwise go ahead and install the check
Install_Null_Excluding_Check (P);
end Apply_Access_Check;
-------------------------------
-- Apply_Accessibility_Check --
-------------------------------
procedure Apply_Accessibility_Check
(N : Node_Id;
Typ : Entity_Id;
Insert_Node : Node_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Check_Cond : Node_Id;
Param_Ent : Entity_Id := Param_Entity (N);
Param_Level : Node_Id;
Type_Level : Node_Id;
begin
-- Verify we haven't tried to add a dynamic accessibility check when we
-- shouldn't.
pragma Assert (not No_Dynamic_Accessibility_Checks_Enabled (N));
if Ada_Version >= Ada_2012
and then not Present (Param_Ent)
and then Is_Entity_Name (N)
and then Ekind (Entity (N)) in E_Constant | E_Variable
and then Present (Effective_Extra_Accessibility (Entity (N)))
then
Param_Ent := Entity (N);
while Present (Renamed_Object (Param_Ent)) loop
-- Renamed_Object must return an Entity_Name here
-- because of preceding "Present (E_E_A (...))" test.
Param_Ent := Entity (Renamed_Object (Param_Ent));
end loop;
end if;
if Inside_A_Generic then
return;
-- Only apply the run-time check if the access parameter has an
-- associated extra access level parameter and when accessibility checks
-- are enabled.
elsif Present (Param_Ent)
and then Present (Get_Dynamic_Accessibility (Param_Ent))
and then not Accessibility_Checks_Suppressed (Param_Ent)
and then not Accessibility_Checks_Suppressed (Typ)
then
-- Obtain the parameter's accessibility level
Param_Level :=
New_Occurrence_Of (Get_Dynamic_Accessibility (Param_Ent), Loc);
-- Use the dynamic accessibility parameter for the function's result
-- when one has been created instead of statically referring to the
-- deepest type level so as to appropriatly handle the rules for
-- RM 3.10.2 (10.1/3).
if Ekind (Scope (Param_Ent)) = E_Function
and then In_Return_Value (N)
and then Ekind (Typ) = E_Anonymous_Access_Type
then
-- Associate the level of the result type to the extra result
-- accessibility parameter belonging to the current function.
if Present (Extra_Accessibility_Of_Result (Scope (Param_Ent))) then
Type_Level :=
New_Occurrence_Of
(Extra_Accessibility_Of_Result (Scope (Param_Ent)), Loc);
-- In Ada 2005 and earlier modes, a result extra accessibility
-- parameter is not generated and no dynamic check is performed.
else
return;
end if;
-- Otherwise get the type's accessibility level normally
else
Type_Level :=
Make_Integer_Literal (Loc, Deepest_Type_Access_Level (Typ));
end if;
-- Raise Program_Error if the accessibility level of the access
-- parameter is deeper than the level of the target access type.
Check_Cond :=
Make_Op_Gt (Loc,
Left_Opnd => Param_Level,
Right_Opnd => Type_Level);
Insert_Action (Insert_Node,
Make_Raise_Program_Error (Loc,
Condition => Check_Cond,
Reason => PE_Accessibility_Check_Failed));
Analyze_And_Resolve (N);
-- If constant folding has happened on the condition for the
-- generated error, then warn about it being unconditional.
if Nkind (Check_Cond) = N_Identifier
and then Entity (Check_Cond) = Standard_True
then
Error_Msg_Warn := SPARK_Mode /= On;
Error_Msg_N ("accessibility check fails<<", N);
Error_Msg_N ("\Program_Error [<<", N);
end if;
end if;
end Apply_Accessibility_Check;
--------------------------------
-- Apply_Address_Clause_Check --
--------------------------------
procedure Apply_Address_Clause_Check (E : Entity_Id; N : Node_Id) is
pragma Assert (Nkind (N) = N_Freeze_Entity);
AC : constant Node_Id := Address_Clause (E);
Loc : constant Source_Ptr := Sloc (AC);
Typ : constant Entity_Id := Etype (E);
Expr : Node_Id;
-- Address expression (not necessarily the same as Aexp, for example
-- when Aexp is a reference to a constant, in which case Expr gets
-- reset to reference the value expression of the constant).
begin
-- See if alignment check needed. Note that we never need a check if the
-- maximum alignment is one, since the check will always succeed.
-- Note: we do not check for checks suppressed here, since that check
-- was done in Sem_Ch13 when the address clause was processed. We are
-- only called if checks were not suppressed. The reason for this is
-- that we have to delay the call to Apply_Alignment_Check till freeze
-- time (so that all types etc are elaborated), but we have to check
-- the status of check suppressing at the point of the address clause.
if No (AC)
or else not Check_Address_Alignment (AC)
or else Maximum_Alignment = 1
then
return;
end if;
-- Obtain expression from address clause
Expr := Address_Value (Expression (AC));
-- See if we know that Expr has an acceptable value at compile time. If
-- it hasn't or we don't know, we defer issuing the warning until the
-- end of the compilation to take into account back end annotations.
if Compile_Time_Known_Value (Expr)
and then (Known_Alignment (E) or else Known_Alignment (Typ))
then
declare
AL : Uint := Alignment (Typ);
begin
-- The object alignment might be more restrictive than the type
-- alignment.
if Known_Alignment (E) then
AL := Alignment (E);
end if;
if Expr_Value (Expr) mod AL = 0 then
return;
end if;
end;
-- If the expression has the form X'Address, then we can find out if the
-- object X has an alignment that is compatible with the object E. If it
-- hasn't or we don't know, we defer issuing the warning until the end
-- of the compilation to take into account back end annotations.
elsif Nkind (Expr) = N_Attribute_Reference
and then Attribute_Name (Expr) = Name_Address
and then
Has_Compatible_Alignment (E, Prefix (Expr), False) = Known_Compatible
then
return;
end if;
-- Here we do not know if the value is acceptable. Strictly we don't
-- have to do anything, since if the alignment is bad, we have an
-- erroneous program. However we are allowed to check for erroneous
-- conditions and we decide to do this by default if the check is not
-- suppressed.
-- However, don't do the check if elaboration code is unwanted
if Restriction_Active (No_Elaboration_Code) then
return;
-- Generate a check to raise PE if alignment may be inappropriate
else
-- If the original expression is a nonstatic constant, use the name
-- of the constant itself rather than duplicating its initialization
-- expression, which was extracted above.
-- Note: Expr is empty if the address-clause is applied to in-mode
-- actuals (allowed by 13.1(22)).
if not Present (Expr)
or else
(Is_Entity_Name (Expression (AC))
and then Ekind (Entity (Expression (AC))) = E_Constant
and then Nkind (Parent (Entity (Expression (AC)))) =
N_Object_Declaration)
then
Expr := New_Copy_Tree (Expression (AC));
else
Remove_Side_Effects (Expr);
end if;
if No (Actions (N)) then
Set_Actions (N, New_List);
end if;
Prepend_To (Actions (N),
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd =>
Make_Op_Mod (Loc,
Left_Opnd =>
Unchecked_Convert_To
(RTE (RE_Integer_Address), Expr),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (E, Loc),
Attribute_Name => Name_Alignment)),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Reason => PE_Misaligned_Address_Value));
Warning_Msg := No_Error_Msg;
Analyze (First (Actions (N)), Suppress => All_Checks);
-- If the above raise action generated a warning message (for example
-- from Warn_On_Non_Local_Exception mode with the active restriction
-- No_Exception_Propagation).
if Warning_Msg /= No_Error_Msg then
-- If the expression has a known at compile time value, then
-- once we know the alignment of the type, we can check if the
-- exception will be raised or not, and if not, we don't need
-- the warning so we will kill the warning later on.
if Compile_Time_Known_Value (Expr) then
Alignment_Warnings.Append
((E => E,
A => Expr_Value (Expr),
P => Empty,
W => Warning_Msg));
-- Likewise if the expression is of the form X'Address
elsif Nkind (Expr) = N_Attribute_Reference
and then Attribute_Name (Expr) = Name_Address
then
Alignment_Warnings.Append
((E => E,
A => No_Uint,
P => Prefix (Expr),
W => Warning_Msg));
-- Add explanation of the warning generated by the check
else
Error_Msg_N
("\address value may be incompatible with alignment of "
& "object?.x?", AC);
end if;
end if;
return;
end if;
exception
-- If we have some missing run time component in configurable run time
-- mode then just skip the check (it is not required in any case).
when RE_Not_Available =>
return;
end Apply_Address_Clause_Check;
-------------------------------------
-- Apply_Arithmetic_Overflow_Check --
-------------------------------------
procedure Apply_Arithmetic_Overflow_Check (N : Node_Id) is
begin
-- Use old routine in almost all cases (the only case we are treating
-- specially is the case of a signed integer arithmetic op with the
-- overflow checking mode set to MINIMIZED or ELIMINATED).
if Overflow_Check_Mode = Strict
or else not Is_Signed_Integer_Arithmetic_Op (N)
then
Apply_Arithmetic_Overflow_Strict (N);
-- Otherwise use the new routine for the case of a signed integer
-- arithmetic op, with Do_Overflow_Check set to True, and the checking
-- mode is MINIMIZED or ELIMINATED.
else
Apply_Arithmetic_Overflow_Minimized_Eliminated (N);
end if;
end Apply_Arithmetic_Overflow_Check;
--------------------------------------
-- Apply_Arithmetic_Overflow_Strict --
--------------------------------------
-- This routine is called only if the type is an integer type and an
-- arithmetic overflow check may be needed for op (add, subtract, or
-- multiply). This check is performed if Backend_Overflow_Checks_On_Target
-- is not enabled and Do_Overflow_Check is set. In this case we expand the
-- operation into a more complex sequence of tests that ensures that
-- overflow is properly caught.
-- This is used in CHECKED modes. It is identical to the code for this
-- cases before the big overflow earthquake, thus ensuring that in this
-- modes we have compatible behavior (and reliability) to what was there
-- before. It is also called for types other than signed integers, and if
-- the Do_Overflow_Check flag is off.
-- Note: we also call this routine if we decide in the MINIMIZED case
-- to give up and just generate an overflow check without any fuss.
procedure Apply_Arithmetic_Overflow_Strict (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Rtyp : constant Entity_Id := Root_Type (Typ);
begin
-- Nothing to do if Do_Overflow_Check not set or overflow checks
-- suppressed.
if not Do_Overflow_Check (N) then
return;
end if;
-- An interesting special case. If the arithmetic operation appears as
-- the operand of a type conversion:
-- type1 (x op y)
-- and all the following conditions apply:
-- arithmetic operation is for a signed integer type
-- target type type1 is a static integer subtype
-- range of x and y are both included in the range of type1
-- range of x op y is included in the range of type1
-- size of type1 is at least twice the result size of op
-- then we don't do an overflow check in any case. Instead, we transform
-- the operation so that we end up with:
-- type1 (type1 (x) op type1 (y))
-- This avoids intermediate overflow before the conversion. It is
-- explicitly permitted by RM 3.5.4(24):
-- For the execution of a predefined operation of a signed integer
-- type, the implementation need not raise Constraint_Error if the
-- result is outside the base range of the type, so long as the
-- correct result is produced.
-- It's hard to imagine that any programmer counts on the exception
-- being raised in this case, and in any case it's wrong coding to
-- have this expectation, given the RM permission. Furthermore, other
-- Ada compilers do allow such out of range results.
-- Note that we do this transformation even if overflow checking is
-- off, since this is precisely about giving the "right" result and
-- avoiding the need for an overflow check.
-- Note: this circuit is partially redundant with respect to the similar
-- processing in Exp_Ch4.Expand_N_Type_Conversion, but the latter deals
-- with cases that do not come through here. We still need the following
-- processing even with the Exp_Ch4 code in place, since we want to be
-- sure not to generate the arithmetic overflow check in these cases
-- (Exp_Ch4 would have a hard time removing them once generated).
if Is_Signed_Integer_Type (Typ)
and then Nkind (Parent (N)) = N_Type_Conversion
then
Conversion_Optimization : declare
Target_Type : constant Entity_Id :=
Base_Type (Entity (Subtype_Mark (Parent (N))));
Llo, Lhi : Uint;
Rlo, Rhi : Uint;
LOK, ROK : Boolean;
Vlo : Uint;
Vhi : Uint;
VOK : Boolean;
Tlo : Uint;
Thi : Uint;
begin
if Is_Integer_Type (Target_Type)
and then RM_Size (Root_Type (Target_Type)) >= 2 * RM_Size (Rtyp)
then
Tlo := Expr_Value (Type_Low_Bound (Target_Type));
Thi := Expr_Value (Type_High_Bound (Target_Type));
Determine_Range
(Left_Opnd (N), LOK, Llo, Lhi, Assume_Valid => True);
Determine_Range
(Right_Opnd (N), ROK, Rlo, Rhi, Assume_Valid => True);
if (LOK and ROK)
and then Tlo <= Llo and then Lhi <= Thi
and then Tlo <= Rlo and then Rhi <= Thi
then
Determine_Range (N, VOK, Vlo, Vhi, Assume_Valid => True);
if VOK and then Tlo <= Vlo and then Vhi <= Thi then
Rewrite (Left_Opnd (N),
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Target_Type, Loc),
Expression => Relocate_Node (Left_Opnd (N))));
Rewrite (Right_Opnd (N),
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Target_Type, Loc),
Expression => Relocate_Node (Right_Opnd (N))));
-- Rewrite the conversion operand so that the original
-- node is retained, in order to avoid the warning for
-- redundant conversions in Resolve_Type_Conversion.
Rewrite (N, Relocate_Node (N));
Set_Etype (N, Target_Type);
Analyze_And_Resolve (Left_Opnd (N), Target_Type);
Analyze_And_Resolve (Right_Opnd (N), Target_Type);
-- Given that the target type is twice the size of the
-- source type, overflow is now impossible, so we can
-- safely kill the overflow check and return.
Set_Do_Overflow_Check (N, False);
return;
end if;
end if;
end if;
end Conversion_Optimization;
end if;
-- Now see if an overflow check is required
declare
Dsiz : constant Uint := 2 * Esize (Rtyp);
Opnod : Node_Id;
Ctyp : Entity_Id;
Opnd : Node_Id;
Cent : RE_Id;
begin
-- Skip check if back end does overflow checks, or the overflow flag
-- is not set anyway, or we are not doing code expansion, or the
-- parent node is a type conversion whose operand is an arithmetic
-- operation on signed integers on which the expander can promote
-- later the operands to type Integer (see Expand_N_Type_Conversion).
if Backend_Overflow_Checks_On_Target
or else not Do_Overflow_Check (N)
or else not Expander_Active
or else (Present (Parent (N))
and then Nkind (Parent (N)) = N_Type_Conversion
and then Integer_Promotion_Possible (Parent (N)))
then
return;
end if;
-- Otherwise, generate the full general code for front end overflow
-- detection, which works by doing arithmetic in a larger type:
-- x op y
-- is expanded into
-- Typ (Checktyp (x) op Checktyp (y));
-- where Typ is the type of the original expression, and Checktyp is
-- an integer type of sufficient length to hold the largest possible
-- result.
-- If the size of the check type exceeds the maximum integer size,
-- we use a different approach, expanding to:
-- typ (xxx_With_Ovflo_Check (Integer_NN (x), Integer_NN (y)))
-- where xxx is Add, Multiply or Subtract as appropriate
-- Find check type if one exists
if Dsiz <= System_Max_Integer_Size then
Ctyp := Integer_Type_For (Dsiz, Uns => False);
-- No check type exists, use runtime call
else
if System_Max_Integer_Size = 64 then
Ctyp := RTE (RE_Integer_64);
else
Ctyp := RTE (RE_Integer_128);
end if;
if Nkind (N) = N_Op_Add then
if System_Max_Integer_Size = 64 then
Cent := RE_Add_With_Ovflo_Check64;
else
Cent := RE_Add_With_Ovflo_Check128;
end if;
elsif Nkind (N) = N_Op_Subtract then
if System_Max_Integer_Size = 64 then
Cent := RE_Subtract_With_Ovflo_Check64;
else
Cent := RE_Subtract_With_Ovflo_Check128;
end if;
else pragma Assert (Nkind (N) = N_Op_Multiply);
if System_Max_Integer_Size = 64 then
Cent := RE_Multiply_With_Ovflo_Check64;
else
Cent := RE_Multiply_With_Ovflo_Check128;
end if;
end if;
Rewrite (N,
OK_Convert_To (Typ,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (RTE (Cent), Loc),
Parameter_Associations => New_List (
OK_Convert_To (Ctyp, Left_Opnd (N)),
OK_Convert_To (Ctyp, Right_Opnd (N))))));
Analyze_And_Resolve (N, Typ);
return;
end if;
-- If we fall through, we have the case where we do the arithmetic
-- in the next higher type and get the check by conversion. In these
-- cases Ctyp is set to the type to be used as the check type.
Opnod := Relocate_Node (N);
Opnd := OK_Convert_To (Ctyp, Left_Opnd (Opnod));
Analyze (Opnd);
Set_Etype (Opnd, Ctyp);
Set_Analyzed (Opnd, True);
Set_Left_Opnd (Opnod, Opnd);
Opnd := OK_Convert_To (Ctyp, Right_Opnd (Opnod));
Analyze (Opnd);
Set_Etype (Opnd, Ctyp);
Set_Analyzed (Opnd, True);
Set_Right_Opnd (Opnod, Opnd);
-- The type of the operation changes to the base type of the check
-- type, and we reset the overflow check indication, since clearly no
-- overflow is possible now that we are using a double length type.
-- We also set the Analyzed flag to avoid a recursive attempt to
-- expand the node.
Set_Etype (Opnod, Base_Type (Ctyp));
Set_Do_Overflow_Check (Opnod, False);
Set_Analyzed (Opnod, True);
-- Now build the outer conversion
Opnd := OK_Convert_To (Typ, Opnod);
Analyze (Opnd);
Set_Etype (Opnd, Typ);
-- In the discrete type case, we directly generate the range check
-- for the outer operand. This range check will implement the
-- required overflow check.
if Is_Discrete_Type (Typ) then
Rewrite (N, Opnd);
Generate_Range_Check
(Expression (N), Typ, CE_Overflow_Check_Failed);
-- For other types, we enable overflow checking on the conversion,
-- after setting the node as analyzed to prevent recursive attempts
-- to expand the conversion node.
else
Set_Analyzed (Opnd, True);
Enable_Overflow_Check (Opnd);
Rewrite (N, Opnd);
end if;
exception
when RE_Not_Available =>
return;
end;
end Apply_Arithmetic_Overflow_Strict;
----------------------------------------------------
-- Apply_Arithmetic_Overflow_Minimized_Eliminated --
----------------------------------------------------
procedure Apply_Arithmetic_Overflow_Minimized_Eliminated (Op : Node_Id) is
pragma Assert (Is_Signed_Integer_Arithmetic_Op (Op));
Loc : constant Source_Ptr := Sloc (Op);
P : constant Node_Id := Parent (Op);
LLIB : constant Entity_Id := Base_Type (Standard_Long_Long_Integer);
-- Operands and results are of this type when we convert
Result_Type : constant Entity_Id := Etype (Op);
-- Original result type
Check_Mode : constant Overflow_Mode_Type := Overflow_Check_Mode;
pragma Assert (Check_Mode in Minimized_Or_Eliminated);
Lo, Hi : Uint;
-- Ranges of values for result
begin
-- Nothing to do if our parent is one of the following:
-- Another signed integer arithmetic op
-- A membership operation
-- A comparison operation
-- In all these cases, we will process at the higher level (and then
-- this node will be processed during the downwards recursion that
-- is part of the processing in Minimize_Eliminate_Overflows).
if Is_Signed_Integer_Arithmetic_Op (P)
or else Nkind (P) in N_Membership_Test
or else Nkind (P) in N_Op_Compare
-- This is also true for an alternative in a case expression
or else Nkind (P) = N_Case_Expression_Alternative
-- This is also true for a range operand in a membership test
or else (Nkind (P) = N_Range
and then Nkind (Parent (P)) in N_Membership_Test)
then
-- If_Expressions and Case_Expressions are treated as arithmetic
-- ops, but if they appear in an assignment or similar contexts
-- there is no overflow check that starts from that parent node,
-- so apply check now.
if Nkind (P) in N_If_Expression | N_Case_Expression
and then not Is_Signed_Integer_Arithmetic_Op (Parent (P))
then
null;
else
return;
end if;
end if;
-- Otherwise, we have a top level arithmetic operation node, and this
-- is where we commence the special processing for MINIMIZED/ELIMINATED
-- modes. This is the case where we tell the machinery not to move into
-- Bignum mode at this top level (of course the top level operation
-- will still be in Bignum mode if either of its operands are of type
-- Bignum).
Minimize_Eliminate_Overflows (Op, Lo, Hi, Top_Level => True);
-- That call may but does not necessarily change the result type of Op.
-- It is the job of this routine to undo such changes, so that at the
-- top level, we have the proper type. This "undoing" is a point at
-- which a final overflow check may be applied.
-- If the result type was not fiddled we are all set. We go to base
-- types here because things may have been rewritten to generate the
-- base type of the operand types.
if Base_Type (Etype (Op)) = Base_Type (Result_Type) then
return;
-- Bignum case
elsif Is_RTE (Etype (Op), RE_Bignum) then
-- We need a sequence that looks like:
-- Rnn : Result_Type;
-- declare
-- M : Mark_Id := SS_Mark;
-- begin
-- Rnn := Long_Long_Integer'Base (From_Bignum (Op));
-- SS_Release (M);
-- end;
-- This block is inserted (using Insert_Actions), and then the node
-- is replaced with a reference to Rnn.
-- If our parent is a conversion node then there is no point in
-- generating a conversion to Result_Type. Instead, we let the parent
-- handle this. Note that this special case is not just about
-- optimization. Consider
-- A,B,C : Integer;
-- ...
-- X := Long_Long_Integer'Base (A * (B ** C));
-- Now the product may fit in Long_Long_Integer but not in Integer.
-- In MINIMIZED/ELIMINATED mode, we don't want to introduce an
-- overflow exception for this intermediate value.
declare
Blk : constant Node_Id := Make_Bignum_Block (Loc);
Rnn : constant Entity_Id := Make_Temporary (Loc, 'R', Op);
RHS : Node_Id;
Rtype : Entity_Id;
begin
RHS := Convert_From_Bignum (Op);
if Nkind (P) /= N_Type_Conversion then
Convert_To_And_Rewrite (Result_Type, RHS);
Rtype := Result_Type;
-- Interesting question, do we need a check on that conversion
-- operation. Answer, not if we know the result is in range.
-- At the moment we are not taking advantage of this. To be
-- looked at later ???
else
Rtype := LLIB;
end if;
Insert_Before
(First (Statements (Handled_Statement_Sequence (Blk))),
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Rnn, Loc),
Expression => RHS));
Insert_Actions (Op, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Rnn,
Object_Definition => New_Occurrence_Of (Rtype, Loc)),
Blk));
Rewrite (Op, New_Occurrence_Of (Rnn, Loc));
Analyze_And_Resolve (Op);
end;
-- Here we know the result is Long_Long_Integer'Base, or that it has
-- been rewritten because the parent operation is a conversion. See
-- Apply_Arithmetic_Overflow_Strict.Conversion_Optimization.
else
pragma Assert
(Etype (Op) = LLIB or else Nkind (Parent (Op)) = N_Type_Conversion);
-- All we need to do here is to convert the result to the proper
-- result type. As explained above for the Bignum case, we can
-- omit this if our parent is a type conversion.
if Nkind (P) /= N_Type_Conversion then
Convert_To_And_Rewrite (Result_Type, Op);
end if;
Analyze_And_Resolve (Op);
end if;
end Apply_Arithmetic_Overflow_Minimized_Eliminated;
----------------------------
-- Apply_Constraint_Check --
----------------------------
procedure Apply_Constraint_Check
(N : Node_Id;
Typ : Entity_Id;
No_Sliding : Boolean := False)
is
Desig_Typ : Entity_Id;
begin
-- No checks inside a generic (check the instantiations)
if Inside_A_Generic then
return;
end if;
-- Apply required constraint checks
if Is_Scalar_Type (Typ) then
Apply_Scalar_Range_Check (N, Typ);
elsif Is_Array_Type (Typ) then
-- A useful optimization: an aggregate with only an others clause
-- always has the right bounds.
if Nkind (N) = N_Aggregate
and then No (Expressions (N))
and then Nkind (First (Component_Associations (N))) =
N_Component_Association
and then Nkind
(First (Choices (First (Component_Associations (N)))))
= N_Others_Choice
then
return;
end if;
if Is_Constrained (Typ) then
Apply_Length_Check (N, Typ);
if No_Sliding then
Apply_Range_Check (N, Typ);
end if;
else
Apply_Range_Check (N, Typ);
end if;
elsif (Is_Record_Type (Typ) or else Is_Private_Type (Typ))
and then Has_Discriminants (Base_Type (Typ))
and then Is_Constrained (Typ)
then
Apply_Discriminant_Check (N, Typ);
elsif Is_Access_Type (Typ) then
Desig_Typ := Designated_Type (Typ);
-- No checks necessary if expression statically null
if Known_Null (N) then
if Can_Never_Be_Null (Typ) then
Install_Null_Excluding_Check (N);
end if;
-- No sliding possible on access to arrays
elsif Is_Array_Type (Desig_Typ) then
if Is_Constrained (Desig_Typ) then
Apply_Length_Check (N, Typ);
end if;
Apply_Range_Check (N, Typ);
-- Do not install a discriminant check for a constrained subtype
-- created for an unconstrained nominal type because the subtype
-- has the correct constraints by construction.
elsif Has_Discriminants (Base_Type (Desig_Typ))
and then Is_Constrained (Desig_Typ)
and then not Is_Constr_Subt_For_U_Nominal (Desig_Typ)
then
Apply_Discriminant_Check (N, Typ);
end if;
-- Apply the 2005 Null_Excluding check. Note that we do not apply
-- this check if the constraint node is illegal, as shown by having
-- an error posted. This additional guard prevents cascaded errors
-- and compiler aborts on illegal programs involving Ada 2005 checks.
if Can_Never_Be_Null (Typ)
and then not Can_Never_Be_Null (Etype (N))
and then not Error_Posted (N)
then
Install_Null_Excluding_Check (N);
end if;
end if;
end Apply_Constraint_Check;
------------------------------
-- Apply_Discriminant_Check --
------------------------------
procedure Apply_Discriminant_Check
(N : Node_Id;
Typ : Entity_Id;
Lhs : Node_Id := Empty)
is
Loc : constant Source_Ptr := Sloc (N);
Do_Access : constant Boolean := Is_Access_Type (Typ);
S_Typ : Entity_Id := Etype (N);
Cond : Node_Id;
T_Typ : Entity_Id;
function Denotes_Explicit_Dereference (Obj : Node_Id) return Boolean;
-- A heap object with an indefinite subtype is constrained by its
-- initial value, and assigning to it requires a constraint_check.
-- The target may be an explicit dereference, or a renaming of one.
function Is_Aliased_Unconstrained_Component return Boolean;
-- It is possible for an aliased component to have a nominal
-- unconstrained subtype (through instantiation). If this is a
-- discriminated component assigned in the expansion of an aggregate
-- in an initialization, the check must be suppressed. This unusual
-- situation requires a predicate of its own.
----------------------------------
-- Denotes_Explicit_Dereference --
----------------------------------
function Denotes_Explicit_Dereference (Obj : Node_Id) return Boolean is
begin
return
Nkind (Obj) = N_Explicit_Dereference
or else
(Is_Entity_Name (Obj)
and then Present (Renamed_Object (Entity (Obj)))
and then Nkind (Renamed_Object (Entity (Obj))) =
N_Explicit_Dereference);
end Denotes_Explicit_Dereference;
----------------------------------------
-- Is_Aliased_Unconstrained_Component --
----------------------------------------
function Is_Aliased_Unconstrained_Component return Boolean is
Comp : Entity_Id;
Pref : Node_Id;
begin
if Nkind (Lhs) /= N_Selected_Component then
return False;
else
Comp := Entity (Selector_Name (Lhs));
Pref := Prefix (Lhs);
end if;
if Ekind (Comp) /= E_Component
or else not Is_Aliased (Comp)
then
return False;
end if;
return not Comes_From_Source (Pref)
and then In_Instance
and then not Is_Constrained (Etype (Comp));
end Is_Aliased_Unconstrained_Component;
-- Start of processing for Apply_Discriminant_Check
begin
if Do_Access then
T_Typ := Designated_Type (Typ);
else
T_Typ := Typ;
end if;
-- If the expression is a function call that returns a limited object
-- it cannot be copied. It is not clear how to perform the proper
-- discriminant check in this case because the discriminant value must
-- be retrieved from the constructed object itself.
if Nkind (N) = N_Function_Call
and then Is_Limited_Type (Typ)
and then Is_Entity_Name (Name (N))
and then Returns_By_Ref (Entity (Name (N)))
then
return;
end if;
-- Only apply checks when generating code and discriminant checks are
-- not suppressed. In GNATprove mode, we do not apply the checks, but we
-- still analyze the expression to possibly issue errors on SPARK code
-- when a run-time error can be detected at compile time.
if not GNATprove_Mode then
if not Expander_Active
or else Discriminant_Checks_Suppressed (T_Typ)
then
return;
end if;
end if;
-- No discriminant checks necessary for an access when expression is
-- statically Null. This is not only an optimization, it is fundamental
-- because otherwise discriminant checks may be generated in init procs
-- for types containing an access to a not-yet-frozen record, causing a
-- deadly forward reference.
-- Also, if the expression is of an access type whose designated type is
-- incomplete, then the access value must be null and we suppress the
-- check.
if Known_Null (N) then
return;
elsif Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
if Ekind (S_Typ) = E_Incomplete_Type then
return;
end if;
end if;
-- If an assignment target is present, then we need to generate the
-- actual subtype if the target is a parameter or aliased object with
-- an unconstrained nominal subtype.
-- Ada 2005 (AI-363): For Ada 2005, we limit the building of the actual
-- subtype to the parameter and dereference cases, since other aliased
-- objects are unconstrained (unless the nominal subtype is explicitly
-- constrained).
if Present (Lhs)
and then (Present (Param_Entity (Lhs))
or else (Ada_Version < Ada_2005
and then not Is_Constrained (T_Typ)
and then Is_Aliased_View (Lhs)
and then not Is_Aliased_Unconstrained_Component)
or else (Ada_Version >= Ada_2005
and then not Is_Constrained (T_Typ)
and then Denotes_Explicit_Dereference (Lhs)
and then Nkind (Original_Node (Lhs)) /=
N_Function_Call))
then
T_Typ := Get_Actual_Subtype (Lhs);
end if;
-- Nothing to do if the type is unconstrained (this is the case where
-- the actual subtype in the RM sense of N is unconstrained and no check
-- is required).
if not Is_Constrained (T_Typ) then
return;
-- Ada 2005: nothing to do if the type is one for which there is a
-- partial view that is constrained.
elsif Ada_Version >= Ada_2005
and then Object_Type_Has_Constrained_Partial_View
(Typ => Base_Type (T_Typ),
Scop => Current_Scope)
then
return;
end if;
-- Nothing to do if the type is an Unchecked_Union
if Is_Unchecked_Union (Base_Type (T_Typ)) then
return;
end if;
-- Suppress checks if the subtypes are the same. The check must be
-- preserved in an assignment to a formal, because the constraint is
-- given by the actual.
if Nkind (Original_Node (N)) /= N_Allocator
and then (No (Lhs)
or else not Is_Entity_Name (Lhs)
or else No (Param_Entity (Lhs)))
then
if (Etype (N) = Typ
or else (Do_Access and then Designated_Type (Typ) = S_Typ))
and then not Is_Aliased_View (Lhs)
then
return;
end if;
-- We can also eliminate checks on allocators with a subtype mark that
-- coincides with the context type. The context type may be a subtype
-- without a constraint (common case, a generic actual).
elsif Nkind (Original_Node (N)) = N_Allocator
and then Is_Entity_Name (Expression (Original_Node (N)))
then
declare
Alloc_Typ : constant Entity_Id :=
Entity (Expression (Original_Node (N)));
begin
if Alloc_Typ = T_Typ
or else (Nkind (Parent (T_Typ)) = N_Subtype_Declaration
and then Is_Entity_Name (
Subtype_Indication (Parent (T_Typ)))
and then Alloc_Typ = Base_Type (T_Typ))
then
return;
end if;
end;
end if;
-- See if we have a case where the types are both constrained, and all
-- the constraints are constants. In this case, we can do the check
-- successfully at compile time.
-- We skip this check for the case where the node is rewritten as
-- an allocator, because it already carries the context subtype,
-- and extracting the discriminants from the aggregate is messy.
if Is_Constrained (S_Typ)
and then Nkind (Original_Node (N)) /= N_Allocator
then
declare
DconT : Elmt_Id;
Discr : Entity_Id;
DconS : Elmt_Id;
ItemS : Node_Id;
ItemT : Node_Id;
begin
-- S_Typ may not have discriminants in the case where it is a
-- private type completed by a default discriminated type. In that
-- case, we need to get the constraints from the underlying type.
-- If the underlying type is unconstrained (i.e. has no default
-- discriminants) no check is needed.
if Has_Discriminants (S_Typ) then
Discr := First_Discriminant (S_Typ);
DconS := First_Elmt (Discriminant_Constraint (S_Typ));
else
Discr := First_Discriminant (Underlying_Type (S_Typ));
DconS :=
First_Elmt
(Discriminant_Constraint (Underlying_Type (S_Typ)));
if No (DconS) then
return;
end if;
-- A further optimization: if T_Typ is derived from S_Typ
-- without imposing a constraint, no check is needed.
if Nkind (Original_Node (Parent (T_Typ))) =
N_Full_Type_Declaration
then
declare
Type_Def : constant Node_Id :=
Type_Definition (Original_Node (Parent (T_Typ)));
begin
if Nkind (Type_Def) = N_Derived_Type_Definition
and then Is_Entity_Name (Subtype_Indication (Type_Def))
and then Entity (Subtype_Indication (Type_Def)) = S_Typ
then
return;
end if;
end;
end if;
end if;
-- Constraint may appear in full view of type
if Ekind (T_Typ) = E_Private_Subtype
and then Present (Full_View (T_Typ))
then
DconT :=
First_Elmt (Discriminant_Constraint (Full_View (T_Typ)));
else
DconT :=
First_Elmt (Discriminant_Constraint (T_Typ));
end if;
while Present (Discr) loop
ItemS := Node (DconS);
ItemT := Node (DconT);
-- For a discriminated component type constrained by the
-- current instance of an enclosing type, there is no
-- applicable discriminant check.
if Nkind (ItemT) = N_Attribute_Reference
and then Is_Access_Type (Etype (ItemT))
and then Is_Entity_Name (Prefix (ItemT))
and then Is_Type (Entity (Prefix (ItemT)))
then
return;
end if;
-- If the expressions for the discriminants are identical
-- and it is side-effect free (for now just an entity),
-- this may be a shared constraint, e.g. from a subtype
-- without a constraint introduced as a generic actual.
-- Examine other discriminants if any.
if ItemS = ItemT
and then Is_Entity_Name (ItemS)
then
null;
elsif not Is_OK_Static_Expression (ItemS)
or else not Is_OK_Static_Expression (ItemT)
then
exit;
elsif Expr_Value (ItemS) /= Expr_Value (ItemT) then
if Do_Access then -- needs run-time check.
exit;
else
Apply_Compile_Time_Constraint_Error
(N, "incorrect value for discriminant&??",
CE_Discriminant_Check_Failed, Ent => Discr);
return;
end if;
end if;
Next_Elmt (DconS);
Next_Elmt (DconT);
Next_Discriminant (Discr);
end loop;
if No (Discr) then
return;
end if;
end;
end if;
-- In GNATprove mode, we do not apply the checks
if GNATprove_Mode then
return;
end if;
-- Here we need a discriminant check. First build the expression
-- for the comparisons of the discriminants:
-- (n.disc1 /= typ.disc1) or else
-- (n.disc2 /= typ.disc2) or else
-- ...
-- (n.discn /= typ.discn)
Cond := Build_Discriminant_Checks (N, T_Typ);
-- If Lhs is set and is a parameter, then the condition is guarded by:
-- lhs'constrained and then (condition built above)
if Present (Param_Entity (Lhs)) then
Cond :=
Make_And_Then (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Param_Entity (Lhs), Loc),
Attribute_Name => Name_Constrained),
Right_Opnd => Cond);
end if;
if Do_Access then
Cond := Guard_Access (Cond, Loc, N);
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end Apply_Discriminant_Check;
-------------------------
-- Apply_Divide_Checks --
-------------------------
procedure Apply_Divide_Checks (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Left : constant Node_Id := Left_Opnd (N);
Right : constant Node_Id := Right_Opnd (N);
Mode : constant Overflow_Mode_Type := Overflow_Check_Mode;
-- Current overflow checking mode
LLB : Uint;
Llo : Uint;
Lhi : Uint;
LOK : Boolean;
Rlo : Uint;
Rhi : Uint;
ROK : Boolean;
pragma Warnings (Off, Lhi);
-- Don't actually use this value
begin
-- If we are operating in MINIMIZED or ELIMINATED mode, and we are
-- operating on signed integer types, then the only thing this routine
-- does is to call Apply_Arithmetic_Overflow_Minimized_Eliminated. That
-- procedure will (possibly later on during recursive downward calls),
-- ensure that any needed overflow/division checks are properly applied.
if Mode in Minimized_Or_Eliminated
and then Is_Signed_Integer_Type (Typ)
then
Apply_Arithmetic_Overflow_Minimized_Eliminated (N);
return;
end if;
-- Proceed here in SUPPRESSED or CHECKED modes
if Expander_Active
and then not Backend_Divide_Checks_On_Target
and then Check_Needed (Right, Division_Check)
then
Determine_Range (Right, ROK, Rlo, Rhi, Assume_Valid => True);
-- Deal with division check
if Do_Division_Check (N)
and then not Division_Checks_Suppressed (Typ)
then
Apply_Division_Check (N, Rlo, Rhi, ROK);
end if;
-- Deal with overflow check
if Do_Overflow_Check (N)
and then not Overflow_Checks_Suppressed (Etype (N))
then
Set_Do_Overflow_Check (N, False);
-- Test for extremely annoying case of xxx'First divided by -1
-- for division of signed integer types (only overflow case).
if Nkind (N) = N_Op_Divide
and then Is_Signed_Integer_Type (Typ)
then
Determine_Range (Left, LOK, Llo, Lhi, Assume_Valid => True);
LLB := Expr_Value (Type_Low_Bound (Base_Type (Typ)));
if ((not ROK) or else (Rlo <= (-1) and then (-1) <= Rhi))
and then
((not LOK) or else (Llo = LLB))
then
-- Ensure that expressions are not evaluated twice (once
-- for their runtime checks and once for their regular
-- computation).
Force_Evaluation (Left, Mode => Strict);
Force_Evaluation (Right, Mode => Strict);
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Eq (Loc,
Left_Opnd =>
Duplicate_Subexpr_Move_Checks (Left),
Right_Opnd => Make_Integer_Literal (Loc, LLB)),
Right_Opnd =>
Make_Op_Eq (Loc,
Left_Opnd => Duplicate_Subexpr (Right),
Right_Opnd => Make_Integer_Literal (Loc, -1))),
Reason => CE_Overflow_Check_Failed));
end if;
end if;
end if;
end if;
end Apply_Divide_Checks;
--------------------------
-- Apply_Division_Check --
--------------------------
procedure Apply_Division_Check
(N : Node_Id;
Rlo : Uint;
Rhi : Uint;
ROK : Boolean)
is
pragma Assert (Do_Division_Check (N));
Loc : constant Source_Ptr := Sloc (N);
Right : constant Node_Id := Right_Opnd (N);
Opnd : Node_Id;
begin
if Expander_Active
and then not Backend_Divide_Checks_On_Target
and then Check_Needed (Right, Division_Check)
-- See if division by zero possible, and if so generate test. This
-- part of the test is not controlled by the -gnato switch, since it
-- is a Division_Check and not an Overflow_Check.
and then Do_Division_Check (N)
then
Set_Do_Division_Check (N, False);
if (not ROK) or else (Rlo <= 0 and then 0 <= Rhi) then
if Is_Floating_Point_Type (Etype (N)) then
Opnd := Make_Real_Literal (Loc, Ureal_0);
else
Opnd := Make_Integer_Literal (Loc, 0);
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (Right),
Right_Opnd => Opnd),
Reason => CE_Divide_By_Zero));
end if;
end if;
end Apply_Division_Check;
----------------------------------
-- Apply_Float_Conversion_Check --
----------------------------------
-- Let F and I be the source and target types of the conversion. The RM
-- specifies that a floating-point value X is rounded to the nearest
-- integer, with halfway cases being rounded away from zero. The rounded
-- value of X is checked against I'Range.
-- The catch in the above paragraph is that there is no good way to know
-- whether the round-to-integer operation resulted in overflow. A remedy is
-- to perform a range check in the floating-point domain instead, however:
-- (1) The bounds may not be known at compile time
-- (2) The check must take into account rounding or truncation.
-- (3) The range of type I may not be exactly representable in F.
-- (4) For the rounding case, the end-points I'First - 0.5 and
-- I'Last + 0.5 may or may not be in range, depending on the
-- sign of I'First and I'Last.
-- (5) X may be a NaN, which will fail any comparison
-- The following steps correctly convert X with rounding:
-- (1) If either I'First or I'Last is not known at compile time, use
-- I'Base instead of I in the next three steps and perform a
-- regular range check against I'Range after conversion.
-- (2) If I'First - 0.5 is representable in F then let Lo be that
-- value and define Lo_OK as (I'First > 0). Otherwise, let Lo be
-- F'Machine (I'First) and let Lo_OK be (Lo >= I'First).
-- In other words, take one of the closest floating-point numbers
-- (which is an integer value) to I'First, and see if it is in
-- range or not.
-- (3) If I'Last + 0.5 is representable in F then let Hi be that value
-- and define Hi_OK as (I'Last < 0). Otherwise, let Hi be
-- F'Machine (I'Last) and let Hi_OK be (Hi <= I'Last).
-- (4) Raise CE when (Lo_OK and X < Lo) or (not Lo_OK and X <= Lo)
-- or (Hi_OK and X > Hi) or (not Hi_OK and X >= Hi)
-- For the truncating case, replace steps (2) and (3) as follows:
-- (2) If I'First > 0, then let Lo be F'Pred (I'First) and let Lo_OK
-- be False. Otherwise, let Lo be F'Succ (I'First - 1) and let
-- Lo_OK be True.
-- (3) If I'Last < 0, then let Hi be F'Succ (I'Last) and let Hi_OK
-- be False. Otherwise let Hi be F'Pred (I'Last + 1) and let
-- Hi_OK be True.
procedure Apply_Float_Conversion_Check
(Expr : Node_Id;
Target_Typ : Entity_Id)
is
LB : constant Node_Id := Type_Low_Bound (Target_Typ);
HB : constant Node_Id := Type_High_Bound (Target_Typ);
Loc : constant Source_Ptr := Sloc (Expr);
Expr_Type : constant Entity_Id := Base_Type (Etype (Expr));
Target_Base : constant Entity_Id :=
Implementation_Base_Type (Target_Typ);
Par : constant Node_Id := Parent (Expr);
pragma Assert (Nkind (Par) = N_Type_Conversion);
-- Parent of check node, must be a type conversion
Truncate : constant Boolean := Float_Truncate (Par);
Max_Bound : constant Uint :=
UI_Expon
(Machine_Radix_Value (Expr_Type),
Machine_Mantissa_Value (Expr_Type) - 1) - 1;
-- Largest bound, so bound plus or minus half is a machine number of F
Ifirst, Ilast : Uint;
-- Bounds of integer type
Lo, Hi : Ureal;
-- Bounds to check in floating-point domain
Lo_OK, Hi_OK : Boolean;
-- True iff Lo resp. Hi belongs to I'Range
Lo_Chk, Hi_Chk : Node_Id;
-- Expressions that are False iff check fails
Reason : RT_Exception_Code;
begin
-- We do not need checks if we are not generating code (i.e. the full
-- expander is not active). In SPARK mode, we specifically don't want
-- the frontend to expand these checks, which are dealt with directly
-- in the formal verification backend.
if not Expander_Active then
return;
end if;
-- Here we will generate an explicit range check, so we don't want to
-- set the Do_Range check flag, since the range check is taken care of
-- by the code we will generate.
Set_Do_Range_Check (Expr, False);
if not Compile_Time_Known_Value (LB)
or not Compile_Time_Known_Value (HB)
then
declare
-- First check that the value falls in the range of the base type,
-- to prevent overflow during conversion and then perform a
-- regular range check against the (dynamic) bounds.
pragma Assert (Target_Base /= Target_Typ);
Temp : constant Entity_Id := Make_Temporary (Loc, 'T', Par);
begin
Apply_Float_Conversion_Check (Expr, Target_Base);
Set_Etype (Temp, Target_Base);
-- Note: Previously the declaration was inserted above the parent
-- of the conversion, apparently as a small optimization for the
-- subequent traversal in Insert_Actions. Unfortunately a similar
-- optimization takes place in Insert_Actions, assuming that the
-- insertion point must be above the expression that creates
-- actions. This is not correct in the presence of conditional
-- expressions, where the insertion must be in the list of actions
-- attached to the current alternative.
Insert_Action (Par,
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => New_Occurrence_Of (Target_Typ, Loc),
Expression => New_Copy_Tree (Par)),
Suppress => All_Checks);
Insert_Action (Par,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Temp, Loc),
Right_Opnd => New_Occurrence_Of (Target_Typ, Loc)),
Reason => CE_Range_Check_Failed));
Rewrite (Par, New_Occurrence_Of (Temp, Loc));
return;
end;
end if;
-- Get the (static) bounds of the target type
Ifirst := Expr_Value (LB);
Ilast := Expr_Value (HB);
-- A simple optimization: if the expression is a universal literal,
-- we can do the comparison with the bounds and the conversion to
-- an integer type statically. The range checks are unchanged.
if Nkind (Expr) = N_Real_Literal
and then Etype (Expr) = Universal_Real
and then Is_Integer_Type (Target_Typ)
then
declare
Int_Val : constant Uint := UR_To_Uint (Realval (Expr));
begin
if Int_Val <= Ilast and then Int_Val >= Ifirst then
-- Conversion is safe
Rewrite (Parent (Expr),
Make_Integer_Literal (Loc, UI_To_Int (Int_Val)));
Analyze_And_Resolve (Parent (Expr), Target_Typ);
return;
end if;
end;
end if;
-- Check against lower bound
if Truncate and then Ifirst > 0 then
Lo := Pred (Expr_Type, UR_From_Uint (Ifirst));
Lo_OK := False;
elsif Truncate then
Lo := Succ (Expr_Type, UR_From_Uint (Ifirst - 1));
Lo_OK := True;
elsif abs (Ifirst) < Max_Bound then
Lo := UR_From_Uint (Ifirst) - Ureal_Half;
Lo_OK := (Ifirst > 0);
else
Lo := Machine_Number (Expr_Type, UR_From_Uint (Ifirst), Expr);
Lo_OK := (Lo >= UR_From_Uint (Ifirst));
end if;
-- Saturate the lower bound to that of the expression's type, because
-- we do not want to create an out-of-range value but we still need to
-- do a comparison to catch NaNs.
if Lo < Expr_Value_R (Type_Low_Bound (Expr_Type)) then
Lo := Expr_Value_R (Type_Low_Bound (Expr_Type));
Lo_OK := True;
end if;
if Lo_OK then
-- Lo_Chk := (X >= Lo)
Lo_Chk := Make_Op_Ge (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Expr),
Right_Opnd => Make_Real_Literal (Loc, Lo));
else
-- Lo_Chk := (X > Lo)
Lo_Chk := Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Expr),
Right_Opnd => Make_Real_Literal (Loc, Lo));
end if;
-- Check against higher bound
if Truncate and then Ilast < 0 then
Hi := Succ (Expr_Type, UR_From_Uint (Ilast));
Hi_OK := False;
elsif Truncate then
Hi := Pred (Expr_Type, UR_From_Uint (Ilast + 1));
Hi_OK := True;
elsif abs (Ilast) < Max_Bound then
Hi := UR_From_Uint (Ilast) + Ureal_Half;
Hi_OK := (Ilast < 0);
else
Hi := Machine_Number (Expr_Type, UR_From_Uint (Ilast), Expr);
Hi_OK := (Hi <= UR_From_Uint (Ilast));
end if;
-- Saturate the higher bound to that of the expression's type, because
-- we do not want to create an out-of-range value but we still need to
-- do a comparison to catch NaNs.
if Hi > Expr_Value_R (Type_High_Bound (Expr_Type)) then
Hi := Expr_Value_R (Type_High_Bound (Expr_Type));
Hi_OK := True;
end if;
if Hi_OK then
-- Hi_Chk := (X <= Hi)
Hi_Chk := Make_Op_Le (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Expr),
Right_Opnd => Make_Real_Literal (Loc, Hi));
else
-- Hi_Chk := (X < Hi)
Hi_Chk := Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Expr),
Right_Opnd => Make_Real_Literal (Loc, Hi));
end if;
-- If the bounds of the target type are the same as those of the base
-- type, the check is an overflow check as a range check is not
-- performed in these cases.
if Expr_Value (Type_Low_Bound (Target_Base)) = Ifirst
and then Expr_Value (Type_High_Bound (Target_Base)) = Ilast
then
Reason := CE_Overflow_Check_Failed;
else
Reason := CE_Range_Check_Failed;
end if;
-- Raise CE if either conditions does not hold
Insert_Action (Expr,
Make_Raise_Constraint_Error (Loc,
Condition => Make_Op_Not (Loc, Make_And_Then (Loc, Lo_Chk, Hi_Chk)),
Reason => Reason));
end Apply_Float_Conversion_Check;
------------------------
-- Apply_Length_Check --
------------------------
procedure Apply_Length_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty)
is
begin
Apply_Selected_Length_Checks
(Expr, Target_Typ, Source_Typ, Do_Static => False);
end Apply_Length_Check;
--------------------------------------
-- Apply_Length_Check_On_Assignment --
--------------------------------------
procedure Apply_Length_Check_On_Assignment
(Expr : Node_Id;
Target_Typ : Entity_Id;
Target : Node_Id;
Source_Typ : Entity_Id := Empty)
is
Assign : constant Node_Id := Parent (Target);
begin
-- No check is needed for the initialization of an object whose
-- nominal subtype is unconstrained.
if Is_Constr_Subt_For_U_Nominal (Target_Typ)
and then Nkind (Parent (Assign)) = N_Freeze_Entity
and then Is_Entity_Name (Target)
and then Entity (Target) = Entity (Parent (Assign))
then
return;
end if;
Apply_Selected_Length_Checks
(Expr, Target_Typ, Source_Typ, Do_Static => False);
end Apply_Length_Check_On_Assignment;
-------------------------------------
-- Apply_Parameter_Aliasing_Checks --
-------------------------------------
procedure Apply_Parameter_Aliasing_Checks
(Call : Node_Id;
Subp : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (Call);
function Parameter_Passing_Mechanism_Specified
(Typ : Entity_Id)
return Boolean;
-- Returns True if parameter-passing mechanism is specified for type Typ
function May_Cause_Aliasing
(Formal_1 : Entity_Id;
Formal_2 : Entity_Id) return Boolean;
-- Determine whether two formal parameters can alias each other
-- depending on their modes.
function Original_Actual (N : Node_Id) return Node_Id;
-- The expander may replace an actual with a temporary for the sake of
-- side effect removal. The temporary may hide a potential aliasing as
-- it does not share the address of the actual. This routine attempts
-- to retrieve the original actual.
procedure Overlap_Check
(Actual_1 : Node_Id;
Actual_2 : Node_Id;
Formal_1 : Entity_Id;
Formal_2 : Entity_Id;
Check : in out Node_Id);
-- Create a check to determine whether Actual_1 overlaps with Actual_2.
-- If detailed exception messages are enabled, the check is augmented to
-- provide information about the names of the corresponding formals. See
-- the body for details. Actual_1 and Actual_2 denote the two actuals to
-- be tested. Formal_1 and Formal_2 denote the corresponding formals.
-- Check contains all and-ed simple tests generated so far or remains
-- unchanged in the case of detailed exception messaged.
-------------------------------------------
-- Parameter_Passing_Mechanism_Specified --
-------------------------------------------
function Parameter_Passing_Mechanism_Specified
(Typ : Entity_Id)
return Boolean
is
begin
return Is_Elementary_Type (Typ)
or else Is_By_Reference_Type (Typ);
end Parameter_Passing_Mechanism_Specified;
------------------------
-- May_Cause_Aliasing --
------------------------
function May_Cause_Aliasing
(Formal_1 : Entity_Id;
Formal_2 : Entity_Id) return Boolean
is
begin
-- The following combination cannot lead to aliasing
-- Formal 1 Formal 2
-- IN IN
if Ekind (Formal_1) = E_In_Parameter
and then
Ekind (Formal_2) = E_In_Parameter
then
return False;
-- The following combinations may lead to aliasing
-- Formal 1 Formal 2
-- IN OUT
-- IN IN OUT
-- OUT IN
-- OUT IN OUT
-- OUT OUT
else
return True;
end if;
end May_Cause_Aliasing;
---------------------
-- Original_Actual --
---------------------
function Original_Actual (N : Node_Id) return Node_Id is
begin
if Nkind (N) = N_Type_Conversion then
return Expression (N);
-- The expander created a temporary to capture the result of a type
-- conversion where the expression is the real actual.
elsif Nkind (N) = N_Identifier
and then Present (Original_Node (N))
and then Nkind (Original_Node (N)) = N_Type_Conversion
then
return Expression (Original_Node (N));
end if;
return N;
end Original_Actual;
-------------------
-- Overlap_Check --
-------------------
procedure Overlap_Check
(Actual_1 : Node_Id;
Actual_2 : Node_Id;
Formal_1 : Entity_Id;
Formal_2 : Entity_Id;
Check : in out Node_Id)
is
Cond : Node_Id;
Formal_Name : Bounded_String;
begin
-- Generate:
-- Actual_1'Overlaps_Storage (Actual_2)
Cond :=
Make_Attribute_Reference (Loc,
Prefix => New_Copy_Tree (Original_Actual (Actual_1)),
Attribute_Name => Name_Overlaps_Storage,
Expressions =>
New_List (New_Copy_Tree (Original_Actual (Actual_2))));
-- Generate the following check when detailed exception messages are
-- enabled:
-- if Actual_1'Overlaps_Storage (Actual_2) then
-- raise Program_Error with <detailed message>;
-- end if;
if Exception_Extra_Info then
Start_String;
-- Do not generate location information for internal calls
if Comes_From_Source (Call) then
Store_String_Chars (Build_Location_String (Loc));
Store_String_Char (' ');
end if;
Store_String_Chars ("aliased parameters, actuals for """);
Append (Formal_Name, Chars (Formal_1));
Adjust_Name_Case (Formal_Name, Sloc (Formal_1));
Store_String_Chars (To_String (Formal_Name));
Store_String_Chars (""" and """);
Formal_Name.Length := 0;
Append (Formal_Name, Chars (Formal_2));
Adjust_Name_Case (Formal_Name, Sloc (Formal_2));
Store_String_Chars (To_String (Formal_Name));
Store_String_Chars (""" overlap");
Insert_Action (Call,
Make_If_Statement (Loc,
Condition => Cond,
Then_Statements => New_List (
Make_Raise_Statement (Loc,
Name =>
New_Occurrence_Of (Standard_Program_Error, Loc),
Expression => Make_String_Literal (Loc, End_String)))));
-- Create a sequence of overlapping checks by and-ing them all
-- together.
else
if No (Check) then
Check := Cond;
else
Check :=
Make_And_Then (Loc,
Left_Opnd => Check,
Right_Opnd => Cond);
end if;
end if;
end Overlap_Check;
-- Local variables
Actual_1 : Node_Id;
Actual_2 : Node_Id;
Check : Node_Id;
Formal_1 : Entity_Id;
Formal_2 : Entity_Id;
Orig_Act_1 : Node_Id;
Orig_Act_2 : Node_Id;
-- Start of processing for Apply_Parameter_Aliasing_Checks
begin
Check := Empty;
Actual_1 := First_Actual (Call);
Formal_1 := First_Formal (Subp);
while Present (Actual_1) and then Present (Formal_1) loop
Orig_Act_1 := Original_Actual (Actual_1);
if Is_Name_Reference (Orig_Act_1) then
Actual_2 := Next_Actual (Actual_1);
Formal_2 := Next_Formal (Formal_1);
while Present (Actual_2) and then Present (Formal_2) loop
Orig_Act_2 := Original_Actual (Actual_2);
-- Generate the check only when the mode of the two formals may
-- lead to aliasing.
if Is_Name_Reference (Orig_Act_2)
and then May_Cause_Aliasing (Formal_1, Formal_2)
then
-- The aliasing check only applies when some of the formals
-- have their passing mechanism unspecified; RM 6.2 (12/3).
if Parameter_Passing_Mechanism_Specified (Etype (Orig_Act_1))
and then
Parameter_Passing_Mechanism_Specified (Etype (Orig_Act_2))
then
null;
else
Remove_Side_Effects (Actual_1);
Remove_Side_Effects (Actual_2);
Overlap_Check
(Actual_1 => Actual_1,
Actual_2 => Actual_2,
Formal_1 => Formal_1,
Formal_2 => Formal_2,
Check => Check);
end if;
end if;
Next_Actual (Actual_2);
Next_Formal (Formal_2);
end loop;
end if;
Next_Actual (Actual_1);
Next_Formal (Formal_1);
end loop;
-- Place a simple check right before the call
if Present (Check) and then not Exception_Extra_Info then
Insert_Action (Call,
Make_Raise_Program_Error (Loc,
Condition => Check,
Reason => PE_Aliased_Parameters));
end if;
end Apply_Parameter_Aliasing_Checks;
-------------------------------------
-- Apply_Parameter_Validity_Checks --
-------------------------------------
procedure Apply_Parameter_Validity_Checks (Subp : Entity_Id) is
Subp_Decl : Node_Id;
procedure Add_Validity_Check
(Formal : Entity_Id;
Prag_Nam : Name_Id;
For_Result : Boolean := False);
-- Add a single 'Valid[_Scalars] check which verifies the initialization
-- of Formal. Prag_Nam denotes the pre or post condition pragma name.
-- Set flag For_Result when to verify the result of a function.
------------------------
-- Add_Validity_Check --
------------------------
procedure Add_Validity_Check
(Formal : Entity_Id;
Prag_Nam : Name_Id;
For_Result : Boolean := False)
is
procedure Build_Pre_Post_Condition (Expr : Node_Id);
-- Create a pre/postcondition pragma that tests expression Expr
------------------------------
-- Build_Pre_Post_Condition --
------------------------------
procedure Build_Pre_Post_Condition (Expr : Node_Id) is
Loc : constant Source_Ptr := Sloc (Subp);
Decls : List_Id;
Prag : Node_Id;
begin
Prag :=
Make_Pragma (Loc,
Chars => Prag_Nam,
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc,
Chars => Name_Check,
Expression => Expr)));
-- Add a message unless exception messages are suppressed
if not Exception_Locations_Suppressed then
Append_To (Pragma_Argument_Associations (Prag),
Make_Pragma_Argument_Association (Loc,
Chars => Name_Message,
Expression =>
Make_String_Literal (Loc,
Strval => "failed "
& Get_Name_String (Prag_Nam)
& " from "
& Build_Location_String (Loc))));
end if;
-- Insert the pragma in the tree
if Nkind (Parent (Subp_Decl)) = N_Compilation_Unit then
Add_Global_Declaration (Prag);
Analyze (Prag);
-- PPC pragmas associated with subprogram bodies must be inserted
-- in the declarative part of the body.
elsif Nkind (Subp_Decl) = N_Subprogram_Body then
Decls := Declarations (Subp_Decl);
if No (Decls) then
Decls := New_List;
Set_Declarations (Subp_Decl, Decls);
end if;
Prepend_To (Decls, Prag);
Analyze (Prag);
-- For subprogram declarations insert the PPC pragma right after
-- the declarative node.
else
Insert_After_And_Analyze (Subp_Decl, Prag);
end if;
end Build_Pre_Post_Condition;
-- Local variables
Loc : constant Source_Ptr := Sloc (Subp);
Typ : constant Entity_Id := Etype (Formal);
Check : Node_Id;
Nam : Name_Id;
-- Start of processing for Add_Validity_Check
begin
-- For scalars, generate 'Valid test
if Is_Scalar_Type (Typ) then
Nam := Name_Valid;
-- For any non-scalar with scalar parts, generate 'Valid_Scalars test
elsif Scalar_Part_Present (Typ) then
Nam := Name_Valid_Scalars;
-- No test needed for other cases (no scalars to test)
else
return;
end if;
-- Step 1: Create the expression to verify the validity of the
-- context.
Check := New_Occurrence_Of (Formal, Loc);
-- When processing a function result, use 'Result. Generate
-- Context'Result
if For_Result then
Check :=
Make_Attribute_Reference (Loc,
Prefix => Check,
Attribute_Name => Name_Result);
end if;
-- Generate:
-- Context['Result]'Valid[_Scalars]
Check :=
Make_Attribute_Reference (Loc,
Prefix => Check,
Attribute_Name => Nam);
-- Step 2: Create a pre or post condition pragma
Build_Pre_Post_Condition (Check);
end Add_Validity_Check;
-- Local variables
Formal : Entity_Id;
Subp_Spec : Node_Id;
-- Start of processing for Apply_Parameter_Validity_Checks
begin
-- Extract the subprogram specification and declaration nodes
Subp_Spec := Parent (Subp);
if No (Subp_Spec) then
return;
end if;
if Nkind (Subp_Spec) = N_Defining_Program_Unit_Name then
Subp_Spec := Parent (Subp_Spec);
end if;
Subp_Decl := Parent (Subp_Spec);
if not Comes_From_Source (Subp)
-- Do not process formal subprograms because the corresponding actual
-- will receive the proper checks when the instance is analyzed.
or else Is_Formal_Subprogram (Subp)
-- Do not process imported subprograms since pre and postconditions
-- are never verified on routines coming from a different language.
or else Is_Imported (Subp)
or else Is_Intrinsic_Subprogram (Subp)
-- The PPC pragmas generated by this routine do not correspond to
-- source aspects, therefore they cannot be applied to abstract
-- subprograms.
or else Nkind (Subp_Decl) = N_Abstract_Subprogram_Declaration
-- Do not consider subprogram renaminds because the renamed entity
-- already has the proper PPC pragmas.
or else Nkind (Subp_Decl) = N_Subprogram_Renaming_Declaration
-- Do not process null procedures because there is no benefit of
-- adding the checks to a no action routine.
or else (Nkind (Subp_Spec) = N_Procedure_Specification
and then Null_Present (Subp_Spec))
then
return;
end if;
-- Inspect all the formals applying aliasing and scalar initialization
-- checks where applicable.
Formal := First_Formal (Subp);
while Present (Formal) loop
-- Generate the following scalar initialization checks for each
-- formal parameter:
-- mode IN - Pre => Formal'Valid[_Scalars]
-- mode IN OUT - Pre, Post => Formal'Valid[_Scalars]
-- mode OUT - Post => Formal'Valid[_Scalars]
if Ekind (Formal) in E_In_Parameter | E_In_Out_Parameter then
Add_Validity_Check (Formal, Name_Precondition, False);
end if;
if Ekind (Formal) in E_In_Out_Parameter | E_Out_Parameter then
Add_Validity_Check (Formal, Name_Postcondition, False);
end if;
Next_Formal (Formal);
end loop;
-- Generate following scalar initialization check for function result:
-- Post => Subp'Result'Valid[_Scalars]
if Ekind (Subp) = E_Function then
Add_Validity_Check (Subp, Name_Postcondition, True);
end if;
end Apply_Parameter_Validity_Checks;
---------------------------
-- Apply_Predicate_Check --
---------------------------
procedure Apply_Predicate_Check
(N : Node_Id;
Typ : Entity_Id;
Fun : Entity_Id := Empty)
is
Par : Node_Id;
S : Entity_Id;
Check_Disabled : constant Boolean := (not Predicate_Enabled (Typ))
or else not Predicate_Check_In_Scope (N);
begin
S := Current_Scope;
while Present (S) and then not Is_Subprogram (S) loop
S := Scope (S);
end loop;
-- If the check appears within the predicate function itself, it means
-- that the user specified a check whose formal is the predicated
-- subtype itself, rather than some covering type. This is likely to be
-- a common error, and thus deserves a warning. We want to emit this
-- warning even if predicate checking is disabled (in which case the
-- warning is still useful even if it is not strictly accurate).
if Present (S) and then S = Predicate_Function (Typ) then
Error_Msg_NE
("predicate check includes a call to& that requires a "
& "predicate check??", Parent (N), Fun);
Error_Msg_N
("\this will result in infinite recursion??", Parent (N));
if Is_First_Subtype (Typ) then
Error_Msg_NE
("\use an explicit subtype of& to carry the predicate",
Parent (N), Typ);
end if;
if not Check_Disabled then
Insert_Action (N,
Make_Raise_Storage_Error (Sloc (N),
Reason => SE_Infinite_Recursion));
return;
end if;
end if;
if Check_Disabled then
return;
end if;
-- Normal case of predicate active
-- If the expression is an IN parameter, the predicate will have
-- been applied at the point of call. An additional check would
-- be redundant, or will lead to out-of-scope references if the
-- call appears within an aspect specification for a precondition.
-- However, if the reference is within the body of the subprogram
-- that declares the formal, the predicate can safely be applied,
-- which may be necessary for a nested call whose formal has a
-- different predicate.
if Is_Entity_Name (N)
and then Ekind (Entity (N)) = E_In_Parameter
then
declare
In_Body : Boolean := False;
P : Node_Id := Parent (N);
begin
while Present (P) loop
if Nkind (P) = N_Subprogram_Body
and then
((Present (Corresponding_Spec (P))
and then
Corresponding_Spec (P) = Scope (Entity (N)))
or else
Defining_Unit_Name (Specification (P)) =
Scope (Entity (N)))
then
In_Body := True;
exit;
end if;
P := Parent (P);
end loop;
if not In_Body then
return;
end if;
end;
end if;
-- If the type has a static predicate and the expression is known
-- at compile time, see if the expression satisfies the predicate.
Check_Expression_Against_Static_Predicate (N, Typ);
if not Expander_Active then
return;
end if;
Par := Parent (N);
if Nkind (Par) = N_Qualified_Expression then
Par := Parent (Par);
end if;
-- For an entity of the type, generate a call to the predicate
-- function, unless its type is an actual subtype, which is not
-- visible outside of the enclosing subprogram.
if Is_Entity_Name (N)
and then not Is_Actual_Subtype (Typ)
then
Insert_Action (N,
Make_Predicate_Check
(Typ, New_Occurrence_Of (Entity (N), Sloc (N))));
return;
elsif Nkind (N) in N_Aggregate | N_Extension_Aggregate then
-- If the expression is an aggregate in an assignment, apply the
-- check to the LHS after the assignment, rather than create a
-- redundant temporary. This is only necessary in rare cases
-- of array types (including strings) initialized with an
-- aggregate with an "others" clause, either coming from source
-- or generated by an Initialize_Scalars pragma.
if Nkind (Par) = N_Assignment_Statement then
Insert_Action_After (Par,
Make_Predicate_Check
(Typ, Duplicate_Subexpr (Name (Par))));
return;
-- Similarly, if the expression is an aggregate in an object
-- declaration, apply it to the object after the declaration.
-- This is only necessary in rare cases of tagged extensions
-- initialized with an aggregate with an "others => <>" clause.
elsif Nkind (Par) = N_Object_Declaration then
Insert_Action_After (Par,
Make_Predicate_Check (Typ,
New_Occurrence_Of (Defining_Identifier (Par), Sloc (N))));
return;
end if;
end if;
-- If the expression is not an entity it may have side effects,
-- and the following call will create an object declaration for
-- it. We disable checks during its analysis, to prevent an
-- infinite recursion.
Insert_Action (N,
Make_Predicate_Check
(Typ, Duplicate_Subexpr (N)), Suppress => All_Checks);
end Apply_Predicate_Check;
-----------------------
-- Apply_Range_Check --
-----------------------
procedure Apply_Range_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Insert_Node : Node_Id := Empty)
is
Checks_On : constant Boolean :=
not Index_Checks_Suppressed (Target_Typ)
or else
not Range_Checks_Suppressed (Target_Typ);
Loc : constant Source_Ptr := Sloc (Expr);
Cond : Node_Id;
R_Cno : Node_Id;
R_Result : Check_Result;
begin
-- Only apply checks when generating code. In GNATprove mode, we do not
-- apply the checks, but we still call Selected_Range_Checks to possibly
-- issue errors on SPARK code when a run-time error can be detected at
-- compile time.
if not GNATprove_Mode then
if not Expander_Active or not Checks_On then
return;
end if;
end if;
R_Result :=
Selected_Range_Checks (Expr, Target_Typ, Source_Typ, Insert_Node);
if GNATprove_Mode then
return;
end if;
for J in 1 .. 2 loop
R_Cno := R_Result (J);
exit when No (R_Cno);
-- The range check requires runtime evaluation. Depending on what its
-- triggering condition is, the check may be converted into a compile
-- time constraint check.
if Nkind (R_Cno) = N_Raise_Constraint_Error
and then Present (Condition (R_Cno))
then
Cond := Condition (R_Cno);
-- Insert the range check before the related context. Note that
-- this action analyses the triggering condition.
if Present (Insert_Node) then
Insert_Action (Insert_Node, R_Cno);
else
Insert_Action (Expr, R_Cno);
end if;
-- The triggering condition evaluates to True, the range check
-- can be converted into a compile time constraint check.
if Is_Entity_Name (Cond)
and then Entity (Cond) = Standard_True
then
-- Since an N_Range is technically not an expression, we have
-- to set one of the bounds to C_E and then just flag the
-- N_Range. The warning message will point to the lower bound
-- and complain about a range, which seems OK.
if Nkind (Expr) = N_Range then
Apply_Compile_Time_Constraint_Error
(Low_Bound (Expr),
"static range out of bounds of}??",
CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
Set_Raises_Constraint_Error (Expr);
else
Apply_Compile_Time_Constraint_Error
(Expr,
"static value out of range of}??",
CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
end if;
end if;
-- The range check raises Constraint_Error explicitly
elsif Present (Insert_Node) then
R_Cno :=
Make_Raise_Constraint_Error (Sloc (Insert_Node),
Reason => CE_Range_Check_Failed);
Insert_Action (Insert_Node, R_Cno);
else
Install_Static_Check (R_Cno, Loc);
end if;
end loop;
end Apply_Range_Check;
------------------------------
-- Apply_Scalar_Range_Check --
------------------------------
-- Note that Apply_Scalar_Range_Check never turns the Do_Range_Check flag
-- off if it is already set on.
procedure Apply_Scalar_Range_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Fixed_Int : Boolean := False)
is
Parnt : constant Node_Id := Parent (Expr);
S_Typ : Entity_Id;
Arr : Node_Id := Empty; -- initialize to prevent warning
Arr_Typ : Entity_Id := Empty; -- initialize to prevent warning
Is_Subscr_Ref : Boolean;
-- Set true if Expr is a subscript
Is_Unconstrained_Subscr_Ref : Boolean;
-- Set true if Expr is a subscript of an unconstrained array. In this
-- case we do not attempt to do an analysis of the value against the
-- range of the subscript, since we don't know the actual subtype.
Int_Real : Boolean;
-- Set to True if Expr should be regarded as a real value even though
-- the type of Expr might be discrete.
procedure Bad_Value (Warn : Boolean := False);
-- Procedure called if value is determined to be out of range. Warn is
-- True to force a warning instead of an error, even when SPARK_Mode is
-- On.
---------------
-- Bad_Value --
---------------
procedure Bad_Value (Warn : Boolean := False) is
begin
Apply_Compile_Time_Constraint_Error
(Expr, "value not in range of}??", CE_Range_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ,
Warn => Warn);
end Bad_Value;
-- Start of processing for Apply_Scalar_Range_Check
begin
-- Return if check obviously not needed
if
-- Not needed inside generic
Inside_A_Generic
-- Not needed if previous error
or else Target_Typ = Any_Type
or else Nkind (Expr) = N_Error
-- Not needed for non-scalar type
or else not Is_Scalar_Type (Target_Typ)
-- Not needed if we know node raises CE already
or else Raises_Constraint_Error (Expr)
then
return;
end if;
-- Now, see if checks are suppressed
Is_Subscr_Ref :=
Is_List_Member (Expr) and then Nkind (Parnt) = N_Indexed_Component;
if Is_Subscr_Ref then
Arr := Prefix (Parnt);
Arr_Typ := Get_Actual_Subtype_If_Available (Arr);
if Is_Access_Type (Arr_Typ) then
Arr_Typ := Designated_Type (Arr_Typ);
end if;
end if;
if not Do_Range_Check (Expr) then
-- Subscript reference. Check for Index_Checks suppressed
if Is_Subscr_Ref then
-- Check array type and its base type
if Index_Checks_Suppressed (Arr_Typ)
or else Index_Checks_Suppressed (Base_Type (Arr_Typ))
then
return;
-- Check array itself if it is an entity name
elsif Is_Entity_Name (Arr)
and then Index_Checks_Suppressed (Entity (Arr))
then
return;
-- Check expression itself if it is an entity name
elsif Is_Entity_Name (Expr)
and then Index_Checks_Suppressed (Entity (Expr))
then
return;
end if;
-- All other cases, check for Range_Checks suppressed
else
-- Check target type and its base type
if Range_Checks_Suppressed (Target_Typ)
or else Range_Checks_Suppressed (Base_Type (Target_Typ))
then
return;
-- Check expression itself if it is an entity name
elsif Is_Entity_Name (Expr)
and then Range_Checks_Suppressed (Entity (Expr))
then
return;
-- If Expr is part of an assignment statement, then check left
-- side of assignment if it is an entity name.
elsif Nkind (Parnt) = N_Assignment_Statement
and then Is_Entity_Name (Name (Parnt))
and then Range_Checks_Suppressed (Entity (Name (Parnt)))
then
return;
end if;
end if;
end if;
-- Do not set range checks if they are killed
if Nkind (Expr) = N_Unchecked_Type_Conversion
and then Kill_Range_Check (Expr)
then
return;
end if;
-- Do not set range checks for any values from System.Scalar_Values
-- since the whole idea of such values is to avoid checking them.
if Is_Entity_Name (Expr)
and then Is_RTU (Scope (Entity (Expr)), System_Scalar_Values)
then
return;
end if;
-- Now see if we need a check
if No (Source_Typ) then
S_Typ := Etype (Expr);
else
S_Typ := Source_Typ;
end if;
if not Is_Scalar_Type (S_Typ) or else S_Typ = Any_Type then
return;
end if;
Is_Unconstrained_Subscr_Ref :=
Is_Subscr_Ref and then not Is_Constrained (Arr_Typ);
-- Special checks for floating-point type
if Is_Floating_Point_Type (S_Typ) then
-- Always do a range check if the source type includes infinities and
-- the target type does not include infinities. We do not do this if
-- range checks are killed.
-- If the expression is a literal and the bounds of the type are
-- static constants it may be possible to optimize the check.
if Has_Infinities (S_Typ)
and then not Has_Infinities (Target_Typ)
then
-- If the expression is a literal and the bounds of the type are
-- static constants it may be possible to optimize the check.
if Nkind (Expr) = N_Real_Literal then
declare
Tlo : constant Node_Id := Type_Low_Bound (Target_Typ);
Thi : constant Node_Id := Type_High_Bound (Target_Typ);
begin
if Compile_Time_Known_Value (Tlo)
and then Compile_Time_Known_Value (Thi)
and then Expr_Value_R (Expr) >= Expr_Value_R (Tlo)
and then Expr_Value_R (Expr) <= Expr_Value_R (Thi)
then
return;
else
Enable_Range_Check (Expr);
end if;
end;
else
Enable_Range_Check (Expr);
end if;
end if;
end if;
-- Return if we know expression is definitely in the range of the target
-- type as determined by Determine_Range_To_Discrete. Right now we only
-- do this for discrete target types, i.e. neither for fixed-point nor
-- for floating-point types. But the additional less precise tests below
-- catch these cases.
-- Note: skip this if we are given a source_typ, since the point of
-- supplying a Source_Typ is to stop us looking at the expression.
-- We could sharpen this test to be out parameters only ???
if Is_Discrete_Type (Target_Typ)
and then not Is_Unconstrained_Subscr_Ref
and then No (Source_Typ)
then
declare
Thi : constant Node_Id := Type_High_Bound (Target_Typ);
Tlo : constant Node_Id := Type_Low_Bound (Target_Typ);
begin
if Compile_Time_Known_Value (Tlo)
and then Compile_Time_Known_Value (Thi)
then
declare
OK : Boolean := False; -- initialize to prevent warning
Hiv : constant Uint := Expr_Value (Thi);
Lov : constant Uint := Expr_Value (Tlo);
Hi : Uint := No_Uint;
Lo : Uint := No_Uint;
begin
-- If range is null, we for sure have a constraint error (we
-- don't even need to look at the value involved, since all
-- possible values will raise CE).
if Lov > Hiv then
-- When SPARK_Mode is On, force a warning instead of
-- an error in that case, as this likely corresponds
-- to deactivated code.
Bad_Value (Warn => SPARK_Mode = On);
return;
end if;
-- Otherwise determine range of value
Determine_Range_To_Discrete
(Expr, OK, Lo, Hi, Fixed_Int, Assume_Valid => True);
if OK then
-- If definitely in range, all OK
if Lo >= Lov and then Hi <= Hiv then
return;
-- If definitely not in range, warn
elsif Lov > Hi or else Hiv < Lo then
-- Ignore out of range values for System.Priority in
-- CodePeer mode since the actual target compiler may
-- provide a wider range.
if not CodePeer_Mode
or else not Is_RTE (Target_Typ, RE_Priority)
then
Bad_Value;
end if;
return;
-- Otherwise we don't know
else
null;
end if;
end if;
end;
end if;
end;
end if;
Int_Real :=
Is_Floating_Point_Type (S_Typ)
or else (Is_Fixed_Point_Type (S_Typ) and then not Fixed_Int);
-- Check if we can determine at compile time whether Expr is in the
-- range of the target type. Note that if S_Typ is within the bounds
-- of Target_Typ then this must be the case. This check is meaningful
-- only if this is not a conversion between integer and real types,
-- unless for a fixed-point type if Fixed_Int is set.
if not Is_Unconstrained_Subscr_Ref
and then (Is_Discrete_Type (S_Typ) = Is_Discrete_Type (Target_Typ)
or else (Fixed_Int and then Is_Discrete_Type (Target_Typ)))
and then
(In_Subrange_Of (S_Typ, Target_Typ, Fixed_Int)
-- Also check if the expression itself is in the range of the
-- target type if it is a known at compile time value. We skip
-- this test if S_Typ is set since for OUT and IN OUT parameters
-- the Expr itself is not relevant to the checking.
or else
(No (Source_Typ)
and then Is_In_Range (Expr, Target_Typ,
Assume_Valid => True,
Fixed_Int => Fixed_Int,
Int_Real => Int_Real)))
then
return;
elsif Is_Out_Of_Range (Expr, Target_Typ,
Assume_Valid => True,
Fixed_Int => Fixed_Int,
Int_Real => Int_Real)
then
Bad_Value;
return;
-- Floating-point case
-- In the floating-point case, we only do range checks if the type is
-- constrained. We definitely do NOT want range checks for unconstrained
-- types, since we want to have infinities, except when
-- Check_Float_Overflow is set.
elsif Is_Floating_Point_Type (S_Typ) then
if Is_Constrained (S_Typ) or else Check_Float_Overflow then
Enable_Range_Check (Expr);
end if;
-- For all other cases we enable a range check unconditionally
else
Enable_Range_Check (Expr);
return;
end if;
end Apply_Scalar_Range_Check;
----------------------------------
-- Apply_Selected_Length_Checks --
----------------------------------
procedure Apply_Selected_Length_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Do_Static : Boolean)
is
Checks_On : constant Boolean :=
not Index_Checks_Suppressed (Target_Typ)
or else
not Length_Checks_Suppressed (Target_Typ);
Loc : constant Source_Ptr := Sloc (Expr);
Cond : Node_Id;
R_Cno : Node_Id;
R_Result : Check_Result;
begin
-- Only apply checks when generating code
-- Note: this means that we lose some useful warnings if the expander
-- is not active.
if not Expander_Active then
return;
end if;
R_Result :=
Selected_Length_Checks (Expr, Target_Typ, Source_Typ, Empty);
for J in 1 .. 2 loop
R_Cno := R_Result (J);
exit when No (R_Cno);
-- A length check may mention an Itype which is attached to a
-- subsequent node. At the top level in a package this can cause
-- an order-of-elaboration problem, so we make sure that the itype
-- is referenced now.
if Ekind (Current_Scope) = E_Package
and then Is_Compilation_Unit (Current_Scope)
then
Ensure_Defined (Target_Typ, Expr);
if Present (Source_Typ) then
Ensure_Defined (Source_Typ, Expr);
elsif Is_Itype (Etype (Expr)) then
Ensure_Defined (Etype (Expr), Expr);
end if;
end if;
if Nkind (R_Cno) = N_Raise_Constraint_Error
and then Present (Condition (R_Cno))
then
Cond := Condition (R_Cno);
-- Case where node does not now have a dynamic check
if not Has_Dynamic_Length_Check (Expr) then
-- If checks are on, just insert the check
if Checks_On then
Insert_Action (Expr, R_Cno);
if not Do_Static then
Set_Has_Dynamic_Length_Check (Expr);
end if;
-- If checks are off, then analyze the length check after
-- temporarily attaching it to the tree in case the relevant
-- condition can be evaluated at compile time. We still want a
-- compile time warning in this case.
else
Set_Parent (R_Cno, Expr);
Analyze (R_Cno);
end if;
end if;
-- Output a warning if the condition is known to be True
if Is_Entity_Name (Cond)
and then Entity (Cond) = Standard_True
then
Apply_Compile_Time_Constraint_Error
(Expr, "wrong length for array of}??",
CE_Length_Check_Failed,
Ent => Target_Typ,
Typ => Target_Typ);
-- If we were only doing a static check, or if checks are not
-- on, then we want to delete the check, since it is not needed.
-- We do this by replacing the if statement by a null statement
elsif Do_Static or else not Checks_On then
Remove_Warning_Messages (R_Cno);
Rewrite (R_Cno, Make_Null_Statement (Loc));
end if;
else
Install_Static_Check (R_Cno, Loc);
end if;
end loop;
end Apply_Selected_Length_Checks;
-------------------------------
-- Apply_Static_Length_Check --
-------------------------------
procedure Apply_Static_Length_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty)
is
begin
Apply_Selected_Length_Checks
(Expr, Target_Typ, Source_Typ, Do_Static => True);
end Apply_Static_Length_Check;
-------------------------------------
-- Apply_Subscript_Validity_Checks --
-------------------------------------
procedure Apply_Subscript_Validity_Checks
(Expr : Node_Id;
No_Check_Needed : Dimension_Set := Empty_Dimension_Set) is
Sub : Node_Id;
Dimension : Pos := 1;
begin
pragma Assert (Nkind (Expr) = N_Indexed_Component);
-- Loop through subscripts
Sub := First (Expressions (Expr));
while Present (Sub) loop
-- Check one subscript. Note that we do not worry about enumeration
-- type with holes, since we will convert the value to a Pos value
-- for the subscript, and that convert will do the necessary validity
-- check.
if (No_Check_Needed = Empty_Dimension_Set)
or else not No_Check_Needed.Elements (Dimension)
then
Ensure_Valid (Sub, Holes_OK => True);
end if;
-- Move to next subscript
Next (Sub);
Dimension := Dimension + 1;
end loop;
end Apply_Subscript_Validity_Checks;
----------------------------------
-- Apply_Type_Conversion_Checks --
----------------------------------
procedure Apply_Type_Conversion_Checks (N : Node_Id) is
Target_Type : constant Entity_Id := Etype (N);
Target_Base : constant Entity_Id := Base_Type (Target_Type);
Expr : constant Node_Id := Expression (N);
Expr_Type : constant Entity_Id := Underlying_Type (Etype (Expr));
-- Note: if Etype (Expr) is a private type without discriminants, its
-- full view might have discriminants with defaults, so we need the
-- full view here to retrieve the constraints.
procedure Make_Discriminant_Constraint_Check
(Target_Type : Entity_Id;
Expr_Type : Entity_Id);
-- Generate a discriminant check based on the target type and expression
-- type for Expr.
----------------------------------------
-- Make_Discriminant_Constraint_Check --
----------------------------------------
procedure Make_Discriminant_Constraint_Check
(Target_Type : Entity_Id;
Expr_Type : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Cond : Node_Id;
Constraint : Elmt_Id;
Discr_Value : Node_Id;
Discr : Entity_Id;
New_Constraints : constant Elist_Id := New_Elmt_List;
Old_Constraints : constant Elist_Id :=
Discriminant_Constraint (Expr_Type);
begin
-- Build an actual discriminant constraint list using the stored
-- constraint, to verify that the expression of the parent type
-- satisfies the constraints imposed by the (unconstrained) derived
-- type. This applies to value conversions, not to view conversions
-- of tagged types.
Constraint := First_Elmt (Stored_Constraint (Target_Type));
while Present (Constraint) loop
Discr_Value := Node (Constraint);
if Is_Entity_Name (Discr_Value)
and then Ekind (Entity (Discr_Value)) = E_Discriminant
then
Discr := Corresponding_Discriminant (Entity (Discr_Value));
if Present (Discr)
and then Scope (Discr) = Base_Type (Expr_Type)
then
-- Parent is constrained by new discriminant. Obtain
-- Value of original discriminant in expression. If the
-- new discriminant has been used to constrain more than
-- one of the stored discriminants, this will provide the
-- required consistency check.
Append_Elmt
(Make_Selected_Component (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks
(Expr, Name_Req => True),
Selector_Name =>
Make_Identifier (Loc, Chars (Discr))),
New_Constraints);
else
-- Discriminant of more remote ancestor ???
return;
end if;
-- Derived type definition has an explicit value for this
-- stored discriminant.
else
Append_Elmt
(Duplicate_Subexpr_No_Checks (Discr_Value),
New_Constraints);
end if;
Next_Elmt (Constraint);
end loop;
-- Use the unconstrained expression type to retrieve the
-- discriminants of the parent, and apply momentarily the
-- discriminant constraint synthesized above.
-- Note: We use Expr_Type instead of Target_Type since the number of
-- actual discriminants may be different due to the presence of
-- stored discriminants and cause Build_Discriminant_Checks to fail.
Set_Discriminant_Constraint (Expr_Type, New_Constraints);
Cond := Build_Discriminant_Checks (Expr, Expr_Type);
Set_Discriminant_Constraint (Expr_Type, Old_Constraints);
-- Conversion between access types requires that we check for null
-- before checking discriminants.
if Is_Access_Type (Etype (Expr)) then
Cond := Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd =>
Duplicate_Subexpr_No_Checks
(Expr, Name_Req => True),
Right_Opnd => Make_Null (Loc)),
Right_Opnd => Cond);
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Discriminant_Check_Failed));
end Make_Discriminant_Constraint_Check;
-- Start of processing for Apply_Type_Conversion_Checks
begin
if Inside_A_Generic then
return;
-- Skip these checks if serious errors detected, there are some nasty
-- situations of incomplete trees that blow things up.
elsif Serious_Errors_Detected > 0 then
return;
-- Never generate discriminant checks for Unchecked_Union types
elsif Present (Expr_Type)
and then Is_Unchecked_Union (Expr_Type)
then
return;
-- Scalar type conversions of the form Target_Type (Expr) require a
-- range check if we cannot be sure that Expr is in the base type of
-- Target_Typ and also that Expr is in the range of Target_Typ. These
-- are not quite the same condition from an implementation point of
-- view, but clearly the second includes the first.
elsif Is_Scalar_Type (Target_Type) then
declare
Conv_OK : constant Boolean := Conversion_OK (N);
-- If the Conversion_OK flag on the type conversion is set and no
-- floating-point type is involved in the type conversion then
-- fixed-point values must be read as integral values.
Float_To_Int : constant Boolean :=
Is_Floating_Point_Type (Expr_Type)
and then Is_Integer_Type (Target_Type);
begin
if not Overflow_Checks_Suppressed (Target_Base)
and then not Overflow_Checks_Suppressed (Target_Type)
and then not
In_Subrange_Of (Expr_Type, Target_Base, Fixed_Int => Conv_OK)
and then not Float_To_Int
then
-- A small optimization: the attribute 'Pos applied to an
-- enumeration type has a known range, even though its type is
-- Universal_Integer. So in numeric conversions it is usually
-- within range of the target integer type. Use the static
-- bounds of the base types to check. Disable this optimization
-- in case of a generic formal discrete type, because we don't
-- necessarily know the upper bound yet.
if Nkind (Expr) = N_Attribute_Reference
and then Attribute_Name (Expr) = Name_Pos
and then Is_Enumeration_Type (Etype (Prefix (Expr)))
and then not Is_Generic_Type (Etype (Prefix (Expr)))
and then Is_Integer_Type (Target_Type)
then
declare
Enum_T : constant Entity_Id :=
Root_Type (Etype (Prefix (Expr)));
Int_T : constant Entity_Id := Base_Type (Target_Type);
Last_I : constant Uint :=
Intval (High_Bound (Scalar_Range (Int_T)));
Last_E : Uint;
begin
-- Character types have no explicit literals, so we use
-- the known number of characters in the type.
if Root_Type (Enum_T) = Standard_Character then
Last_E := UI_From_Int (255);
elsif Enum_T = Standard_Wide_Character
or else Enum_T = Standard_Wide_Wide_Character
then
Last_E := UI_From_Int (65535);
else
Last_E :=
Enumeration_Pos
(Entity (High_Bound (Scalar_Range (Enum_T))));
end if;
if Last_E > Last_I then
Activate_Overflow_Check (N);
end if;
end;
else
Activate_Overflow_Check (N);
end if;
end if;
if not Range_Checks_Suppressed (Target_Type)
and then not Range_Checks_Suppressed (Expr_Type)
then
if Float_To_Int
and then not GNATprove_Mode
then
Apply_Float_Conversion_Check (Expr, Target_Type);
else
-- Raw conversions involving fixed-point types are expanded
-- separately and do not need a Range_Check flag yet, except
-- in GNATprove_Mode where this expansion is not performed.
-- This does not apply to conversion where fixed-point types
-- are treated as integers, which are precisely generated by
-- this expansion.
if GNATprove_Mode
or else Conv_OK
or else (not Is_Fixed_Point_Type (Expr_Type)
and then not Is_Fixed_Point_Type (Target_Type))
then
Apply_Scalar_Range_Check
(Expr, Target_Type, Fixed_Int => Conv_OK);
else
Set_Do_Range_Check (Expr, False);
end if;
-- If the target type has predicates, we need to indicate
-- the need for a check, even if Determine_Range finds that
-- the value is within bounds. This may be the case e.g for
-- a division with a constant denominator.
if Has_Predicates (Target_Type) then
Enable_Range_Check (Expr);
end if;
end if;
end if;
end;
-- Generate discriminant constraint checks for access types on the
-- designated target type's stored constraints.
-- Do we need to generate subtype predicate checks here as well ???
elsif Comes_From_Source (N)
and then Ekind (Target_Type) = E_General_Access_Type
-- Check that both of the designated types have known discriminants,
-- and that such checks on the target type are not suppressed.
and then Has_Discriminants (Directly_Designated_Type (Target_Type))
and then Has_Discriminants (Directly_Designated_Type (Expr_Type))
and then not Discriminant_Checks_Suppressed
(Directly_Designated_Type (Target_Type))
-- Verify the designated type of the target has stored constraints
and then Present
(Stored_Constraint (Directly_Designated_Type (Target_Type)))
then
Make_Discriminant_Constraint_Check
(Target_Type => Directly_Designated_Type (Target_Type),
Expr_Type => Directly_Designated_Type (Expr_Type));
-- Create discriminant checks for the Target_Type's stored constraints
elsif Comes_From_Source (N)
and then not Discriminant_Checks_Suppressed (Target_Type)
and then Is_Record_Type (Target_Type)
and then Is_Derived_Type (Target_Type)
and then not Is_Tagged_Type (Target_Type)
and then not Is_Constrained (Target_Type)
and then Present (Stored_Constraint (Target_Type))
then
Make_Discriminant_Constraint_Check (Target_Type, Expr_Type);
-- For arrays, checks are set now, but conversions are applied during
-- expansion, to take into accounts changes of representation. The
-- checks become range checks on the base type or length checks on the
-- subtype, depending on whether the target type is unconstrained or
-- constrained. Note that the range check is put on the expression of a
-- type conversion, while the length check is put on the type conversion
-- itself.
elsif Is_Array_Type (Target_Type) then
if Is_Constrained (Target_Type) then
Set_Do_Length_Check (N);
else
Set_Do_Range_Check (Expr);
end if;
end if;
end Apply_Type_Conversion_Checks;
----------------------------------------------
-- Apply_Universal_Integer_Attribute_Checks --
----------------------------------------------
procedure Apply_Universal_Integer_Attribute_Checks (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
begin
if Inside_A_Generic then
return;
-- Nothing to do if the result type is universal integer
elsif Typ = Universal_Integer then
return;
-- Nothing to do if checks are suppressed
elsif Range_Checks_Suppressed (Typ)
and then Overflow_Checks_Suppressed (Typ)
then
return;
-- Nothing to do if the attribute does not come from source. The
-- internal attributes we generate of this type do not need checks,
-- and furthermore the attempt to check them causes some circular
-- elaboration orders when dealing with packed types.
elsif not Comes_From_Source (N) then
return;
-- If the prefix is a selected component that depends on a discriminant
-- the check may improperly expose a discriminant instead of using
-- the bounds of the object itself. Set the type of the attribute to
-- the base type of the context, so that a check will be imposed when
-- needed (e.g. if the node appears as an index).
elsif Nkind (Prefix (N)) = N_Selected_Component
and then Ekind (Typ) = E_Signed_Integer_Subtype
and then Depends_On_Discriminant (Scalar_Range (Typ))
then
Set_Etype (N, Base_Type (Typ));
-- Otherwise, replace the attribute node with a type conversion node
-- whose expression is the attribute, retyped to universal integer, and
-- whose subtype mark is the target type. The call to analyze this
-- conversion will set range and overflow checks as required for proper
-- detection of an out of range value.
else
Set_Etype (N, Universal_Integer);
Set_Analyzed (N, True);
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Expression => Relocate_Node (N)));
Analyze_And_Resolve (N, Typ);
return;
end if;
end Apply_Universal_Integer_Attribute_Checks;
-------------------------------------
-- Atomic_Synchronization_Disabled --
-------------------------------------
-- Note: internally Disable/Enable_Atomic_Synchronization is implemented
-- using a bogus check called Atomic_Synchronization. This is to make it
-- more convenient to get exactly the same semantics as [Un]Suppress.
function Atomic_Synchronization_Disabled (E : Entity_Id) return Boolean is
begin
-- If debug flag d.e is set, always return False, i.e. all atomic sync
-- looks enabled, since it is never disabled.
if Debug_Flag_Dot_E then
return False;
-- If debug flag d.d is set then always return True, i.e. all atomic
-- sync looks disabled, since it always tests True.
elsif Debug_Flag_Dot_D then
return True;
-- If entity present, then check result for that entity
elsif Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Atomic_Synchronization);
-- Otherwise result depends on current scope setting
else
return Scope_Suppress.Suppress (Atomic_Synchronization);
end if;
end Atomic_Synchronization_Disabled;
-------------------------------
-- Build_Discriminant_Checks --
-------------------------------
function Build_Discriminant_Checks
(N : Node_Id;
T_Typ : Entity_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Cond : Node_Id;
Disc : Elmt_Id;
Disc_Ent : Entity_Id;
Dref : Node_Id;
Dval : Node_Id;
function Aggregate_Discriminant_Val (Disc : Entity_Id) return Node_Id;
function Replace_Current_Instance
(N : Node_Id) return Traverse_Result;
-- Replace a reference to the current instance of the type with the
-- corresponding _init formal of the initialization procedure. Note:
-- this function relies on us currently being within the initialization
-- procedure.
--------------------------------
-- Aggregate_Discriminant_Val --
--------------------------------
function Aggregate_Discriminant_Val (Disc : Entity_Id) return Node_Id is
Assoc : Node_Id;
begin
-- The aggregate has been normalized with named associations. We use
-- the Chars field to locate the discriminant to take into account
-- discriminants in derived types, which carry the same name as those
-- in the parent.
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
if Chars (First (Choices (Assoc))) = Chars (Disc) then
return Expression (Assoc);
else
Next (Assoc);
end if;
end loop;
-- Discriminant must have been found in the loop above
raise Program_Error;
end Aggregate_Discriminant_Val;
------------------------------
-- Replace_Current_Instance --
------------------------------
function Replace_Current_Instance
(N : Node_Id) return Traverse_Result is
begin
if Is_Entity_Name (N)
and then Etype (N) = Entity (N)
then
Rewrite (N,
New_Occurrence_Of (First_Formal (Current_Subprogram), Loc));
end if;
return OK;
end Replace_Current_Instance;
procedure Search_And_Replace_Current_Instance is new
Traverse_Proc (Replace_Current_Instance);
-- Start of processing for Build_Discriminant_Checks
begin
-- Loop through discriminants evolving the condition
Cond := Empty;
Disc := First_Elmt (Discriminant_Constraint (T_Typ));
-- For a fully private type, use the discriminants of the parent type
if Is_Private_Type (T_Typ)
and then No (Full_View (T_Typ))
then
Disc_Ent := First_Discriminant (Etype (Base_Type (T_Typ)));
else
Disc_Ent := First_Discriminant (T_Typ);
end if;
while Present (Disc) loop
Dval := Node (Disc);
if Nkind (Dval) = N_Identifier
and then Ekind (Entity (Dval)) = E_Discriminant
then
Dval := New_Occurrence_Of (Discriminal (Entity (Dval)), Loc);
else
Dval := Duplicate_Subexpr_No_Checks (Dval);
end if;
-- Replace references to the current instance of the type with the
-- corresponding _init formal of the initialization procedure.
if Within_Init_Proc then
Search_And_Replace_Current_Instance (Dval);
end if;
-- If we have an Unchecked_Union node, we can infer the discriminants
-- of the node.
if Is_Unchecked_Union (Base_Type (T_Typ)) then
Dref := New_Copy (
Get_Discriminant_Value (
First_Discriminant (T_Typ),
T_Typ,
Stored_Constraint (T_Typ)));
elsif Nkind (N) = N_Aggregate then
Dref :=
Duplicate_Subexpr_No_Checks
(Aggregate_Discriminant_Val (Disc_Ent));
elsif Is_Access_Type (Etype (N)) then
Dref :=
Make_Selected_Component (Loc,
Prefix =>
Make_Explicit_Dereference (Loc,
Duplicate_Subexpr_No_Checks (N, Name_Req => True)),
Selector_Name => Make_Identifier (Loc, Chars (Disc_Ent)));
Set_Is_In_Discriminant_Check (Dref);
else
Dref :=
Make_Selected_Component (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Selector_Name => Make_Identifier (Loc, Chars (Disc_Ent)));
Set_Is_In_Discriminant_Check (Dref);
end if;
Evolve_Or_Else (Cond,
Make_Op_Ne (Loc,
Left_Opnd => Dref,
Right_Opnd => Dval));
Next_Elmt (Disc);
Next_Discriminant (Disc_Ent);
end loop;
return Cond;
end Build_Discriminant_Checks;
------------------
-- Check_Needed --
------------------
function Check_Needed (Nod : Node_Id; Check : Check_Type) return Boolean is
N : Node_Id;
P : Node_Id;
K : Node_Kind;
L : Node_Id;
R : Node_Id;
function Left_Expression (Op : Node_Id) return Node_Id;
-- Return the relevant expression from the left operand of the given
-- short circuit form: this is LO itself, except if LO is a qualified
-- expression, a type conversion, or an expression with actions, in
-- which case this is Left_Expression (Expression (LO)).
---------------------
-- Left_Expression --
---------------------
function Left_Expression (Op : Node_Id) return Node_Id is
LE : Node_Id := Left_Opnd (Op);
begin
while Nkind (LE) in N_Qualified_Expression
| N_Type_Conversion
| N_Expression_With_Actions
loop
LE := Expression (LE);
end loop;
return LE;
end Left_Expression;
-- Start of processing for Check_Needed
begin
-- Always check if not simple entity
if Nkind (Nod) not in N_Has_Entity
or else not Comes_From_Source (Nod)
then
return True;
end if;
-- Look up tree for short circuit
N := Nod;
loop
P := Parent (N);
K := Nkind (P);
-- Done if out of subexpression (note that we allow generated stuff
-- such as itype declarations in this context, to keep the loop going
-- since we may well have generated such stuff in complex situations.
-- Also done if no parent (probably an error condition, but no point
-- in behaving nasty if we find it).
if No (P)
or else (K not in N_Subexpr and then Comes_From_Source (P))
then
return True;
-- Or/Or Else case, where test is part of the right operand, or is
-- part of one of the actions associated with the right operand, and
-- the left operand is an equality test.
elsif K = N_Op_Or then
exit when N = Right_Opnd (P)
and then Nkind (Left_Expression (P)) = N_Op_Eq;
elsif K = N_Or_Else then
exit when (N = Right_Opnd (P)
or else
(Is_List_Member (N)
and then List_Containing (N) = Actions (P)))
and then Nkind (Left_Expression (P)) = N_Op_Eq;
-- Similar test for the And/And then case, where the left operand
-- is an inequality test.
elsif K = N_Op_And then
exit when N = Right_Opnd (P)
and then Nkind (Left_Expression (P)) = N_Op_Ne;
elsif K = N_And_Then then
exit when (N = Right_Opnd (P)
or else
(Is_List_Member (N)
and then List_Containing (N) = Actions (P)))
and then Nkind (Left_Expression (P)) = N_Op_Ne;
end if;
N := P;
end loop;
-- If we fall through the loop, then we have a conditional with an
-- appropriate test as its left operand, so look further.
L := Left_Expression (P);
-- L is an "=" or "/=" operator: extract its operands
R := Right_Opnd (L);
L := Left_Opnd (L);
-- Left operand of test must match original variable
if Nkind (L) not in N_Has_Entity or else Entity (L) /= Entity (Nod) then
return True;
end if;
-- Right operand of test must be key value (zero or null)
case Check is
when Access_Check =>
if not Known_Null (R) then
return True;
end if;
when Division_Check =>
if not Compile_Time_Known_Value (R)
or else Expr_Value (R) /= Uint_0
then
return True;
end if;
when others =>
raise Program_Error;
end case;
-- Here we have the optimizable case, warn if not short-circuited
if K = N_Op_And or else K = N_Op_Or then
Error_Msg_Warn := SPARK_Mode /= On;
case Check is
when Access_Check =>
if GNATprove_Mode then
Error_Msg_N
("Constraint_Error might have been raised (access check)",
Parent (Nod));
else
Error_Msg_N
("Constraint_Error may be raised (access check)??",
Parent (Nod));
end if;
when Division_Check =>
if GNATprove_Mode then
Error_Msg_N
("Constraint_Error might have been raised (zero divide)",
Parent (Nod));
else
Error_Msg_N
("Constraint_Error may be raised (zero divide)??",
Parent (Nod));
end if;
when others =>
raise Program_Error;
end case;
if K = N_Op_And then
Error_Msg_N -- CODEFIX
("use `AND THEN` instead of AND??", P);
else
Error_Msg_N -- CODEFIX
("use `OR ELSE` instead of OR??", P);
end if;
-- If not short-circuited, we need the check
return True;
-- If short-circuited, we can omit the check
else
return False;
end if;
end Check_Needed;
-----------------------------------
-- Check_Valid_Lvalue_Subscripts --
-----------------------------------
procedure Check_Valid_Lvalue_Subscripts (Expr : Node_Id) is
begin
-- Skip this if range checks are suppressed
if Range_Checks_Suppressed (Etype (Expr)) then
return;
-- Only do this check for expressions that come from source. We assume
-- that expander generated assignments explicitly include any necessary
-- checks. Note that this is not just an optimization, it avoids
-- infinite recursions.
elsif not Comes_From_Source (Expr) then
return;
-- For a selected component, check the prefix
elsif Nkind (Expr) = N_Selected_Component then
Check_Valid_Lvalue_Subscripts (Prefix (Expr));
return;
-- Case of indexed component
elsif Nkind (Expr) = N_Indexed_Component then
Apply_Subscript_Validity_Checks (Expr);
-- Prefix may itself be or contain an indexed component, and these
-- subscripts need checking as well.
Check_Valid_Lvalue_Subscripts (Prefix (Expr));
end if;
end Check_Valid_Lvalue_Subscripts;
----------------------------------
-- Null_Exclusion_Static_Checks --
----------------------------------
procedure Null_Exclusion_Static_Checks
(N : Node_Id;
Comp : Node_Id := Empty;
Array_Comp : Boolean := False)
is
Has_Null : constant Boolean := Has_Null_Exclusion (N);
Kind : constant Node_Kind := Nkind (N);
Error_Nod : Node_Id;
Expr : Node_Id;
Typ : Entity_Id;
begin
pragma Assert
(Kind in N_Component_Declaration
| N_Discriminant_Specification
| N_Function_Specification
| N_Object_Declaration
| N_Parameter_Specification);
if Kind = N_Function_Specification then
Typ := Etype (Defining_Entity (N));
else
Typ := Etype (Defining_Identifier (N));
end if;
case Kind is
when N_Component_Declaration =>
if Present (Access_Definition (Component_Definition (N))) then
Error_Nod := Component_Definition (N);
else
Error_Nod := Subtype_Indication (Component_Definition (N));
end if;
when N_Discriminant_Specification =>
Error_Nod := Discriminant_Type (N);
when N_Function_Specification =>
Error_Nod := Result_Definition (N);
when N_Object_Declaration =>
Error_Nod := Object_Definition (N);
when N_Parameter_Specification =>
Error_Nod := Parameter_Type (N);
when others =>
raise Program_Error;
end case;
if Has_Null then
-- Enforce legality rule 3.10 (13): A null exclusion can only be
-- applied to an access [sub]type.
if not Is_Access_Type (Typ) then
Error_Msg_N
("`NOT NULL` allowed only for an access type", Error_Nod);
-- Enforce legality rule RM 3.10(14/1): A null exclusion can only
-- be applied to a [sub]type that does not exclude null already.
elsif Can_Never_Be_Null (Typ) and then Comes_From_Source (Typ) then
Error_Msg_NE
("`NOT NULL` not allowed (& already excludes null)",
Error_Nod, Typ);
end if;
end if;
-- Check that null-excluding objects are always initialized, except for
-- deferred constants, for which the expression will appear in the full
-- declaration.
if Kind = N_Object_Declaration
and then No (Expression (N))
and then not Constant_Present (N)
and then not No_Initialization (N)
then
if Present (Comp) then
-- Specialize the warning message to indicate that we are dealing
-- with an uninitialized composite object that has a defaulted
-- null-excluding component.
Error_Msg_Name_1 := Chars (Defining_Identifier (Comp));
Error_Msg_Name_2 := Chars (Defining_Identifier (N));
Discard_Node
(Compile_Time_Constraint_Error
(N => N,
Msg =>
"(Ada 2005) null-excluding component % of object % must "
& "be initialized??",
Ent => Defining_Identifier (Comp)));
-- This is a case of an array with null-excluding components, so
-- indicate that in the warning.
elsif Array_Comp then
Discard_Node
(Compile_Time_Constraint_Error
(N => N,
Msg =>
"(Ada 2005) null-excluding array components must "
& "be initialized??",
Ent => Defining_Identifier (N)));
-- Normal case of object of a null-excluding access type
else
-- Add an expression that assigns null. This node is needed by
-- Apply_Compile_Time_Constraint_Error, which will replace this
-- with a Constraint_Error node.
Set_Expression (N, Make_Null (Sloc (N)));
Set_Etype (Expression (N), Etype (Defining_Identifier (N)));
Apply_Compile_Time_Constraint_Error
(N => Expression (N),
Msg =>
"(Ada 2005) null-excluding objects must be initialized??",
Reason => CE_Null_Not_Allowed);
end if;
end if;
-- Check that a null-excluding component, formal or object is not being
-- assigned a null value. Otherwise generate a warning message and
-- replace Expression (N) by an N_Constraint_Error node.
if Kind /= N_Function_Specification then
Expr := Expression (N);
if Present (Expr) and then Known_Null (Expr) then
case Kind is
when N_Component_Declaration
| N_Discriminant_Specification
=>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg =>
"(Ada 2005) NULL not allowed in null-excluding "
& "components??",
Reason => CE_Null_Not_Allowed);
when N_Object_Declaration =>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg =>
"(Ada 2005) NULL not allowed in null-excluding "
& "objects??",
Reason => CE_Null_Not_Allowed);
when N_Parameter_Specification =>
Apply_Compile_Time_Constraint_Error
(N => Expr,
Msg =>
"(Ada 2005) NULL not allowed in null-excluding "
& "formals??",
Reason => CE_Null_Not_Allowed);
when others =>
null;
end case;
end if;
end if;
end Null_Exclusion_Static_Checks;
-------------------------------------
-- Compute_Range_For_Arithmetic_Op --
-------------------------------------
procedure Compute_Range_For_Arithmetic_Op
(Op : Node_Kind;
Lo_Left : Uint;
Hi_Left : Uint;
Lo_Right : Uint;
Hi_Right : Uint;
OK : out Boolean;
Lo : out Uint;
Hi : out Uint)
is
-- Use local variables for possible adjustments
Llo : Uint renames Lo_Left;
Lhi : Uint renames Hi_Left;
Rlo : Uint := Lo_Right;
Rhi : Uint := Hi_Right;
begin
-- We will compute a range for the result in almost all cases
OK := True;
case Op is
-- Absolute value
when N_Op_Abs =>
Lo := Uint_0;
Hi := UI_Max (abs Rlo, abs Rhi);
-- Addition
when N_Op_Add =>
Lo := Llo + Rlo;
Hi := Lhi + Rhi;
-- Division
when N_Op_Divide =>
-- If the right operand can only be zero, set 0..0
if Rlo = 0 and then Rhi = 0 then
Lo := Uint_0;
Hi := Uint_0;
-- Possible bounds of division must come from dividing end
-- values of the input ranges (four possibilities), provided
-- zero is not included in the possible values of the right
-- operand.
-- Otherwise, we just consider two intervals of values for
-- the right operand: the interval of negative values (up to
-- -1) and the interval of positive values (starting at 1).
-- Since division by 1 is the identity, and division by -1
-- is negation, we get all possible bounds of division in that
-- case by considering:
-- - all values from the division of end values of input
-- ranges;
-- - the end values of the left operand;
-- - the negation of the end values of the left operand.
else
declare
Mrk : constant Uintp.Save_Mark := Mark;
-- Mark so we can release the RR and Ev values
Ev1 : Uint;
Ev2 : Uint;
Ev3 : Uint;
Ev4 : Uint;
begin
-- Discard extreme values of zero for the divisor, since
-- they will simply result in an exception in any case.
if Rlo = 0 then
Rlo := Uint_1;
elsif Rhi = 0 then
Rhi := -Uint_1;
end if;
-- Compute possible bounds coming from dividing end
-- values of the input ranges.
Ev1 := Llo / Rlo;
Ev2 := Llo / Rhi;
Ev3 := Lhi / Rlo;
Ev4 := Lhi / Rhi;
Lo := UI_Min (UI_Min (Ev1, Ev2), UI_Min (Ev3, Ev4));
Hi := UI_Max (UI_Max (Ev1, Ev2), UI_Max (Ev3, Ev4));
-- If the right operand can be both negative or positive,
-- include the end values of the left operand in the
-- extreme values, as well as their negation.
if Rlo < 0 and then Rhi > 0 then
Ev1 := Llo;
Ev2 := -Llo;
Ev3 := Lhi;
Ev4 := -Lhi;
Lo := UI_Min (Lo,
UI_Min (UI_Min (Ev1, Ev2), UI_Min (Ev3, Ev4)));
Hi := UI_Max (Hi,
UI_Max (UI_Max (Ev1, Ev2), UI_Max (Ev3, Ev4)));
end if;
-- Release the RR and Ev values
Release_And_Save (Mrk, Lo, Hi);
end;
end if;
-- Exponentiation
when N_Op_Expon =>
-- Discard negative values for the exponent, since they will
-- simply result in an exception in any case.
if Rhi < 0 then
Rhi := Uint_0;
elsif Rlo < 0 then
Rlo := Uint_0;
end if;
-- Estimate number of bits in result before we go computing
-- giant useless bounds. Basically the number of bits in the
-- result is the number of bits in the base multiplied by the
-- value of the exponent. If this is big enough that the result
-- definitely won't fit in Long_Long_Integer, return immediately
-- and avoid computing giant bounds.
-- The comparison here is approximate, but conservative, it
-- only clicks on cases that are sure to exceed the bounds.
if Num_Bits (UI_Max (abs Llo, abs Lhi)) * Rhi + 1 > 100 then
Lo := No_Uint;
Hi := No_Uint;
OK := False;
return;
-- If right operand is zero then result is 1
elsif Rhi = 0 then
Lo := Uint_1;
Hi := Uint_1;
else
-- High bound comes either from exponentiation of largest
-- positive value to largest exponent value, or from
-- the exponentiation of most negative value to an
-- even exponent.
declare
Hi1, Hi2 : Uint;
begin
if Lhi > 0 then
Hi1 := Lhi ** Rhi;
else
Hi1 := Uint_0;
end if;
if Llo < 0 then
if Rhi mod 2 = 0 then
Hi2 := Llo ** Rhi;
else
Hi2 := Llo ** (Rhi - 1);
end if;
else
Hi2 := Uint_0;
end if;
Hi := UI_Max (Hi1, Hi2);
end;
-- Result can only be negative if base can be negative
if Llo < 0 then
if Rhi mod 2 = 0 then
Lo := Llo ** (Rhi - 1);
else
Lo := Llo ** Rhi;
end if;
-- Otherwise low bound is minimum ** minimum
else
Lo := Llo ** Rlo;
end if;
end if;
-- Negation
when N_Op_Minus =>
Lo := -Rhi;
Hi := -Rlo;
-- Mod
when N_Op_Mod =>
declare
Maxabs : constant Uint := UI_Max (abs Rlo, abs Rhi) - 1;
-- This is the maximum absolute value of the result
begin
Lo := Uint_0;
Hi := Uint_0;
-- The result depends only on the sign and magnitude of
-- the right operand, it does not depend on the sign or
-- magnitude of the left operand.
if Rlo < 0 then
Lo := -Maxabs;
end if;
if Rhi > 0 then
Hi := Maxabs;
end if;
end;
-- Multiplication
when N_Op_Multiply =>
-- Possible bounds of multiplication must come from multiplying
-- end values of the input ranges (four possibilities).
declare
Mrk : constant Uintp.Save_Mark := Mark;
-- Mark so we can release the Ev values
Ev1 : constant Uint := Llo * Rlo;
Ev2 : constant Uint := Llo * Rhi;
Ev3 : constant Uint := Lhi * Rlo;
Ev4 : constant Uint := Lhi * Rhi;
begin
Lo := UI_Min (UI_Min (Ev1, Ev2), UI_Min (Ev3, Ev4));
Hi := UI_Max (UI_Max (Ev1, Ev2), UI_Max (Ev3, Ev4));
-- Release the Ev values
Release_And_Save (Mrk, Lo, Hi);
end;
-- Plus operator (affirmation)
when N_Op_Plus =>
Lo := Rlo;
Hi := Rhi;
-- Remainder
when N_Op_Rem =>
declare
Maxabs : constant Uint := UI_Max (abs Rlo, abs Rhi) - 1;
-- This is the maximum absolute value of the result. Note
-- that the result range does not depend on the sign of the
-- right operand.
begin
Lo := Uint_0;
Hi := Uint_0;
-- Case of left operand negative, which results in a range
-- of -Maxabs .. 0 for those negative values. If there are
-- no negative values then Lo value of result is always 0.
if Llo < 0 then
Lo := -Maxabs;
end if;
-- Case of left operand positive
if Lhi > 0 then
Hi := Maxabs;
end if;
end;
-- Subtract
when N_Op_Subtract =>
Lo := Llo - Rhi;
Hi := Lhi - Rlo;
-- Nothing else should be possible
when others =>
raise Program_Error;
end case;
end Compute_Range_For_Arithmetic_Op;
----------------------------------
-- Conditional_Statements_Begin --
----------------------------------
procedure Conditional_Statements_Begin is
begin
Saved_Checks_TOS := Saved_Checks_TOS + 1;
-- If stack overflows, kill all checks, that way we know to simply reset
-- the number of saved checks to zero on return. This should never occur
-- in practice.
if Saved_Checks_TOS > Saved_Checks_Stack'Last then
Kill_All_Checks;
-- In the normal case, we just make a new stack entry saving the current
-- number of saved checks for a later restore.
else
Saved_Checks_Stack (Saved_Checks_TOS) := Num_Saved_Checks;
if Debug_Flag_CC then
w ("Conditional_Statements_Begin: Num_Saved_Checks = ",
Num_Saved_Checks);
end if;
end if;
end Conditional_Statements_Begin;
--------------------------------
-- Conditional_Statements_End --
--------------------------------
procedure Conditional_Statements_End is
begin
pragma Assert (Saved_Checks_TOS > 0);
-- If the saved checks stack overflowed, then we killed all checks, so
-- setting the number of saved checks back to zero is correct. This
-- should never occur in practice.
if Saved_Checks_TOS > Saved_Checks_Stack'Last then
Num_Saved_Checks := 0;
-- In the normal case, restore the number of saved checks from the top
-- stack entry.
else
Num_Saved_Checks := Saved_Checks_Stack (Saved_Checks_TOS);
if Debug_Flag_CC then
w ("Conditional_Statements_End: Num_Saved_Checks = ",
Num_Saved_Checks);
end if;
end if;
Saved_Checks_TOS := Saved_Checks_TOS - 1;
end Conditional_Statements_End;
-------------------------
-- Convert_From_Bignum --
-------------------------
function Convert_From_Bignum (N : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (N);
begin
pragma Assert (Is_RTE (Etype (N), RE_Bignum));
-- Construct call From Bignum
return
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_From_Bignum), Loc),
Parameter_Associations => New_List (Relocate_Node (N)));
end Convert_From_Bignum;
-----------------------
-- Convert_To_Bignum --
-----------------------
function Convert_To_Bignum (N : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (N);
begin
-- Nothing to do if Bignum already except call Relocate_Node
if Is_RTE (Etype (N), RE_Bignum) then
return Relocate_Node (N);
-- Otherwise construct call to To_Bignum, converting the operand to the
-- required Long_Long_Integer form.
else
pragma Assert (Is_Signed_Integer_Type (Etype (N)));
return
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_To_Bignum), Loc),
Parameter_Associations => New_List (
Convert_To (Standard_Long_Long_Integer, Relocate_Node (N))));
end if;
end Convert_To_Bignum;
---------------------
-- Determine_Range --
---------------------
Cache_Size : constant := 2 ** 10;
type Cache_Index is range 0 .. Cache_Size - 1;
-- Determine size of below cache (power of 2 is more efficient)
Determine_Range_Cache_N : array (Cache_Index) of Node_Id;
Determine_Range_Cache_O : array (Cache_Index) of Node_Id;
Determine_Range_Cache_V : array (Cache_Index) of Boolean;
Determine_Range_Cache_Lo : array (Cache_Index) of Uint;
Determine_Range_Cache_Hi : array (Cache_Index) of Uint;
Determine_Range_Cache_Lo_R : array (Cache_Index) of Ureal;
Determine_Range_Cache_Hi_R : array (Cache_Index) of Ureal;
-- The above arrays are used to implement a small direct cache for
-- Determine_Range and Determine_Range_R calls. Because of the way these
-- subprograms recursively traces subexpressions, and because overflow
-- checking calls the routine on the way up the tree, a quadratic behavior
-- can otherwise be encountered in large expressions. The cache entry for
-- node N is stored in the (N mod Cache_Size) entry, and can be validated
-- by checking the actual node value stored there. The Range_Cache_O array
-- records the setting of Original_Node (N) so that the cache entry does
-- not become stale when the node N is rewritten. The Range_Cache_V array
-- records the setting of Assume_Valid for the cache entry.
procedure Determine_Range
(N : Node_Id;
OK : out Boolean;
Lo : out Uint;
Hi : out Uint;
Assume_Valid : Boolean := False)
is
Kind : constant Node_Kind := Nkind (N);
-- Kind of node
function Half_Address_Space return Uint;
-- The size of half the total addressable memory space in storage units
-- (minus one, so that the size fits in a signed integer whose size is
-- System_Address_Size, which helps in various cases).
------------------------
-- Half_Address_Space --
------------------------
function Half_Address_Space return Uint is
begin
return Uint_2 ** (System_Address_Size - 1) - 1;
end Half_Address_Space;
-- Local variables
Typ : Entity_Id := Etype (N);
-- Type to use, may get reset to base type for possibly invalid entity
Lo_Left : Uint := No_Uint;
Hi_Left : Uint := No_Uint;
-- Lo and Hi bounds of left operand
Lo_Right : Uint := No_Uint;
Hi_Right : Uint := No_Uint;
-- Lo and Hi bounds of right (or only) operand
Bound : Node_Id;
-- Temp variable used to hold a bound node
Hbound : Uint;
-- High bound of base type of expression
Lor : Uint;
Hir : Uint;
-- Refined values for low and high bounds, after tightening
OK1 : Boolean;
-- Used in lower level calls to indicate if call succeeded
Cindex : Cache_Index;
-- Used to search cache
Btyp : Entity_Id;
-- Base type
-- Start of processing for Determine_Range
begin
-- Prevent junk warnings by initializing range variables
Lo := No_Uint;
Hi := No_Uint;
Lor := No_Uint;
Hir := No_Uint;
-- For temporary constants internally generated to remove side effects
-- we must use the corresponding expression to determine the range of
-- the expression. But note that the expander can also generate
-- constants in other cases, including deferred constants.
if Is_Entity_Name (N)
and then Nkind (Parent (Entity (N))) = N_Object_Declaration
and then Ekind (Entity (N)) = E_Constant
and then Is_Internal_Name (Chars (Entity (N)))
then
if Present (Expression (Parent (Entity (N)))) then
Determine_Range
(Expression (Parent (Entity (N))), OK, Lo, Hi, Assume_Valid);
elsif Present (Full_View (Entity (N))) then
Determine_Range
(Expression (Parent (Full_View (Entity (N)))),
OK, Lo, Hi, Assume_Valid);
else
OK := False;
end if;
return;
end if;
-- If type is not defined, we can't determine its range
if No (Typ)
-- We don't deal with anything except discrete types
or else not Is_Discrete_Type (Typ)
-- Don't deal with enumerated types with non-standard representation
or else (Is_Enumeration_Type (Typ)
and then Present (Enum_Pos_To_Rep (Base_Type (Typ))))
-- Ignore type for which an error has been posted, since range in
-- this case may well be a bogosity deriving from the error. Also
-- ignore if error posted on the reference node.
or else Error_Posted (N) or else Error_Posted (Typ)
then
OK := False;
return;
end if;
-- For all other cases, we can determine the range
OK := True;
-- If value is compile time known, then the possible range is the one
-- value that we know this expression definitely has.
if Compile_Time_Known_Value (N) then
Lo := Expr_Value (N);
Hi := Lo;
return;
end if;
-- Return if already in the cache
Cindex := Cache_Index (N mod Cache_Size);
if Determine_Range_Cache_N (Cindex) = N
and then
Determine_Range_Cache_O (Cindex) = Original_Node (N)
and then
Determine_Range_Cache_V (Cindex) = Assume_Valid
then
Lo := Determine_Range_Cache_Lo (Cindex);
Hi := Determine_Range_Cache_Hi (Cindex);
return;
end if;
-- Otherwise, start by finding the bounds of the type of the expression,
-- the value cannot be outside this range (if it is, then we have an
-- overflow situation, which is a separate check, we are talking here
-- only about the expression value).
-- First a check, never try to find the bounds of a generic type, since
-- these bounds are always junk values, and it is only valid to look at
-- the bounds in an instance.
if Is_Generic_Type (Typ) then
OK := False;
return;
end if;
-- First step, change to use base type unless we know the value is valid
if (Is_Entity_Name (N) and then Is_Known_Valid (Entity (N)))
or else Assume_No_Invalid_Values
or else Assume_Valid
then
-- If this is a known valid constant with a nonstatic value, it may
-- have inherited a narrower subtype from its initial value; use this
-- saved subtype (see sem_ch3.adb).
if Is_Entity_Name (N)
and then Ekind (Entity (N)) = E_Constant
and then Present (Actual_Subtype (Entity (N)))
then
Typ := Actual_Subtype (Entity (N));
end if;
else
Typ := Underlying_Type (Base_Type (Typ));
end if;
-- Retrieve the base type. Handle the case where the base type is a
-- private enumeration type.
Btyp := Base_Type (Typ);
if Is_Private_Type (Btyp) and then Present (Full_View (Btyp)) then
Btyp := Full_View (Btyp);
end if;
-- We use the actual bound unless it is dynamic, in which case use the
-- corresponding base type bound if possible. If we can't get a bound
-- then we figure we can't determine the range (a peculiar case, that
-- perhaps cannot happen, but there is no point in bombing in this
-- optimization circuit).
-- First the low bound
Bound := Type_Low_Bound (Typ);
if Compile_Time_Known_Value (Bound) then
Lo := Expr_Value (Bound);
elsif Compile_Time_Known_Value (Type_Low_Bound (Btyp)) then
Lo := Expr_Value (Type_Low_Bound (Btyp));
else
OK := False;
return;
end if;
-- Now the high bound
Bound := Type_High_Bound (Typ);
-- We need the high bound of the base type later on, and this should
-- always be compile time known. Again, it is not clear that this
-- can ever be false, but no point in bombing.
if Compile_Time_Known_Value (Type_High_Bound (Btyp)) then
Hbound := Expr_Value (Type_High_Bound (Btyp));
Hi := Hbound;
else
OK := False;
return;
end if;
-- If we have a static subtype, then that may have a tighter bound so
-- use the upper bound of the subtype instead in this case.
if Compile_Time_Known_Value (Bound) then
Hi := Expr_Value (Bound);
end if;
-- We may be able to refine this value in certain situations. If any
-- refinement is possible, then Lor and Hir are set to possibly tighter
-- bounds, and OK1 is set to True.
case Kind is
-- Unary operation case
when N_Op_Abs
| N_Op_Minus
| N_Op_Plus
=>
Determine_Range
(Right_Opnd (N), OK1, Lo_Right, Hi_Right, Assume_Valid);
if OK1 then
Compute_Range_For_Arithmetic_Op
(Kind, Lo_Left, Hi_Left, Lo_Right, Hi_Right, OK1, Lor, Hir);
end if;
-- Binary operation case
when N_Op_Add
| N_Op_Divide
| N_Op_Expon
| N_Op_Mod
| N_Op_Multiply
| N_Op_Rem
| N_Op_Subtract
=>
Determine_Range
(Left_Opnd (N), OK1, Lo_Left, Hi_Left, Assume_Valid);
if OK1 then
Determine_Range
(Right_Opnd (N), OK1, Lo_Right, Hi_Right, Assume_Valid);
end if;
if OK1 then
Compute_Range_For_Arithmetic_Op
(Kind, Lo_Left, Hi_Left, Lo_Right, Hi_Right, OK1, Lor, Hir);
end if;
-- Attribute reference cases
when N_Attribute_Reference =>
case Get_Attribute_Id (Attribute_Name (N)) is
-- For Min/Max attributes, we can refine the range using the
-- possible range of values of the attribute expressions.
when Attribute_Min
| Attribute_Max
=>
Determine_Range
(First (Expressions (N)),
OK1, Lo_Left, Hi_Left, Assume_Valid);
if OK1 then
Determine_Range
(Next (First (Expressions (N))),
OK1, Lo_Right, Hi_Right, Assume_Valid);
end if;
if OK1 then
Lor := UI_Min (Lo_Left, Lo_Right);
Hir := UI_Max (Hi_Left, Hi_Right);
end if;
-- For Pos/Val attributes, we can refine the range using the
-- possible range of values of the attribute expression.
when Attribute_Pos
| Attribute_Val
=>
Determine_Range
(First (Expressions (N)), OK1, Lor, Hir, Assume_Valid);
-- For Length and Range_Length attributes, use the bounds of
-- the (corresponding index) type to refine the range.
when Attribute_Length
| Attribute_Range_Length
=>
declare
Ptyp : Entity_Id;
Ityp : Entity_Id;
LL, LU : Uint;
UL, UU : Uint;
begin
Ptyp := Etype (Prefix (N));
if Is_Access_Type (Ptyp) then
Ptyp := Designated_Type (Ptyp);
end if;
-- For string literal, we know exact value
if Ekind (Ptyp) = E_String_Literal_Subtype then
OK := True;
Lo := String_Literal_Length (Ptyp);
Hi := String_Literal_Length (Ptyp);
return;
end if;
if Is_Array_Type (Ptyp) then
Ityp := Get_Index_Subtype (N);
else
Ityp := Ptyp;
end if;
-- If the (index) type is a formal type or derived from
-- one, the bounds are not static.
if Is_Generic_Type (Root_Type (Ityp)) then
OK := False;
return;
end if;
Determine_Range
(Type_Low_Bound (Ityp), OK1, LL, LU, Assume_Valid);
if OK1 then
Determine_Range
(Type_High_Bound (Ityp), OK1, UL, UU, Assume_Valid);
if OK1 then
-- The maximum value for Length is the biggest
-- possible gap between the values of the bounds.
-- But of course, this value cannot be negative.
Hir := UI_Max (Uint_0, UU - LL + 1);
-- For a constrained array, the minimum value for
-- Length is taken from the actual value of the
-- bounds, since the index will be exactly of this
-- subtype.
if Is_Constrained (Ptyp) then
Lor := UI_Max (Uint_0, UL - LU + 1);
-- For an unconstrained array, the minimum value
-- for length is always zero.
else
Lor := Uint_0;
end if;
end if;
end if;
-- Small optimization: the maximum size in storage units
-- an object can have with GNAT is half of the address
-- space, so we can bound the length of an array declared
-- in Interfaces (or its children) because its component
-- size is at least the storage unit and it is meant to
-- be used to interface actual array objects.
if Is_Array_Type (Ptyp) then
declare
S : constant Entity_Id := Scope (Base_Type (Ptyp));
begin
if Is_RTU (S, Interfaces)
or else (S /= Standard_Standard
and then Is_RTU (Scope (S), Interfaces))
then
Hir := UI_Min (Hir, Half_Address_Space);
end if;
end;
end if;
end;
-- The maximum default alignment is quite low, but GNAT accepts
-- alignment clauses that are fairly large, but not as large as
-- the maximum size of objects, see below.
when Attribute_Alignment =>
Lor := Uint_0;
Hir := Half_Address_Space;
OK1 := True;
-- The attribute should have been folded if a component clause
-- was specified, so we assume there is none.
when Attribute_Bit
| Attribute_First_Bit
=>
Lor := Uint_0;
Hir := UI_From_Int (System_Storage_Unit - 1);
OK1 := True;
-- Likewise about the component clause. Note that Last_Bit
-- yields -1 for a field of size 0 if First_Bit is 0.
when Attribute_Last_Bit =>
Lor := Uint_Minus_1;
Hir := Hi;
OK1 := True;
-- Likewise about the component clause for Position. The
-- maximum size in storage units that an object can have
-- with GNAT is half of the address space.
when Attribute_Max_Size_In_Storage_Elements
| Attribute_Position
=>
Lor := Uint_0;
Hir := Half_Address_Space;
OK1 := True;
-- These attributes yield a nonnegative value (we do not set
-- the maximum value because it is too large to be useful).
when Attribute_Bit_Position
| Attribute_Component_Size
| Attribute_Object_Size
| Attribute_Size
| Attribute_Value_Size
=>
Lor := Uint_0;
Hir := Hi;
OK1 := True;
-- The maximum size is the sum of twice the size of the largest
-- integer for every dimension, rounded up to the next multiple
-- of the maximum alignment, but we add instead of rounding.
when Attribute_Descriptor_Size =>
declare
Max_Align : constant Pos :=
Maximum_Alignment * System_Storage_Unit;
Max_Size : constant Uint :=
2 * Esize (Universal_Integer);
Ndims : constant Pos :=
Number_Dimensions (Etype (Prefix (N)));
begin
Lor := Uint_0;
Hir := Max_Size * Ndims + Max_Align;
OK1 := True;
end;
-- No special handling for other attributes for now
when others =>
OK1 := False;
end case;
when N_Type_Conversion =>
-- For a type conversion, we can try to refine the range using the
-- converted value.
Determine_Range_To_Discrete
(Expression (N), OK1, Lor, Hir, Conversion_OK (N), Assume_Valid);
-- Nothing special to do for all other expression kinds
when others =>
OK1 := False;
Lor := No_Uint;
Hir := No_Uint;
end case;
-- At this stage, if OK1 is true, then we know that the actual result of
-- the computed expression is in the range Lor .. Hir. We can use this
-- to restrict the possible range of results.
if OK1 then
-- If the refined value of the low bound is greater than the type
-- low bound, then reset it to the more restrictive value. However,
-- we do NOT do this for the case of a modular type where the
-- possible upper bound on the value is above the base type high
-- bound, because that means the result could wrap.
if Lor > Lo
and then not (Is_Modular_Integer_Type (Typ) and then Hir > Hbound)
then
Lo := Lor;
end if;
-- Similarly, if the refined value of the high bound is less than the
-- value so far, then reset it to the more restrictive value. Again,
-- we do not do this if the refined low bound is negative for a
-- modular type, since this would wrap.
if Hir < Hi
and then not (Is_Modular_Integer_Type (Typ) and then Lor < Uint_0)
then
Hi := Hir;
end if;
end if;
-- Set cache entry for future call and we are all done
Determine_Range_Cache_N (Cindex) := N;
Determine_Range_Cache_O (Cindex) := Original_Node (N);
Determine_Range_Cache_V (Cindex) := Assume_Valid;
Determine_Range_Cache_Lo (Cindex) := Lo;
Determine_Range_Cache_Hi (Cindex) := Hi;
return;
-- If any exception occurs, it means that we have some bug in the compiler,
-- possibly triggered by a previous error, or by some unforeseen peculiar
-- occurrence. However, this is only an optimization attempt, so there is
-- really no point in crashing the compiler. Instead we just decide, too
-- bad, we can't figure out a range in this case after all.
exception
when others =>
-- Debug flag K disables this behavior (useful for debugging)
if Debug_Flag_K then
raise;
else
OK := False;
Lo := No_Uint;
Hi := No_Uint;
return;
end if;
end Determine_Range;
-----------------------
-- Determine_Range_R --
-----------------------
procedure Determine_Range_R
(N : Node_Id;
OK : out Boolean;
Lo : out Ureal;
Hi : out Ureal;
Assume_Valid : Boolean := False)
is
Typ : Entity_Id := Etype (N);
-- Type to use, may get reset to base type for possibly invalid entity
Lo_Left : Ureal;
Hi_Left : Ureal;
-- Lo and Hi bounds of left operand
Lo_Right : Ureal := No_Ureal;
Hi_Right : Ureal := No_Ureal;
-- Lo and Hi bounds of right (or only) operand
Bound : Node_Id;
-- Temp variable used to hold a bound node
Hbound : Ureal;
-- High bound of base type of expression
Lor : Ureal;
Hir : Ureal;
-- Refined values for low and high bounds, after tightening
OK1 : Boolean;
-- Used in lower level calls to indicate if call succeeded
Cindex : Cache_Index;
-- Used to search cache
Btyp : Entity_Id;
-- Base type
function OK_Operands return Boolean;
-- Used for binary operators. Determines the ranges of the left and
-- right operands, and if they are both OK, returns True, and puts
-- the results in Lo_Right, Hi_Right, Lo_Left, Hi_Left.
function Round_Machine (B : Ureal) return Ureal;
-- B is a real bound. Round it to the nearest machine number.
-----------------
-- OK_Operands --
-----------------
function OK_Operands return Boolean is
begin
Determine_Range_R
(Left_Opnd (N), OK1, Lo_Left, Hi_Left, Assume_Valid);
if not OK1 then
return False;
end if;
Determine_Range_R
(Right_Opnd (N), OK1, Lo_Right, Hi_Right, Assume_Valid);
return OK1;
end OK_Operands;
-------------------
-- Round_Machine --
-------------------
function Round_Machine (B : Ureal) return Ureal is
begin
return Machine_Number (Typ, B, N);
end Round_Machine;
-- Start of processing for Determine_Range_R
begin
-- Prevent junk warnings by initializing range variables
Lo := No_Ureal;
Hi := No_Ureal;
Lor := No_Ureal;
Hir := No_Ureal;
-- For temporary constants internally generated to remove side effects
-- we must use the corresponding expression to determine the range of
-- the expression. But note that the expander can also generate
-- constants in other cases, including deferred constants.
if Is_Entity_Name (N)
and then Nkind (Parent (Entity (N))) = N_Object_Declaration
and then Ekind (Entity (N)) = E_Constant
and then Is_Internal_Name (Chars (Entity (N)))
then
if Present (Expression (Parent (Entity (N)))) then
Determine_Range_R
(Expression (Parent (Entity (N))), OK, Lo, Hi, Assume_Valid);
elsif Present (Full_View (Entity (N))) then
Determine_Range_R
(Expression (Parent (Full_View (Entity (N)))),
OK, Lo, Hi, Assume_Valid);
else
OK := False;
end if;
return;
end if;
-- If type is not defined, we can't determine its range
pragma Warnings (Off, "condition can only be True if invalid");
-- Otherwise the compiler warns on the check of Float_Rep below, because
-- there is only one value (see types.ads).
if No (Typ)
-- We don't deal with anything except IEEE floating-point types
or else not Is_Floating_Point_Type (Typ)
or else Float_Rep (Typ) /= IEEE_Binary
-- Ignore type for which an error has been posted, since range in
-- this case may well be a bogosity deriving from the error. Also
-- ignore if error posted on the reference node.
or else Error_Posted (N) or else Error_Posted (Typ)
then
pragma Warnings (On, "condition can only be True if invalid");
OK := False;
return;
end if;
-- For all other cases, we can determine the range
OK := True;
-- If value is compile time known, then the possible range is the one
-- value that we know this expression definitely has.
if Compile_Time_Known_Value (N) then
Lo := Expr_Value_R (N);
Hi := Lo;
return;
end if;
-- Return if already in the cache
Cindex := Cache_Index (N mod Cache_Size);
if Determine_Range_Cache_N (Cindex) = N
and then
Determine_Range_Cache_O (Cindex) = Original_Node (N)
and then
Determine_Range_Cache_V (Cindex) = Assume_Valid
then
Lo := Determine_Range_Cache_Lo_R (Cindex);
Hi := Determine_Range_Cache_Hi_R (Cindex);
return;
end if;
-- Otherwise, start by finding the bounds of the type of the expression,
-- the value cannot be outside this range (if it is, then we have an
-- overflow situation, which is a separate check, we are talking here
-- only about the expression value).
-- First a check, never try to find the bounds of a generic type, since
-- these bounds are always junk values, and it is only valid to look at
-- the bounds in an instance.
if Is_Generic_Type (Typ) then
OK := False;
return;
end if;
-- First step, change to use base type unless we know the value is valid
if (Is_Entity_Name (N) and then Is_Known_Valid (Entity (N)))
or else Assume_No_Invalid_Values
or else Assume_Valid
then
null;
else
Typ := Underlying_Type (Base_Type (Typ));
end if;
-- Retrieve the base type. Handle the case where the base type is a
-- private type.
Btyp := Base_Type (Typ);
if Is_Private_Type (Btyp) and then Present (Full_View (Btyp)) then
Btyp := Full_View (Btyp);
end if;
-- We use the actual bound unless it is dynamic, in which case use the
-- corresponding base type bound if possible. If we can't get a bound
-- then we figure we can't determine the range (a peculiar case, that
-- perhaps cannot happen, but there is no point in bombing in this
-- optimization circuit).
-- First the low bound
Bound := Type_Low_Bound (Typ);
if Compile_Time_Known_Value (Bound) then
Lo := Expr_Value_R (Bound);
elsif Compile_Time_Known_Value (Type_Low_Bound (Btyp)) then
Lo := Expr_Value_R (Type_Low_Bound (Btyp));
else
OK := False;
return;
end if;
-- Now the high bound
Bound := Type_High_Bound (Typ);
-- We need the high bound of the base type later on, and this should
-- always be compile time known. Again, it is not clear that this
-- can ever be false, but no point in bombing.
if Compile_Time_Known_Value (Type_High_Bound (Btyp)) then
Hbound := Expr_Value_R (Type_High_Bound (Btyp));
Hi := Hbound;
else
OK := False;
return;
end if;
-- If we have a static subtype, then that may have a tighter bound so
-- use the upper bound of the subtype instead in this case.
if Compile_Time_Known_Value (Bound) then
Hi := Expr_Value_R (Bound);
end if;
-- We may be able to refine this value in certain situations. If any
-- refinement is possible, then Lor and Hir are set to possibly tighter
-- bounds, and OK1 is set to True.
case Nkind (N) is
-- For unary plus, result is limited by range of operand
when N_Op_Plus =>
Determine_Range_R
(Right_Opnd (N), OK1, Lor, Hir, Assume_Valid);
-- For unary minus, determine range of operand, and negate it
when N_Op_Minus =>
Determine_Range_R
(Right_Opnd (N), OK1, Lo_Right, Hi_Right, Assume_Valid);
if OK1 then
Lor := -Hi_Right;
Hir := -Lo_Right;
end if;
-- For binary addition, get range of each operand and do the
-- addition to get the result range.
when N_Op_Add =>
if OK_Operands then
Lor := Round_Machine (Lo_Left + Lo_Right);
Hir := Round_Machine (Hi_Left + Hi_Right);
end if;
-- For binary subtraction, get range of each operand and do the worst
-- case subtraction to get the result range.
when N_Op_Subtract =>
if OK_Operands then
Lor := Round_Machine (Lo_Left - Hi_Right);
Hir := Round_Machine (Hi_Left - Lo_Right);
end if;
-- For multiplication, get range of each operand and do the
-- four multiplications to get the result range.
when N_Op_Multiply =>
if OK_Operands then
declare
M1 : constant Ureal := Round_Machine (Lo_Left * Lo_Right);
M2 : constant Ureal := Round_Machine (Lo_Left * Hi_Right);
M3 : constant Ureal := Round_Machine (Hi_Left * Lo_Right);
M4 : constant Ureal := Round_Machine (Hi_Left * Hi_Right);
begin
Lor := UR_Min (UR_Min (M1, M2), UR_Min (M3, M4));
Hir := UR_Max (UR_Max (M1, M2), UR_Max (M3, M4));
end;
end if;
-- For division, consider separately the cases where the right
-- operand is positive or negative. Otherwise, the right operand
-- can be arbitrarily close to zero, so the result is likely to
-- be unbounded in one direction, do not attempt to compute it.
when N_Op_Divide =>
if OK_Operands then
-- Right operand is positive
if Lo_Right > Ureal_0 then
-- If the low bound of the left operand is negative, obtain
-- the overall low bound by dividing it by the smallest
-- value of the right operand, and otherwise by the largest
-- value of the right operand.
if Lo_Left < Ureal_0 then
Lor := Round_Machine (Lo_Left / Lo_Right);
else
Lor := Round_Machine (Lo_Left / Hi_Right);
end if;
-- If the high bound of the left operand is negative, obtain
-- the overall high bound by dividing it by the largest
-- value of the right operand, and otherwise by the
-- smallest value of the right operand.
if Hi_Left < Ureal_0 then
Hir := Round_Machine (Hi_Left / Hi_Right);
else
Hir := Round_Machine (Hi_Left / Lo_Right);
end if;
-- Right operand is negative
elsif Hi_Right < Ureal_0 then
-- If the low bound of the left operand is negative, obtain
-- the overall low bound by dividing it by the largest
-- value of the right operand, and otherwise by the smallest
-- value of the right operand.
if Lo_Left < Ureal_0 then
Lor := Round_Machine (Lo_Left / Hi_Right);
else
Lor := Round_Machine (Lo_Left / Lo_Right);
end if;
-- If the high bound of the left operand is negative, obtain
-- the overall high bound by dividing it by the smallest
-- value of the right operand, and otherwise by the
-- largest value of the right operand.
if Hi_Left < Ureal_0 then
Hir := Round_Machine (Hi_Left / Lo_Right);
else
Hir := Round_Machine (Hi_Left / Hi_Right);
end if;
else
OK1 := False;
end if;
end if;
when N_Type_Conversion =>
-- For type conversion from one floating-point type to another, we
-- can refine the range using the converted value.
if Is_Floating_Point_Type (Etype (Expression (N))) then
Determine_Range_R (Expression (N), OK1, Lor, Hir, Assume_Valid);
-- When converting an integer to a floating-point type, determine
-- the range in integer first, and then convert the bounds.
elsif Is_Discrete_Type (Etype (Expression (N))) then
declare
Hir_Int : Uint;
Lor_Int : Uint;
begin
Determine_Range
(Expression (N), OK1, Lor_Int, Hir_Int, Assume_Valid);
if OK1 then
Lor := Round_Machine (UR_From_Uint (Lor_Int));
Hir := Round_Machine (UR_From_Uint (Hir_Int));
end if;
end;
else
OK1 := False;
end if;
-- Nothing special to do for all other expression kinds
when others =>
OK1 := False;
Lor := No_Ureal;
Hir := No_Ureal;
end case;
-- At this stage, if OK1 is true, then we know that the actual result of
-- the computed expression is in the range Lor .. Hir. We can use this
-- to restrict the possible range of results.
if OK1 then
-- If the refined value of the low bound is greater than the type
-- low bound, then reset it to the more restrictive value.
if Lor > Lo then
Lo := Lor;
end if;
-- Similarly, if the refined value of the high bound is less than the
-- value so far, then reset it to the more restrictive value.
if Hir < Hi then
Hi := Hir;
end if;
end if;
-- Set cache entry for future call and we are all done
Determine_Range_Cache_N (Cindex) := N;
Determine_Range_Cache_O (Cindex) := Original_Node (N);
Determine_Range_Cache_V (Cindex) := Assume_Valid;
Determine_Range_Cache_Lo_R (Cindex) := Lo;
Determine_Range_Cache_Hi_R (Cindex) := Hi;
return;
-- If any exception occurs, it means that we have some bug in the compiler,
-- possibly triggered by a previous error, or by some unforeseen peculiar
-- occurrence. However, this is only an optimization attempt, so there is
-- really no point in crashing the compiler. Instead we just decide, too
-- bad, we can't figure out a range in this case after all.
exception
when others =>
-- Debug flag K disables this behavior (useful for debugging)
if Debug_Flag_K then
raise;
else
OK := False;
Lo := No_Ureal;
Hi := No_Ureal;
return;
end if;
end Determine_Range_R;
---------------------------------
-- Determine_Range_To_Discrete --
---------------------------------
procedure Determine_Range_To_Discrete
(N : Node_Id;
OK : out Boolean;
Lo : out Uint;
Hi : out Uint;
Fixed_Int : Boolean := False;
Assume_Valid : Boolean := False)
is
Typ : constant Entity_Id := Etype (N);
begin
-- For a discrete type, simply defer to Determine_Range
if Is_Discrete_Type (Typ) then
Determine_Range (N, OK, Lo, Hi, Assume_Valid);
-- For a fixed point type treated as an integer, we can determine the
-- range using the Corresponding_Integer_Value of the bounds of the
-- type or base type. This is done by the calls to Expr_Value below.
elsif Is_Fixed_Point_Type (Typ) and then Fixed_Int then
declare
Btyp, Ftyp : Entity_Id;
Bound : Node_Id;
begin
if Assume_Valid then
Ftyp := Typ;
else
Ftyp := Underlying_Type (Base_Type (Typ));
end if;
Btyp := Base_Type (Ftyp);
-- First the low bound
Bound := Type_Low_Bound (Ftyp);
if Compile_Time_Known_Value (Bound) then
Lo := Expr_Value (Bound);
else
Lo := Expr_Value (Type_Low_Bound (Btyp));
end if;
-- Then the high bound
Bound := Type_High_Bound (Ftyp);
if Compile_Time_Known_Value (Bound) then
Hi := Expr_Value (Bound);
else
Hi := Expr_Value (Type_High_Bound (Btyp));
end if;
OK := True;
end;
-- For a floating-point type, we can determine the range in real first,
-- and then convert the bounds using UR_To_Uint, which correctly rounds
-- away from zero when half way between two integers, as required by
-- normal Ada 95 rounding semantics. But this is only possible because
-- GNATprove's analysis rules out the possibility of a NaN or infinite.
elsif GNATprove_Mode and then Is_Floating_Point_Type (Typ) then
declare
Lo_Real, Hi_Real : Ureal;
begin
Determine_Range_R (N, OK, Lo_Real, Hi_Real, Assume_Valid);
if OK then
Lo := UR_To_Uint (Lo_Real);
Hi := UR_To_Uint (Hi_Real);
else
Lo := No_Uint;
Hi := No_Uint;
end if;
end;
else
Lo := No_Uint;
Hi := No_Uint;
OK := False;
end if;
end Determine_Range_To_Discrete;
------------------------------------
-- Discriminant_Checks_Suppressed --
------------------------------------
function Discriminant_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) then
if Is_Unchecked_Union (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Discriminant_Check);
end if;
end if;
return Scope_Suppress.Suppress (Discriminant_Check);
end Discriminant_Checks_Suppressed;
--------------------------------
-- Division_Checks_Suppressed --
--------------------------------
function Division_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Division_Check);
else
return Scope_Suppress.Suppress (Division_Check);
end if;
end Division_Checks_Suppressed;
--------------------------------------
-- Duplicated_Tag_Checks_Suppressed --
--------------------------------------
function Duplicated_Tag_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Duplicated_Tag_Check);
else
return Scope_Suppress.Suppress (Duplicated_Tag_Check);
end if;
end Duplicated_Tag_Checks_Suppressed;
-----------------------------------
-- Elaboration_Checks_Suppressed --
-----------------------------------
function Elaboration_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
-- The complication in this routine is that if we are in the dynamic
-- model of elaboration, we also check All_Checks, since All_Checks
-- does not set Elaboration_Check explicitly.
if Present (E) then
if Kill_Elaboration_Checks (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
if Is_Check_Suppressed (E, Elaboration_Check) then
return True;
elsif Dynamic_Elaboration_Checks then
return Is_Check_Suppressed (E, All_Checks);
else
return False;
end if;
end if;
end if;
if Scope_Suppress.Suppress (Elaboration_Check) then
return True;
elsif Dynamic_Elaboration_Checks then
return Scope_Suppress.Suppress (All_Checks);
else
return False;
end if;
end Elaboration_Checks_Suppressed;
---------------------------
-- Enable_Overflow_Check --
---------------------------
procedure Enable_Overflow_Check (N : Node_Id) is
Typ : constant Entity_Id := Base_Type (Etype (N));
Mode : constant Overflow_Mode_Type := Overflow_Check_Mode;
Chk : Nat;
OK : Boolean;
Ent : Entity_Id;
Ofs : Uint;
Lo : Uint;
Hi : Uint;
Do_Ovflow_Check : Boolean;
begin
if Debug_Flag_CC then
w ("Enable_Overflow_Check for node ", Int (N));
Write_Str (" Source location = ");
wl (Sloc (N));
pg (Union_Id (N));
end if;
-- No check if overflow checks suppressed for type of node
if Overflow_Checks_Suppressed (Etype (N)) then
return;
-- Nothing to do for unsigned integer types, which do not overflow
elsif Is_Modular_Integer_Type (Typ) then
return;
end if;
-- This is the point at which processing for STRICT mode diverges
-- from processing for MINIMIZED/ELIMINATED modes. This divergence is
-- probably more extreme that it needs to be, but what is going on here
-- is that when we introduced MINIMIZED/ELIMINATED modes, we wanted
-- to leave the processing for STRICT mode untouched. There were
-- two reasons for this. First it avoided any incompatible change of
-- behavior. Second, it guaranteed that STRICT mode continued to be
-- legacy reliable.
-- The big difference is that in STRICT mode there is a fair amount of
-- circuitry to try to avoid setting the Do_Overflow_Check flag if we
-- know that no check is needed. We skip all that in the two new modes,
-- since really overflow checking happens over a whole subtree, and we
-- do the corresponding optimizations later on when applying the checks.
if Mode in Minimized_Or_Eliminated then
if not (Overflow_Checks_Suppressed (Etype (N)))
and then not (Is_Entity_Name (N)
and then Overflow_Checks_Suppressed (Entity (N)))
then
Activate_Overflow_Check (N);
end if;
if Debug_Flag_CC then
w ("Minimized/Eliminated mode");
end if;
return;
end if;
-- Remainder of processing is for STRICT case, and is unchanged from
-- earlier versions preceding the addition of MINIMIZED/ELIMINATED.
-- Nothing to do if the range of the result is known OK. We skip this
-- for conversions, since the caller already did the check, and in any
-- case the condition for deleting the check for a type conversion is
-- different.
if Nkind (N) /= N_Type_Conversion then
Determine_Range (N, OK, Lo, Hi, Assume_Valid => True);
-- Note in the test below that we assume that the range is not OK
-- if a bound of the range is equal to that of the type. That's not
-- quite accurate but we do this for the following reasons:
-- a) The way that Determine_Range works, it will typically report
-- the bounds of the value as being equal to the bounds of the
-- type, because it either can't tell anything more precise, or
-- does not think it is worth the effort to be more precise.
-- b) It is very unusual to have a situation in which this would
-- generate an unnecessary overflow check (an example would be
-- a subtype with a range 0 .. Integer'Last - 1 to which the
-- literal value one is added).
-- c) The alternative is a lot of special casing in this routine
-- which would partially duplicate Determine_Range processing.
if OK then
Do_Ovflow_Check := True;
-- Note that the following checks are quite deliberately > and <
-- rather than >= and <= as explained above.
if Lo > Expr_Value (Type_Low_Bound (Typ))
and then
Hi < Expr_Value (Type_High_Bound (Typ))
then
Do_Ovflow_Check := False;
-- Despite the comments above, it is worth dealing specially with
-- division. The only case where integer division can overflow is
-- (largest negative number) / (-1). So we will do an extra range
-- analysis to see if this is possible.
elsif Nkind (N) = N_Op_Divide then
Determine_Range
(Left_Opnd (N), OK, Lo, Hi, Assume_Valid => True);
if OK and then Lo > Expr_Value (Type_Low_Bound (Typ)) then
Do_Ovflow_Check := False;
else
Determine_Range
(Right_Opnd (N), OK, Lo, Hi, Assume_Valid => True);
if OK and then (Lo > Uint_Minus_1
or else
Hi < Uint_Minus_1)
then
Do_Ovflow_Check := False;
end if;
end if;
-- Likewise for Abs/Minus, the only case where the operation can
-- overflow is when the operand is the largest negative number.
elsif Nkind (N) in N_Op_Abs | N_Op_Minus then
Determine_Range
(Right_Opnd (N), OK, Lo, Hi, Assume_Valid => True);
if OK and then Lo > Expr_Value (Type_Low_Bound (Typ)) then
Do_Ovflow_Check := False;
end if;
end if;
-- If no overflow check required, we are done
if not Do_Ovflow_Check then
if Debug_Flag_CC then
w ("No overflow check required");
end if;
return;
end if;
end if;
end if;
-- If not in optimizing mode, set flag and we are done. We are also done
-- (and just set the flag) if the type is not a discrete type, since it
-- is not worth the effort to eliminate checks for other than discrete
-- types. In addition, we take this same path if we have stored the
-- maximum number of checks possible already (a very unlikely situation,
-- but we do not want to blow up).
if Optimization_Level = 0
or else not Is_Discrete_Type (Etype (N))
or else Num_Saved_Checks = Saved_Checks'Last
then
Activate_Overflow_Check (N);
if Debug_Flag_CC then
w ("Optimization off");
end if;
return;
end if;
-- Otherwise evaluate and check the expression
Find_Check
(Expr => N,
Check_Type => 'O',
Target_Type => Empty,
Entry_OK => OK,
Check_Num => Chk,
Ent => Ent,
Ofs => Ofs);
if Debug_Flag_CC then
w ("Called Find_Check");
w (" OK = ", OK);
if OK then
w (" Check_Num = ", Chk);
w (" Ent = ", Int (Ent));
Write_Str (" Ofs = ");
pid (Ofs);
end if;
end if;
-- If check is not of form to optimize, then set flag and we are done
if not OK then
Activate_Overflow_Check (N);
return;
end if;
-- If check is already performed, then return without setting flag
if Chk /= 0 then
if Debug_Flag_CC then
w ("Check suppressed!");
end if;
return;
end if;
-- Here we will make a new entry for the new check
Activate_Overflow_Check (N);
Num_Saved_Checks := Num_Saved_Checks + 1;
Saved_Checks (Num_Saved_Checks) :=
(Killed => False,
Entity => Ent,
Offset => Ofs,
Check_Type => 'O',
Target_Type => Empty);
if Debug_Flag_CC then
w ("Make new entry, check number = ", Num_Saved_Checks);
w (" Entity = ", Int (Ent));
Write_Str (" Offset = ");
pid (Ofs);
w (" Check_Type = O");
w (" Target_Type = Empty");
end if;
-- If we get an exception, then something went wrong, probably because of
-- an error in the structure of the tree due to an incorrect program. Or
-- it may be a bug in the optimization circuit. In either case the safest
-- thing is simply to set the check flag unconditionally.
exception
when others =>
Activate_Overflow_Check (N);
if Debug_Flag_CC then
w (" exception occurred, overflow flag set");
end if;
return;
end Enable_Overflow_Check;
------------------------
-- Enable_Range_Check --
------------------------
procedure Enable_Range_Check (N : Node_Id) is
Chk : Nat;
OK : Boolean;
Ent : Entity_Id;
Ofs : Uint;
Ttyp : Entity_Id;
P : Node_Id;
begin
-- Return if unchecked type conversion with range check killed. In this
-- case we never set the flag (that's what Kill_Range_Check is about).
if Nkind (N) = N_Unchecked_Type_Conversion
and then Kill_Range_Check (N)
then
return;
end if;
-- Do not set range check flag if parent is assignment statement or
-- object declaration with Suppress_Assignment_Checks flag set
if Nkind (Parent (N)) in N_Assignment_Statement | N_Object_Declaration
and then Suppress_Assignment_Checks (Parent (N))
then
return;
end if;
-- Check for various cases where we should suppress the range check
-- No check if range checks suppressed for type of node
if Present (Etype (N)) and then Range_Checks_Suppressed (Etype (N)) then
return;
-- No check if node is an entity name, and range checks are suppressed
-- for this entity, or for the type of this entity.
elsif Is_Entity_Name (N)
and then (Range_Checks_Suppressed (Entity (N))
or else Range_Checks_Suppressed (Etype (Entity (N))))
then
return;
-- No checks if index of array, and index checks are suppressed for
-- the array object or the type of the array.
elsif Nkind (Parent (N)) = N_Indexed_Component then
declare
Pref : constant Node_Id := Prefix (Parent (N));
begin
if Is_Entity_Name (Pref)
and then Index_Checks_Suppressed (Entity (Pref))
then
return;
elsif Index_Checks_Suppressed (Etype (Pref)) then
return;
end if;
end;
end if;
-- Debug trace output
if Debug_Flag_CC then
w ("Enable_Range_Check for node ", Int (N));
Write_Str (" Source location = ");
wl (Sloc (N));
pg (Union_Id (N));
end if;
-- If not in optimizing mode, set flag and we are done. We are also done
-- (and just set the flag) if the type is not a discrete type, since it
-- is not worth the effort to eliminate checks for other than discrete
-- types. In addition, we take this same path if we have stored the
-- maximum number of checks possible already (a very unlikely situation,
-- but we do not want to blow up).
if Optimization_Level = 0
or else No (Etype (N))
or else not Is_Discrete_Type (Etype (N))
or else Num_Saved_Checks = Saved_Checks'Last
then
Activate_Range_Check (N);
if Debug_Flag_CC then
w ("Optimization off");
end if;
return;
end if;
-- Otherwise find out the target type
P := Parent (N);
-- For assignment, use left side subtype
if Nkind (P) = N_Assignment_Statement
and then Expression (P) = N
then
Ttyp := Etype (Name (P));
-- For indexed component, use subscript subtype
elsif Nkind (P) = N_Indexed_Component then
declare
Atyp : Entity_Id;
Indx : Node_Id;
Subs : Node_Id;
begin
Atyp := Etype (Prefix (P));
if Is_Access_Type (Atyp) then
Atyp := Designated_Type (Atyp);
-- If the prefix is an access to an unconstrained array,
-- perform check unconditionally: it depends on the bounds of
-- an object and we cannot currently recognize whether the test
-- may be redundant.
if not Is_Constrained (Atyp) then
Activate_Range_Check (N);
return;
end if;
-- Ditto if prefix is simply an unconstrained array. We used
-- to think this case was OK, if the prefix was not an explicit
-- dereference, but we have now seen a case where this is not
-- true, so it is safer to just suppress the optimization in this
-- case. The back end is getting better at eliminating redundant
-- checks in any case, so the loss won't be important.
elsif Is_Array_Type (Atyp)
and then not Is_Constrained (Atyp)
then
Activate_Range_Check (N);
return;
end if;
Indx := First_Index (Atyp);
Subs := First (Expressions (P));
loop
if Subs = N then
Ttyp := Etype (Indx);
exit;
end if;
Next_Index (Indx);
Next (Subs);
end loop;
end;
-- For now, ignore all other cases, they are not so interesting
else
if Debug_Flag_CC then
w (" target type not found, flag set");
end if;
Activate_Range_Check (N);
return;
end if;
-- Evaluate and check the expression
Find_Check
(Expr => N,
Check_Type => 'R',
Target_Type => Ttyp,
Entry_OK => OK,
Check_Num => Chk,
Ent => Ent,
Ofs => Ofs);
if Debug_Flag_CC then
w ("Called Find_Check");
w ("Target_Typ = ", Int (Ttyp));
w (" OK = ", OK);
if OK then
w (" Check_Num = ", Chk);
w (" Ent = ", Int (Ent));
Write_Str (" Ofs = ");
pid (Ofs);
end if;
end if;
-- If check is not of form to optimize, then set flag and we are done
if not OK then
if Debug_Flag_CC then
w (" expression not of optimizable type, flag set");
end if;
Activate_Range_Check (N);
return;
end if;
-- If check is already performed, then return without setting flag
if Chk /= 0 then
if Debug_Flag_CC then
w ("Check suppressed!");
end if;
return;
end if;
-- Here we will make a new entry for the new check
Activate_Range_Check (N);
Num_Saved_Checks := Num_Saved_Checks + 1;
Saved_Checks (Num_Saved_Checks) :=
(Killed => False,
Entity => Ent,
Offset => Ofs,
Check_Type => 'R',
Target_Type => Ttyp);
if Debug_Flag_CC then
w ("Make new entry, check number = ", Num_Saved_Checks);
w (" Entity = ", Int (Ent));
Write_Str (" Offset = ");
pid (Ofs);
w (" Check_Type = R");
w (" Target_Type = ", Int (Ttyp));
pg (Union_Id (Ttyp));
end if;
-- If we get an exception, then something went wrong, probably because of
-- an error in the structure of the tree due to an incorrect program. Or
-- it may be a bug in the optimization circuit. In either case the safest
-- thing is simply to set the check flag unconditionally.
exception
when others =>
Activate_Range_Check (N);
if Debug_Flag_CC then
w (" exception occurred, range flag set");
end if;
return;
end Enable_Range_Check;
------------------
-- Ensure_Valid --
------------------
procedure Ensure_Valid
(Expr : Node_Id;
Holes_OK : Boolean := False;
Related_Id : Entity_Id := Empty;
Is_Low_Bound : Boolean := False;
Is_High_Bound : Boolean := False)
is
Typ : constant Entity_Id := Etype (Expr);
begin
-- Ignore call if we are not doing any validity checking
if not Validity_Checks_On then
return;
-- Ignore call if range or validity checks suppressed on entity or type
elsif Range_Or_Validity_Checks_Suppressed (Expr) then
return;
-- No check required if expression is from the expander, we assume the
-- expander will generate whatever checks are needed. Note that this is
-- not just an optimization, it avoids infinite recursions.
-- Unchecked conversions must be checked, unless they are initialized
-- scalar values, as in a component assignment in an init proc.
-- In addition, we force a check if Force_Validity_Checks is set
elsif not Comes_From_Source (Expr)
and then not
(Nkind (Expr) = N_Identifier
and then Present (Renamed_Entity_Or_Object (Entity (Expr)))
and then
Comes_From_Source (Renamed_Entity_Or_Object (Entity (Expr))))
and then not Force_Validity_Checks
and then (Nkind (Expr) /= N_Unchecked_Type_Conversion
or else Kill_Range_Check (Expr))
then
return;
-- No check required if expression is known to have valid value
elsif Expr_Known_Valid (Expr) then
return;
-- No check needed within a generated predicate function. Validity
-- of input value will have been checked earlier.
elsif Ekind (Current_Scope) = E_Function
and then Is_Predicate_Function (Current_Scope)
then
return;
-- Ignore case of enumeration with holes where the flag is set not to
-- worry about holes, since no special validity check is needed
elsif Is_Enumeration_Type (Typ)
and then Has_Non_Standard_Rep (Typ)
and then Holes_OK
then
return;
-- No check required on the left-hand side of an assignment
elsif Nkind (Parent (Expr)) = N_Assignment_Statement
and then Expr = Name (Parent (Expr))
then
return;
-- No check on a universal real constant. The context will eventually
-- convert it to a machine number for some target type, or report an
-- illegality.
elsif Nkind (Expr) = N_Real_Literal
and then Etype (Expr) = Universal_Real
then
return;
-- If the expression denotes a component of a packed boolean array,
-- no possible check applies. We ignore the old ACATS chestnuts that
-- involve Boolean range True..True.
-- Note: validity checks are generated for expressions that yield a
-- scalar type, when it is possible to create a value that is outside of
-- the type. If this is a one-bit boolean no such value exists. This is
-- an optimization, and it also prevents compiler blowing up during the
-- elaboration of improperly expanded packed array references.
elsif Nkind (Expr) = N_Indexed_Component
and then Is_Bit_Packed_Array (Etype (Prefix (Expr)))
and then Root_Type (Etype (Expr)) = Standard_Boolean
then
return;
-- For an expression with actions, we want to insert the validity check
-- on the final Expression.
elsif Nkind (Expr) = N_Expression_With_Actions then
Ensure_Valid (Expression (Expr));
return;
-- An annoying special case. If this is an out parameter of a scalar
-- type, then the value is not going to be accessed, therefore it is
-- inappropriate to do any validity check at the call site. Likewise
-- if the parameter is passed by reference.
else
-- Only need to worry about scalar types
if Is_Scalar_Type (Typ) then
declare
P : Node_Id;
N : Node_Id;
E : Entity_Id;
F : Entity_Id;
A : Node_Id;
L : List_Id;
begin
-- Find actual argument (which may be a parameter association)
-- and the parent of the actual argument (the call statement)
N := Expr;
P := Parent (Expr);
if Nkind (P) = N_Parameter_Association then
N := P;
P := Parent (N);
end if;
-- If this is an indirect or dispatching call, get signature
-- from the subprogram type.
if Nkind (P) in N_Entry_Call_Statement
| N_Function_Call
| N_Procedure_Call_Statement
then
E := Get_Called_Entity (P);
L := Parameter_Associations (P);
-- Only need to worry if there are indeed actuals, and if
-- this could be a subprogram call, otherwise we cannot get
-- a match (either we are not an argument, or the mode of
-- the formal is not OUT). This test also filters out the
-- generic case.
if Is_Non_Empty_List (L) and then Is_Subprogram (E) then
-- This is the loop through parameters, looking for an
-- OUT parameter for which we are the argument.
F := First_Formal (E);
A := First (L);
while Present (F) loop
if A = N
and then (Ekind (F) = E_Out_Parameter
or else Mechanism (F) = By_Reference)
then
return;
end if;
Next_Formal (F);
Next (A);
end loop;
end if;
end if;
end;
end if;
end if;
-- If this is a boolean expression, only its elementary operands need
-- checking: if they are valid, a boolean or short-circuit operation
-- with them will be valid as well.
if Base_Type (Typ) = Standard_Boolean
and then
(Nkind (Expr) in N_Op or else Nkind (Expr) in N_Short_Circuit)
then
return;
end if;
-- If we fall through, a validity check is required
Insert_Valid_Check (Expr, Related_Id, Is_Low_Bound, Is_High_Bound);
if Is_Entity_Name (Expr)
and then Safe_To_Capture_Value (Expr, Entity (Expr))
then
Set_Is_Known_Valid (Entity (Expr));
end if;
end Ensure_Valid;
----------------------
-- Expr_Known_Valid --
----------------------
function Expr_Known_Valid (Expr : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (Expr);
begin
-- Non-scalar types are always considered valid, since they never give
-- rise to the issues of erroneous or bounded error behavior that are
-- the concern. In formal reference manual terms the notion of validity
-- only applies to scalar types. Note that even when packed arrays are
-- represented using modular types, they are still arrays semantically,
-- so they are also always valid (in particular, the unused bits can be
-- random rubbish without affecting the validity of the array value).
if not Is_Scalar_Type (Typ) or else Is_Packed_Array_Impl_Type (Typ) then
return True;
-- If no validity checking, then everything is considered valid
elsif not Validity_Checks_On then
return True;
-- Floating-point types are considered valid unless floating-point
-- validity checks have been specifically turned on.
elsif Is_Floating_Point_Type (Typ)
and then not Validity_Check_Floating_Point
then
return True;
-- If the expression is the value of an object that is known to be
-- valid, then clearly the expression value itself is valid.
elsif Is_Entity_Name (Expr)
and then Is_Known_Valid (Entity (Expr))
-- Exclude volatile variables
and then not Treat_As_Volatile (Entity (Expr))
then
return True;
-- References to discriminants are always considered valid. The value
-- of a discriminant gets checked when the object is built. Within the
-- record, we consider it valid, and it is important to do so, since
-- otherwise we can try to generate bogus validity checks which
-- reference discriminants out of scope. Discriminants of concurrent
-- types are excluded for the same reason.
elsif Is_Entity_Name (Expr)
and then Denotes_Discriminant (Expr, Check_Concurrent => True)
then
return True;
-- If the type is one for which all values are known valid, then we are
-- sure that the value is valid except in the slightly odd case where
-- the expression is a reference to a variable whose size has been
-- explicitly set to a value greater than the object size.
elsif Is_Known_Valid (Typ) then
if Is_Entity_Name (Expr)
and then Ekind (Entity (Expr)) = E_Variable
and then Known_Esize (Entity (Expr))
and then Esize (Entity (Expr)) > Esize (Typ)
then
return False;
else
return True;
end if;
-- Integer and character literals always have valid values, where
-- appropriate these will be range checked in any case.
elsif Nkind (Expr) in N_Integer_Literal | N_Character_Literal then
return True;
-- If we have a type conversion or a qualification of a known valid
-- value, then the result will always be valid.
elsif Nkind (Expr) in N_Type_Conversion | N_Qualified_Expression then
return Expr_Known_Valid (Expression (Expr));
-- Case of expression is a non-floating-point operator. In this case we
-- can assume the result is valid the generated code for the operator
-- will include whatever checks are needed (e.g. range checks) to ensure
-- validity. This assumption does not hold for the floating-point case,
-- since floating-point operators can generate Infinite or NaN results
-- which are considered invalid.
-- Historical note: in older versions, the exemption of floating-point
-- types from this assumption was done only in cases where the parent
-- was an assignment, function call or parameter association. Presumably
-- the idea was that in other contexts, the result would be checked
-- elsewhere, but this list of cases was missing tests (at least the
-- N_Object_Declaration case, as shown by a reported missing validity
-- check), and it is not clear why function calls but not procedure
-- calls were tested for. It really seems more accurate and much
-- safer to recognize that expressions which are the result of a
-- floating-point operator can never be assumed to be valid.
elsif Nkind (Expr) in N_Op and then not Is_Floating_Point_Type (Typ) then
return True;
-- The result of a membership test is always valid, since it is true or
-- false, there are no other possibilities.
elsif Nkind (Expr) in N_Membership_Test then
return True;
-- For all other cases, we do not know the expression is valid
else
return False;
end if;
end Expr_Known_Valid;
----------------
-- Find_Check --
----------------
procedure Find_Check
(Expr : Node_Id;
Check_Type : Character;
Target_Type : Entity_Id;
Entry_OK : out Boolean;
Check_Num : out Nat;
Ent : out Entity_Id;
Ofs : out Uint)
is
function Within_Range_Of
(Target_Type : Entity_Id;
Check_Type : Entity_Id) return Boolean;
-- Given a requirement for checking a range against Target_Type, and
-- and a range Check_Type against which a check has already been made,
-- determines if the check against check type is sufficient to ensure
-- that no check against Target_Type is required.
---------------------
-- Within_Range_Of --
---------------------
function Within_Range_Of
(Target_Type : Entity_Id;
Check_Type : Entity_Id) return Boolean
is
begin
if Target_Type = Check_Type then
return True;
else
declare
Tlo : constant Node_Id := Type_Low_Bound (Target_Type);
Thi : constant Node_Id := Type_High_Bound (Target_Type);
Clo : constant Node_Id := Type_Low_Bound (Check_Type);
Chi : constant Node_Id := Type_High_Bound (Check_Type);
begin
if (Tlo = Clo
or else (Compile_Time_Known_Value (Tlo)
and then
Compile_Time_Known_Value (Clo)
and then
Expr_Value (Clo) >= Expr_Value (Tlo)))
and then
(Thi = Chi
or else (Compile_Time_Known_Value (Thi)
and then
Compile_Time_Known_Value (Chi)
and then
Expr_Value (Chi) <= Expr_Value (Clo)))
then
return True;
else
return False;
end if;
end;
end if;
end Within_Range_Of;
-- Start of processing for Find_Check
begin
-- Establish default, in case no entry is found
Check_Num := 0;
-- Case of expression is simple entity reference
if Is_Entity_Name (Expr) then
Ent := Entity (Expr);
Ofs := Uint_0;
-- Case of expression is entity + known constant
elsif Nkind (Expr) = N_Op_Add
and then Compile_Time_Known_Value (Right_Opnd (Expr))
and then Is_Entity_Name (Left_Opnd (Expr))
then
Ent := Entity (Left_Opnd (Expr));
Ofs := Expr_Value (Right_Opnd (Expr));
-- Case of expression is entity - known constant
elsif Nkind (Expr) = N_Op_Subtract
and then Compile_Time_Known_Value (Right_Opnd (Expr))
and then Is_Entity_Name (Left_Opnd (Expr))
then
Ent := Entity (Left_Opnd (Expr));
Ofs := UI_Negate (Expr_Value (Right_Opnd (Expr)));
-- Any other expression is not of the right form
else
Ent := Empty;
Ofs := Uint_0;
Entry_OK := False;
return;
end if;
-- Come here with expression of appropriate form, check if entity is an
-- appropriate one for our purposes.
if (Ekind (Ent) = E_Variable
or else Is_Constant_Object (Ent))
and then not Is_Library_Level_Entity (Ent)
then
Entry_OK := True;
else
Entry_OK := False;
return;
end if;
-- See if there is matching check already
for J in reverse 1 .. Num_Saved_Checks loop
declare
SC : Saved_Check renames Saved_Checks (J);
begin
if SC.Killed = False
and then SC.Entity = Ent
and then SC.Offset = Ofs
and then SC.Check_Type = Check_Type
and then Within_Range_Of (Target_Type, SC.Target_Type)
then
Check_Num := J;
return;
end if;
end;
end loop;
-- If we fall through entry was not found
return;
end Find_Check;
---------------------------------
-- Generate_Discriminant_Check --
---------------------------------
procedure Generate_Discriminant_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Pref : constant Node_Id := Prefix (N);
Sel : constant Node_Id := Selector_Name (N);
Orig_Comp : constant Entity_Id :=
Original_Record_Component (Entity (Sel));
-- The original component to be checked
Discr_Fct : constant Entity_Id :=
Discriminant_Checking_Func (Orig_Comp);
-- The discriminant checking function
Discr : Entity_Id;
-- One discriminant to be checked in the type
Real_Discr : Entity_Id;
-- Actual discriminant in the call
Pref_Type : Entity_Id;
-- Type of relevant prefix (ignoring private/access stuff)
Args : List_Id;
-- List of arguments for function call
Formal : Entity_Id;
-- Keep track of the formal corresponding to the actual we build for
-- each discriminant, in order to be able to perform the necessary type
-- conversions.
Scomp : Node_Id;
-- Selected component reference for checking function argument
begin
Pref_Type := Etype (Pref);
-- Force evaluation of the prefix, so that it does not get evaluated
-- twice (once for the check, once for the actual reference). Such a
-- double evaluation is always a potential source of inefficiency, and
-- is functionally incorrect in the volatile case, or when the prefix
-- may have side effects. A nonvolatile entity or a component of a
-- nonvolatile entity requires no evaluation.
if Is_Entity_Name (Pref) then
if Treat_As_Volatile (Entity (Pref)) then
Force_Evaluation (Pref, Name_Req => True);
end if;
elsif Treat_As_Volatile (Etype (Pref)) then
Force_Evaluation (Pref, Name_Req => True);
elsif Nkind (Pref) = N_Selected_Component
and then Is_Entity_Name (Prefix (Pref))
then
null;
else
Force_Evaluation (Pref, Name_Req => True);
end if;
-- For a tagged type, use the scope of the original component to
-- obtain the type, because ???
if Is_Tagged_Type (Scope (Orig_Comp)) then
Pref_Type := Scope (Orig_Comp);
-- For an untagged derived type, use the discriminants of the parent
-- which have been renamed in the derivation, possibly by a one-to-many
-- discriminant constraint. For untagged type, initially get the Etype
-- of the prefix
else
if Is_Derived_Type (Pref_Type)
and then Number_Discriminants (Pref_Type) /=
Number_Discriminants (Etype (Base_Type (Pref_Type)))
then
Pref_Type := Etype (Base_Type (Pref_Type));
end if;
end if;
-- We definitely should have a checking function, This routine should
-- not be called if no discriminant checking function is present.
pragma Assert (Present (Discr_Fct));
-- Create the list of the actual parameters for the call. This list
-- is the list of the discriminant fields of the record expression to
-- be discriminant checked.
Args := New_List;
Formal := First_Formal (Discr_Fct);
Discr := First_Discriminant (Pref_Type);
while Present (Discr) loop
-- If we have a corresponding discriminant field, and a parent
-- subtype is present, then we want to use the corresponding
-- discriminant since this is the one with the useful value.
if Present (Corresponding_Discriminant (Discr))
and then Ekind (Pref_Type) = E_Record_Type
and then Present (Parent_Subtype (Pref_Type))
then
Real_Discr := Corresponding_Discriminant (Discr);
else
Real_Discr := Discr;
end if;
-- Construct the reference to the discriminant
Scomp :=
Make_Selected_Component (Loc,
Prefix =>
Unchecked_Convert_To (Pref_Type,
Duplicate_Subexpr (Pref)),
Selector_Name => New_Occurrence_Of (Real_Discr, Loc));
-- Manually analyze and resolve this selected component. We really
-- want it just as it appears above, and do not want the expander
-- playing discriminal games etc with this reference. Then we append
-- the argument to the list we are gathering.
Set_Etype (Scomp, Etype (Real_Discr));
Set_Analyzed (Scomp, True);
Append_To (Args, Convert_To (Etype (Formal), Scomp));
Next_Formal_With_Extras (Formal);
Next_Discriminant (Discr);
end loop;
-- Now build and insert the call
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Discr_Fct, Loc),
Parameter_Associations => Args),
Reason => CE_Discriminant_Check_Failed));
end Generate_Discriminant_Check;
---------------------------
-- Generate_Index_Checks --
---------------------------
procedure Generate_Index_Checks
(N : Node_Id;
Checks_Generated : out Dimension_Set)
is
function Entity_Of_Prefix return Entity_Id;
-- Returns the entity of the prefix of N (or Empty if not found)
----------------------
-- Entity_Of_Prefix --
----------------------
function Entity_Of_Prefix return Entity_Id is
P : Node_Id;
begin
P := Prefix (N);
while not Is_Entity_Name (P) loop
if Nkind (P) not in N_Selected_Component | N_Indexed_Component then
return Empty;
end if;
P := Prefix (P);
end loop;
return Entity (P);
end Entity_Of_Prefix;
-- Local variables
Loc : constant Source_Ptr := Sloc (N);
A : constant Node_Id := Prefix (N);
A_Ent : constant Entity_Id := Entity_Of_Prefix;
Sub : Node_Id;
-- Start of processing for Generate_Index_Checks
begin
Checks_Generated.Elements := (others => False);
-- Ignore call if the prefix is not an array since we have a serious
-- error in the sources. Ignore it also if index checks are suppressed
-- for array object or type.
if not Is_Array_Type (Etype (A))
or else (Present (A_Ent) and then Index_Checks_Suppressed (A_Ent))
or else Index_Checks_Suppressed (Etype (A))
then
return;
-- The indexed component we are dealing with contains 'Loop_Entry in its
-- prefix. This case arises when analysis has determined that constructs
-- such as
-- Prefix'Loop_Entry (Expr)
-- Prefix'Loop_Entry (Expr1, Expr2, ... ExprN)
-- require rewriting for error detection purposes. A side effect of this
-- action is the generation of index checks that mention 'Loop_Entry.
-- Delay the generation of the check until 'Loop_Entry has been properly
-- expanded. This is done in Expand_Loop_Entry_Attributes.
elsif Nkind (Prefix (N)) = N_Attribute_Reference
and then Attribute_Name (Prefix (N)) = Name_Loop_Entry
then
return;
end if;
-- Generate a raise of constraint error with the appropriate reason and
-- a condition of the form:
-- Base_Type (Sub) not in Array'Range (Subscript)
-- Note that the reason we generate the conversion to the base type here
-- is that we definitely want the range check to take place, even if it
-- looks like the subtype is OK. Optimization considerations that allow
-- us to omit the check have already been taken into account in the
-- setting of the Do_Range_Check flag earlier on.
Sub := First (Expressions (N));
-- Handle string literals
if Ekind (Etype (A)) = E_String_Literal_Subtype then
if Do_Range_Check (Sub) then
Set_Do_Range_Check (Sub, False);
-- For string literals we obtain the bounds of the string from the
-- associated subtype.
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd =>
Convert_To (Base_Type (Etype (Sub)),
Duplicate_Subexpr_Move_Checks (Sub)),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Etype (A), Loc),
Attribute_Name => Name_Range)),
Reason => CE_Index_Check_Failed));
Checks_Generated.Elements (1) := True;
end if;
-- General case
else
declare
A_Idx : Node_Id;
A_Range : Node_Id;
Ind : Pos;
Num : List_Id;
Range_N : Node_Id;
begin
A_Idx := First_Index (Etype (A));
Ind := 1;
while Present (Sub) loop
if Do_Range_Check (Sub) then
Set_Do_Range_Check (Sub, False);
-- Force evaluation except for the case of a simple name of
-- a nonvolatile entity.
if not Is_Entity_Name (Sub)
or else Treat_As_Volatile (Entity (Sub))
then
Force_Evaluation (Sub);
end if;
if Nkind (A_Idx) = N_Range then
A_Range := A_Idx;
elsif Nkind (A_Idx) in N_Identifier | N_Expanded_Name then
A_Range := Scalar_Range (Entity (A_Idx));
if Nkind (A_Range) = N_Subtype_Indication then
A_Range := Range_Expression (Constraint (A_Range));
end if;
else pragma Assert (Nkind (A_Idx) = N_Subtype_Indication);
A_Range := Range_Expression (Constraint (A_Idx));
end if;
-- For array objects with constant bounds we can generate
-- the index check using the bounds of the type of the index
if Present (A_Ent)
and then Ekind (A_Ent) = E_Variable
and then Is_Constant_Bound (Low_Bound (A_Range))
and then Is_Constant_Bound (High_Bound (A_Range))
then
Range_N :=
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Etype (A_Idx), Loc),
Attribute_Name => Name_Range);
-- For arrays with non-constant bounds we cannot generate
-- the index check using the bounds of the type of the index
-- since it may reference discriminants of some enclosing
-- type. We obtain the bounds directly from the prefix
-- object.
else
if Ind = 1 then
Num := No_List;
else
Num := New_List (Make_Integer_Literal (Loc, Ind));
end if;
Range_N :=
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr_Move_Checks (A, Name_Req => True),
Attribute_Name => Name_Range,
Expressions => Num);
end if;
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd =>
Convert_To (Base_Type (Etype (Sub)),
Duplicate_Subexpr_Move_Checks (Sub)),
Right_Opnd => Range_N),
Reason => CE_Index_Check_Failed));
Checks_Generated.Elements (Ind) := True;
end if;
Next_Index (A_Idx);
Ind := Ind + 1;
Next (Sub);
end loop;
end;
end if;
end Generate_Index_Checks;
--------------------------
-- Generate_Range_Check --
--------------------------
procedure Generate_Range_Check
(N : Node_Id;
Target_Type : Entity_Id;
Reason : RT_Exception_Code)
is
Loc : constant Source_Ptr := Sloc (N);
Source_Type : constant Entity_Id := Etype (N);
Source_Base_Type : constant Entity_Id := Base_Type (Source_Type);
Target_Base_Type : constant Entity_Id := Base_Type (Target_Type);
procedure Convert_And_Check_Range (Suppress : Check_Id);
-- Convert N to the target base type and save the result in a temporary.
-- The action is analyzed using the default checks as modified by the
-- given Suppress argument. Then check the converted value against the
-- range of the target subtype.
function Is_Single_Attribute_Reference (N : Node_Id) return Boolean;
-- Return True if N is an expression that contains a single attribute
-- reference, possibly as operand among only integer literal operands.
-----------------------------
-- Convert_And_Check_Range --
-----------------------------
procedure Convert_And_Check_Range (Suppress : Check_Id) is
Tnn : constant Entity_Id := Make_Temporary (Loc, 'T', N);
Conv_N : Node_Id;
begin
-- For enumeration types with non-standard representation this is a
-- direct conversion from the enumeration type to the target integer
-- type, which is treated by the back end as a normal integer type
-- conversion, treating the enumeration type as an integer, which is
-- exactly what we want. We set Conversion_OK to make sure that the
-- analyzer does not complain about what otherwise might be an
-- illegal conversion.
if Is_Enumeration_Type (Source_Base_Type)
and then Present (Enum_Pos_To_Rep (Source_Base_Type))
and then Is_Integer_Type (Target_Base_Type)
then
Conv_N := OK_Convert_To (Target_Base_Type, Duplicate_Subexpr (N));
else
Conv_N := Convert_To (Target_Base_Type, Duplicate_Subexpr (N));
end if;
-- We make a temporary to hold the value of the conversion to the
-- target base type, and then do the test against this temporary.
-- N itself is replaced by an occurrence of Tnn and followed by
-- the explicit range check.
-- Tnn : constant Target_Base_Type := Target_Base_Type (N);
-- [constraint_error when Tnn not in Target_Type]
-- Tnn
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Tnn,
Object_Definition => New_Occurrence_Of (Target_Base_Type, Loc),
Constant_Present => True,
Expression => Conv_N),
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Tnn, Loc),
Right_Opnd => New_Occurrence_Of (Target_Type, Loc)),
Reason => Reason)),
Suppress => Suppress);
Rewrite (N, New_Occurrence_Of (Tnn, Loc));
-- Set the type of N, because the declaration for Tnn might not
-- be analyzed yet, as is the case if N appears within a record
-- declaration, as a discriminant constraint or expression.
Set_Etype (N, Target_Base_Type);
end Convert_And_Check_Range;
-------------------------------------
-- Is_Single_Attribute_Reference --
-------------------------------------
function Is_Single_Attribute_Reference (N : Node_Id) return Boolean is
begin
if Nkind (N) = N_Attribute_Reference then
return True;
elsif Nkind (N) in N_Binary_Op then
if Nkind (Right_Opnd (N)) = N_Integer_Literal then
return Is_Single_Attribute_Reference (Left_Opnd (N));
elsif Nkind (Left_Opnd (N)) = N_Integer_Literal then
return Is_Single_Attribute_Reference (Right_Opnd (N));
else
return False;
end if;
else
return False;
end if;
end Is_Single_Attribute_Reference;
-- Start of processing for Generate_Range_Check
begin
-- First special case, if the source type is already within the range
-- of the target type, then no check is needed (probably we should have
-- stopped Do_Range_Check from being set in the first place, but better
-- late than never in preventing junk code and junk flag settings).
if In_Subrange_Of (Source_Type, Target_Type)
-- We do NOT apply this if the source node is a literal, since in this
-- case the literal has already been labeled as having the subtype of
-- the target.
and then not
(Nkind (N) in
N_Integer_Literal | N_Real_Literal | N_Character_Literal
or else
(Is_Entity_Name (N)
and then Ekind (Entity (N)) = E_Enumeration_Literal))
then
Set_Do_Range_Check (N, False);
return;
end if;
-- Here a check is needed. If the expander is not active (which is also
-- the case in GNATprove mode), then simply set the Do_Range_Check flag
-- and we are done. We just want to see the range check flag set, we do
-- not want to generate the explicit range check code.
if not Expander_Active then
Set_Do_Range_Check (N);
return;
end if;
-- Here we will generate an explicit range check, so we don't want to
-- set the Do_Range check flag, since the range check is taken care of
-- by the code we will generate.
Set_Do_Range_Check (N, False);
-- Force evaluation of the node, so that it does not get evaluated twice
-- (once for the check, once for the actual reference). Such a double
-- evaluation is always a potential source of inefficiency, and is
-- functionally incorrect in the volatile case.
-- We skip the evaluation of attribute references because, after these
-- runtime checks are generated, the expander may need to rewrite this
-- node (for example, see Attribute_Max_Size_In_Storage_Elements in
-- Expand_N_Attribute_Reference) and, in many cases, their return type
-- is universal integer, which is a very large type for a temporary.
if not Is_Single_Attribute_Reference (N)
and then (not Is_Entity_Name (N)
or else Treat_As_Volatile (Entity (N)))
then
Force_Evaluation (N, Mode => Strict);
end if;
-- The easiest case is when Source_Base_Type and Target_Base_Type are
-- the same since in this case we can simply do a direct check of the
-- value of N against the bounds of Target_Type.
-- [constraint_error when N not in Target_Type]
-- Note: this is by far the most common case, for example all cases of
-- checks on the RHS of assignments are in this category, but not all
-- cases are like this. Notably conversions can involve two types.
if Source_Base_Type = Target_Base_Type then
-- Insert the explicit range check. Note that we suppress checks for
-- this code, since we don't want a recursive range check popping up.
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd => New_Occurrence_Of (Target_Type, Loc)),
Reason => Reason),
Suppress => All_Checks);
-- Next test for the case where the target type is within the bounds
-- of the base type of the source type, since in this case we can
-- simply convert the bounds of the target type to this base type
-- to do the test.
-- [constraint_error when N not in
-- Source_Base_Type (Target_Type'First)
-- ..
-- Source_Base_Type(Target_Type'Last))]
-- The conversions will always work and need no check
-- Unchecked_Convert_To is used instead of Convert_To to handle the case
-- of converting from an enumeration value to an integer type, such as
-- occurs for the case of generating a range check on Enum'Val(Exp)
-- (which used to be handled by gigi). This is OK, since the conversion
-- itself does not require a check.
elsif In_Subrange_Of (Target_Type, Source_Base_Type) then
-- Insert the explicit range check. Note that we suppress checks for
-- this code, since we don't want a recursive range check popping up.
if Is_Discrete_Type (Source_Base_Type)
and then
Is_Discrete_Type (Target_Base_Type)
then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Not_In (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Make_Range (Loc,
Low_Bound =>
Unchecked_Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First)),
High_Bound =>
Unchecked_Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last)))),
Reason => Reason),
Suppress => All_Checks);
-- For conversions involving at least one type that is not discrete,
-- first convert to the target base type and then generate the range
-- check. This avoids problems with values that are close to a bound
-- of the target type that would fail a range check when done in a
-- larger source type before converting but pass if converted with
-- rounding and then checked (such as in float-to-float conversions).
-- Note that overflow checks are not suppressed for this code because
-- we do not know whether the source type is in range of the target
-- base type (unlike in the next case below).
else
Convert_And_Check_Range (Suppress => Range_Check);
end if;
-- Note that at this stage we know that the Target_Base_Type is not in
-- the range of the Source_Base_Type (since even the Target_Type itself
-- is not in this range). It could still be the case that Source_Type is
-- in range of the target base type since we have not checked that case.
-- If that is the case, we can freely convert the source to the target,
-- and then test the target result against the bounds. Note that checks
-- are suppressed for this code, since we don't want a recursive range
-- check popping up.
elsif In_Subrange_Of (Source_Type, Target_Base_Type) then
Convert_And_Check_Range (Suppress => All_Checks);
-- At this stage, we know that we have two scalar types, which are
-- directly convertible, and where neither scalar type has a base
-- range that is in the range of the other scalar type.
-- The only way this can happen is with a signed and unsigned type.
-- So test for these two cases:
else
-- Case of the source is unsigned and the target is signed
if Is_Unsigned_Type (Source_Base_Type)
and then not Is_Unsigned_Type (Target_Base_Type)
then
-- If the source is unsigned and the target is signed, then we
-- know that the source is not shorter than the target (otherwise
-- the source base type would be in the target base type range).
-- In other words, the unsigned type is either the same size as
-- the target, or it is larger. It cannot be smaller.
pragma Assert
(Esize (Source_Base_Type) >= Esize (Target_Base_Type));
-- We only need to check the low bound if the low bound of the
-- target type is non-negative. If the low bound of the target
-- type is negative, then we know that we will fit fine.
-- If the high bound of the target type is negative, then we
-- know we have a constraint error, since we can't possibly
-- have a negative source.
-- With these two checks out of the way, we can do the check
-- using the source type safely
-- This is definitely the most annoying case.
-- [constraint_error
-- when (Target_Type'First >= 0
-- and then
-- N < Source_Base_Type (Target_Type'First))
-- or else Target_Type'Last < 0
-- or else N > Source_Base_Type (Target_Type'Last)];
-- We turn off all checks since we know that the conversions
-- will work fine, given the guards for negative values.
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Or_Else (Loc,
Make_Or_Else (Loc,
Left_Opnd =>
Make_And_Then (Loc,
Left_Opnd => Make_Op_Ge (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Right_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_First)))),
Right_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0))),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd =>
Convert_To (Source_Base_Type,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Target_Type, Loc),
Attribute_Name => Name_Last)))),
Reason => Reason),
Suppress => All_Checks);
-- Only remaining possibility is that the source is signed and
-- the target is unsigned.
else
pragma Assert (not Is_Unsigned_Type (Source_Base_Type)
and then Is_Unsigned_Type (Target_Base_Type));
-- If the source is signed and the target is unsigned, then we
-- know that the target is not shorter than the source (otherwise
-- the target base type would be in the source base type range).
-- In other words, the unsigned type is either the same size as
-- the target, or it is larger. It cannot be smaller.
-- Clearly we have an error if the source value is negative since
-- no unsigned type can have negative values. If the source type
-- is non-negative, then the check can be done using the target
-- type.
-- Tnn : constant Target_Base_Type (N) := Target_Type;
-- [constraint_error
-- when N < 0 or else Tnn not in Target_Type];
-- We turn off all checks for the conversion of N to the target
-- base type, since we generate the explicit check to ensure that
-- the value is non-negative
declare
Tnn : constant Entity_Id := Make_Temporary (Loc, 'T', N);
begin
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => Tnn,
Object_Definition =>
New_Occurrence_Of (Target_Base_Type, Loc),
Constant_Present => True,
Expression =>
Unchecked_Convert_To
(Target_Base_Type, Duplicate_Subexpr (N))),
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd => Duplicate_Subexpr (N),
Right_Opnd => Make_Integer_Literal (Loc, Uint_0)),
Right_Opnd =>
Make_Not_In (Loc,
Left_Opnd => New_Occurrence_Of (Tnn, Loc),
Right_Opnd =>
New_Occurrence_Of (Target_Type, Loc))),
Reason => Reason)),
Suppress => All_Checks);
-- Set the Etype explicitly, because Insert_Actions may have
-- placed the declaration in the freeze list for an enclosing
-- construct, and thus it is not analyzed yet.
Set_Etype (Tnn, Target_Base_Type);
Rewrite (N, New_Occurrence_Of (Tnn, Loc));
end;
end if;
end if;
end Generate_Range_Check;
------------------
-- Get_Check_Id --
------------------
function Get_Check_Id (N : Name_Id) return Check_Id is
begin
-- For standard check name, we can do a direct computation
if N in First_Check_Name .. Last_Check_Name then
return Check_Id (N - (First_Check_Name - 1));
-- For non-standard names added by pragma Check_Name, search table
else
for J in All_Checks + 1 .. Check_Names.Last loop
if Check_Names.Table (J) = N then
return J;
end if;
end loop;
end if;
-- No matching name found
return No_Check_Id;
end Get_Check_Id;
---------------------
-- Get_Discriminal --
---------------------
function Get_Discriminal (E : Entity_Id; Bound : Node_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (E);
D : Entity_Id;
Sc : Entity_Id;
begin
-- The bound can be a bona fide parameter of a protected operation,
-- rather than a prival encoded as an in-parameter.
if No (Discriminal_Link (Entity (Bound))) then
return Bound;
end if;
-- Climb the scope stack looking for an enclosing protected type. If
-- we run out of scopes, return the bound itself.
Sc := Scope (E);
while Present (Sc) loop
if Sc = Standard_Standard then
return Bound;
elsif Ekind (Sc) = E_Protected_Type then
exit;
end if;
Sc := Scope (Sc);
end loop;
D := First_Discriminant (Sc);
while Present (D) loop
if Chars (D) = Chars (Bound) then
return New_Occurrence_Of (Discriminal (D), Loc);
end if;
Next_Discriminant (D);
end loop;
return Bound;
end Get_Discriminal;
----------------------
-- Get_Range_Checks --
----------------------
function Get_Range_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Warn_Node : Node_Id := Empty) return Check_Result
is
begin
return
Selected_Range_Checks (Expr, Target_Typ, Source_Typ, Warn_Node);
end Get_Range_Checks;
------------------
-- Guard_Access --
------------------
function Guard_Access
(Cond : Node_Id;
Loc : Source_Ptr;
Expr : Node_Id) return Node_Id
is
begin
if Nkind (Cond) = N_Or_Else then
Set_Paren_Count (Cond, 1);
end if;
if Nkind (Expr) = N_Allocator then
return Cond;
else
return
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Expr),
Right_Opnd => Make_Null (Loc)),
Right_Opnd => Cond);
end if;
end Guard_Access;
-----------------------------
-- Index_Checks_Suppressed --
-----------------------------
function Index_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Index_Check);
else
return Scope_Suppress.Suppress (Index_Check);
end if;
end Index_Checks_Suppressed;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
for J in Determine_Range_Cache_N'Range loop
Determine_Range_Cache_N (J) := Empty;
end loop;
Check_Names.Init;
for J in Int range 1 .. All_Checks loop
Check_Names.Append (Name_Id (Int (First_Check_Name) + J - 1));
end loop;
end Initialize;
-------------------------
-- Insert_Range_Checks --
-------------------------
procedure Insert_Range_Checks
(Checks : Check_Result;
Node : Node_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr;
Do_Before : Boolean := False)
is
Checks_On : constant Boolean :=
not Index_Checks_Suppressed (Suppress_Typ)
or else
not Range_Checks_Suppressed (Suppress_Typ);
Check_Node : Node_Id;
begin
-- For now we just return if Checks_On is false, however this should be
-- enhanced to check for an always True value in the condition and to
-- generate a compilation warning.
if not Expander_Active or not Checks_On then
return;
end if;
for J in 1 .. 2 loop
exit when No (Checks (J));
if Nkind (Checks (J)) = N_Raise_Constraint_Error
and then Present (Condition (Checks (J)))
then
Check_Node := Checks (J);
else
Check_Node :=
Make_Raise_Constraint_Error (Static_Sloc,
Reason => CE_Range_Check_Failed);
end if;
Mark_Rewrite_Insertion (Check_Node);
if Do_Before then
Insert_Before_And_Analyze (Node, Check_Node);
else
Insert_After_And_Analyze (Node, Check_Node);
end if;
end loop;
end Insert_Range_Checks;
------------------------
-- Insert_Valid_Check --
------------------------
procedure Insert_Valid_Check
(Expr : Node_Id;
Related_Id : Entity_Id := Empty;
Is_Low_Bound : Boolean := False;
Is_High_Bound : Boolean := False)
is
Loc : constant Source_Ptr := Sloc (Expr);
Typ : Entity_Id := Etype (Expr);
Exp : Node_Id;
begin
-- Do not insert if checks off, or if not checking validity or if
-- expression is known to be valid.
if not Validity_Checks_On
or else Range_Or_Validity_Checks_Suppressed (Expr)
or else Expr_Known_Valid (Expr)
then
return;
-- Do not insert checks within a predicate function. This will arise
-- if the current unit and the predicate function are being compiled
-- with validity checks enabled.
elsif Present (Predicate_Function (Typ))
and then Current_Scope = Predicate_Function (Typ)
then
return;
-- If the expression is a packed component of a modular type of the
-- right size, the data is always valid.
elsif Nkind (Expr) = N_Selected_Component
and then Present (Component_Clause (Entity (Selector_Name (Expr))))
and then Is_Modular_Integer_Type (Typ)
and then Modulus (Typ) = 2 ** Esize (Entity (Selector_Name (Expr)))
then
return;
-- Do not generate a validity check when inside a generic unit as this
-- is an expansion activity.
elsif Inside_A_Generic then
return;
end if;
-- Entities declared in Lock_free protected types must be treated as
-- volatile, and we must inhibit validity checks to prevent improper
-- constant folding.
if Is_Entity_Name (Expr)
and then Is_Subprogram (Scope (Entity (Expr)))
and then Present (Protected_Subprogram (Scope (Entity (Expr))))
and then Uses_Lock_Free
(Scope (Protected_Subprogram (Scope (Entity (Expr)))))
then
return;
end if;
-- If we have a checked conversion, then validity check applies to
-- the expression inside the conversion, not the result, since if
-- the expression inside is valid, then so is the conversion result.
Exp := Expr;
while Nkind (Exp) = N_Type_Conversion loop
Exp := Expression (Exp);
end loop;
Typ := Etype (Exp);
-- Do not generate a check for a variable which already validates the
-- value of an assignable object.
if Is_Validation_Variable_Reference (Exp) then
return;
end if;
declare
CE : Node_Id;
PV : Node_Id;
Var_Id : Entity_Id;
begin
-- If the expression denotes an assignable object, capture its value
-- in a variable and replace the original expression by the variable.
-- This approach has several effects:
-- 1) The evaluation of the object results in only one read in the
-- case where the object is atomic or volatile.
-- Var ... := Object; -- read
-- 2) The captured value is the one verified by attribute 'Valid.
-- As a result the object is not evaluated again, which would
-- result in an unwanted read in the case where the object is
-- atomic or volatile.
-- if not Var'Valid then -- OK, no read of Object
-- if not Object'Valid then -- Wrong, extra read of Object
-- 3) The captured value replaces the original object reference.
-- As a result the object is not evaluated again, in the same
-- vein as 2).
-- ... Var ... -- OK, no read of Object
-- ... Object ... -- Wrong, extra read of Object
-- 4) The use of a variable to capture the value of the object
-- allows the propagation of any changes back to the original
-- object.
-- procedure Call (Val : in out ...);
-- Var : ... := Object; -- read Object
-- if not Var'Valid then -- validity check
-- Call (Var); -- modify Var
-- Object := Var; -- update Object
if Is_Variable (Exp) then
Var_Id := Make_Temporary (Loc, 'T', Exp);
-- Because we could be dealing with a transient scope which would
-- cause our object declaration to remain unanalyzed we must do
-- some manual decoration.
Mutate_Ekind (Var_Id, E_Variable);
Set_Etype (Var_Id, Typ);
Insert_Action (Exp,
Make_Object_Declaration (Loc,
Defining_Identifier => Var_Id,
Object_Definition => New_Occurrence_Of (Typ, Loc),
Expression => New_Copy_Tree (Exp)),
Suppress => Validity_Check);
Set_Validated_Object (Var_Id, New_Copy_Tree (Exp));
Rewrite (Exp, New_Occurrence_Of (Var_Id, Loc));
-- Move the Do_Range_Check flag over to the new Exp so it doesn't
-- get lost and doesn't leak elsewhere.
if Do_Range_Check (Validated_Object (Var_Id)) then
Set_Do_Range_Check (Exp);
Set_Do_Range_Check (Validated_Object (Var_Id), False);
end if;
-- In case of a type conversion, an expansion of the expr may be
-- needed (eg. fixed-point as actual).
if Exp /= Expr then
pragma Assert (Nkind (Expr) = N_Type_Conversion);
Analyze_And_Resolve (Expr);
end if;
PV := New_Occurrence_Of (Var_Id, Loc);
-- Otherwise the expression does not denote a variable. Force its
-- evaluation by capturing its value in a constant. Generate:
-- Temp : constant ... := Exp;
else
Force_Evaluation
(Exp => Exp,
Related_Id => Related_Id,
Is_Low_Bound => Is_Low_Bound,
Is_High_Bound => Is_High_Bound);
PV := New_Copy_Tree (Exp);
end if;
-- A rather specialized test. If PV is an analyzed expression which
-- is an indexed component of a packed array that has not been
-- properly expanded, turn off its Analyzed flag to make sure it
-- gets properly reexpanded. If the prefix is an access value,
-- the dereference will be added later.
-- The reason this arises is that Duplicate_Subexpr_No_Checks did
-- an analyze with the old parent pointer. This may point e.g. to
-- a subprogram call, which deactivates this expansion.
if Analyzed (PV)
and then Nkind (PV) = N_Indexed_Component
and then Is_Array_Type (Etype (Prefix (PV)))
and then Present (Packed_Array_Impl_Type (Etype (Prefix (PV))))
then
Set_Analyzed (PV, False);
end if;
-- Build the raise CE node to check for validity. We build a type
-- qualification for the prefix, since it may not be of the form of
-- a name, and we don't care in this context!
CE :=
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => PV,
Attribute_Name => Name_Valid)),
Reason => CE_Invalid_Data);
-- Insert the validity check. Note that we do this with validity
-- checks turned off, to avoid recursion, we do not want validity
-- checks on the validity checking code itself.
Insert_Action (Expr, CE, Suppress => Validity_Check);
-- If the expression is a reference to an element of a bit-packed
-- array, then it is rewritten as a renaming declaration. If the
-- expression is an actual in a call, it has not been expanded,
-- waiting for the proper point at which to do it. The same happens
-- with renamings, so that we have to force the expansion now. This
-- non-local complication is due to code in exp_ch2,adb, exp_ch4.adb
-- and exp_ch6.adb.
if Is_Entity_Name (Exp)
and then Nkind (Parent (Entity (Exp))) =
N_Object_Renaming_Declaration
then
declare
Old_Exp : constant Node_Id := Name (Parent (Entity (Exp)));
begin
if Nkind (Old_Exp) = N_Indexed_Component
and then Is_Bit_Packed_Array (Etype (Prefix (Old_Exp)))
then
Expand_Packed_Element_Reference (Old_Exp);
end if;
end;
end if;
end;
end Insert_Valid_Check;
-------------------------------------
-- Is_Signed_Integer_Arithmetic_Op --
-------------------------------------
function Is_Signed_Integer_Arithmetic_Op (N : Node_Id) return Boolean is
begin
case Nkind (N) is
when N_Op_Abs
| N_Op_Add
| N_Op_Divide
| N_Op_Expon
| N_Op_Minus
| N_Op_Mod
| N_Op_Multiply
| N_Op_Plus
| N_Op_Rem
| N_Op_Subtract
=>
return Is_Signed_Integer_Type (Etype (N));
when N_Case_Expression
| N_If_Expression
=>
return Is_Signed_Integer_Type (Etype (N));
when others =>
return False;
end case;
end Is_Signed_Integer_Arithmetic_Op;
----------------------------------
-- Install_Null_Excluding_Check --
----------------------------------
procedure Install_Null_Excluding_Check (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (Parent (N));
Typ : constant Entity_Id := Etype (N);
function Safe_To_Capture_In_Parameter_Value return Boolean;
-- Determines if it is safe to capture Known_Non_Null status for an
-- the entity referenced by node N. The caller ensures that N is indeed
-- an entity name. It is safe to capture the non-null status for an IN
-- parameter when the reference occurs within a declaration that is sure
-- to be executed as part of the declarative region.
procedure Mark_Non_Null;
-- After installation of check, if the node in question is an entity
-- name, then mark this entity as non-null if possible.
function Safe_To_Capture_In_Parameter_Value return Boolean is
E : constant Entity_Id := Entity (N);
S : constant Entity_Id := Current_Scope;
S_Par : Node_Id;
begin
if Ekind (E) /= E_In_Parameter then
return False;
end if;
-- Two initial context checks. We must be inside a subprogram body
-- with declarations and reference must not appear in nested scopes.
if (Ekind (S) /= E_Function and then Ekind (S) /= E_Procedure)
or else Scope (E) /= S
then
return False;
end if;
S_Par := Parent (Parent (S));
if Nkind (S_Par) /= N_Subprogram_Body
or else No (Declarations (S_Par))
then
return False;
end if;
declare
N_Decl : Node_Id;
P : Node_Id;
begin
-- Retrieve the declaration node of N (if any). Note that N
-- may be a part of a complex initialization expression.
P := Parent (N);
N_Decl := Empty;
while Present (P) loop
-- If we have a short circuit form, and we are within the right
-- hand expression, we return false, since the right hand side
-- is not guaranteed to be elaborated.
if Nkind (P) in N_Short_Circuit
and then N = Right_Opnd (P)
then
return False;
end if;
-- Similarly, if we are in an if expression and not part of the
-- condition, then we return False, since neither the THEN or
-- ELSE dependent expressions will always be elaborated.
if Nkind (P) = N_If_Expression
and then N /= First (Expressions (P))
then
return False;
end if;
-- If within a case expression, and not part of the expression,
-- then return False, since a particular dependent expression
-- may not always be elaborated
if Nkind (P) = N_Case_Expression
and then N /= Expression (P)
then
return False;
end if;
-- While traversing the parent chain, if node N belongs to a
-- statement, then it may never appear in a declarative region.
if Nkind (P) in N_Statement_Other_Than_Procedure_Call
or else Nkind (P) = N_Procedure_Call_Statement
then
return False;
end if;
-- If we are at a declaration, record it and exit
if Nkind (P) in N_Declaration
and then Nkind (P) not in N_Subprogram_Specification
then
N_Decl := P;
exit;
end if;
P := Parent (P);
end loop;
if No (N_Decl) then
return False;
end if;
return List_Containing (N_Decl) = Declarations (S_Par);
end;
end Safe_To_Capture_In_Parameter_Value;
-------------------
-- Mark_Non_Null --
-------------------
procedure Mark_Non_Null is
begin
-- Only case of interest is if node N is an entity name
if Is_Entity_Name (N) then
-- For sure, we want to clear an indication that this is known to
-- be null, since if we get past this check, it definitely is not.
Set_Is_Known_Null (Entity (N), False);
-- We can mark the entity as known to be non-null if either it is
-- safe to capture the value, or in the case of an IN parameter,
-- which is a constant, if the check we just installed is in the
-- declarative region of the subprogram body. In this latter case,
-- a check is decisive for the rest of the body if the expression
-- is sure to be elaborated, since we know we have to elaborate
-- all declarations before executing the body.
-- Couldn't this always be part of Safe_To_Capture_Value ???
if Safe_To_Capture_Value (N, Entity (N))
or else Safe_To_Capture_In_Parameter_Value
then
Set_Is_Known_Non_Null (Entity (N));
end if;
end if;
end Mark_Non_Null;
-- Start of processing for Install_Null_Excluding_Check
begin
-- No need to add null-excluding checks when the tree may not be fully
-- decorated.
if Serious_Errors_Detected > 0 then
return;
end if;
pragma Assert (Is_Access_Type (Typ));
-- No check inside a generic, check will be emitted in instance
if Inside_A_Generic then
return;
end if;
-- No check needed if known to be non-null
if Known_Non_Null (N) then
return;
end if;
-- If known to be null, here is where we generate a compile time check
if Known_Null (N) then
-- Avoid generating warning message inside init procs. In SPARK mode
-- we can go ahead and call Apply_Compile_Time_Constraint_Error
-- since it will be turned into an error in any case.
if (not Inside_Init_Proc or else SPARK_Mode = On)
-- Do not emit the warning within a conditional expression,
-- where the expression might not be evaluated, and the warning
-- appear as extraneous noise.
and then not Within_Case_Or_If_Expression (N)
then
Apply_Compile_Time_Constraint_Error
(N, "null value not allowed here??", CE_Access_Check_Failed);
-- Remaining cases, where we silently insert the raise
else
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Reason => CE_Access_Check_Failed));
end if;
Mark_Non_Null;
return;
end if;
-- If entity is never assigned, for sure a warning is appropriate
if Is_Entity_Name (N) then
Check_Unset_Reference (N);
end if;
-- No check needed if checks are suppressed on the range. Note that we
-- don't set Is_Known_Non_Null in this case (we could legitimately do
-- so, since the program is erroneous, but we don't like to casually
-- propagate such conclusions from erroneosity).
if Access_Checks_Suppressed (Typ) then
return;
end if;
-- No check needed for access to concurrent record types generated by
-- the expander. This is not just an optimization (though it does indeed
-- remove junk checks). It also avoids generation of junk warnings.
if Nkind (N) in N_Has_Chars
and then Chars (N) = Name_uObject
and then Is_Concurrent_Record_Type
(Directly_Designated_Type (Etype (N)))
then
return;
end if;
-- No check needed in interface thunks since the runtime check is
-- already performed at the caller side.
if Is_Thunk (Current_Scope) then
return;
end if;
-- In GNATprove mode, we do not apply the check
if GNATprove_Mode then
return;
end if;
-- Otherwise install access check
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd => Duplicate_Subexpr_Move_Checks (N),
Right_Opnd => Make_Null (Loc)),
Reason => CE_Access_Check_Failed));
Mark_Non_Null;
end Install_Null_Excluding_Check;
-----------------------------------------
-- Install_Primitive_Elaboration_Check --
-----------------------------------------
procedure Install_Primitive_Elaboration_Check (Subp_Body : Node_Id) is
function Within_Compilation_Unit_Instance
(Subp_Id : Entity_Id) return Boolean;
-- Determine whether subprogram Subp_Id appears within an instance which
-- acts as a compilation unit.
--------------------------------------
-- Within_Compilation_Unit_Instance --
--------------------------------------
function Within_Compilation_Unit_Instance
(Subp_Id : Entity_Id) return Boolean
is
Pack : Entity_Id;
begin
-- Examine the scope chain looking for a compilation-unit-level
-- instance.
Pack := Scope (Subp_Id);
while Present (Pack) and then Pack /= Standard_Standard loop
if Ekind (Pack) = E_Package
and then Is_Generic_Instance (Pack)
and then Nkind (Parent (Unit_Declaration_Node (Pack))) =
N_Compilation_Unit
then
return True;
end if;
Pack := Scope (Pack);
end loop;
return False;
end Within_Compilation_Unit_Instance;
-- Local declarations
Context : constant Node_Id := Parent (Subp_Body);
Loc : constant Source_Ptr := Sloc (Subp_Body);
Subp_Id : constant Entity_Id := Unique_Defining_Entity (Subp_Body);
Subp_Decl : constant Node_Id := Unit_Declaration_Node (Subp_Id);
Decls : List_Id;
Flag_Id : Entity_Id;
Set_Ins : Node_Id;
Set_Stmt : Node_Id;
Tag_Typ : Entity_Id;
-- Start of processing for Install_Primitive_Elaboration_Check
begin
-- Do not generate an elaboration check in compilation modes where
-- expansion is not desirable.
if GNATprove_Mode then
return;
-- Do not generate an elaboration check if all checks have been
-- suppressed.
elsif Suppress_Checks then
return;
-- Do not generate an elaboration check if the related subprogram is
-- not subject to elaboration checks.
elsif Elaboration_Checks_Suppressed (Subp_Id) then
return;
-- Do not generate an elaboration check if such code is not desirable
elsif Restriction_Active (No_Elaboration_Code) then
return;
-- If pragma Pure or Preelaborate applies, then these elaboration checks
-- cannot fail, so do not generate them.
elsif In_Preelaborated_Unit then
return;
-- Do not generate an elaboration check if exceptions cannot be used,
-- caught, or propagated.
elsif not Exceptions_OK then
return;
-- Do not consider subprograms that are compilation units, because they
-- cannot be the target of a dispatching call.
elsif Nkind (Context) = N_Compilation_Unit then
return;
-- Do not consider anything other than nonabstract library-level source
-- primitives.
elsif not
(Comes_From_Source (Subp_Id)
and then Is_Library_Level_Entity (Subp_Id)
and then Is_Primitive (Subp_Id)
and then not Is_Abstract_Subprogram (Subp_Id))
then
return;
-- Do not consider inlined primitives, because once the body is inlined
-- the reference to the elaboration flag will be out of place and will
-- result in an undefined symbol.
elsif Is_Inlined (Subp_Id) or else Has_Pragma_Inline (Subp_Id) then
return;
-- Do not generate a duplicate elaboration check. This happens only in
-- the case of primitives completed by an expression function, as the
-- corresponding body is apparently analyzed and expanded twice.
elsif Analyzed (Subp_Body) then
return;
-- Do not consider primitives that occur within an instance that is a
-- compilation unit. Such an instance defines its spec and body out of
-- order (body is first) within the tree, which causes the reference to
-- the elaboration flag to appear as an undefined symbol.
elsif Within_Compilation_Unit_Instance (Subp_Id) then
return;
end if;
Tag_Typ := Find_Dispatching_Type (Subp_Id);
-- Only tagged primitives may be the target of a dispatching call
if No (Tag_Typ) then
return;
-- Do not consider finalization-related primitives, because they may
-- need to be called while elaboration is taking place.
elsif Is_Controlled (Tag_Typ)
and then
Chars (Subp_Id) in Name_Adjust | Name_Finalize | Name_Initialize
then
return;
end if;
-- Create the declaration of the elaboration flag. The name carries a
-- unique counter in case of name overloading.
Flag_Id :=
Make_Defining_Identifier (Loc,
Chars => New_External_Name (Chars (Subp_Id), 'E', -1));
Set_Is_Frozen (Flag_Id);
-- Insert the declaration of the elaboration flag in front of the
-- primitive spec and analyze it in the proper context.
Push_Scope (Scope (Subp_Id));
-- Generate:
-- E : Boolean := False;
Insert_Action (Subp_Decl,
Make_Object_Declaration (Loc,
Defining_Identifier => Flag_Id,
Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc),
Expression => New_Occurrence_Of (Standard_False, Loc)));
Pop_Scope;
-- Prevent the compiler from optimizing the elaboration check by killing
-- the current value of the flag and the associated assignment.
Set_Current_Value (Flag_Id, Empty);
Set_Last_Assignment (Flag_Id, Empty);
-- Add a check at the top of the body declarations to ensure that the
-- elaboration flag has been set.
Decls := Declarations (Subp_Body);
if No (Decls) then
Decls := New_List;
Set_Declarations (Subp_Body, Decls);
end if;
-- Generate:
-- if not F then
-- raise Program_Error with "access before elaboration";
-- end if;
Prepend_To (Decls,
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd => New_Occurrence_Of (Flag_Id, Loc)),
Reason => PE_Access_Before_Elaboration));
Analyze (First (Decls));
-- Set the elaboration flag once the body has been elaborated. Insert
-- the statement after the subprogram stub when the primitive body is
-- a subunit.
if Nkind (Context) = N_Subunit then
Set_Ins := Corresponding_Stub (Context);
else
Set_Ins := Subp_Body;
end if;
-- Generate:
-- E := True;
Set_Stmt :=
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Flag_Id, Loc),
Expression => New_Occurrence_Of (Standard_True, Loc));
-- Mark the assignment statement as elaboration code. This allows the
-- early call region mechanism (see Sem_Elab) to properly ignore such
-- assignments even though they are non-preelaborable code.
Set_Is_Elaboration_Code (Set_Stmt);
Insert_After_And_Analyze (Set_Ins, Set_Stmt);
end Install_Primitive_Elaboration_Check;
--------------------------
-- Install_Static_Check --
--------------------------
procedure Install_Static_Check (R_Cno : Node_Id; Loc : Source_Ptr) is
Stat : constant Boolean := Is_OK_Static_Expression (R_Cno);
Typ : constant Entity_Id := Etype (R_Cno);
begin
Rewrite (R_Cno,
Make_Raise_Constraint_Error (Loc,
Reason => CE_Range_Check_Failed));
Set_Analyzed (R_Cno);
Set_Etype (R_Cno, Typ);
Set_Raises_Constraint_Error (R_Cno);
Set_Is_Static_Expression (R_Cno, Stat);
-- Now deal with possible local raise handling
Possible_Local_Raise (R_Cno, Standard_Constraint_Error);
end Install_Static_Check;
-------------------------
-- Is_Check_Suppressed --
-------------------------
function Is_Check_Suppressed (E : Entity_Id; C : Check_Id) return Boolean is
Ptr : Suppress_Stack_Entry_Ptr;
begin
-- First search the local entity suppress stack. We search this from the
-- top of the stack down so that we get the innermost entry that applies
-- to this case if there are nested entries.
Ptr := Local_Suppress_Stack_Top;
while Ptr /= null loop
if (Ptr.Entity = Empty or else Ptr.Entity = E)
and then (Ptr.Check = All_Checks or else Ptr.Check = C)
then
return Ptr.Suppress;
end if;
Ptr := Ptr.Prev;
end loop;
-- Now search the global entity suppress table for a matching entry.
-- We also search this from the top down so that if there are multiple
-- pragmas for the same entity, the last one applies (not clear what
-- or whether the RM specifies this handling, but it seems reasonable).
Ptr := Global_Suppress_Stack_Top;
while Ptr /= null loop
if (Ptr.Entity = Empty or else Ptr.Entity = E)
and then (Ptr.Check = All_Checks or else Ptr.Check = C)
then
return Ptr.Suppress;
end if;
Ptr := Ptr.Prev;
end loop;
-- If we did not find a matching entry, then use the normal scope
-- suppress value after all (actually this will be the global setting
-- since it clearly was not overridden at any point). For a predefined
-- check, we test the specific flag. For a user defined check, we check
-- the All_Checks flag. The Overflow flag requires special handling to
-- deal with the General vs Assertion case.
if C = Overflow_Check then
return Overflow_Checks_Suppressed (Empty);
elsif C in Predefined_Check_Id then
return Scope_Suppress.Suppress (C);
else
return Scope_Suppress.Suppress (All_Checks);
end if;
end Is_Check_Suppressed;
---------------------
-- Kill_All_Checks --
---------------------
procedure Kill_All_Checks is
begin
if Debug_Flag_CC then
w ("Kill_All_Checks");
end if;
-- We reset the number of saved checks to zero, and also modify all
-- stack entries for statement ranges to indicate that the number of
-- checks at each level is now zero.
Num_Saved_Checks := 0;
-- Note: the Int'Min here avoids any possibility of J being out of
-- range when called from e.g. Conditional_Statements_Begin.
for J in 1 .. Int'Min (Saved_Checks_TOS, Saved_Checks_Stack'Last) loop
Saved_Checks_Stack (J) := 0;
end loop;
end Kill_All_Checks;
-----------------
-- Kill_Checks --
-----------------
procedure Kill_Checks (V : Entity_Id) is
begin
if Debug_Flag_CC then
w ("Kill_Checks for entity", Int (V));
end if;
for J in 1 .. Num_Saved_Checks loop
if Saved_Checks (J).Entity = V then
if Debug_Flag_CC then
w (" Checks killed for saved check ", J);
end if;
Saved_Checks (J).Killed := True;
end if;
end loop;
end Kill_Checks;
------------------------------
-- Length_Checks_Suppressed --
------------------------------
function Length_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Length_Check);
else
return Scope_Suppress.Suppress (Length_Check);
end if;
end Length_Checks_Suppressed;
-----------------------
-- Make_Bignum_Block --
-----------------------
function Make_Bignum_Block (Loc : Source_Ptr) return Node_Id is
M : constant Entity_Id := Make_Defining_Identifier (Loc, Name_uM);
begin
return
Make_Block_Statement (Loc,
Declarations =>
New_List (Build_SS_Mark_Call (Loc, M)),
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Build_SS_Release_Call (Loc, M))));
end Make_Bignum_Block;
----------------------------------
-- Minimize_Eliminate_Overflows --
----------------------------------
-- This is a recursive routine that is called at the top of an expression
-- tree to properly process overflow checking for a whole subtree by making
-- recursive calls to process operands. This processing may involve the use
-- of bignum or long long integer arithmetic, which will change the types
-- of operands and results. That's why we can't do this bottom up (since
-- it would interfere with semantic analysis).
-- What happens is that if MINIMIZED/ELIMINATED mode is in effect then
-- the operator expansion routines, as well as the expansion routines for
-- if/case expression, do nothing (for the moment) except call the routine
-- to apply the overflow check (Apply_Arithmetic_Overflow_Check). That
-- routine does nothing for non top-level nodes, so at the point where the
-- call is made for the top level node, the entire expression subtree has
-- not been expanded, or processed for overflow. All that has to happen as
-- a result of the top level call to this routine.
-- As noted above, the overflow processing works by making recursive calls
-- for the operands, and figuring out what to do, based on the processing
-- of these operands (e.g. if a bignum operand appears, the parent op has
-- to be done in bignum mode), and the determined ranges of the operands.
-- After possible rewriting of a constituent subexpression node, a call is
-- made to either reexpand the node (if nothing has changed) or reanalyze
-- the node (if it has been modified by the overflow check processing). The
-- Analyzed_Flag is set to False before the reexpand/reanalyze. To avoid
-- a recursive call into the whole overflow apparatus, an important rule
-- for this call is that the overflow handling mode must be temporarily set
-- to STRICT.
procedure Minimize_Eliminate_Overflows
(N : Node_Id;
Lo : out Uint;
Hi : out Uint;
Top_Level : Boolean)
is
Rtyp : constant Entity_Id := Etype (N);
pragma Assert (Is_Signed_Integer_Type (Rtyp));
-- Result type, must be a signed integer type
Check_Mode : constant Overflow_Mode_Type := Overflow_Check_Mode;
pragma Assert (Check_Mode in Minimized_Or_Eliminated);
Loc : constant Source_Ptr := Sloc (N);
Rlo, Rhi : Uint;
-- Ranges of values for right operand (operator case)
Llo : Uint := No_Uint; -- initialize to prevent warning
Lhi : Uint := No_Uint; -- initialize to prevent warning
-- Ranges of values for left operand (operator case)
LLIB : constant Entity_Id := Base_Type (Standard_Long_Long_Integer);
-- Operands and results are of this type when we convert
LLLo : constant Uint := Intval (Type_Low_Bound (LLIB));
LLHi : constant Uint := Intval (Type_High_Bound (LLIB));
-- Bounds of Long_Long_Integer
Binary : constant Boolean := Nkind (N) in N_Binary_Op;
-- Indicates binary operator case
OK : Boolean;
-- Used in call to Determine_Range
Bignum_Operands : Boolean;
-- Set True if one or more operands is already of type Bignum, meaning
-- that for sure (regardless of Top_Level setting) we are committed to
-- doing the operation in Bignum mode (or in the case of a case or if
-- expression, converting all the dependent expressions to Bignum).
Long_Long_Integer_Operands : Boolean;
-- Set True if one or more operands is already of type Long_Long_Integer
-- which means that if the result is known to be in the result type
-- range, then we must convert such operands back to the result type.
procedure Reanalyze (Typ : Entity_Id; Suppress : Boolean := False);
-- This is called when we have modified the node and we therefore need
-- to reanalyze it. It is important that we reset the mode to STRICT for
-- this reanalysis, since if we leave it in MINIMIZED or ELIMINATED mode
-- we would reenter this routine recursively which would not be good.
-- The argument Suppress is set True if we also want to suppress
-- overflow checking for the reexpansion (this is set when we know
-- overflow is not possible). Typ is the type for the reanalysis.
procedure Reexpand (Suppress : Boolean := False);
-- This is like Reanalyze, but does not do the Analyze step, it only
-- does a reexpansion. We do this reexpansion in STRICT mode, so that
-- instead of reentering the MINIMIZED/ELIMINATED mode processing, we
-- follow the normal expansion path (e.g. converting A**4 to A**2**2).
-- Note that skipping reanalysis is not just an optimization, testing
-- has showed up several complex cases in which reanalyzing an already
-- analyzed node causes incorrect behavior.
function In_Result_Range return Boolean;
-- Returns True iff Lo .. Hi are within range of the result type
procedure Max (A : in out Uint; B : Uint);
-- If A is No_Uint, sets A to B, else to UI_Max (A, B)
procedure Min (A : in out Uint; B : Uint);
-- If A is No_Uint, sets A to B, else to UI_Min (A, B)
---------------------
-- In_Result_Range --
---------------------
function In_Result_Range return Boolean is
begin
if No (Lo) or else No (Hi) then
return False;
elsif Is_OK_Static_Subtype (Etype (N)) then
return Lo >= Expr_Value (Type_Low_Bound (Rtyp))
and then
Hi <= Expr_Value (Type_High_Bound (Rtyp));
else
return Lo >= Expr_Value (Type_Low_Bound (Base_Type (Rtyp)))
and then
Hi <= Expr_Value (Type_High_Bound (Base_Type (Rtyp)));
end if;
end In_Result_Range;
---------
-- Max --
---------
procedure Max (A : in out Uint; B : Uint) is
begin
if No (A) or else B > A then
A := B;
end if;
end Max;
---------
-- Min --
---------
procedure Min (A : in out Uint; B : Uint) is
begin
if No (A) or else B < A then
A := B;
end if;
end Min;
---------------
-- Reanalyze --
---------------
procedure Reanalyze (Typ : Entity_Id; Suppress : Boolean := False) is
Svg : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_General;
Sva : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_Assertions;
Svo : constant Boolean :=
Scope_Suppress.Suppress (Overflow_Check);
begin
Scope_Suppress.Overflow_Mode_General := Strict;
Scope_Suppress.Overflow_Mode_Assertions := Strict;
if Suppress then
Scope_Suppress.Suppress (Overflow_Check) := True;
end if;
Analyze_And_Resolve (N, Typ);
Scope_Suppress.Suppress (Overflow_Check) := Svo;
Scope_Suppress.Overflow_Mode_General := Svg;
Scope_Suppress.Overflow_Mode_Assertions := Sva;
end Reanalyze;
--------------
-- Reexpand --
--------------
procedure Reexpand (Suppress : Boolean := False) is
Svg : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_General;
Sva : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_Assertions;
Svo : constant Boolean :=
Scope_Suppress.Suppress (Overflow_Check);
begin
Scope_Suppress.Overflow_Mode_General := Strict;
Scope_Suppress.Overflow_Mode_Assertions := Strict;
Set_Analyzed (N, False);
if Suppress then
Scope_Suppress.Suppress (Overflow_Check) := True;
end if;
Expand (N);
Scope_Suppress.Suppress (Overflow_Check) := Svo;
Scope_Suppress.Overflow_Mode_General := Svg;
Scope_Suppress.Overflow_Mode_Assertions := Sva;
end Reexpand;
-- Start of processing for Minimize_Eliminate_Overflows
begin
-- Default initialize Lo and Hi since these are not guaranteed to be
-- set otherwise.
Lo := No_Uint;
Hi := No_Uint;
-- Case where we do not have a signed integer arithmetic operation
if not Is_Signed_Integer_Arithmetic_Op (N) then
-- Use the normal Determine_Range routine to get the range. We
-- don't require operands to be valid, invalid values may result in
-- rubbish results where the result has not been properly checked for
-- overflow, that's fine.
Determine_Range (N, OK, Lo, Hi, Assume_Valid => False);
-- If Determine_Range did not work (can this in fact happen? Not
-- clear but might as well protect), use type bounds.
if not OK then
Lo := Intval (Type_Low_Bound (Base_Type (Etype (N))));
Hi := Intval (Type_High_Bound (Base_Type (Etype (N))));
end if;
-- If we don't have a binary operator, all we have to do is to set
-- the Hi/Lo range, so we are done.
return;
-- Processing for if expression
elsif Nkind (N) = N_If_Expression then
declare
Then_DE : constant Node_Id := Next (First (Expressions (N)));
Else_DE : constant Node_Id := Next (Then_DE);
begin
Bignum_Operands := False;
Minimize_Eliminate_Overflows
(Then_DE, Lo, Hi, Top_Level => False);
if No (Lo) then
Bignum_Operands := True;
end if;
Minimize_Eliminate_Overflows
(Else_DE, Rlo, Rhi, Top_Level => False);
if No (Rlo) then
Bignum_Operands := True;
else
Long_Long_Integer_Operands :=
Etype (Then_DE) = LLIB or else Etype (Else_DE) = LLIB;
Min (Lo, Rlo);
Max (Hi, Rhi);
end if;
-- If at least one of our operands is now Bignum, we must rebuild
-- the if expression to use Bignum operands. We will analyze the
-- rebuilt if expression with overflow checks off, since once we
-- are in bignum mode, we are all done with overflow checks.
if Bignum_Operands then
Rewrite (N,
Make_If_Expression (Loc,
Expressions => New_List (
Remove_Head (Expressions (N)),
Convert_To_Bignum (Then_DE),
Convert_To_Bignum (Else_DE)),
Is_Elsif => Is_Elsif (N)));
Reanalyze (RTE (RE_Bignum), Suppress => True);
-- If we have no Long_Long_Integer operands, then we are in result
-- range, since it means that none of our operands felt the need
-- to worry about overflow (otherwise it would have already been
-- converted to long long integer or bignum). We reexpand to
-- complete the expansion of the if expression (but we do not
-- need to reanalyze).
elsif not Long_Long_Integer_Operands then
Set_Do_Overflow_Check (N, False);
Reexpand;
-- Otherwise convert us to long long integer mode. Note that we
-- don't need any further overflow checking at this level.
else
Convert_To_And_Rewrite (LLIB, Then_DE);
Convert_To_And_Rewrite (LLIB, Else_DE);
Set_Etype (N, LLIB);
-- Now reanalyze with overflow checks off
Set_Do_Overflow_Check (N, False);
Reanalyze (LLIB, Suppress => True);
end if;
end;
return;
-- Here for case expression
elsif Nkind (N) = N_Case_Expression then
Bignum_Operands := False;
Long_Long_Integer_Operands := False;
declare
Alt : Node_Id;
begin
-- Loop through expressions applying recursive call
Alt := First (Alternatives (N));
while Present (Alt) loop
declare
Aexp : constant Node_Id := Expression (Alt);
begin
Minimize_Eliminate_Overflows
(Aexp, Lo, Hi, Top_Level => False);
if No (Lo) then
Bignum_Operands := True;
elsif Etype (Aexp) = LLIB then
Long_Long_Integer_Operands := True;
end if;
end;
Next (Alt);
end loop;
-- If we have no bignum or long long integer operands, it means
-- that none of our dependent expressions could raise overflow.
-- In this case, we simply return with no changes except for
-- resetting the overflow flag, since we are done with overflow
-- checks for this node. We will reexpand to get the needed
-- expansion for the case expression, but we do not need to
-- reanalyze, since nothing has changed.
if not (Bignum_Operands or Long_Long_Integer_Operands) then
Set_Do_Overflow_Check (N, False);
Reexpand (Suppress => True);
-- Otherwise we are going to rebuild the case expression using
-- either bignum or long long integer operands throughout.
else
declare
Rtype : Entity_Id := Empty;
New_Alts : List_Id;
New_Exp : Node_Id;
begin
New_Alts := New_List;
Alt := First (Alternatives (N));
while Present (Alt) loop
if Bignum_Operands then
New_Exp := Convert_To_Bignum (Expression (Alt));
Rtype := RTE (RE_Bignum);
else
New_Exp := Convert_To (LLIB, Expression (Alt));
Rtype := LLIB;
end if;
Append_To (New_Alts,
Make_Case_Expression_Alternative (Sloc (Alt),
Discrete_Choices => Discrete_Choices (Alt),
Expression => New_Exp));
Next (Alt);
end loop;
Rewrite (N,
Make_Case_Expression (Loc,
Expression => Expression (N),
Alternatives => New_Alts));
pragma Assert (Present (Rtype));
Reanalyze (Rtype, Suppress => True);
end;
end if;
end;
return;
end if;
-- If we have an arithmetic operator we make recursive calls on the
-- operands to get the ranges (and to properly process the subtree
-- that lies below us).
Minimize_Eliminate_Overflows
(Right_Opnd (N), Rlo, Rhi, Top_Level => False);
if Binary then
Minimize_Eliminate_Overflows
(Left_Opnd (N), Llo, Lhi, Top_Level => False);
end if;
-- Record if we have Long_Long_Integer operands
Long_Long_Integer_Operands :=
Etype (Right_Opnd (N)) = LLIB
or else (Binary and then Etype (Left_Opnd (N)) = LLIB);
-- If either operand is a bignum, then result will be a bignum and we
-- don't need to do any range analysis. As previously discussed we could
-- do range analysis in such cases, but it could mean working with giant
-- numbers at compile time for very little gain (the number of cases
-- in which we could slip back from bignum mode is small).
if No (Rlo) or else (Binary and then No (Llo)) then
Lo := No_Uint;
Hi := No_Uint;
Bignum_Operands := True;
-- Otherwise compute result range
else
Compute_Range_For_Arithmetic_Op
(Nkind (N), Llo, Lhi, Rlo, Rhi, OK, Lo, Hi);
Bignum_Operands := False;
end if;
-- Here for the case where we have not rewritten anything (no bignum
-- operands or long long integer operands), and we know the result.
-- If we know we are in the result range, and we do not have Bignum
-- operands or Long_Long_Integer operands, we can just reexpand with
-- overflow checks turned off (since we know we cannot have overflow).
-- As always the reexpansion is required to complete expansion of the
-- operator, but we do not need to reanalyze, and we prevent recursion
-- by suppressing the check.
if not (Bignum_Operands or Long_Long_Integer_Operands)
and then In_Result_Range
then
Set_Do_Overflow_Check (N, False);
Reexpand (Suppress => True);
return;
-- Here we know that we are not in the result range, and in the general
-- case we will move into either the Bignum or Long_Long_Integer domain
-- to compute the result. However, there is one exception. If we are
-- at the top level, and we do not have Bignum or Long_Long_Integer
-- operands, we will have to immediately convert the result back to
-- the result type, so there is no point in Bignum/Long_Long_Integer
-- fiddling.
elsif Top_Level
and then not (Bignum_Operands or Long_Long_Integer_Operands)
-- One further refinement. If we are at the top level, but our parent
-- is a type conversion, then go into bignum or long long integer node
-- since the result will be converted to that type directly without
-- going through the result type, and we may avoid an overflow. This
-- is the case for example of Long_Long_Integer (A ** 4), where A is
-- of type Integer, and the result A ** 4 fits in Long_Long_Integer
-- but does not fit in Integer.
and then Nkind (Parent (N)) /= N_Type_Conversion
then
-- Here keep original types, but we need to complete analysis
-- One subtlety. We can't just go ahead and do an analyze operation
-- here because it will cause recursion into the whole MINIMIZED/
-- ELIMINATED overflow processing which is not what we want. Here
-- we are at the top level, and we need a check against the result
-- mode (i.e. we want to use STRICT mode). So do exactly that.
-- Also, we have not modified the node, so this is a case where
-- we need to reexpand, but not reanalyze.
Reexpand;
return;
-- Cases where we do the operation in Bignum mode. This happens either
-- because one of our operands is in Bignum mode already, or because
-- the computed bounds are outside the bounds of Long_Long_Integer,
-- which in some cases can be indicated by Hi and Lo being No_Uint.
-- Note: we could do better here and in some cases switch back from
-- Bignum mode to normal mode, e.g. big mod 2 must be in the range
-- 0 .. 1, but the cases are rare and it is not worth the effort.
-- Failing to do this switching back is only an efficiency issue.
elsif No (Lo) or else Lo < LLLo or else Hi > LLHi then
-- OK, we are definitely outside the range of Long_Long_Integer. The
-- question is whether to move to Bignum mode, or stay in the domain
-- of Long_Long_Integer, signalling that an overflow check is needed.
-- Obviously in MINIMIZED mode we stay with LLI, since we are not in
-- the Bignum business. In ELIMINATED mode, we will normally move
-- into Bignum mode, but there is an exception if neither of our
-- operands is Bignum now, and we are at the top level (Top_Level
-- set True). In this case, there is no point in moving into Bignum
-- mode to prevent overflow if the caller will immediately convert
-- the Bignum value back to LLI with an overflow check. It's more
-- efficient to stay in LLI mode with an overflow check (if needed)
if Check_Mode = Minimized
or else (Top_Level and not Bignum_Operands)
then
if Do_Overflow_Check (N) then
Enable_Overflow_Check (N);
end if;
-- The result now has to be in Long_Long_Integer mode, so adjust
-- the possible range to reflect this. Note these calls also
-- change No_Uint values from the top level case to LLI bounds.
Max (Lo, LLLo);
Min (Hi, LLHi);
-- Otherwise we are in ELIMINATED mode and we switch to Bignum mode
else
pragma Assert (Check_Mode = Eliminated);
declare
Fent : Entity_Id;
Args : List_Id;
begin
case Nkind (N) is
when N_Op_Abs =>
Fent := RTE (RE_Big_Abs);
when N_Op_Add =>
Fent := RTE (RE_Big_Add);
when N_Op_Divide =>
Fent := RTE (RE_Big_Div);
when N_Op_Expon =>
Fent := RTE (RE_Big_Exp);
when N_Op_Minus =>
Fent := RTE (RE_Big_Neg);
when N_Op_Mod =>
Fent := RTE (RE_Big_Mod);
when N_Op_Multiply =>
Fent := RTE (RE_Big_Mul);
when N_Op_Rem =>
Fent := RTE (RE_Big_Rem);
when N_Op_Subtract =>
Fent := RTE (RE_Big_Sub);
-- Anything else is an internal error, this includes the
-- N_Op_Plus case, since how can plus cause the result
-- to be out of range if the operand is in range?
when others =>
raise Program_Error;
end case;
-- Construct argument list for Bignum call, converting our
-- operands to Bignum form if they are not already there.
Args := New_List;
if Binary then
Append_To (Args, Convert_To_Bignum (Left_Opnd (N)));
end if;
Append_To (Args, Convert_To_Bignum (Right_Opnd (N)));
-- Now rewrite the arithmetic operator with a call to the
-- corresponding bignum function.
Rewrite (N,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Fent, Loc),
Parameter_Associations => Args));
Reanalyze (RTE (RE_Bignum), Suppress => True);
-- Indicate result is Bignum mode
Lo := No_Uint;
Hi := No_Uint;
return;
end;
end if;
-- Otherwise we are in range of Long_Long_Integer, so no overflow
-- check is required, at least not yet.
else
Set_Do_Overflow_Check (N, False);
end if;
-- Here we are not in Bignum territory, but we may have long long
-- integer operands that need special handling. First a special check:
-- If an exponentiation operator exponent is of type Long_Long_Integer,
-- it means we converted it to prevent overflow, but exponentiation
-- requires a Natural right operand, so convert it back to Natural.
-- This conversion may raise an exception which is fine.
if Nkind (N) = N_Op_Expon and then Etype (Right_Opnd (N)) = LLIB then
Convert_To_And_Rewrite (Standard_Natural, Right_Opnd (N));
end if;
-- Here we will do the operation in Long_Long_Integer. We do this even
-- if we know an overflow check is required, better to do this in long
-- long integer mode, since we are less likely to overflow.
-- Convert right or only operand to Long_Long_Integer, except that
-- we do not touch the exponentiation right operand.
if Nkind (N) /= N_Op_Expon then
Convert_To_And_Rewrite (LLIB, Right_Opnd (N));
end if;
-- Convert left operand to Long_Long_Integer for binary case
if Binary then
Convert_To_And_Rewrite (LLIB, Left_Opnd (N));
end if;
-- Reset node to unanalyzed
Set_Analyzed (N, False);
Set_Etype (N, Empty);
Set_Entity (N, Empty);
-- Now analyze this new node. This reanalysis will complete processing
-- for the node. In particular we will complete the expansion of an
-- exponentiation operator (e.g. changing A ** 2 to A * A), and also
-- we will complete any division checks (since we have not changed the
-- setting of the Do_Division_Check flag).
-- We do this reanalysis in STRICT mode to avoid recursion into the
-- MINIMIZED/ELIMINATED handling, since we are now done with that.
declare
SG : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_General;
SA : constant Overflow_Mode_Type :=
Scope_Suppress.Overflow_Mode_Assertions;
begin
Scope_Suppress.Overflow_Mode_General := Strict;
Scope_Suppress.Overflow_Mode_Assertions := Strict;
if not Do_Overflow_Check (N) then
Reanalyze (LLIB, Suppress => True);
else
Reanalyze (LLIB);
end if;
Scope_Suppress.Overflow_Mode_General := SG;
Scope_Suppress.Overflow_Mode_Assertions := SA;
end;
end Minimize_Eliminate_Overflows;
-------------------------
-- Overflow_Check_Mode --
-------------------------
function Overflow_Check_Mode return Overflow_Mode_Type is
begin
if In_Assertion_Expr = 0 then
return Scope_Suppress.Overflow_Mode_General;
else
return Scope_Suppress.Overflow_Mode_Assertions;
end if;
end Overflow_Check_Mode;
--------------------------------
-- Overflow_Checks_Suppressed --
--------------------------------
function Overflow_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Overflow_Check);
else
return Scope_Suppress.Suppress (Overflow_Check);
end if;
end Overflow_Checks_Suppressed;
---------------------------------
-- Predicate_Checks_Suppressed --
---------------------------------
function Predicate_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Predicate_Check);
else
return Scope_Suppress.Suppress (Predicate_Check);
end if;
end Predicate_Checks_Suppressed;
-----------------------------
-- Range_Checks_Suppressed --
-----------------------------
function Range_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) then
if Kill_Range_Checks (E) then
return True;
elsif Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Range_Check);
end if;
end if;
return Scope_Suppress.Suppress (Range_Check);
end Range_Checks_Suppressed;
-----------------------------------------
-- Range_Or_Validity_Checks_Suppressed --
-----------------------------------------
-- Note: the coding would be simpler here if we simply made appropriate
-- calls to Range/Validity_Checks_Suppressed, but that would result in
-- duplicated checks which we prefer to avoid.
function Range_Or_Validity_Checks_Suppressed
(Expr : Node_Id) return Boolean
is
begin
-- Immediate return if scope checks suppressed for either check
if Scope_Suppress.Suppress (Range_Check)
or
Scope_Suppress.Suppress (Validity_Check)
then
return True;
end if;
-- If no expression, that's odd, decide that checks are suppressed,
-- since we don't want anyone trying to do checks in this case, which
-- is most likely the result of some other error.
if No (Expr) then
return True;
end if;
-- Expression is present, so perform suppress checks on type
declare
Typ : constant Entity_Id := Etype (Expr);
begin
if Checks_May_Be_Suppressed (Typ)
and then (Is_Check_Suppressed (Typ, Range_Check)
or else
Is_Check_Suppressed (Typ, Validity_Check))
then
return True;
end if;
end;
-- If expression is an entity name, perform checks on this entity
if Is_Entity_Name (Expr) then
declare
Ent : constant Entity_Id := Entity (Expr);
begin
if Checks_May_Be_Suppressed (Ent) then
return Is_Check_Suppressed (Ent, Range_Check)
or else Is_Check_Suppressed (Ent, Validity_Check);
end if;
end;
end if;
-- If we fall through, no checks suppressed
return False;
end Range_Or_Validity_Checks_Suppressed;
-------------------
-- Remove_Checks --
-------------------
procedure Remove_Checks (Expr : Node_Id) is
function Process (N : Node_Id) return Traverse_Result;
-- Process a single node during the traversal
procedure Traverse is new Traverse_Proc (Process);
-- The traversal procedure itself
-------------
-- Process --
-------------
function Process (N : Node_Id) return Traverse_Result is
begin
if Nkind (N) not in N_Subexpr then
return Skip;
end if;
Set_Do_Range_Check (N, False);
case Nkind (N) is
when N_And_Then =>
Traverse (Left_Opnd (N));
return Skip;
when N_Attribute_Reference =>
Set_Do_Overflow_Check (N, False);
when N_Op =>
Set_Do_Overflow_Check (N, False);
case Nkind (N) is
when N_Op_Divide =>
Set_Do_Division_Check (N, False);
when N_Op_And =>
Set_Do_Length_Check (N, False);
when N_Op_Mod =>
Set_Do_Division_Check (N, False);
when N_Op_Or =>
Set_Do_Length_Check (N, False);
when N_Op_Rem =>
Set_Do_Division_Check (N, False);
when N_Op_Xor =>
Set_Do_Length_Check (N, False);
when others =>
null;
end case;
when N_Or_Else =>
Traverse (Left_Opnd (N));
return Skip;
when N_Selected_Component =>
Set_Do_Discriminant_Check (N, False);
when N_Type_Conversion =>
Set_Do_Length_Check (N, False);
Set_Do_Overflow_Check (N, False);
when others =>
null;
end case;
return OK;
end Process;
-- Start of processing for Remove_Checks
begin
Traverse (Expr);
end Remove_Checks;
----------------------------
-- Selected_Length_Checks --
----------------------------
function Selected_Length_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Expr);
S_Typ : Entity_Id;
T_Typ : Entity_Id;
Expr_Actual : Node_Id;
Exptyp : Entity_Id;
Cond : Node_Id := Empty;
Do_Access : Boolean := False;
Wnode : Node_Id := Warn_Node;
Ret_Result : Check_Result := (Empty, Empty);
Num_Checks : Natural := 0;
procedure Add_Check (N : Node_Id);
-- Adds the action given to Ret_Result if N is non-Empty
function Get_E_Length (E : Entity_Id; Indx : Nat) return Node_Id;
-- Return E'Length (Indx)
function Get_N_Length (N : Node_Id; Indx : Nat) return Node_Id;
-- Return N'Length (Indx)
function Same_Bounds (L : Node_Id; R : Node_Id) return Boolean;
-- True for equal literals and for nodes that denote the same constant
-- entity, even if its value is not a static constant. This includes the
-- case of a discriminal reference within an init proc. Removes some
-- obviously superfluous checks.
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Exptyp'Length
function Length_N_Cond
(Exp : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Typ'Length /= Exp'Length
function Length_Mismatch_Info_Message
(Left_Element_Count : Uint;
Right_Element_Count : Uint) return String;
-- Returns a message indicating how many elements were expected
-- (Left_Element_Count) and how many were found (Right_Element_Count).
---------------
-- Add_Check --
---------------
procedure Add_Check (N : Node_Id) is
begin
if Present (N) then
-- We do not support inserting more than 2 checks on the same
-- node. If this happens it means we have already added an
-- unconditional raise, so we can skip the other checks safely
-- since N will always raise an exception.
if Num_Checks = 2 then
return;
end if;
pragma Assert (Num_Checks <= 1);
Num_Checks := Num_Checks + 1;
Ret_Result (Num_Checks) := N;
end if;
end Add_Check;
------------------
-- Get_E_Length --
------------------
function Get_E_Length (E : Entity_Id; Indx : Nat) return Node_Id is
SE : constant Entity_Id := Scope (E);
N : Node_Id;
E1 : Entity_Id := E;
begin
if Ekind (Scope (E)) = E_Record_Type
and then Has_Discriminants (Scope (E))
then
N := Build_Discriminal_Subtype_Of_Component (E);
if Present (N) then
Insert_Action (Expr, N);
E1 := Defining_Identifier (N);
end if;
end if;
if Ekind (E1) = E_String_Literal_Subtype then
return
Make_Integer_Literal (Loc,
Intval => String_Literal_Length (E1));
elsif SE /= Standard_Standard
and then Ekind (Scope (SE)) = E_Protected_Type
and then Has_Discriminants (Scope (SE))
and then Has_Completion (Scope (SE))
and then not Inside_Init_Proc
then
-- If the type whose length is needed is a private component
-- constrained by a discriminant, we must expand the 'Length
-- attribute into an explicit computation, using the discriminal
-- of the current protected operation. This is because the actual
-- type of the prival is constructed after the protected opera-
-- tion has been fully expanded.
declare
Indx_Type : Node_Id;
Bounds : Range_Nodes;
Do_Expand : Boolean := False;
begin
Indx_Type := First_Index (E);
for J in 1 .. Indx - 1 loop
Next_Index (Indx_Type);
end loop;
Bounds := Get_Index_Bounds (Indx_Type);
if Nkind (Bounds.First) = N_Identifier
and then Ekind (Entity (Bounds.First)) = E_In_Parameter
then
Bounds.First := Get_Discriminal (E, Bounds.First);
Do_Expand := True;
end if;
if Nkind (Bounds.Last) = N_Identifier
and then Ekind (Entity (Bounds.Last)) = E_In_Parameter
then
Bounds.Last := Get_Discriminal (E, Bounds.Last);
Do_Expand := True;
end if;
if Do_Expand then
if not Is_Entity_Name (Bounds.First) then
Bounds.First :=
Duplicate_Subexpr_No_Checks (Bounds.First);
end if;
if not Is_Entity_Name (Bounds.Last) then
Bounds.First := Duplicate_Subexpr_No_Checks (Bounds.Last);
end if;
N :=
Make_Op_Add (Loc,
Left_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd => Bounds.Last,
Right_Opnd => Bounds.First),
Right_Opnd => Make_Integer_Literal (Loc, 1));
return N;
else
N :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
New_Occurrence_Of (E1, Loc));
if Indx > 1 then
Set_Expressions (N, New_List (
Make_Integer_Literal (Loc, Indx)));
end if;
return N;
end if;
end;
else
N :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
New_Occurrence_Of (E1, Loc));
if Indx > 1 then
Set_Expressions (N, New_List (
Make_Integer_Literal (Loc, Indx)));
end if;
return N;
end if;
end Get_E_Length;
------------------
-- Get_N_Length --
------------------
function Get_N_Length (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Length,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_Length;
-------------------
-- Length_E_Cond --
-------------------
function Length_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (Typ, Indx),
Right_Opnd => Get_E_Length (Exptyp, Indx));
end Length_E_Cond;
-------------------
-- Length_N_Cond --
-------------------
function Length_N_Cond
(Exp : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (Typ, Indx),
Right_Opnd => Get_N_Length (Exp, Indx));
end Length_N_Cond;
----------------------------------
-- Length_Mismatch_Info_Message --
----------------------------------
function Length_Mismatch_Info_Message
(Left_Element_Count : Uint;
Right_Element_Count : Uint) return String
is
function Plural_Vs_Singular_Ending (Count : Uint) return String;
-- Returns an empty string if Count is 1; otherwise returns "s"
function Plural_Vs_Singular_Ending (Count : Uint) return String is
begin
if Count = 1 then
return "";
else
return "s";
end if;
end Plural_Vs_Singular_Ending;
begin
return "expected " & UI_Image (Left_Element_Count)
& " element"
& Plural_Vs_Singular_Ending (Left_Element_Count)
& "; found " & UI_Image (Right_Element_Count)
& " element"
& Plural_Vs_Singular_Ending (Right_Element_Count);
end Length_Mismatch_Info_Message;
-----------------
-- Same_Bounds --
-----------------
function Same_Bounds (L : Node_Id; R : Node_Id) return Boolean is
begin
return
(Nkind (L) = N_Integer_Literal
and then Nkind (R) = N_Integer_Literal
and then Intval (L) = Intval (R))
or else
(Is_Entity_Name (L)
and then Ekind (Entity (L)) = E_Constant
and then ((Is_Entity_Name (R)
and then Entity (L) = Entity (R))
or else
(Nkind (R) = N_Type_Conversion
and then Is_Entity_Name (Expression (R))
and then Entity (L) = Entity (Expression (R)))))
or else
(Is_Entity_Name (R)
and then Ekind (Entity (R)) = E_Constant
and then Nkind (L) = N_Type_Conversion
and then Is_Entity_Name (Expression (L))
and then Entity (R) = Entity (Expression (L)))
or else
(Is_Entity_Name (L)
and then Is_Entity_Name (R)
and then Entity (L) = Entity (R)
and then Ekind (Entity (L)) = E_In_Parameter
and then Inside_Init_Proc);
end Same_Bounds;
-- Start of processing for Selected_Length_Checks
begin
-- Checks will be applied only when generating code
if not Expander_Active then
return Ret_Result;
end if;
if Target_Typ = Any_Type
or else Target_Typ = Any_Composite
or else Raises_Constraint_Error (Expr)
then
return Ret_Result;
end if;
if No (Wnode) then
Wnode := Expr;
end if;
T_Typ := Target_Typ;
if No (Source_Typ) then
S_Typ := Etype (Expr);
else
S_Typ := Source_Typ;
end if;
if S_Typ = Any_Type or else S_Typ = Any_Composite then
return Ret_Result;
end if;
if Is_Access_Type (T_Typ) and then Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
T_Typ := Designated_Type (T_Typ);
Do_Access := True;
-- A simple optimization for the null case
if Known_Null (Expr) then
return Ret_Result;
end if;
end if;
if Is_Array_Type (T_Typ) and then Is_Array_Type (S_Typ) then
if Is_Constrained (T_Typ) then
-- The checking code to be generated will freeze the corresponding
-- array type. However, we must freeze the type now, so that the
-- freeze node does not appear within the generated if expression,
-- but ahead of it.
Freeze_Before (Expr, T_Typ);
Expr_Actual := Get_Referenced_Object (Expr);
Exptyp := Get_Actual_Subtype (Expr);
if Is_Access_Type (Exptyp) then
Exptyp := Designated_Type (Exptyp);
end if;
-- String_Literal case. This needs to be handled specially be-
-- cause no index types are available for string literals. The
-- condition is simply:
-- T_Typ'Length = string-literal-length
if Nkind (Expr_Actual) = N_String_Literal
and then Ekind (Etype (Expr_Actual)) = E_String_Literal_Subtype
then
Cond :=
Make_Op_Ne (Loc,
Left_Opnd => Get_E_Length (T_Typ, 1),
Right_Opnd =>
Make_Integer_Literal (Loc,
Intval =>
String_Literal_Length (Etype (Expr_Actual))));
-- General array case. Here we have a usable actual subtype for
-- the expression, and the condition is built from the two types
-- (Do_Length):
-- T_Typ'Length /= Exptyp'Length or else
-- T_Typ'Length (2) /= Exptyp'Length (2) or else
-- T_Typ'Length (3) /= Exptyp'Length (3) or else
-- ...
elsif Is_Constrained (Exptyp) then
declare
Ndims : constant Nat := Number_Dimensions (T_Typ);
L_Index : Node_Id;
R_Index : Node_Id;
L_Bounds : Range_Nodes;
R_Bounds : Range_Nodes;
L_Length : Uint;
R_Length : Uint;
Ref_Node : Node_Id;
begin
-- At the library level, we need to ensure that the type of
-- the object is elaborated before the check itself is
-- emitted. This is only done if the object is in the
-- current compilation unit, otherwise the type is frozen
-- and elaborated in its unit.
if Is_Itype (Exptyp)
and then
Ekind (Cunit_Entity (Current_Sem_Unit)) = E_Package
and then
not In_Package_Body (Cunit_Entity (Current_Sem_Unit))
and then In_Open_Scopes (Scope (Exptyp))
then
Ref_Node := Make_Itype_Reference (Sloc (Expr));
Set_Itype (Ref_Node, Exptyp);
Insert_Action (Expr, Ref_Node);
end if;
L_Index := First_Index (T_Typ);
R_Index := First_Index (Exptyp);
for Indx in 1 .. Ndims loop
if not (Nkind (L_Index) = N_Raise_Constraint_Error
or else
Nkind (R_Index) = N_Raise_Constraint_Error)
then
L_Bounds := Get_Index_Bounds (L_Index);
R_Bounds := Get_Index_Bounds (R_Index);
-- Deal with compile time length check. Note that we
-- skip this in the access case, because the access
-- value may be null, so we cannot know statically.
if not Do_Access
and then Compile_Time_Known_Value (L_Bounds.First)
and then Compile_Time_Known_Value (L_Bounds.Last)
and then Compile_Time_Known_Value (R_Bounds.First)
and then Compile_Time_Known_Value (R_Bounds.Last)
then
if Expr_Value (L_Bounds.Last) >=
Expr_Value (L_Bounds.First)
then
L_Length := Expr_Value (L_Bounds.Last) -
Expr_Value (L_Bounds.First) + 1;
else
L_Length := UI_From_Int (0);
end if;
if Expr_Value (R_Bounds.Last) >=
Expr_Value (R_Bounds.First)
then
R_Length := Expr_Value (R_Bounds.Last) -
Expr_Value (R_Bounds.First) + 1;
else
R_Length := UI_From_Int (0);
end if;
if L_Length > R_Length then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "too few elements for}??", T_Typ,
Extra_Msg => Length_Mismatch_Info_Message
(L_Length, R_Length)));
elsif L_Length < R_Length then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "too many elements for}??", T_Typ,
Extra_Msg => Length_Mismatch_Info_Message
(L_Length, R_Length)));
end if;
-- The comparison for an individual index subtype
-- is omitted if the corresponding index subtypes
-- statically match, since the result is known to
-- be true. Note that this test is worth while even
-- though we do static evaluation, because non-static
-- subtypes can statically match.
elsif not
Subtypes_Statically_Match
(Etype (L_Index), Etype (R_Index))
and then not
(Same_Bounds (L_Bounds.First, R_Bounds.First)
and then
Same_Bounds (L_Bounds.Last, R_Bounds.Last))
then
Evolve_Or_Else
(Cond, Length_E_Cond (Exptyp, T_Typ, Indx));
end if;
Next (L_Index);
Next (R_Index);
end if;
end loop;
end;
-- Handle cases where we do not get a usable actual subtype that
-- is constrained. This happens for example in the function call
-- and explicit dereference cases. In these cases, we have to get
-- the length or range from the expression itself, making sure we
-- do not evaluate it more than once.
-- Here Expr is the original expression, or more properly the
-- result of applying Duplicate_Expr to the original tree, forcing
-- the result to be a name.
else
declare
Ndims : constant Pos := Number_Dimensions (T_Typ);
begin
-- Build the condition for the explicit dereference case
for Indx in 1 .. Ndims loop
Evolve_Or_Else
(Cond, Length_N_Cond (Expr, T_Typ, Indx));
end loop;
end;
end if;
end if;
end if;
-- Construct the test and insert into the tree
if Present (Cond) then
if Do_Access then
Cond := Guard_Access (Cond, Loc, Expr);
end if;
Add_Check
(Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Length_Check_Failed));
end if;
return Ret_Result;
end Selected_Length_Checks;
---------------------------
-- Selected_Range_Checks --
---------------------------
function Selected_Range_Checks
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id;
Warn_Node : Node_Id) return Check_Result
is
Loc : constant Source_Ptr := Sloc (Expr);
S_Typ : Entity_Id;
T_Typ : Entity_Id;
Expr_Actual : Node_Id;
Exptyp : Entity_Id;
Cond : Node_Id := Empty;
Do_Access : Boolean := False;
Wnode : Node_Id := Warn_Node;
Ret_Result : Check_Result := (Empty, Empty);
Num_Checks : Natural := 0;
procedure Add_Check (N : Node_Id);
-- Adds the action given to Ret_Result if N is non-Empty
function Discrete_Range_Cond
(Exp : Node_Id;
Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Low_Bound (Exp) < Typ'First
-- or else
-- High_Bound (Exp) > Typ'Last
function Discrete_Expr_Cond
(Exp : Node_Id;
Typ : Entity_Id) return Node_Id;
-- Returns expression to compute:
-- Exp < Typ'First
-- or else
-- Exp > Typ'Last
function Get_E_First_Or_Last
(Loc : Source_Ptr;
E : Entity_Id;
Indx : Nat;
Nam : Name_Id) return Node_Id;
-- Returns an attribute reference
-- E'First or E'Last
-- with a source location of Loc.
--
-- Nam is Name_First or Name_Last, according to which attribute is
-- desired. If Indx is non-zero, it is passed as a literal in the
-- Expressions of the attribute reference (identifying the desired
-- array dimension).
function Get_N_First (N : Node_Id; Indx : Nat) return Node_Id;
function Get_N_Last (N : Node_Id; Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- N'First or N'Last using Duplicate_Subexpr_No_Checks
function Range_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat)
return Node_Id;
-- Returns expression to compute:
-- Exptyp'First < Typ'First or else Exptyp'Last > Typ'Last
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Returns expression to compute:
-- Exptyp'First /= Typ'First or else Exptyp'Last /= Typ'Last
function Range_N_Cond
(Exp : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id;
-- Return expression to compute:
-- Exp'First < Typ'First or else Exp'Last > Typ'Last
---------------
-- Add_Check --
---------------
procedure Add_Check (N : Node_Id) is
begin
if Present (N) then
-- We do not support inserting more than 2 checks on the same
-- node. If this happens it means we have already added an
-- unconditional raise, so we can skip the other checks safely
-- since N will always raise an exception.
if Num_Checks = 2 then
return;
end if;
pragma Assert (Num_Checks <= 1);
Num_Checks := Num_Checks + 1;
Ret_Result (Num_Checks) := N;
end if;
end Add_Check;
-------------------------
-- Discrete_Expr_Cond --
-------------------------
function Discrete_Expr_Cond
(Exp : Node_Id;
Typ : Entity_Id) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Convert_To (Base_Type (Typ),
Duplicate_Subexpr_No_Checks (Exp)),
Right_Opnd =>
Convert_To (Base_Type (Typ),
Get_E_First_Or_Last (Loc, Typ, 0, Name_First))),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd =>
Convert_To (Base_Type (Typ),
Duplicate_Subexpr_No_Checks (Exp)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Loc, Typ, 0, Name_Last))));
end Discrete_Expr_Cond;
-------------------------
-- Discrete_Range_Cond --
-------------------------
function Discrete_Range_Cond
(Exp : Node_Id;
Typ : Entity_Id) return Node_Id
is
LB : Node_Id := Low_Bound (Exp);
HB : Node_Id := High_Bound (Exp);
Left_Opnd : Node_Id;
Right_Opnd : Node_Id;
begin
if Nkind (LB) = N_Identifier
and then Ekind (Entity (LB)) = E_Discriminant
then
LB := New_Occurrence_Of (Discriminal (Entity (LB)), Loc);
end if;
-- If the index type has a fixed lower bound, then we require an
-- exact match of the range's lower bound against that fixed lower
-- bound.
if Is_Fixed_Lower_Bound_Index_Subtype (Typ) then
Left_Opnd :=
Make_Op_Ne (Loc,
Left_Opnd =>
Convert_To
(Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Loc, Typ, 0, Name_First)));
-- Otherwise we do the expected less-than comparison
else
Left_Opnd :=
Make_Op_Lt (Loc,
Left_Opnd =>
Convert_To
(Base_Type (Typ), Duplicate_Subexpr_No_Checks (LB)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Loc, Typ, 0, Name_First)));
end if;
if Nkind (HB) = N_Identifier
and then Ekind (Entity (HB)) = E_Discriminant
then
HB := New_Occurrence_Of (Discriminal (Entity (HB)), Loc);
end if;
Right_Opnd :=
Make_Op_Gt (Loc,
Left_Opnd =>
Convert_To
(Base_Type (Typ), Duplicate_Subexpr_No_Checks (HB)),
Right_Opnd =>
Convert_To
(Base_Type (Typ),
Get_E_First_Or_Last (Loc, Typ, 0, Name_Last)));
return Make_Or_Else (Loc, Left_Opnd, Right_Opnd);
end Discrete_Range_Cond;
-------------------------
-- Get_E_First_Or_Last --
-------------------------
function Get_E_First_Or_Last
(Loc : Source_Ptr;
E : Entity_Id;
Indx : Nat;
Nam : Name_Id) return Node_Id
is
Exprs : List_Id;
begin
if Indx > 0 then
Exprs := New_List (Make_Integer_Literal (Loc, UI_From_Int (Indx)));
else
Exprs := No_List;
end if;
return Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (E, Loc),
Attribute_Name => Nam,
Expressions => Exprs);
end Get_E_First_Or_Last;
-----------------
-- Get_N_First --
-----------------
function Get_N_First (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_First;
----------------
-- Get_N_Last --
----------------
function Get_N_Last (N : Node_Id; Indx : Nat) return Node_Id is
begin
return
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
Prefix =>
Duplicate_Subexpr_No_Checks (N, Name_Req => True),
Expressions => New_List (
Make_Integer_Literal (Loc, Indx)));
end Get_N_Last;
------------------
-- Range_E_Cond --
------------------
function Range_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Get_E_First_Or_Last (Loc, Exptyp, Indx, Name_First),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd =>
Get_E_First_Or_Last (Loc, Exptyp, Indx, Name_Last),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_Last)));
end Range_E_Cond;
------------------------
-- Range_Equal_E_Cond --
------------------------
function Range_Equal_E_Cond
(Exptyp : Entity_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd =>
Get_E_First_Or_Last (Loc, Exptyp, Indx, Name_First),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Ne (Loc,
Left_Opnd =>
Get_E_First_Or_Last (Loc, Exptyp, Indx, Name_Last),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_Last)));
end Range_Equal_E_Cond;
------------------
-- Range_N_Cond --
------------------
function Range_N_Cond
(Exp : Node_Id;
Typ : Entity_Id;
Indx : Nat) return Node_Id
is
begin
return
Make_Or_Else (Loc,
Left_Opnd =>
Make_Op_Lt (Loc,
Left_Opnd =>
Get_N_First (Exp, Indx),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_First)),
Right_Opnd =>
Make_Op_Gt (Loc,
Left_Opnd =>
Get_N_Last (Exp, Indx),
Right_Opnd =>
Get_E_First_Or_Last (Loc, Typ, Indx, Name_Last)));
end Range_N_Cond;
function "<" (Left, Right : Node_Id) return Boolean
is (if Is_Floating_Point_Type (S_Typ)
then Expr_Value_R (Left) < Expr_Value_R (Right)
else Expr_Value (Left) < Expr_Value (Right));
-- Convenience comparison function of integer or floating point
-- values.
-- Start of processing for Selected_Range_Checks
begin
-- Checks will be applied only when generating code. In GNATprove mode,
-- we do not apply the checks, but we still call Selected_Range_Checks
-- outside of generics to possibly issue errors on SPARK code when a
-- run-time error can be detected at compile time.
if Inside_A_Generic or (not GNATprove_Mode and not Expander_Active) then
return Ret_Result;
end if;
if Target_Typ = Any_Type
or else Target_Typ = Any_Composite
or else Raises_Constraint_Error (Expr)
then
return Ret_Result;
end if;
if No (Wnode) then
Wnode := Expr;
end if;
T_Typ := Target_Typ;
if No (Source_Typ) then
S_Typ := Etype (Expr);
else
S_Typ := Source_Typ;
end if;
if S_Typ = Any_Type or else S_Typ = Any_Composite then
return Ret_Result;
end if;
-- The order of evaluating T_Typ before S_Typ seems to be critical
-- because S_Typ can be derived from Etype (Expr), if it's not passed
-- in, and since Node can be an N_Range node, it might be invalid.
-- Should there be an assert check somewhere for taking the Etype of
-- an N_Range node ???
if Is_Access_Type (T_Typ) and then Is_Access_Type (S_Typ) then
S_Typ := Designated_Type (S_Typ);
T_Typ := Designated_Type (T_Typ);
Do_Access := True;
-- A simple optimization for the null case
if Known_Null (Expr) then
return Ret_Result;
end if;
end if;
-- For an N_Range Node, check for a null range and then if not
-- null generate a range check action.
if Nkind (Expr) = N_Range then
-- There's no point in checking a range against itself
if Expr = Scalar_Range (T_Typ) then
return Ret_Result;
end if;
declare
T_LB : constant Node_Id := Type_Low_Bound (T_Typ);
T_HB : constant Node_Id := Type_High_Bound (T_Typ);
Known_T_LB : constant Boolean := Compile_Time_Known_Value (T_LB);
Known_T_HB : constant Boolean := Compile_Time_Known_Value (T_HB);
LB : Node_Id := Low_Bound (Expr);
HB : Node_Id := High_Bound (Expr);
Known_LB : Boolean := False;
Known_HB : Boolean := False;
Check_Added : Boolean := False;
Out_Of_Range_L : Boolean := False;
Out_Of_Range_H : Boolean := False;
begin
-- Compute what is known at compile time
if Known_T_LB and Known_T_HB then
if Compile_Time_Known_Value (LB) then
Known_LB := True;
-- There's no point in checking that a bound is within its
-- own range so pretend that it is known in this case. First
-- deal with low bound.
elsif Ekind (Etype (LB)) = E_Signed_Integer_Subtype
and then Scalar_Range (Etype (LB)) = Scalar_Range (T_Typ)
then
LB := T_LB;
Known_LB := True;
end if;
-- Likewise for the high bound
if Compile_Time_Known_Value (HB) then
Known_HB := True;
elsif Ekind (Etype (HB)) = E_Signed_Integer_Subtype
and then Scalar_Range (Etype (HB)) = Scalar_Range (T_Typ)
then
HB := T_HB;
Known_HB := True;
end if;
end if;
-- Check for the simple cases where we can do the check at
-- compile time. This is skipped if we have an access type, since
-- the access value may be null.
if not Do_Access and then Not_Null_Range (LB, HB) then
if Known_LB then
if Known_T_LB then
Out_Of_Range_L := LB < T_LB;
end if;
if Known_T_HB and not Out_Of_Range_L then
Out_Of_Range_L := T_HB < LB;
end if;
if Out_Of_Range_L then
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(Low_Bound (Expr),
"static value out of range of}??", T_Typ));
Check_Added := True;
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode,
"static range out of bounds of}??", T_Typ));
Check_Added := True;
end if;
end if;
end if;
-- Flag the case of a fixed-lower-bound index where the static
-- bounds are not equal.
if not Check_Added
and then Is_Fixed_Lower_Bound_Index_Subtype (T_Typ)
and then Expr_Value (LB) /= Expr_Value (T_LB)
then
Add_Check
(Compile_Time_Constraint_Error
((if Present (Warn_Node)
then Warn_Node else Low_Bound (Expr)),
"static value does not equal lower bound of}??",
T_Typ));
Check_Added := True;
end if;
if Known_HB then
if Known_T_HB then
Out_Of_Range_H := T_HB < HB;
end if;
if Known_T_LB and not Out_Of_Range_H then
Out_Of_Range_H := HB < T_LB;
end if;
if Out_Of_Range_H then
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(High_Bound (Expr),
"static value out of range of}??", T_Typ));
Check_Added := True;
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode,
"static range out of bounds of}??", T_Typ));
Check_Added := True;
end if;
end if;
end if;
end if;
-- Check for the case where not everything is static
if not Check_Added
and then
(Do_Access
or else not Known_T_LB
or else not Known_LB
or else not Known_T_HB
or else not Known_HB)
then
declare
LB : Node_Id := Low_Bound (Expr);
HB : Node_Id := High_Bound (Expr);
begin
-- If either bound is a discriminant and we are within the
-- record declaration, it is a use of the discriminant in a
-- constraint of a component, and nothing can be checked
-- here. The check will be emitted within the init proc.
-- Before then, the discriminal has no real meaning.
-- Similarly, if the entity is a discriminal, there is no
-- check to perform yet.
-- The same holds within a discriminated synchronized type,
-- where the discriminant may constrain a component or an
-- entry family.
if Nkind (LB) = N_Identifier
and then Denotes_Discriminant (LB, True)
then
if Current_Scope = Scope (Entity (LB))
or else Is_Concurrent_Type (Current_Scope)
or else Ekind (Entity (LB)) /= E_Discriminant
then
return Ret_Result;
else
LB :=
New_Occurrence_Of (Discriminal (Entity (LB)), Loc);
end if;
end if;
if Nkind (HB) = N_Identifier
and then Denotes_Discriminant (HB, True)
then
if Current_Scope = Scope (Entity (HB))
or else Is_Concurrent_Type (Current_Scope)
or else Ekind (Entity (HB)) /= E_Discriminant
then
return Ret_Result;
else
HB :=
New_Occurrence_Of (Discriminal (Entity (HB)), Loc);
end if;
end if;
Cond := Discrete_Range_Cond (Expr, T_Typ);
Set_Paren_Count (Cond, 1);
Cond :=
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ge (Loc,
Left_Opnd =>
Convert_To (Base_Type (Etype (HB)),
Duplicate_Subexpr_No_Checks (HB)),
Right_Opnd =>
Convert_To (Base_Type (Etype (LB)),
Duplicate_Subexpr_No_Checks (LB))),
Right_Opnd => Cond);
end;
end if;
end;
elsif Is_Scalar_Type (S_Typ) then
-- This somewhat duplicates what Apply_Scalar_Range_Check does,
-- except the above simply sets a flag in the node and lets the
-- check be generated based on the Etype of the expression.
-- Sometimes, however we want to do a dynamic check against an
-- arbitrary target type, so we do that here.
if Ekind (Base_Type (S_Typ)) /= Ekind (Base_Type (T_Typ)) then
Cond := Discrete_Expr_Cond (Expr, T_Typ);
-- For literals, we can tell if the constraint error will be
-- raised at compile time, so we never need a dynamic check, but
-- if the exception will be raised, then post the usual warning,
-- and replace the literal with a raise constraint error
-- expression. As usual, skip this for access types
elsif Compile_Time_Known_Value (Expr) and then not Do_Access then
if Is_Out_Of_Range (Expr, T_Typ) then
-- Bounds of the type are static and the literal is out of
-- range so output a warning message.
if No (Warn_Node) then
Add_Check
(Compile_Time_Constraint_Error
(Expr, "static value out of range of}??", T_Typ));
else
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "static value out of range of}??", T_Typ));
end if;
else
Cond := Discrete_Expr_Cond (Expr, T_Typ);
end if;
-- Here for the case of a non-static expression, we need a runtime
-- check unless the source type range is guaranteed to be in the
-- range of the target type.
else
if not In_Subrange_Of (S_Typ, T_Typ) then
Cond := Discrete_Expr_Cond (Expr, T_Typ);
end if;
end if;
end if;
if Is_Array_Type (T_Typ) and then Is_Array_Type (S_Typ) then
if Is_Constrained (T_Typ) then
Expr_Actual := Get_Referenced_Object (Expr);
Exptyp := Get_Actual_Subtype (Expr_Actual);
if Is_Access_Type (Exptyp) then
Exptyp := Designated_Type (Exptyp);
end if;
-- String_Literal case. This needs to be handled specially be-
-- cause no index types are available for string literals. The
-- condition is simply:
-- T_Typ'Length = string-literal-length
if Nkind (Expr_Actual) = N_String_Literal then
null;
-- General array case. Here we have a usable actual subtype for
-- the expression, and the condition is built from the two types
-- T_Typ'First < Exptyp'First or else
-- T_Typ'Last > Exptyp'Last or else
-- T_Typ'First(1) < Exptyp'First(1) or else
-- T_Typ'Last(1) > Exptyp'Last(1) or else
-- ...
elsif Is_Constrained (Exptyp) then
declare
Ndims : constant Pos := Number_Dimensions (T_Typ);
L_Index : Node_Id;
R_Index : Node_Id;
begin
L_Index := First_Index (T_Typ);
R_Index := First_Index (Exptyp);
for Indx in 1 .. Ndims loop
if not (Nkind (L_Index) = N_Raise_Constraint_Error
or else
Nkind (R_Index) = N_Raise_Constraint_Error)
then
-- Deal with compile time length check. Note that we
-- skip this in the access case, because the access
-- value may be null, so we cannot know statically.
if not
Subtypes_Statically_Match
(Etype (L_Index), Etype (R_Index))
then
-- If the target type is constrained then we
-- have to check for exact equality of bounds
-- (required for qualified expressions).
if Is_Constrained (T_Typ) then
Evolve_Or_Else
(Cond,
Range_Equal_E_Cond (Exptyp, T_Typ, Indx));
else
Evolve_Or_Else
(Cond, Range_E_Cond (Exptyp, T_Typ, Indx));
end if;
end if;
Next (L_Index);
Next (R_Index);
end if;
end loop;
end;
-- Handle cases where we do not get a usable actual subtype that
-- is constrained. This happens for example in the function call
-- and explicit dereference cases. In these cases, we have to get
-- the length or range from the expression itself, making sure we
-- do not evaluate it more than once.
-- Here Expr is the original expression, or more properly the
-- result of applying Duplicate_Expr to the original tree,
-- forcing the result to be a name.
else
declare
Ndims : constant Pos := Number_Dimensions (T_Typ);
begin
-- Build the condition for the explicit dereference case
for Indx in 1 .. Ndims loop
Evolve_Or_Else
(Cond, Range_N_Cond (Expr, T_Typ, Indx));
end loop;
end;
end if;
-- If the context is a qualified_expression where the subtype is
-- an unconstrained array subtype with fixed-lower-bound indexes,
-- then consistency checks must be done between the lower bounds
-- of any such indexes and the corresponding lower bounds of the
-- qualified array object.
elsif Is_Fixed_Lower_Bound_Array_Subtype (T_Typ)
and then Nkind (Parent (Expr)) = N_Qualified_Expression
and then not Do_Access
then
declare
Ndims : constant Pos := Number_Dimensions (T_Typ);
Qual_Index : Node_Id;
Expr_Index : Node_Id;
begin
Expr_Actual := Get_Referenced_Object (Expr);
Exptyp := Get_Actual_Subtype (Expr_Actual);
Qual_Index := First_Index (T_Typ);
Expr_Index := First_Index (Exptyp);
for Indx in 1 .. Ndims loop
if Nkind (Expr_Index) /= N_Raise_Constraint_Error then
-- If this index of the qualifying array subtype has
-- a fixed lower bound, then apply a check that the
-- corresponding lower bound of the array expression
-- is equal to it.
if Is_Fixed_Lower_Bound_Index_Subtype (Etype (Qual_Index))
then
Evolve_Or_Else
(Cond,
Make_Op_Ne (Loc,
Left_Opnd =>
Get_E_First_Or_Last
(Loc, Exptyp, Indx, Name_First),
Right_Opnd =>
New_Copy_Tree
(Type_Low_Bound (Etype (Qual_Index)))));
end if;
Next (Qual_Index);
Next (Expr_Index);
end if;
end loop;
end;
else
-- For a conversion to an unconstrained array type, generate an
-- Action to check that the bounds of the source value are within
-- the constraints imposed by the target type (RM 4.6(38)). No
-- check is needed for a conversion to an access to unconstrained
-- array type, as 4.6(24.15/2) requires the designated subtypes
-- of the two access types to statically match.
if Nkind (Parent (Expr)) = N_Type_Conversion
and then not Do_Access
then
declare
Opnd_Index : Node_Id;
Targ_Index : Node_Id;
Opnd_Range : Node_Id;
begin
Opnd_Index := First_Index (Get_Actual_Subtype (Expr));
Targ_Index := First_Index (T_Typ);
while Present (Opnd_Index) loop
-- If the index is a range, use its bounds. If it is an
-- entity (as will be the case if it is a named subtype
-- or an itype created for a slice) retrieve its range.
if Is_Entity_Name (Opnd_Index)
and then Is_Type (Entity (Opnd_Index))
then
Opnd_Range := Scalar_Range (Entity (Opnd_Index));
else
Opnd_Range := Opnd_Index;
end if;
if Nkind (Opnd_Range) = N_Range then
if Is_In_Range
(Low_Bound (Opnd_Range), Etype (Targ_Index),
Assume_Valid => True)
and then
Is_In_Range
(High_Bound (Opnd_Range), Etype (Targ_Index),
Assume_Valid => True)
then
null;
-- If null range, no check needed
elsif
Compile_Time_Known_Value (High_Bound (Opnd_Range))
and then
Compile_Time_Known_Value (Low_Bound (Opnd_Range))
and then
Expr_Value (High_Bound (Opnd_Range)) <
Expr_Value (Low_Bound (Opnd_Range))
then
null;
elsif Is_Out_Of_Range
(Low_Bound (Opnd_Range), Etype (Targ_Index),
Assume_Valid => True)
or else
Is_Out_Of_Range
(High_Bound (Opnd_Range), Etype (Targ_Index),
Assume_Valid => True)
then
Add_Check
(Compile_Time_Constraint_Error
(Wnode, "value out of range of}??", T_Typ));
else
Evolve_Or_Else
(Cond,
Discrete_Range_Cond
(Opnd_Range, Etype (Targ_Index)));
end if;
end if;
Next_Index (Opnd_Index);
Next_Index (Targ_Index);
end loop;
end;
end if;
end if;
end if;
-- Construct the test and insert into the tree
if Present (Cond) then
if Do_Access then
Cond := Guard_Access (Cond, Loc, Expr);
end if;
Add_Check
(Make_Raise_Constraint_Error (Loc,
Condition => Cond,
Reason => CE_Range_Check_Failed));
end if;
return Ret_Result;
end Selected_Range_Checks;
-------------------------------
-- Storage_Checks_Suppressed --
-------------------------------
function Storage_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E) and then Checks_May_Be_Suppressed (E) then
return Is_Check_Suppressed (E, Storage_Check);
else
return Scope_Suppress.Suppress (Storage_Check);
end if;
end Storage_Checks_Suppressed;
---------------------------
-- Tag_Checks_Suppressed --
---------------------------
function Tag_Checks_Suppressed (E : Entity_Id) return Boolean is
begin
if Present (E)
and then Checks_May_Be_Suppressed (E)
then
return Is_Check_Suppressed (E, Tag_Check);
else
return Scope_Suppress.Suppress (Tag_Check);
end if;
end Tag_Checks_Suppressed;
---------------------------------------
-- Validate_Alignment_Check_Warnings --
---------------------------------------
procedure Validate_Alignment_Check_Warnings is
begin
for J in Alignment_Warnings.First .. Alignment_Warnings.Last loop
declare
AWR : Alignment_Warnings_Record
renames Alignment_Warnings.Table (J);
begin
if Known_Alignment (AWR.E)
and then ((Present (AWR.A)
and then AWR.A mod Alignment (AWR.E) = 0)
or else (Present (AWR.P)
and then Has_Compatible_Alignment
(AWR.E, AWR.P, True) =
Known_Compatible))
then
Delete_Warning_And_Continuations (AWR.W);
end if;
end;
end loop;
end Validate_Alignment_Check_Warnings;
--------------------------
-- Validity_Check_Range --
--------------------------
procedure Validity_Check_Range
(N : Node_Id;
Related_Id : Entity_Id := Empty) is
begin
if Validity_Checks_On and Validity_Check_Operands then
if Nkind (N) = N_Range then
Ensure_Valid
(Expr => Low_Bound (N),
Related_Id => Related_Id,
Is_Low_Bound => True);
Ensure_Valid
(Expr => High_Bound (N),
Related_Id => Related_Id,
Is_High_Bound => True);
end if;
end if;
end Validity_Check_Range;
end Checks;
|
reznikmm/matreshka | Ada | 3,669 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Db_Key_Columns_Elements is
pragma Preelaborate;
type ODF_Db_Key_Columns is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Db_Key_Columns_Access is
access all ODF_Db_Key_Columns'Class
with Storage_Size => 0;
end ODF.DOM.Db_Key_Columns_Elements;
|
reznikmm/matreshka | Ada | 16,873 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_000C is
pragma Preelaborate;
Group_000C : aliased constant Core_Second_Stage
:= (16#00# => -- 0C00
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#01# .. 16#03# => -- 0C01 .. 0C03
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#04# => -- 0C04
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#0D# => -- 0C0D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#11# => -- 0C11
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#29# => -- 0C29
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#3A# .. 16#3C# => -- 0C3A .. 0C3C
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#3E# .. 16#40# => -- 0C3E .. 0C40
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#41# .. 16#44# => -- 0C41 .. 0C44
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#45# => -- 0C45
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#46# .. 16#48# => -- 0C46 .. 0C48
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#49# => -- 0C49
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#4A# .. 16#4C# => -- 0C4A .. 0C4C
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#4D# => -- 0C4D
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#4E# .. 16#54# => -- 0C4E .. 0C54
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#55# .. 16#56# => -- 0C55 .. 0C56
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#57# => -- 0C57
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#5A# .. 16#5F# => -- 0C5A .. 0C5F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#62# .. 16#63# => -- 0C62 .. 0C63
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#64# .. 16#65# => -- 0C64 .. 0C65
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#66# .. 16#6F# => -- 0C66 .. 0C6F
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#70# .. 16#77# => -- 0C70 .. 0C77
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#78# .. 16#7E# => -- 0C78 .. 0C7E
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#7F# => -- 0C7F
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#80# => -- 0C80
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#81# => -- 0C81
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#82# .. 16#83# => -- 0C82 .. 0C83
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#84# => -- 0C84
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8D# => -- 0C8D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#91# => -- 0C91
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A9# => -- 0CA9
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#B4# => -- 0CB4
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#BA# .. 16#BB# => -- 0CBA .. 0CBB
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#BC# => -- 0CBC
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#BE# => -- 0CBE
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#BF# => -- 0CBF
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#C0# .. 16#C1# => -- 0CC0 .. 0CC1
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#C2# => -- 0CC2
(Spacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Other_Grapheme_Extend
| Alphabetic
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#C3# .. 16#C4# => -- 0CC3 .. 0CC4
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#C5# => -- 0CC5
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#C6# => -- 0CC6
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#C7# .. 16#C8# => -- 0CC7 .. 0CC8
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#C9# => -- 0CC9
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#CA# .. 16#CB# => -- 0CCA .. 0CCB
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#CC# => -- 0CCC
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#CD# => -- 0CCD
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#CE# .. 16#D4# => -- 0CCE .. 0CD4
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#D5# .. 16#D6# => -- 0CD5 .. 0CD6
(Spacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Other_Grapheme_Extend
| Alphabetic
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#D7# .. 16#DD# => -- 0CD7 .. 0CDD
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#DF# => -- 0CDF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#E2# .. 16#E3# => -- 0CE2 .. 0CE3
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E4# .. 16#E5# => -- 0CE4 .. 0CE5
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#E6# .. 16#EF# => -- 0CE6 .. 0CEF
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#F0# => -- 0CF0
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#F3# .. 16#FF# => -- 0CF3 .. 0CFF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_000C;
|
DrenfongWong/tkm-rpc | Ada | 290 | ads | with Tkmrpc.Request;
with Tkmrpc.Response;
package Tkmrpc.Operation_Handlers.Ike.Cc_Add_Certificate is
procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type);
-- Handler for the cc_add_certificate operation.
end Tkmrpc.Operation_Handlers.Ike.Cc_Add_Certificate;
|
sungyeon/drake | Ada | 34,878 | adb | with Ada.Containers.Array_Sorting;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with System.Address_To_Named_Access_Conversions;
with System.Growth;
with System.Long_Long_Integer_Types;
package body Ada.Containers.Vectors is
pragma Check_Policy (Validate => Ignore);
use type Copy_On_Write.Data_Access;
use type System.Address;
use type System.Long_Long_Integer_Types.Word_Integer;
subtype Word_Integer is System.Long_Long_Integer_Types.Word_Integer;
package DA_Conv is
new System.Address_To_Named_Access_Conversions (Data, Data_Access);
function Upcast is
new Unchecked_Conversion (Data_Access, Copy_On_Write.Data_Access);
function Downcast is
new Unchecked_Conversion (Copy_On_Write.Data_Access, Data_Access);
-- diff (Free)
procedure Free is new Unchecked_Deallocation (Data, Data_Access);
procedure Assign_Element (
Target : out Element_Type;
Source : Element_Type);
procedure Assign_Element (
Target : out Element_Type;
Source : Element_Type) is
begin
Target := Source;
end Assign_Element;
procedure Swap_Element (I, J : Word_Integer; Params : System.Address);
procedure Swap_Element (I, J : Word_Integer; Params : System.Address) is
Data : constant Data_Access := DA_Conv.To_Pointer (Params);
Temp : constant Element_Type := Data.Items (Index_Type'Val (I));
begin
Assign_Element (
Data.Items (Index_Type'Val (I)),
Data.Items (Index_Type'Val (J)));
Assign_Element (Data.Items (Index_Type'Val (J)), Temp);
end Swap_Element;
-- diff (Equivalent_Element)
--
--
--
--
--
--
-- diff (Allocate_Element)
--
--
--
--
--
--
--
--
procedure Free_Data (Data : in out Copy_On_Write.Data_Access);
procedure Free_Data (Data : in out Copy_On_Write.Data_Access) is
X : Data_Access := Downcast (Data);
begin
-- diff
-- diff
-- diff
Free (X);
Data := null;
end Free_Data;
procedure Allocate_Data (
Target : out not null Copy_On_Write.Data_Access;
New_Length : Count_Type;
Capacity : Count_Type);
procedure Allocate_Data (
Target : out not null Copy_On_Write.Data_Access;
New_Length : Count_Type;
Capacity : Count_Type)
is
New_Data : constant Data_Access :=
new Data'(
Capacity_Last => Index_Type'First - 1 + Index_Type'Base (Capacity),
Super => <>,
Max_Length => New_Length,
Items => <>);
begin
Target := Upcast (New_Data);
end Allocate_Data;
-- diff (Move_Data)
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
procedure Copy_Data (
Target : out not null Copy_On_Write.Data_Access;
Source : not null Copy_On_Write.Data_Access;
Length : Count_Type;
New_Length : Count_Type;
Capacity : Count_Type);
procedure Copy_Data (
Target : out not null Copy_On_Write.Data_Access;
Source : not null Copy_On_Write.Data_Access;
Length : Count_Type;
New_Length : Count_Type;
Capacity : Count_Type) is
begin
Allocate_Data (Target, New_Length, Capacity);
declare
subtype R is
Extended_Index range
Index_Type'First ..
Index_Type'First - 1 + Index_Type'Base (Length);
begin
Downcast (Target).Items (R) := Downcast (Source).Items (R);
-- diff
-- diff
-- diff
-- diff
-- diff
-- diff
end;
end Copy_Data;
function Max_Length (Data : not null Copy_On_Write.Data_Access)
return not null access Count_Type;
function Max_Length (Data : not null Copy_On_Write.Data_Access)
return not null access Count_Type is
begin
return Downcast (Data).Max_Length'Access;
end Max_Length;
procedure Reallocate (
Container : in out Vector;
Length : Count_Type;
Capacity : Count_Type;
To_Update : Boolean);
procedure Reallocate (
Container : in out Vector;
Length : Count_Type;
Capacity : Count_Type;
To_Update : Boolean) is
begin
Copy_On_Write.Unique (
Target => Container.Super'Access,
Target_Length => Container.Length,
Target_Capacity => Vectors.Capacity (Container),
New_Length => Length,
New_Capacity => Capacity,
To_Update => To_Update,
Allocate => Allocate_Data'Access,
Move => Copy_Data'Access,
Copy => Copy_Data'Access,
Free => Free_Data'Access,
Max_Length => Max_Length'Access);
end Reallocate;
procedure Unique (Container : in out Vector; To_Update : Boolean);
procedure Unique (Container : in out Vector; To_Update : Boolean) is
begin
if Copy_On_Write.Shared (Container.Super.Data) then
Reallocate (
Container,
Container.Length,
Capacity (Container), -- not shrinking
To_Update);
end if;
end Unique;
-- implementation
function Empty_Vector return Vector is
begin
return (Finalization.Controlled with Super => <>, Length => 0);
end Empty_Vector;
function Has_Element (Position : Cursor) return Boolean is
begin
return Position /= No_Element;
end Has_Element;
overriding function "=" (Left, Right : Vector) return Boolean is
begin
if Left.Length /= Right.Length then
return False;
elsif Left.Length = 0 or else Left.Super.Data = Right.Super.Data then
return True;
else
Unique (Left'Unrestricted_Access.all, False); -- private
Unique (Right'Unrestricted_Access.all, False); -- private
for I in Index_Type'First .. Last (Left) loop
if Downcast (Left.Super.Data).Items (I) /=
Downcast (Right.Super.Data).Items (I)
then
return False;
end if;
-- diff
-- diff
-- diff
-- diff
-- diff
end loop;
return True;
end if;
end "=";
function To_Vector (Length : Count_Type) return Vector is
begin
return Result : Vector do
Insert_Space (Result, Index_Type'First, Length);
end return;
end To_Vector;
function To_Vector (New_Item : Element_Type; Length : Count_Type)
return Vector is
begin
return Result : Vector do
Append (Result, New_Item, Length);
end return;
end To_Vector;
function Generic_Array_To_Vector (S : Element_Array) return Vector is
begin
return Result : Vector do
declare
Length : constant Count_Type := S'Length;
subtype R1 is
Extended_Index range
Index_Type'First ..
Index_Type'First - 1 + Index_Type'Base (Length);
begin
Set_Length (Result, Length);
Downcast (Result.Super.Data).Items (R1) :=
Vectors.Element_Array (S);
end;
end return;
end Generic_Array_To_Vector;
function "&" (Left, Right : Vector) return Vector is
begin
return Result : Vector := Left do
Append (Result, Right);
end return;
end "&";
function "&" (Left : Vector; Right : Element_Type) return Vector is
begin
return Result : Vector := Left do
Append (Result, Right);
end return;
end "&";
function "&" (Left : Element_Type; Right : Vector) return Vector is
begin
return Result : Vector do
Reallocate (Result, 0, 1 + Right.Length, True);
Append (Result, Left);
Append (Result, Right);
end return;
end "&";
function "&" (Left, Right : Element_Type) return Vector is
begin
return Result : Vector do
Reallocate (Result, 0, 2, True);
Append (Result, Left);
Append (Result, Right);
end return;
end "&";
function Capacity (Container : Vector) return Count_Type is
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
if Data = null then
return 0;
else
return Count_Type'Base (Data.Capacity_Last - Index_Type'First + 1);
end if;
end Capacity;
procedure Reserve_Capacity (
Container : in out Vector;
Capacity : Count_Type)
is
New_Capacity : constant Count_Type :=
Count_Type'Max (Capacity, Container.Length);
begin
Reallocate (Container, Container.Length, New_Capacity, True);
end Reserve_Capacity;
function Length (Container : Vector) return Count_Type is
begin
return Container.Length;
end Length;
procedure Set_Length (Container : in out Vector; Length : Count_Type) is
Old_Capacity : constant Count_Type := Capacity (Container);
Failure : Boolean;
begin
Copy_On_Write.In_Place_Set_Length (
Target => Container.Super'Access,
Target_Length => Container.Length,
Target_Capacity => Old_Capacity,
New_Length => Length,
Failure => Failure,
Max_Length => Max_Length'Access);
if Failure then
declare
function Grow is
new System.Growth.Good_Grow (
Count_Type,
Component_Size => Element_Array'Component_Size);
New_Capacity : Count_Type;
begin
if Old_Capacity >= Length then
New_Capacity := Old_Capacity; -- not shrinking
else
New_Capacity := Count_Type'Max (Grow (Old_Capacity), Length);
end if;
Reallocate (Container, Length, New_Capacity, False);
end;
end if;
Container.Length := Length;
end Set_Length;
function Is_Empty (Container : Vector) return Boolean is
begin
return Container.Length = 0;
end Is_Empty;
procedure Clear (Container : in out Vector) is
begin
Copy_On_Write.Clear (Container.Super'Access, Free => Free_Data'Access);
Container.Length := 0;
end Clear;
function To_Cursor (
Container : Vector'Class;
Index : Extended_Index)
return Cursor
is
pragma Check (Pre,
Check =>
Index <= Last_Index (Container) + 1
or else raise Constraint_Error);
begin
if Index = Index_Type'First + Index_Type'Base (Container.Length) then
return No_Element; -- Last_Index (Container) + 1
else
return Index;
end if;
end To_Cursor;
function Element (
Container : Vector'Class;
Index : Index_Type)
return Element_Type is
begin
return Constant_Reference (
Vector (Container),
Index) -- checking Constraint_Error
.Element.all;
end Element;
procedure Replace_Element (
Container : in out Vector;
Position : Cursor;
New_Item : Element_Type)
is
pragma Check (Pre,
Check =>
Position in Index_Type'First .. Last (Container)
or else raise Constraint_Error);
begin
Unique (Container, True);
declare
E : Element_Type
renames Downcast (Container.Super.Data).Items (Position);
begin
-- diff
Assign_Element (E, New_Item);
end;
end Replace_Element;
procedure Query_Element (
Container : Vector'Class;
Index : Index_Type;
Process : not null access procedure (Element : Element_Type)) is
begin
Process (
Constant_Reference (
Vector (Container),
Index) -- checking Constraint_Error
.Element.all);
end Query_Element;
procedure Update_Element (
Container : in out Vector'Class;
Position : Cursor;
Process : not null access procedure (Element : in out Element_Type)) is
begin
Process (
Reference (Vector (Container), Position) -- checking Constraint_Error
.Element.all);
end Update_Element;
function Constant_Reference (Container : aliased Vector; Position : Cursor)
return Constant_Reference_Type
is
pragma Check (Pre,
Check =>
Position in Index_Type'First .. Last (Container)
or else raise Constraint_Error);
begin
Unique (Container'Unrestricted_Access.all, False);
declare
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
return (Element => Data.all.Items (Position)'Access); -- [gcc-6] .all
end;
end Constant_Reference;
function Reference (Container : aliased in out Vector; Position : Cursor)
return Reference_Type
is
pragma Check (Pre,
Check =>
Position in Index_Type'First .. Last (Container)
or else raise Constraint_Error);
begin
Unique (Container, True);
declare
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
return (Element => Data.all.Items (Position)'Access); -- [gcc-6] .all
end;
end Reference;
procedure Assign (Target : in out Vector; Source : Vector) is
begin
Copy_On_Write.Assign (
Target.Super'Access,
Source.Super'Access,
Free => Free_Data'Access);
Target.Length := Source.Length;
end Assign;
function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector is
begin
return Result : Vector := Source do
Reserve_Capacity (Result, Capacity);
end return;
end Copy;
procedure Move (Target : in out Vector; Source : in out Vector) is
begin
Copy_On_Write.Move (
Target.Super'Access,
Source.Super'Access,
Free => Free_Data'Access);
Target.Length := Source.Length;
Source.Length := 0;
end Move;
procedure Insert (
Container : in out Vector;
Before : Cursor;
New_Item : Vector)
is
Position : Cursor;
begin
Insert (
Container,
Before, -- checking Constraint_Error
New_Item, -- checking Program_Error if same nonempty container
Position);
end Insert;
procedure Insert (
Container : in out Vector;
Before : Cursor;
New_Item : Vector;
Position : out Cursor)
is
pragma Check (Pre,
Check =>
Before <= Last (Container) + 1 or else raise Constraint_Error);
pragma Check (Pre,
Check =>
Container'Address /= New_Item'Address
or else Is_Empty (Container)
or else raise Program_Error);
-- same nonempty container (should this case be supported?)
New_Item_Length : constant Count_Type := New_Item.Length;
begin
if Container.Length = 0
and then Capacity (Container) < New_Item_Length -- New_Item_Length > 0
then
Position := Index_Type'First;
Assign (Container, New_Item);
else
Insert_Space (Container, Before, Position, New_Item_Length);
if New_Item_Length > 0 then
Unique (New_Item'Unrestricted_Access.all, False); -- private
declare
subtype R1 is
Extended_Index range
Position ..
Position + Index_Type'Base (New_Item_Length) - 1;
subtype R2 is
Extended_Index range
Index_Type'First ..
Index_Type'First - 1 + Index_Type'Base (New_Item_Length);
begin
Downcast (Container.Super.Data).Items (R1) :=
Downcast (New_Item.Super.Data).Items (R2);
end;
-- diff
-- diff
-- diff
-- diff
end if;
end if;
end Insert;
procedure Insert (
Container : in out Vector;
Before : Cursor;
New_Item : Element_Type;
Count : Count_Type := 1)
is
Position : Cursor;
begin
Insert (
Container,
Before, -- checking Constraint_Error
New_Item,
Position,
Count);
end Insert;
procedure Insert (
Container : in out Vector;
Before : Cursor;
New_Item : Element_Type;
Position : out Cursor;
Count : Count_Type := 1) is
begin
Insert_Space (
Container,
Before, -- checking Constraint_Error
Position,
Count);
for I in Position .. Position + Index_Type'Base (Count) - 1 loop
declare
E : Element_Type
renames Downcast (Container.Super.Data).Items (I);
begin
-- diff
Assign_Element (E, New_Item);
end;
end loop;
end Insert;
procedure Prepend (Container : in out Vector; New_Item : Vector) is
begin
Insert (
Container,
Index_Type'First,
New_Item); -- checking Program_Error if same nonempty container
end Prepend;
procedure Prepend (
Container : in out Vector;
New_Item : Element_Type;
Count : Count_Type := 1) is
begin
Insert (Container, Index_Type'First, New_Item, Count);
end Prepend;
procedure Append (Container : in out Vector; New_Item : Vector) is
New_Item_Length : constant Count_Type := New_Item.Length;
Old_Length : constant Count_Type := Container.Length;
begin
if Old_Length = 0 and then Capacity (Container) < New_Item_Length then
Assign (Container, New_Item);
elsif New_Item_Length > 0 then
Set_Length (Container, Old_Length + New_Item_Length);
Unique (New_Item'Unrestricted_Access.all, False); -- private
declare
subtype R1 is
Extended_Index range
Index_Type'First + Index_Type'Base (Old_Length) ..
Last (Container);
subtype R2 is
Extended_Index range
Index_Type'First ..
Index_Type'First - 1 + Index_Type'Base (New_Item_Length);
-- Do not use New_Item.Length or Last (New_Item) in here
-- for Append (X, X).
begin
Downcast (Container.Super.Data).Items (R1) :=
Downcast (New_Item.Super.Data).Items (R2);
end;
-- diff
-- diff
end if;
end Append;
procedure Append (
Container : in out Vector;
New_Item : Element_Type;
Count : Count_Type := 1)
is
Old_Length : constant Count_Type := Container.Length;
begin
Set_Length (Container, Old_Length + Count);
for I in
Index_Type'First + Index_Type'Base (Old_Length) ..
Last (Container)
loop
declare
E : Element_Type
renames Downcast (Container.Super.Data).Items (I);
begin
-- diff
Assign_Element (E, New_Item);
end;
end loop;
end Append;
procedure Insert_Space (
Container : in out Vector'Class;
Before : Extended_Index;
Count : Count_Type := 1)
is
Position : Cursor;
begin
Insert_Space (
Vector (Container),
Before, -- checking Constraint_Error
Position,
Count);
end Insert_Space;
procedure Insert_Space (
Container : in out Vector;
Before : Cursor;
Position : out Cursor;
Count : Count_Type := 1)
is
pragma Check (Pre,
Check =>
Before <= Last (Container) + 1 or else raise Constraint_Error);
Old_Length : constant Count_Type := Container.Length;
After_Last : constant Index_Type'Base :=
Index_Type'First + Index_Type'Base (Old_Length);
begin
Position := Before;
if Position = No_Element then
Position := After_Last;
end if;
if Count > 0 then
Set_Length (Container, Old_Length + Count);
if Position < After_Last then -- Last_Index (Container) + 1
Unique (Container, True);
declare
Data : constant Data_Access := Downcast (Container.Super.Data);
subtype R1 is
Extended_Index range
Position + Index_Type'Base (Count) ..
After_Last - 1 + Index_Type'Base (Count);
subtype R2 is Extended_Index range Position .. After_Last - 1;
begin
-- diff
-- diff
-- diff
Data.Items (R1) := Data.Items (R2);
-- diff
-- diff
-- diff
end;
end if;
end if;
end Insert_Space;
procedure Delete (
Container : in out Vector;
Position : in out Cursor;
Count : Count_Type := 1)
is
pragma Check (Pre,
Check =>
Position in
Index_Type'First ..
Last (Container) - Index_Type'Base (Count) + 1
or else raise Constraint_Error);
begin
if Count > 0 then
declare
Old_Length : constant Count_Type := Container.Length;
After_Last : constant Index_Type'Base :=
Index_Type'First + Index_Type'Base (Old_Length);
begin
if Position + Index_Type'Base (Count) < After_Last then
Unique (Container, True);
declare
Data : constant Data_Access :=
Downcast (Container.Super.Data);
subtype R1 is
Extended_Index range
Position .. After_Last - 1 - Index_Type'Base (Count);
subtype R2 is
Extended_Index range
Position + Index_Type'Base (Count) .. After_Last - 1;
begin
-- diff
-- diff
-- diff
Data.Items (R1) := Data.Items (R2);
-- diff
-- diff
-- diff
end;
end if;
Set_Length (Container, Old_Length - Count);
Position := No_Element;
end;
end if;
end Delete;
procedure Delete_First (
Container : in out Vector'Class;
Count : Count_Type := 1)
is
Position : Cursor := Index_Type'First;
begin
Delete (Vector (Container), Position, Count => Count);
end Delete_First;
procedure Delete_Last (
Container : in out Vector'Class;
Count : Count_Type := 1) is
begin
Set_Length (Vector (Container), Container.Length - Count);
end Delete_Last;
procedure Reverse_Elements (Container : in out Vector) is
begin
if Container.Length > 1 then
Unique (Container, True);
Array_Sorting.In_Place_Reverse (
Index_Type'Pos (Index_Type'First),
Index_Type'Pos (Last (Container)),
DA_Conv.To_Address (Downcast (Container.Super.Data)),
Swap => Swap_Element'Access);
end if;
end Reverse_Elements;
procedure Swap (Container : in out Vector; I, J : Cursor) is
pragma Check (Pre,
Check =>
(I in Index_Type'First .. Last (Container)
and then J in Index_Type'First .. Last (Container))
or else raise Constraint_Error);
begin
Unique (Container, True);
Swap_Element (
Index_Type'Pos (I),
Index_Type'Pos (J),
DA_Conv.To_Address (Downcast (Container.Super.Data)));
end Swap;
function First_Index (Container : Vector'Class)
return Index_Type
is
pragma Unreferenced (Container);
begin
return Index_Type'First;
end First_Index;
function First (Container : Vector) return Cursor is
begin
if Container.Length = 0 then
return No_Element;
else
return Index_Type'First;
end if;
end First;
function First_Element (Container : Vector'Class)
return Element_Type is
begin
return Element (Container, Index_Type'First);
end First_Element;
function Last_Index (Container : Vector'Class)
return Extended_Index is
begin
return Last (Vector (Container));
end Last_Index;
function Last (Container : Vector) return Cursor is
begin
return Index_Type'First - 1 + Index_Type'Base (Container.Length);
end Last;
function Last_Element (Container : Vector'Class)
return Element_Type is
begin
return Element (Container, Last_Index (Container));
end Last_Element;
function Find_Index (
Container : Vector'Class;
Item : Element_Type;
Index : Index_Type := Index_Type'First)
return Extended_Index is
begin
if Index = Index_Type'First and then Container.Length = 0 then
return No_Index;
else
return Find (
Vector (Container),
Item,
Index); -- checking Constraint_Error
end if;
end Find_Index;
function Find (
Container : Vector;
Item : Element_Type)
return Cursor is
begin
return Find (Container, Item, First (Container));
end Find;
function Find (
Container : Vector;
Item : Element_Type;
Position : Cursor)
return Cursor
is
pragma Check (Pre,
Check =>
Position in Index_Type'First .. Last (Container)
or else (Is_Empty (Container) and then Position = No_Element)
or else raise Constraint_Error);
Last : constant Cursor := Vectors.Last (Container);
begin
if Position in Index_Type'First .. Last then
Unique (Container'Unrestricted_Access.all, False); -- private
for I in Position .. Last loop
if Downcast (Container.Super.Data).Items (I) = Item then
-- diff
-- diff
-- diff
return I;
end if;
end loop;
end if;
return No_Element;
end Find;
function Reverse_Find_Index (
Container : Vector'Class;
Item : Element_Type;
Index : Index_Type := Index_Type'Last)
return Extended_Index
is
Start : constant Extended_Index :=
Extended_Index'Min (Index, Last_Index (Container));
begin
return Reverse_Find (
Vector (Container),
Item,
Start); -- checking Constraint_Error
end Reverse_Find_Index;
function Reverse_Find (
Container : Vector;
Item : Element_Type)
return Cursor is
begin
return Reverse_Find (Container, Item, Last (Container));
end Reverse_Find;
function Reverse_Find (
Container : Vector;
Item : Element_Type;
Position : Cursor)
return Cursor
is
pragma Check (Pre,
Check =>
(Position in Index_Type'First .. Last (Container))
or else (Is_Empty (Container) and then Position = No_Element)
or else raise Constraint_Error);
begin
if Position >= Index_Type'First then
Unique (Container'Unrestricted_Access.all, False); -- private
for I in reverse Index_Type'First .. Position loop
if Downcast (Container.Super.Data).Items (I) = Item then
-- diff
-- diff
-- diff
return I;
end if;
end loop;
end if;
return No_Element;
end Reverse_Find;
function Contains (Container : Vector; Item : Element_Type)
return Boolean is
begin
return Find (Container, Item) /= No_Element;
end Contains;
procedure Iterate (
Container : Vector'Class;
Process : not null access procedure (Position : Cursor)) is
begin
for I in Index_Type'First .. Last (Vector (Container)) loop
Process (I);
end loop;
end Iterate;
procedure Reverse_Iterate (
Container : Vector'Class;
Process : not null access procedure (Position : Cursor)) is
begin
for I in reverse Index_Type'First .. Last (Vector (Container)) loop
Process (I);
end loop;
end Reverse_Iterate;
function Iterate (Container : Vector'Class)
return Vector_Iterator_Interfaces.Reversible_Iterator'Class is
begin
return Vector_Iterator'(
First => First (Vector (Container)),
Last => Last (Vector (Container)));
end Iterate;
function Iterate (Container : Vector'Class; First, Last : Cursor)
return Vector_Iterator_Interfaces.Reversible_Iterator'Class
is
pragma Check (Pre,
Check =>
(First <= Vectors.Last (Vector (Container)) + 1
and then Last <= Vectors.Last (Vector (Container)))
or else raise Constraint_Error);
Actual_First : Cursor := First;
Actual_Last : Cursor := Last;
begin
if Actual_First = No_Element
or else Actual_Last < Actual_First -- implies Last = No_Element
then
Actual_First := No_Element;
Actual_Last := No_Element;
end if;
return Vector_Iterator'(First => Actual_First, Last => Actual_Last);
end Iterate;
function Constant_Reference (Container : aliased Vector)
return Slicing.Constant_Reference_Type is
begin
Unique (Container'Unrestricted_Access.all, False);
declare
type Element_Array_Access is access constant Element_Array;
for Element_Array_Access'Storage_Size use 0;
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
return Slicing.Constant_Slice (
Element_Array_Access'(Data.Items'Unrestricted_Access).all,
Index_Type'First,
Last (Container));
end;
end Constant_Reference;
function Reference (Container : aliased in out Vector)
return Slicing.Reference_Type is
begin
Unique (Container, True);
declare
type Element_Array_Access is access all Element_Array;
for Element_Array_Access'Storage_Size use 0;
Data : constant Data_Access := Downcast (Container.Super.Data);
begin
return Slicing.Slice (
Element_Array_Access'(Data.Items'Unrestricted_Access).all,
Index_Type'First,
Last (Container));
end;
end Reference;
overriding procedure Adjust (Object : in out Vector) is
begin
Copy_On_Write.Adjust (Object.Super'Access);
end Adjust;
overriding function First (Object : Vector_Iterator) return Cursor is
begin
return Object.First;
end First;
overriding function Next (Object : Vector_Iterator; Position : Cursor)
return Cursor is
begin
if Position >= Object.Last then
return No_Element;
else
return Position + 1;
end if;
end Next;
overriding function Last (Object : Vector_Iterator) return Cursor is
begin
return Object.Last;
end Last;
overriding function Previous (Object : Vector_Iterator; Position : Cursor)
return Cursor is
begin
if Position <= Object.First then
return No_Element;
else
return Position - 1;
end if;
end Previous;
function Constant_Indexing (
Container : aliased Vector'Class;
Index : Index_Type)
return Constant_Reference_Type is
begin
return Constant_Reference (Vector (Container), Index);
end Constant_Indexing;
function Indexing (
Container : aliased in out Vector'Class;
Index : Index_Type)
return Reference_Type is
begin
return Reference (Vector (Container), Index);
end Indexing;
package body Generic_Sorting is
function LT (Left, Right : Word_Integer; Params : System.Address)
return Boolean;
function LT (Left, Right : Word_Integer; Params : System.Address)
return Boolean
is
Data : constant Data_Access := DA_Conv.To_Pointer (Params);
begin
return Data.Items (Index_Type'Val (Left)) <
Data.Items (Index_Type'Val (Right));
end LT;
function Is_Sorted (Container : Vector) return Boolean is
begin
if Container.Length <= 1 then
return True;
else
Unique (Container'Unrestricted_Access.all, False); -- private
return Array_Sorting.Is_Sorted (
Index_Type'Pos (Index_Type'First),
Index_Type'Pos (Last (Container)),
DA_Conv.To_Address (Downcast (Container.Super.Data)),
LT => LT'Access);
end if;
end Is_Sorted;
procedure Sort (Container : in out Vector) is
begin
if Container.Length > 1 then
Unique (Container, True);
Array_Sorting.In_Place_Merge_Sort (
Index_Type'Pos (Index_Type'First),
Index_Type'Pos (Last (Container)),
DA_Conv.To_Address (Downcast (Container.Super.Data)),
LT => LT'Access,
Swap => Swap_Element'Access);
end if;
end Sort;
procedure Merge (Target : in out Vector; Source : in out Vector) is
pragma Check (Pre,
Check =>
Target'Address /= Source'Address
or else Is_Empty (Target)
or else raise Program_Error);
-- RM A.18.2(237/3), same nonempty container
begin
if Source.Length > 0 then
declare
Old_Length : constant Count_Type := Target.Length;
begin
if Old_Length = 0 then
Move (Target, Source);
else
Append (Target, Source);
Unique (Target, True);
-- diff
-- diff
-- diff
-- diff
-- diff
-- diff
-- diff
Set_Length (Source, 0);
Array_Sorting.In_Place_Merge (
Index_Type'Pos (Index_Type'First),
Word_Integer (Index_Type'First)
+ Word_Integer (Old_Length),
Index_Type'Pos (Last (Target)),
DA_Conv.To_Address (Downcast (Target.Super.Data)),
LT => LT'Access,
Swap => Swap_Element'Access);
end if;
end;
end if;
end Merge;
end Generic_Sorting;
package body Streaming is
procedure Read (
Stream : not null access Streams.Root_Stream_Type'Class;
Item : out Vector)
is
Length : Count_Type'Base;
begin
Count_Type'Base'Read (Stream, Length);
Clear (Item);
if Length > 0 then
Set_Length (Item, Length);
Element_Array'Read (
Stream,
Downcast (Item.Super.Data).Items (
Index_Type'First .. Last (Item)));
-- diff
-- diff
-- diff
-- diff
-- diff
end if;
end Read;
procedure Write (
Stream : not null access Streams.Root_Stream_Type'Class;
Item : Vector)
is
Length : constant Count_Type := Vectors.Length (Item);
begin
Count_Type'Write (Stream, Length);
if Length > 0 then
Unique (Item'Unrestricted_Access.all, False); -- private
Element_Array'Write (
Stream,
Downcast (Item.Super.Data).Items (
Index_Type'First .. Last (Item)));
-- diff
end if;
end Write;
end Streaming;
end Ada.Containers.Vectors;
|
msrLi/portingSources | Ada | 3,017 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Form_Demo is
procedure Demo;
end Sample.Form_Demo;
|
reznikmm/matreshka | Ada | 4,345 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
limited with AMF.UML.Call_Operation_Actions;
package AMF.Utp.Validation_Actions is
pragma Preelaborate;
type Utp_Validation_Action is limited interface;
type Utp_Validation_Action_Access is
access all Utp_Validation_Action'Class;
for Utp_Validation_Action_Access'Storage_Size use 0;
not overriding function Get_Base_Call_Operation_Action
(Self : not null access constant Utp_Validation_Action)
return AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access is abstract;
-- Getter of ValidationAction::base_CallOperationAction.
--
not overriding procedure Set_Base_Call_Operation_Action
(Self : not null access Utp_Validation_Action;
To : AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access) is abstract;
-- Setter of ValidationAction::base_CallOperationAction.
--
end AMF.Utp.Validation_Actions;
|
Fabien-Chouteau/coffee-clock | Ada | 3,005 | adb | -------------------------------------------------------------------------------
-- --
-- Coffee Clock --
-- --
-- Copyright (C) 2016-2017 Fabien Chouteau --
-- --
-- Coffee Clock is free software: you can redistribute it and/or --
-- modify it under the terms of the GNU General Public License as --
-- published by the Free Software Foundation, either version 3 of the --
-- License, or (at your option) any later version. --
-- --
-- Coffee Clock is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public License --
-- along with We Noise Maker. If not, see <http://www.gnu.org/licenses/>. --
-- --
-------------------------------------------------------------------------------
with Ada.Real_Time; use Ada.Real_Time;
with STM32.Device; use STM32.Device;
with STM32.GPIO; use STM32.GPIO;
with STM32.Board; use STM32.Board;
package body Coffee_Maker is
Trigger_Pin : GPIO_Point renames PD3;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Enable_Clock (Trigger_Pin);
Trigger_Pin.Configure_IO ((Mode => Mode_Out,
Output_Type => Push_Pull,
Speed => Speed_25MHz,
Resistors => Floating));
Trigger_Pin.Clear;
Initialize_LEDs;
end Initialize;
-----------------
-- Make_Coffee --
-----------------
procedure Make_Coffee is
procedure Pulse;
-----------
-- Pulse --
-----------
procedure Pulse is
begin
Trigger_Pin.Set;
delay until Clock + Milliseconds (1000);
Trigger_Pin.Clear;
end Pulse;
begin
-- Turning the machine on
Pulse;
-- Waiting for warmup (assuming cold start)
delay until Clock + Seconds (7);
-- Start coffee
Pulse;
for Cnt in 1 .. 10 loop
All_LEDs_On;
delay until Clock + Milliseconds (500);
All_LEDs_Off;
delay until Clock + Milliseconds (500);
end loop;
end Make_Coffee;
end Coffee_Maker;
|
msrLi/portingSources | Ada | 865 | adb | -- Copyright 2011-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure A is
FC : Color := Red;
SC : Color := Green;
begin
Do_Nothing (FC'Address);
Do_Nothing (SC'Address);
end A;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 941 | ads | package STM32GD.Clock is
pragma Preelaborate;
type Clock_Type is (SYSCLK, PCLK, HSI, LSI, LSE, HCLK, PLLCLK, RTCCLK);
type PLL_Source_Type is (HSI, HSE);
type RTC_Source_Type is (LSE, HSE, LSI);
type SYSCLK_Source_Type is (PLL, HSI, HSE);
subtype HSE_Range is Integer range 4_000_000 .. 32_000_000;
subtype PLL_Prediv_Range is Integer range 1 .. 16;
subtype PLL_Mul_Range is Integer range 1 .. 16;
subtype PLL_Range is Integer range 16_000_000 .. 72_000_000;
subtype PLL_Input_Range is Integer range 4_000_000 .. 16_000_000;
subtype SYSCLK_Speed is Integer range 4_000_000 .. 72_000_000;
type AHB_Prescaler_Type is (DIV1, DIV2, DIV4, DIV8, DIV16,
DIV64, DIV128, DIV256, DIV512);
type APB_Prescaler_Type is (DIV1, DIV2, DIV4, DIV8, DIV16);
HSI_Value : constant Integer := 8_000_000;
LSI_Value : constant Integer := 40_000;
LSE_Value : constant Integer := 32_768;
end STM32GD.Clock;
|
charlie5/cBound | Ada | 1,501 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_get_input_focus_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_get_input_focus_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_input_focus_request_t.Item,
Element_Array => xcb.xcb_get_input_focus_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_get_input_focus_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_input_focus_request_t.Pointer,
Element_Array => xcb.xcb_get_input_focus_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_get_input_focus_request_t;
|
AdaCore/libadalang | Ada | 258 | adb | procedure Main is
package Foo is
type T is null record;
function "=" (X, Y : T) return Boolean is (True);
pragma Find_All_References (Any);
end Foo;
use Foo;
A, B : T;
begin
if A /= B then
null;
end if;
end Main;
|
sbksba/Concurrence-LI330 | Ada | 2,683 | adb | with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
package body Matrice is
Read : Integer;
-- procedure d'initialisation d'une matrice par saisie des valeurs au clavier
-- l'initialisation doit se faire ligne par ligne
procedure Initialiser_Une_Matrice(Matrice: in out Une_Matrice_Entiere) is
-- A completer
begin
for I in Matrice'Range(1) loop
for J in Matrice'Range(2) loop
Get(Read);
Matrice(I,J) := Read;
end loop;
end loop;
end Initialiser_Une_Matrice;
-- procedure d'affichage d'une matrice
procedure Afficher_Une_Matrice(Matrice : in Une_Matrice_Entiere) is
-- A completer
begin
for I in Matrice'Range(1) loop
for J in Matrice'Range(2) loop
Put(Matrice(I,J));
Put(" ");
end loop;
New_Line;
end loop;
end Afficher_Une_Matrice;
-- fonction d'addition de 2 matrices
function "+"(Matrice1, Matrice2 : Une_Matrice_Entiere) return Une_Matrice_Entiere is
-- A completer
Res : Une_Matrice_Entiere (Matrice1'range(1),Matrice1'Range(2));
K : Integer := Matrice2'First(1);
T : Integer := Matrice2'First(2);
begin
for I in Matrice1'Range(1) loop
for J in Matrice1'Range(2) loop
Res(I,J) := Matrice1(I,J) + Matrice2(K,T);
T:=T+1;
end loop;
T:=Matrice2'First(2);
K:=K+1;
end loop;
return Res;
end "+";
-- fonction de multiplication d'une matrice par un scalaire
function "*"(Matrice : in Une_Matrice_Entiere; Scalaire : Integer) return Une_Matrice_Entiere is
-- A completer
Res : Une_Matrice_Entiere (Matrice'range(1),Matrice'range(2));
begin
for I in Matrice'Range(1) loop
for J in Matrice'Range(2) loop
Res(I,J) := Matrice(I,J) * Scalaire;
end loop;
end loop;
return Res;
end "*";
-- fonction de multiplication d'un scalaire par une matrice
function "*"(Scalaire : Integer; Matrice : in Une_Matrice_Entiere) return Une_Matrice_Entiere is
begin
-- A completer
return "*"(Matrice,Scalaire);
end "*";
-- fonction de multiplication d'une matrice par une matrice
function "*"(Matrice1, Matrice2 : in Une_Matrice_Entiere) return Une_Matrice_Entiere is
-- A completer
Mat : Une_Matrice_Entiere( 1 .. Matrice1'Length (1), 1 .. Matrice2'Length (2));
A : Integer := 0;
begin
for I in Mat'Range (1) loop
for J in Mat'Range (2) loop
for K in 1 .. Matrice1'Length (2) loop
A := A+ (Matrice1 (Matrice1'First (1)-1+I, Matrice1'First (2)-1+K) *Matrice2 (Matrice2'First (1)-1+K, Matrice2'First (2)-1+J));
end loop;
Mat (I, J) := A;
A := 0;
end loop;
end loop;
return Mat;
end "*";
end Matrice;
|
JeremyGrosser/clock3 | Ada | 1,678 | adb | with SAMD21_SVD.USB; use SAMD21_SVD.USB;
with SAMD21_SVD.PM; use SAMD21_SVD.PM;
with SAMD21_SVD.GCLK; use SAMD21_SVD.GCLK;
with SAMD21.Device; use SAMD21.Device;
with HAL; use HAL;
with Board; use Board;
package body SAMD21.USB is
procedure Initialize is
Pad_Trans_N : USB_PADCAL_USB_DEVICE_TRANSN_Field := NVMCTRL_OTP4.USB_TRANSN;
Pad_Trans_P : USB_PADCAL_USB_DEVICE_TRANSP_Field := NVMCTRL_OTP4.USB_TRANSP;
Pad_Trim : USB_PADCAL_USB_DEVICE_TRIM_Field := NVMCTRL_OTP4.USB_TRIM;
begin
PM_Periph.APBBMASK.USB := True;
Pin_Mode (USB_DM, Alternate);
Pin_Mode (USB_DP, Alternate);
GCLK_Periph.CLKCTRL :=
(ID => SAMD21_SVD.GCLK.USB,
GEN => GCLK0,
CLKEN => True,
others => <>);
while GCLK_Periph.STATUS.SYNCBUSY loop
null;
end loop;
USB_Periph.USB_DEVICE.CTRLA.SWRST := True;
while USB_Periph.USB_DEVICE.SYNCBUSY.SWRST loop
null;
end loop;
if Pad_Trans_N = 16#1F# then
Pad_Trans_N := 5;
end if;
if Pad_Trans_P = 16#1F# then
Pad_Trans_P := 29;
end if;
if Pad_Trim = 7 then
Pad_Trim := 3;
end if;
USB_Periph.USB_DEVICE.PADCAL.TRANSN := Pad_Trans_N;
USB_Periph.USB_DEVICE.PADCAL.TRANSP := Pad_Trans_P;
USB_Periph.USB_DEVICE.PADCAL.TRIM := Pad_Trim;
USB_Periph.USB_DEVICE.CTRLA :=
(MODE => SAMD21_SVD.USB.DEVICE,
RUNSTDBY => True,
others => <>);
-- DESCADD
USB_Periph.USB_DEVICE.CTRLB :=
(SPDCONF => FS,
DETACH => False,
others => <>);
end Initialize;
end SAMD21.USB;
|
hfegran/efx32_ada_examples | Ada | 465 | ads | with System;
package Tasking is
procedure Wait_Forever;
task Init is
pragma Priority(System.Priority'Last - 2);
end Init;
task Task_1 is
pragma Priority(System.Priority'Last - 1);
end Task_1;
task Task_2 is
pragma Priority(System.Priority'Last);
end Task_2;
procedure Last_Chance_Handler (Msg : System.Address; Line : Integer);
pragma Export (C, Last_Chance_Handler, "__gnat_last_chance_handler");
end Tasking;
|
charlie5/lace | Ada | 755 | ads | package physics.Joint.cone_Twist
--
-- An interface to a cone-twist joint.
--
is
type Item is limited interface
and Joint.item;
type View is access all Item'Class;
function lower_Limit (Self : in Item; DoF : in Degree_of_freedom) return Real is abstract;
function upper_Limit (Self : in Item; DoF : in Degree_of_freedom) return Real is abstract;
procedure lower_Limit_is (Self : in out Item; Now : in Real;
DoF : in Degree_of_freedom) is abstract;
procedure upper_Limit_is (Self : in out Item; Now : in Real;
DoF : in Degree_of_freedom) is abstract;
end physics.Joint.cone_Twist;
|
charlie5/lace | Ada | 555 | ads | package gel.Dolly.simple
--
-- Provides a simple camera dolly.
--
is
type Item is new gel.Dolly.item with private;
type View is access all Item'Class;
---------
--- Forge
--
overriding
procedure define (Self : in out Item);
overriding
procedure destroy (Self : in out Item);
--------------
--- Operations
--
overriding
procedure freshen (Self : in out Item);
private
type Direction_Flags is array (Direction) of Boolean;
type Item is new gel.Dolly.item with null record;
end gel.Dolly.simple;
|
AdaCore/libadalang | Ada | 297 | adb | procedure Testloop is
type My_Int is range Integer'First .. Integer'Last;
B : My_Int;
type My_Array is array (Integer range <>) of Natural;
function Foo return My_Array is ((1, 2, 3, 4));
begin
for El of Foo loop
El := 12;
end loop;
pragma Test_Block;
end Testloop;
|
rveenker/sdlada | Ada | 2,016 | adb | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
package body SDL.Power is
package C renames Interfaces.C;
use type C.int;
procedure Info (Data : in out Battery_Info) is
function SDL_GetPowerInfo (Seconds, Percent : out C.int) return State with
Import => True,
Convention => C,
External_Name => "SDL_GetPowerInfo";
Seconds, Percent : C.int;
begin
Data.Power_State := SDL_GetPowerInfo (Seconds, Percent);
if Seconds = -1 then
Data.Time_Valid := False;
else
Data.Time_Valid := True;
Data.Time := SDL.Power.Seconds (Seconds);
end if;
if Percent = -1 then
Data.Percentage_Valid := False;
else
Data.Percentage_Valid := True;
Data.Percent := Percentage (Percent);
end if;
end Info;
end SDL.Power;
|
sungyeon/drake | Ada | 3,964 | adb | with Ada.Unchecked_Conversion;
with System.Unwind.Occurrences;
with System.UTF_Conversions.From_8_To_16;
with System.UTF_Conversions.From_8_To_32;
package body Ada.Exceptions is
pragma Suppress (All_Checks);
use type System.Unwind.Exception_Data_Access;
-- for Exception_Information
type Information_Context_Type is record
Item : String (
1 ..
256
+ System.Unwind.Exception_Msg_Max_Length
+ System.Unwind.Max_Tracebacks
* (3 + (Standard'Address_Size + 3) / 4));
Last : Natural;
end record;
pragma Suppress_Initialization (Information_Context_Type);
procedure Put (S : String; Params : System.Address);
procedure Put (S : String; Params : System.Address) is
Context : Information_Context_Type;
for Context'Address use Params;
First : constant Positive := Context.Last + 1;
begin
Context.Last := Context.Last + S'Length;
Context.Item (First .. Context.Last) := S;
end Put;
procedure New_Line (Params : System.Address);
procedure New_Line (Params : System.Address) is
Context : Information_Context_Type;
for Context'Address use Params;
begin
Context.Last := Context.Last + 1;
Context.Item (Context.Last) := Character'Val (10);
end New_Line;
-- implementation
function Wide_Exception_Name (Id : Exception_Id) return Wide_String is
begin
return System.UTF_Conversions.From_8_To_16.Convert (Exception_Name (Id));
end Wide_Exception_Name;
function Wide_Wide_Exception_Name (Id : Exception_Id)
return Wide_Wide_String is
begin
return System.UTF_Conversions.From_8_To_32.Convert (Exception_Name (Id));
end Wide_Wide_Exception_Name;
function Exception_Message (X : Exception_Occurrence) return String is
begin
if X.Id = null then
raise Constraint_Error;
else
return X.Msg (1 .. X.Msg_Length);
end if;
end Exception_Message;
procedure Reraise_Occurrence (X : Exception_Occurrence) is
begin
if X.Id /= null then
Reraise_Occurrence_Always (X);
end if;
end Reraise_Occurrence;
function Exception_Identity (X : Exception_Occurrence)
return Exception_Id
is
function To_Exception_Id is
new Unchecked_Conversion (
System.Unwind.Exception_Data_Access,
Exception_Id);
begin
return Exception_Id (To_Exception_Id (X.Id));
end Exception_Identity;
function Exception_Name (X : Exception_Occurrence) return String is
begin
return Exception_Name (Exception_Identity (X));
end Exception_Name;
function Wide_Exception_Name (X : Exception_Occurrence)
return Wide_String is
begin
return Wide_Exception_Name (Exception_Identity (X));
end Wide_Exception_Name;
function Wide_Wide_Exception_Name (X : Exception_Occurrence)
return Wide_Wide_String is
begin
return Wide_Wide_Exception_Name (Exception_Identity (X));
end Wide_Wide_Exception_Name;
function Exception_Information (X : Exception_Occurrence) return String is
begin
if X.Id = null then
raise Constraint_Error;
else
declare
Context : aliased Information_Context_Type;
begin
Context.Last := 0;
System.Unwind.Occurrences.Exception_Information (
System.Unwind.Exception_Occurrence (X),
Context'Address,
Put => Put'Access,
New_Line => New_Line'Access);
return Context.Item (1 .. Context.Last);
end;
end if;
end Exception_Information;
function Save_Occurrence (
Source : Exception_Occurrence)
return Exception_Occurrence_Access
is
Result : constant Exception_Occurrence_Access :=
new Exception_Occurrence;
begin
Save_Occurrence (Result.all, Source);
return Result;
end Save_Occurrence;
end Ada.Exceptions;
|
reznikmm/matreshka | Ada | 6,760 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Form.Radio_Elements is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Form_Radio_Element_Node is
begin
return Self : Form_Radio_Element_Node do
Matreshka.ODF_Form.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Form_Prefix);
end return;
end Create;
----------------
-- Enter_Node --
----------------
overriding procedure Enter_Node
(Self : not null access Form_Radio_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Enter_Form_Radio
(ODF.DOM.Form_Radio_Elements.ODF_Form_Radio_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Enter_Node (Visitor, Control);
end if;
end Enter_Node;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Form_Radio_Element_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Radio_Element;
end Get_Local_Name;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Form_Radio_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Leave_Form_Radio
(ODF.DOM.Form_Radio_Elements.ODF_Form_Radio_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Leave_Node (Visitor, Control);
end if;
end Leave_Node;
----------------
-- Visit_Node --
----------------
overriding procedure Visit_Node
(Self : not null access Form_Radio_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then
ODF.DOM.Iterators.Abstract_ODF_Iterator'Class
(Iterator).Visit_Form_Radio
(Visitor,
ODF.DOM.Form_Radio_Elements.ODF_Form_Radio_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Visit_Node (Iterator, Visitor, Control);
end if;
end Visit_Node;
begin
Matreshka.DOM_Documents.Register_Element
(Matreshka.ODF_String_Constants.Form_URI,
Matreshka.ODF_String_Constants.Radio_Element,
Form_Radio_Element_Node'Tag);
end Matreshka.ODF_Form.Radio_Elements;
|
reznikmm/matreshka | Ada | 19,052 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Time_Expressions is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Time_Expression_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Time_Expression
(AMF.UML.Time_Expressions.UML_Time_Expression_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Time_Expression_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Time_Expression
(AMF.UML.Time_Expressions.UML_Time_Expression_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Time_Expression_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Time_Expression
(Visitor,
AMF.UML.Time_Expressions.UML_Time_Expression_Access (Self),
Control);
end if;
end Visit_Element;
--------------
-- Get_Expr --
--------------
overriding function Get_Expr
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access is
begin
return
AMF.UML.Value_Specifications.UML_Value_Specification_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Expr
(Self.Element)));
end Get_Expr;
--------------
-- Set_Expr --
--------------
overriding procedure Set_Expr
(Self : not null access UML_Time_Expression_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Expr
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Expr;
---------------------
-- Get_Observation --
---------------------
overriding function Get_Observation
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Observations.Collections.Set_Of_UML_Observation is
begin
return
AMF.UML.Observations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Observation
(Self.Element)));
end Get_Observation;
--------------
-- Get_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Types.UML_Type_Access is
begin
return
AMF.UML.Types.UML_Type_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_Time_Expression_Proxy;
To : AMF.UML.Types.UML_Type_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Time_Expression_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Time_Expression_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Time_Expression_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
-------------------
-- Boolean_Value --
-------------------
overriding function Boolean_Value
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Boolean_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Boolean_Value";
return Boolean_Value (Self);
end Boolean_Value;
-------------------
-- Integer_Value --
-------------------
overriding function Integer_Value
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_Integer is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Integer_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Integer_Value";
return Integer_Value (Self);
end Integer_Value;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Time_Expression_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
-------------------
-- Is_Computable --
-------------------
overriding function Is_Computable
(Self : not null access constant UML_Time_Expression_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Computable unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Is_Computable";
return Is_Computable (Self);
end Is_Computable;
-------------
-- Is_Null --
-------------
overriding function Is_Null
(Self : not null access constant UML_Time_Expression_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Null unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Is_Null";
return Is_Null (Self);
end Is_Null;
----------------
-- Real_Value --
----------------
overriding function Real_Value
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_Real is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Real_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Real_Value";
return Real_Value (Self);
end Real_Value;
------------------
-- String_Value --
------------------
overriding function String_Value
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "String_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.String_Value";
return String_Value (Self);
end String_Value;
---------------------
-- Unlimited_Value --
---------------------
overriding function Unlimited_Value
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.Optional_Unlimited_Natural is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Unlimited_Value unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Unlimited_Value";
return Unlimited_Value (Self);
end Unlimited_Value;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Time_Expression_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Time_Expression_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Namespace";
return Namespace (Self);
end Namespace;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Time_Expression_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Time_Expression_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
end AMF.Internals.UML_Time_Expressions;
|
sungyeon/drake | Ada | 36 | ads | ../machine-apple-darwin/s-natint.ads |
onox/orka | Ada | 2,425 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Text_IO;
with EGL.Objects.Displays;
with EGL.Objects.Devices;
with EGL.Errors;
procedure Orka_EGL_Info is
use Ada.Text_IO;
Devices : constant EGL.Objects.Devices.Device_List := EGL.Objects.Devices.Devices;
begin
Put_Line ("Client extensions:");
for Extension of EGL.Objects.Displays.Client_Extensions loop
Put_Line (" " & EGL.SU.To_String (Extension));
end loop;
Put_Line ("");
Put_Line ("Platforms:");
for Platform in EGL.Objects.Displays.Platform_Kind'Range loop
Put_Line ("");
begin
declare
Display : constant EGL.Objects.Displays.Display :=
EGL.Objects.Displays.Create_Display (Platform);
begin
Put_Line (Display.Platform'Image & ":");
Put_Line (" vendor: " & Display.Vendor);
Put_Line (" version: " & Display.Version);
Put_Line (" extensions:");
for Extension of Display.Extensions loop
Put_Line (" " & EGL.SU.To_String (Extension));
end loop;
end;
exception
when EGL.Errors.Not_Initialized_Error =>
Put_Line (Platform'Image & ": not supported");
when EGL.Errors.Invalid_Value_Error =>
Put_Line (Platform'Image & ": creating display failed");
end;
end loop;
Put_Line ("");
Put_Line ("Devices:");
for Device of Devices loop
Put_Line ("");
declare
Name : constant String := Device.Name;
begin
Put_Line (if Name /= "" then Device.Name else "unknown");
end;
Put_Line (" extensions:");
for Extension of Device.Extensions loop
Put_Line (" " & EGL.SU.To_String (Extension));
end loop;
end loop;
end Orka_EGL_Info;
|
AdaCore/libadalang | Ada | 8,103 | adb | with Ada.Strings.Unbounded;
with GNATCOLL.Strings;
with Langkit_Support.Slocs;
with Langkit_Support.Text;
with Libadalang.Common;
-- with GNATCOLL.Iconv;
package body HTML is
package LALCO renames Libadalang.Common;
Hex_Digits : constant
array (Colors.Color_Level range 0 .. 15) of Character :=
"0123456789abcdef";
------------
-- Escape --
------------
function Escape (S : String) return String is
use Ada.Strings.Unbounded;
Result : Unbounded_String;
begin
for C of S loop
case C is
when '"' => Append (Result, """);
when '&' => Append (Result, "&");
when '<' => Append (Result, "<");
when '>' => Append (Result, ">");
when others => Append (Result, C);
end case;
end loop;
return To_String (Result);
end Escape;
-------------------
-- Color_To_HTML --
-------------------
function Color_To_HTML (Color : Colors.Color_Type) return HTML_Color is
use type Colors.Color_Level;
Result : HTML_Color;
begin
Result (1) := Hex_Digits (Color.Red / 16);
Result (2) := Hex_Digits (Color.Red mod 16);
Result (3) := Hex_Digits (Color.Green / 16);
Result (4) := Hex_Digits (Color.Green mod 16);
Result (5) := Hex_Digits (Color.Blue / 16);
Result (6) := Hex_Digits (Color.Blue mod 16);
return Result;
end Color_To_HTML;
-------------------
-- Put_CSS_Rules --
-------------------
procedure Put_CSS_Rules (S : Colors.Style_Type) is
begin
Put ("pre.code_highlight { background-color: #"
& Color_To_HTML (S.Background_Color) & "; }" & ASCII.LF);
for HL in Highlighter.Highlight_Type'Range loop
declare
Style : Colors.Token_Style renames S.Tok_Styles (HL);
begin
Put ("pre.code_highlight span."
& Highlighter.Highlight_Name (HL) & " {");
Put (" color: #" & Color_To_HTML (Style.Color) & ";");
if Style.Bold then
Put (" font-weight: bold;");
end if;
Put (" }" & ASCII.LF);
end;
end loop;
end Put_CSS_Rules;
----------------
-- Put_Tokens --
----------------
procedure Put_Tokens
(Unit : LAL.Analysis_Unit;
Highlights : Highlighter.Highlights_Holder;
Charset : String;
With_Xrefs : Boolean := False)
is
pragma Unreferenced (Charset);
-- TODO: use Charset to properly encode token text (see Escape below)
function Line_Anchor (Line : Natural) return String;
-- Name of the anchor for the given line
function Escape (T : Langkit_Support.Text.Text_Type) return String
is (Escape (Langkit_Support.Text.Image (T)));
procedure Put_Token
(Token : LALCO.Token_Reference;
Data : LALCO.Token_Data_Type;
HL : Highlighter.Highlight_Type);
procedure New_Line;
procedure Add_Whitespace (C : Character);
-- Generic parameters for Put_Tokens below
Xrefs : array (1 .. LAL.Token_Count (Unit)) of LAL.Basic_Decl;
-- For each token, No_Basic_Decl for no cross-reference, or the
-- declaration to which the token should link.
function Traverse (Node : LAL.Ada_Node'Class) return LALCO.Visit_Status;
-- Callback for AST traversal. Return "Into" in all cases. When visiting
-- a string literal or an identifier, perform name resolution on it and
-- record the resulting declaration in the Xrefs array.
Current_Line : Positive := 1;
-- Line number for the tokens to be emitted
Empty_Line : Boolean := True;
-- Whether the current line is empty
-----------------
-- Line_Anchor --
-----------------
function Line_Anchor (Line : Natural) return String is
begin
return 'L' & GNATCOLL.Strings.To_XString
(Natural'Image (Line)).Trim.To_String;
end Line_Anchor;
---------------
-- Put_Token --
---------------
procedure Put_Token
(Token : LALCO.Token_Reference;
Data : LALCO.Token_Data_Type;
HL : Highlighter.Highlight_Type)
is
Text : constant Langkit_Support.Text.Text_Type := LALCO.Text (Token);
Decl : constant LAL.Basic_Decl :=
(if LALCO.Is_Trivia (Data)
then LAL.No_Basic_Decl
else Xrefs (Natural (LALCO.Index (Token))));
-- The declaration that xrefs associated to this token, if any
begin
-- Emit decoration for xref information, if any
if not Decl.Is_Null then
declare
Unit : constant LAL.Analysis_Unit := Decl.Unit;
Href : constant String := URL (Unit);
Line_Raw : constant String :=
Langkit_Support.Slocs.Line_Number'Image
(Decl.Sloc_Range.Start_Line);
Line : constant String :=
GNATCOLL.Strings.To_XString (Line_Raw).Trim.To_String;
begin
-- If the declaration for this token is in the scope of the set
-- of HTML documents we generate, create a hyperlink. In all
-- cases, create a label for the token.
Put ("<a");
if Href /= "" then
Put (" href=""" & Escape (Href) & "#L" & Line & """");
end if;
Put (" title=""" & Escape (LAL.Get_Filename (Unit))
& ", line " & Line & """");
Put (">");
end;
end if;
-- Emit the highlighted token/trivia itself
Put ("<span class=""" & Highlighter.Highlight_Name (HL) & """>");
Put (Escape (Text));
Put ("</span>");
if not Decl.Is_Null then
Put ("</a>");
end if;
Empty_Line := False;
end Put_Token;
--------------
-- New_Line --
--------------
procedure New_Line is
begin
Current_Line := Current_Line + 1;
Put ("</span>");
if Empty_Line then
Put ((1 => ASCII.LF));
end if;
Put ("<span class=""line"" id="""
& Line_Anchor (Current_Line) & """>");
Empty_Line := True;
end New_Line;
------------
-- Indent --
------------
procedure Add_Whitespace (C : Character) is
begin
Empty_Line := False;
Put ((1 => C));
end Add_Whitespace;
--------------
-- Traverse --
--------------
function Traverse (Node : LAL.Ada_Node'Class) return LALCO.Visit_Status
is
begin
-- We only annnotate leaf nodes for xrefs
if Node.Kind not in LALCO.Ada_String_Literal | LALCO.Ada_Identifier
then
return LALCO.Into;
end if;
-- Try to perform name resolution on this single-token node. Discard
-- errors.
declare
Token : constant LALCO.Token_Reference :=
Node.As_Single_Tok_Node.Token_Start;
Index : constant Natural := Natural (LALCO.Index (Token));
Decl : LAL.Basic_Decl renames Xrefs (Index);
begin
Decl := Node.As_Name.P_Referenced_Decl;
exception
when LALCO.Property_Error =>
Decl := LAL.No_Basic_Decl;
end;
return LALCO.Into;
end Traverse;
procedure Put_Tokens is new Highlighter.Put_Tokens;
begin
-- Create the Xrefs array if asked to
if With_Xrefs then
for Xref of Xrefs loop
Xref := LAL.No_Basic_Decl;
end loop;
LAL.Root (Unit).Traverse (Traverse'Access);
end if;
-- Then emit HTML tags for the highlighted source code
Put ("<pre class=""code_highlight"">");
Put ("<span class=""inline"" id=""" & Line_Anchor (1) & """>");
Put_Tokens (Unit, Highlights);
Put ("</span>");
Put ("</pre>");
end Put_Tokens;
end HTML;
|
AdaCore/Ada_Drivers_Library | Ada | 3,484 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL; use HAL;
with HAL.Framebuffer; use HAL.Framebuffer;
with Framebuffer_DSI;
private with STM32.Device;
private with STM32.DSI;
private with STM32.GPIO;
package Framebuffer_OTM8009A is
LCD_Natural_Width : constant := Framebuffer_DSI.LCD_Natural_Width;
LCD_Natural_Height : constant := Framebuffer_DSI.LCD_Natural_Height;
type Frame_Buffer is limited
new HAL.Framebuffer.Frame_Buffer_Display with private;
procedure Initialize
(Display : in out Frame_Buffer;
Orientation : HAL.Framebuffer.Display_Orientation := Default;
Mode : HAL.Framebuffer.Wait_Mode := Interrupt);
private
DSI_RESET : STM32.GPIO.GPIO_Point renames STM32.Device.PJ15;
PLLSAIN : constant := 417;
PLLSAIR : constant := 5;
PLLSAI_DIVR : constant := 2;
PLL_N_Div : constant := 100;
PLL_IN_Div : constant STM32.DSI.DSI_PLL_IDF := STM32.DSI.PLL_IN_DIV5;
PLL_OUT_Div : constant STM32.DSI.DSI_PLL_ODF := STM32.DSI.PLL_OUT_DIV1;
type Frame_Buffer is limited new Framebuffer_DSI.Frame_Buffer
with null record;
end Framebuffer_OTM8009A;
|
stcarrez/ada-awa | Ada | 1,065 | ads | -----------------------------------------------------------------------
-- awa -- Ada Web Application
-- Copyright (C) 2009 - 2020 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- = AWA Core ==
--
-- @include awa-applications.ads
-- @include awa-modules.ads
-- @include awa-permissions.ads
-- @include awa-events.ads
-- @include awa-commands.ads
package AWA is
pragma Pure;
end AWA;
|
reznikmm/matreshka | Ada | 5,889 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Connectable_Element_Template_Parameters.Collections is
pragma Preelaborate;
package UML_Connectable_Element_Template_Parameter_Collections is
new AMF.Generic_Collections
(UML_Connectable_Element_Template_Parameter,
UML_Connectable_Element_Template_Parameter_Access);
type Set_Of_UML_Connectable_Element_Template_Parameter is
new UML_Connectable_Element_Template_Parameter_Collections.Set with null record;
Empty_Set_Of_UML_Connectable_Element_Template_Parameter : constant Set_Of_UML_Connectable_Element_Template_Parameter;
type Ordered_Set_Of_UML_Connectable_Element_Template_Parameter is
new UML_Connectable_Element_Template_Parameter_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Connectable_Element_Template_Parameter : constant Ordered_Set_Of_UML_Connectable_Element_Template_Parameter;
type Bag_Of_UML_Connectable_Element_Template_Parameter is
new UML_Connectable_Element_Template_Parameter_Collections.Bag with null record;
Empty_Bag_Of_UML_Connectable_Element_Template_Parameter : constant Bag_Of_UML_Connectable_Element_Template_Parameter;
type Sequence_Of_UML_Connectable_Element_Template_Parameter is
new UML_Connectable_Element_Template_Parameter_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Connectable_Element_Template_Parameter : constant Sequence_Of_UML_Connectable_Element_Template_Parameter;
private
Empty_Set_Of_UML_Connectable_Element_Template_Parameter : constant Set_Of_UML_Connectable_Element_Template_Parameter
:= (UML_Connectable_Element_Template_Parameter_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Connectable_Element_Template_Parameter : constant Ordered_Set_Of_UML_Connectable_Element_Template_Parameter
:= (UML_Connectable_Element_Template_Parameter_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Connectable_Element_Template_Parameter : constant Bag_Of_UML_Connectable_Element_Template_Parameter
:= (UML_Connectable_Element_Template_Parameter_Collections.Bag with null record);
Empty_Sequence_Of_UML_Connectable_Element_Template_Parameter : constant Sequence_Of_UML_Connectable_Element_Template_Parameter
:= (UML_Connectable_Element_Template_Parameter_Collections.Sequence with null record);
end AMF.UML.Connectable_Element_Template_Parameters.Collections;
|
AdaCore/Ada_Drivers_Library | Ada | 3,694 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- This package provides routines for drawing shapes, characters, and strings
-- on a bit-mapped device or graphical buffer.
with BMP_Fonts; use BMP_Fonts;
with Hershey_Fonts; use Hershey_Fonts;
with HAL; use HAL;
with HAL.Bitmap; use HAL.Bitmap;
package Bitmapped_Drawing is
procedure Draw_Char
(Buffer : in out Bitmap_Buffer'Class;
Start : Point;
Char : Character;
Font : BMP_Font;
Foreground : UInt32;
Background : UInt32);
procedure Draw_String
(Buffer : in out Bitmap_Buffer'Class;
Start : Point;
Msg : String;
Font : BMP_Font;
Foreground : Bitmap_Color;
Background : Bitmap_Color);
procedure Draw_String
(Buffer : in out Bitmap_Buffer'Class;
Start : Point;
Msg : String;
Font : Hershey_Font;
Height : Natural;
Bold : Boolean;
Foreground : Bitmap_Color;
Fast : Boolean := True);
procedure Draw_String
(Buffer : in out Bitmap_Buffer'Class;
Area : Rect;
Msg : String;
Font : Hershey_Font;
Bold : Boolean;
Outline : Boolean;
Foreground : Bitmap_Color;
Fast : Boolean := True);
end Bitmapped_Drawing;
|
zhmu/ananas | Ada | 944 | adb | -- { dg-do compile }
procedure Unchecked_Union2 is
type small_array is array (0 .. 2) of Integer;
type big_array is array (0 .. 3) of Integer;
type small_record is record
field1 : aliased Integer := 0;
field2 : aliased small_array := (0, 0, 0);
end record;
type big_record is record
field1 : aliased Integer := 0;
field2 : aliased big_array := (0, 0, 0, 0);
end record;
type myUnion (discr : Integer := 0) is record
case discr is
when 0 =>
record1 : aliased small_record;
when others =>
record2 : aliased big_record;
end case;
end record;
type UU_myUnion3 (discr : Integer := 0) is new myUnion (discr); -- Test
pragma Unchecked_Union (UU_myUnion3);
pragma Convention (C, UU_myUnion3);
procedure Convert (A : in UU_myUnion3; B : out UU_myUnion3);
pragma Import (C, Convert);
begin
null;
end Unchecked_Union2;
|
euripedesrocha/plugtrain | Ada | 302 | adb | with Interfaces.ATSAM4L.GPIO; use Interfaces.ATSAM4L.GPIO;
procedure Main is
type int is range 0 .. 50;
counter : int := 0;
begin
GPIO_Periph.GPER2.Arr (7) := 1;
GPIO_Periph.ODER2.Arr (7) := 1;
GPIO_Periph.OVR2.Arr (7) := 1;
loop
counter := counter + 1;
end loop;
end Main;
|
reznikmm/matreshka | Ada | 4,791 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings;
with Matreshka.DOM_Nodes;
with XML.DOM.Notations;
with XML.DOM.Visitors;
package Matreshka.DOM_Notations is
pragma Preelaborate;
type Notation_Node is new Matreshka.DOM_Nodes.Node
and XML.DOM.Notations.DOM_Notation with null record;
overriding procedure Enter_Node
(Self : not null access Notation_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding function Get_Node_Name
(Self : not null access constant Notation_Node)
return League.Strings.Universal_String;
overriding function Get_Node_Type
(Self : not null access constant Notation_Node)
return XML.DOM.Node_Type;
overriding procedure Leave_Node
(Self : not null access Notation_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Node
(Self : not null access Notation_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end Matreshka.DOM_Notations;
|
ohenley/awt | Ada | 1,350 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Strings.Unbounded;
with AWT.Inputs;
package AWT.Clipboard is
package SU renames Ada.Strings.Unbounded;
procedure Set (Value : String)
with Pre => AWT.Inputs.Keyboard_Has_Focus;
-- Write the given string to the clipboard
type Receive_Callback is access protected procedure (Value : SU.Unbounded_String);
procedure Get (Callback : not null Receive_Callback);
-- Asynchronously read the content from the clipboard
--
-- This procedure returns immediately and the callback will be called
-- before or after this procedure has returned.
function Get return String;
-- Read and return the content from the clipboard
end AWT.Clipboard;
|
Fabien-Chouteau/GESTE | Ada | 78,505 | ads | package GESTE_Fonts.FreeMonoBold18pt7b is
Font : constant Bitmap_Font_Ref;
private
FreeMonoBold18pt7bBitmaps : aliased constant Font_Bitmap := (
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#01#,
16#F0#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#1F#, 16#00#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#7C#,
16#00#, 16#00#, 16#F8#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#03#, 16#E0#,
16#00#, 16#03#, 16#C0#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#,
16#0F#, 16#80#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#0F#, 16#1E#, 16#00#, 16#1E#, 16#3C#, 16#00#, 16#3C#, 16#78#,
16#00#, 16#78#, 16#F0#, 16#00#, 16#F1#, 16#E0#, 16#00#, 16#E1#, 16#C0#,
16#01#, 16#83#, 16#00#, 16#03#, 16#06#, 16#00#, 16#06#, 16#0C#, 16#00#,
16#0C#, 16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#E3#, 16#80#,
16#01#, 16#C7#, 16#00#, 16#07#, 16#8E#, 16#00#, 16#0F#, 16#3C#, 16#00#,
16#1E#, 16#78#, 16#00#, 16#3C#, 16#F0#, 16#00#, 16#79#, 16#E0#, 16#07#,
16#FF#, 16#F0#, 16#0F#, 16#FF#, 16#F0#, 16#1F#, 16#FF#, 16#E0#, 16#3F#,
16#FF#, 16#80#, 16#0E#, 16#38#, 16#00#, 16#1C#, 16#70#, 16#00#, 16#38#,
16#E0#, 16#03#, 16#FF#, 16#F8#, 16#0F#, 16#FF#, 16#F0#, 16#1F#, 16#FF#,
16#E0#, 16#1F#, 16#FF#, 16#C0#, 16#0F#, 16#3C#, 16#00#, 16#1E#, 16#78#,
16#00#, 16#3C#, 16#F0#, 16#00#, 16#79#, 16#E0#, 16#00#, 16#F3#, 16#C0#,
16#01#, 16#E7#, 16#80#, 16#03#, 16#8E#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#0F#,
16#FE#, 16#00#, 16#3F#, 16#FC#, 16#00#, 16#FF#, 16#F8#, 16#01#, 16#F0#,
16#F0#, 16#03#, 16#C0#, 16#E0#, 16#07#, 16#01#, 16#C0#, 16#0F#, 16#E0#,
16#00#, 16#1F#, 16#FC#, 16#00#, 16#1F#, 16#FC#, 16#00#, 16#0F#, 16#FC#,
16#00#, 16#01#, 16#FC#, 16#03#, 16#80#, 16#78#, 16#07#, 16#00#, 16#F0#,
16#0F#, 16#01#, 16#E0#, 16#1F#, 16#07#, 16#C0#, 16#3F#, 16#FF#, 16#00#,
16#7F#, 16#FC#, 16#00#, 16#FF#, 16#F0#, 16#00#, 16#07#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#80#,
16#00#, 16#3F#, 16#C0#, 16#00#, 16#61#, 16#80#, 16#01#, 16#C3#, 16#80#,
16#03#, 16#03#, 16#00#, 16#07#, 16#0E#, 16#00#, 16#06#, 16#18#, 16#00#,
16#0F#, 16#F0#, 16#C0#, 16#07#, 16#8F#, 16#80#, 16#00#, 16#FE#, 16#00#,
16#0F#, 16#E0#, 16#00#, 16#FE#, 16#00#, 16#03#, 16#E3#, 16#C0#, 16#06#,
16#1F#, 16#E0#, 16#00#, 16#71#, 16#C0#, 16#00#, 16#E1#, 16#C0#, 16#01#,
16#83#, 16#80#, 16#03#, 16#87#, 16#00#, 16#07#, 16#1C#, 16#00#, 16#07#,
16#F8#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#03#, 16#D0#, 16#00#, 16#0F#, 16#F0#, 16#00#,
16#3F#, 16#E0#, 16#00#, 16#FF#, 16#C0#, 16#01#, 16#E7#, 16#00#, 16#03#,
16#80#, 16#00#, 16#07#, 16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#FE#, 16#00#, 16#03#, 16#FE#,
16#F0#, 16#07#, 16#BF#, 16#F0#, 16#0E#, 16#3F#, 16#C0#, 16#1C#, 16#3F#,
16#00#, 16#3C#, 16#3E#, 16#00#, 16#7F#, 16#FE#, 16#00#, 16#FF#, 16#FE#,
16#00#, 16#FF#, 16#FC#, 16#00#, 16#7E#, 16#F0#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#03#,
16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#,
16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#00#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#78#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#03#, 16#C0#,
16#00#, 16#07#, 16#80#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#,
16#00#, 16#78#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#,
16#07#, 16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#3C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#78#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#07#, 16#80#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#3E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#00#,
16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#,
16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#,
16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#,
16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#07#, 16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#,
16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#03#, 16#C0#, 16#00#,
16#0F#, 16#80#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#20#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#87#,
16#08#, 16#03#, 16#EE#, 16#F8#, 16#07#, 16#FF#, 16#F0#, 16#07#, 16#FF#,
16#C0#, 16#03#, 16#FE#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#07#, 16#F0#,
16#00#, 16#1E#, 16#F0#, 16#00#, 16#78#, 16#F0#, 16#00#, 16#F1#, 16#E0#,
16#00#, 16#C1#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#80#,
16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#FF#, 16#FF#, 16#83#, 16#FF#, 16#FF#, 16#03#, 16#FF#, 16#FE#, 16#07#,
16#FF#, 16#FC#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#,
16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C0#,
16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#83#, 16#FF#, 16#FF#,
16#03#, 16#FF#, 16#FE#, 16#07#, 16#FF#, 16#FC#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#70#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#,
16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#07#, 16#80#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#78#, 16#00#, 16#01#,
16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#03#, 16#C0#,
16#00#, 16#07#, 16#80#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#80#, 16#00#,
16#0F#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#03#,
16#FE#, 16#00#, 16#0F#, 16#FE#, 16#00#, 16#3F#, 16#FE#, 16#00#, 16#7C#,
16#7C#, 16#00#, 16#F0#, 16#78#, 16#03#, 16#C0#, 16#78#, 16#07#, 16#80#,
16#F0#, 16#0E#, 16#00#, 16#E0#, 16#1C#, 16#01#, 16#C0#, 16#38#, 16#03#,
16#80#, 16#70#, 16#07#, 16#00#, 16#E0#, 16#0E#, 16#01#, 16#C0#, 16#1C#,
16#03#, 16#80#, 16#38#, 16#07#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#E0#,
16#0F#, 16#07#, 16#80#, 16#1F#, 16#1F#, 16#00#, 16#3F#, 16#FE#, 16#00#,
16#3F#, 16#F8#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#1F#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#F0#, 16#00#, 16#07#, 16#E0#, 16#00#, 16#1F#, 16#C0#,
16#00#, 16#7F#, 16#80#, 16#01#, 16#F7#, 16#00#, 16#03#, 16#8E#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#,
16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#7F#,
16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#, 16#03#, 16#FF#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FC#, 16#00#, 16#07#, 16#FE#, 16#00#, 16#1F#, 16#FE#, 16#00#,
16#7F#, 16#FE#, 16#00#, 16#F8#, 16#7C#, 16#01#, 16#C0#, 16#78#, 16#03#,
16#80#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#,
16#07#, 16#80#, 16#00#, 16#1F#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#01#,
16#F0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#1F#, 16#00#, 16#00#, 16#78#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#3E#, 16#07#,
16#00#, 16#FF#, 16#FF#, 16#01#, 16#FF#, 16#FE#, 16#03#, 16#FF#, 16#FC#,
16#07#, 16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#FC#, 16#00#, 16#07#, 16#FE#, 16#00#, 16#1F#,
16#FE#, 16#00#, 16#7F#, 16#FE#, 16#00#, 16#70#, 16#3C#, 16#00#, 16#00#,
16#3C#, 16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#FF#, 16#80#, 16#01#, 16#FC#, 16#00#, 16#03#, 16#F8#,
16#00#, 16#07#, 16#FC#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#00#, 16#78#,
16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#C0#,
16#38#, 16#0F#, 16#80#, 16#FF#, 16#FF#, 16#00#, 16#FF#, 16#FC#, 16#01#,
16#FF#, 16#F0#, 16#00#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#FC#, 16#00#, 16#03#, 16#F8#,
16#00#, 16#07#, 16#F0#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#7B#, 16#C0#,
16#00#, 16#E7#, 16#80#, 16#03#, 16#CF#, 16#00#, 16#0F#, 16#1E#, 16#00#,
16#1C#, 16#3C#, 16#00#, 16#78#, 16#78#, 16#01#, 16#E0#, 16#F0#, 16#03#,
16#FF#, 16#F0#, 16#07#, 16#FF#, 16#F0#, 16#0F#, 16#FF#, 16#E0#, 16#1F#,
16#FF#, 16#80#, 16#00#, 16#1E#, 16#00#, 16#01#, 16#FE#, 16#00#, 16#03#,
16#FE#, 16#00#, 16#07#, 16#FC#, 16#00#, 16#0F#, 16#F0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#0F#, 16#FF#, 16#80#, 16#1F#, 16#FF#, 16#00#, 16#3F#, 16#FE#, 16#00#,
16#7F#, 16#F8#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#07#, 16#FE#, 16#00#, 16#0F#, 16#FF#, 16#00#, 16#1F#,
16#FF#, 16#00#, 16#3F#, 16#FE#, 16#00#, 16#38#, 16#3E#, 16#00#, 16#00#,
16#3C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#78#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#03#, 16#C0#, 16#78#, 16#0F#, 16#80#, 16#FF#, 16#FE#,
16#00#, 16#FF#, 16#FC#, 16#00#, 16#FF#, 16#F0#, 16#00#, 16#7F#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#C0#, 16#00#, 16#3F#, 16#E0#, 16#01#, 16#FF#, 16#C0#, 16#07#,
16#FF#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#F8#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#07#, 16#80#, 16#00#, 16#0F#, 16#3E#,
16#00#, 16#1E#, 16#FE#, 16#00#, 16#3B#, 16#FE#, 16#00#, 16#7F#, 16#FE#,
16#00#, 16#FC#, 16#3C#, 16#01#, 16#E0#, 16#3C#, 16#03#, 16#C0#, 16#78#,
16#07#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#E0#, 16#0F#, 16#07#, 16#80#,
16#1F#, 16#FF#, 16#00#, 16#1F#, 16#FC#, 16#00#, 16#1F#, 16#F0#, 16#00#,
16#0F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#FF#, 16#C0#, 16#3F#, 16#FF#,
16#80#, 16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#C0#, 16#3C#,
16#00#, 16#00#, 16#70#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#,
16#00#, 16#07#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#,
16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#,
16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#03#, 16#FE#, 16#00#,
16#0F#, 16#FE#, 16#00#, 16#3F#, 16#FE#, 16#00#, 16#78#, 16#3C#, 16#01#,
16#E0#, 16#3C#, 16#03#, 16#C0#, 16#78#, 16#07#, 16#80#, 16#F0#, 16#0F#,
16#01#, 16#C0#, 16#0F#, 16#07#, 16#80#, 16#0F#, 16#FE#, 16#00#, 16#0F#,
16#F8#, 16#00#, 16#3F#, 16#F8#, 16#00#, 16#FF#, 16#F8#, 16#03#, 16#E0#,
16#F8#, 16#07#, 16#80#, 16#F0#, 16#0E#, 16#00#, 16#E0#, 16#1E#, 16#03#,
16#C0#, 16#3E#, 16#0F#, 16#80#, 16#3F#, 16#FE#, 16#00#, 16#7F#, 16#FC#,
16#00#, 16#7F#, 16#F0#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#03#,
16#FF#, 16#00#, 16#0F#, 16#FF#, 16#00#, 16#1F#, 16#FE#, 16#00#, 16#7C#,
16#3E#, 16#00#, 16#F0#, 16#3C#, 16#01#, 16#E0#, 16#38#, 16#03#, 16#80#,
16#78#, 16#07#, 16#80#, 16#F0#, 16#0F#, 16#03#, 16#E0#, 16#1F#, 16#0F#,
16#C0#, 16#1F#, 16#FF#, 16#80#, 16#1F#, 16#FF#, 16#00#, 16#1F#, 16#DE#,
16#00#, 16#1F#, 16#38#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#03#, 16#E0#,
16#00#, 16#0F#, 16#80#, 16#00#, 16#7E#, 16#00#, 16#3F#, 16#FC#, 16#00#,
16#7F#, 16#E0#, 16#00#, 16#FF#, 16#80#, 16#00#, 16#FC#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#00#, 16#F8#, 16#00#,
16#01#, 16#F0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#03#,
16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#0E#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#01#,
16#F0#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#E0#,
16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#,
16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#03#, 16#80#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#04#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#0F#,
16#E0#, 16#00#, 16#7F#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#1F#, 16#C0#,
16#00#, 16#FE#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#01#, 16#FC#, 16#00#,
16#00#, 16#FE#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#00#, 16#3F#, 16#80#,
16#00#, 16#1F#, 16#C0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#07#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#FF#, 16#F0#, 16#7F#, 16#FF#, 16#E0#, 16#7F#, 16#FF#, 16#C0#,
16#FF#, 16#FF#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#FF#, 16#FC#, 16#1F#, 16#FF#, 16#F8#, 16#1F#, 16#FF#, 16#F0#, 16#3F#,
16#FF#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#80#, 16#00#, 16#0F#,
16#C0#, 16#00#, 16#0F#, 16#E0#, 16#00#, 16#07#, 16#F0#, 16#00#, 16#03#,
16#F8#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#00#, 16#FE#, 16#00#, 16#00#,
16#FE#, 16#00#, 16#07#, 16#F0#, 16#00#, 16#3F#, 16#80#, 16#01#, 16#FC#,
16#00#, 16#0F#, 16#E0#, 16#00#, 16#7F#, 16#00#, 16#00#, 16#F8#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#1F#,
16#FC#, 16#00#, 16#7F#, 16#FC#, 16#00#, 16#FF#, 16#F8#, 16#01#, 16#E0#,
16#F8#, 16#03#, 16#80#, 16#F0#, 16#07#, 16#00#, 16#E0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#7E#, 16#00#, 16#03#, 16#F8#,
16#00#, 16#07#, 16#C0#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#03#, 16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#, 16#80#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#07#, 16#FC#,
16#00#, 16#1F#, 16#FC#, 16#00#, 16#7C#, 16#78#, 16#00#, 16#E0#, 16#38#,
16#03#, 16#C0#, 16#70#, 16#07#, 16#00#, 16#E0#, 16#0E#, 16#01#, 16#C0#,
16#1C#, 16#0F#, 16#80#, 16#30#, 16#7F#, 16#00#, 16#61#, 16#FE#, 16#00#,
16#C7#, 16#9C#, 16#01#, 16#8E#, 16#38#, 16#03#, 16#18#, 16#70#, 16#06#,
16#38#, 16#E0#, 16#0C#, 16#71#, 16#C0#, 16#18#, 16#FF#, 16#80#, 16#30#,
16#FF#, 16#80#, 16#70#, 16#7E#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#40#, 16#07#, 16#C3#,
16#C0#, 16#07#, 16#FF#, 16#80#, 16#07#, 16#FE#, 16#00#, 16#03#, 16#F0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#3F#, 16#F0#, 16#00#, 16#FF#, 16#E0#, 16#00#, 16#FF#, 16#C0#, 16#01#,
16#FF#, 16#C0#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#F7#, 16#80#, 16#01#,
16#EF#, 16#00#, 16#03#, 16#9E#, 16#00#, 16#0F#, 16#1E#, 16#00#, 16#1E#,
16#3C#, 16#00#, 16#78#, 16#3C#, 16#00#, 16#F0#, 16#78#, 16#03#, 16#FF#,
16#F8#, 16#07#, 16#FF#, 16#F0#, 16#0F#, 16#FF#, 16#E0#, 16#3F#, 16#FF#,
16#E0#, 16#78#, 16#03#, 16#C3#, 16#FC#, 16#1F#, 16#E7#, 16#F8#, 16#7F#,
16#EF#, 16#F8#, 16#FF#, 16#DF#, 16#E0#, 16#FF#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#FF#, 16#FC#, 16#03#, 16#FF#, 16#FC#, 16#07#, 16#FF#,
16#FC#, 16#07#, 16#FF#, 16#FC#, 16#03#, 16#C0#, 16#78#, 16#07#, 16#80#,
16#70#, 16#0F#, 16#00#, 16#E0#, 16#1E#, 16#07#, 16#C0#, 16#3F#, 16#FF#,
16#00#, 16#7F#, 16#FC#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FE#,
16#03#, 16#C0#, 16#7C#, 16#07#, 16#80#, 16#3C#, 16#0F#, 16#00#, 16#78#,
16#1E#, 16#00#, 16#F0#, 16#3C#, 16#01#, 16#E1#, 16#FF#, 16#FF#, 16#87#,
16#FF#, 16#FF#, 16#0F#, 16#FF#, 16#FC#, 16#0F#, 16#FF#, 16#E0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#F9#, 16#C0#, 16#1F#, 16#FF#,
16#80#, 16#7F#, 16#FF#, 16#01#, 16#FF#, 16#FE#, 16#03#, 16#E0#, 16#7C#,
16#0F#, 16#80#, 16#78#, 16#1E#, 16#00#, 16#70#, 16#78#, 16#00#, 16#E0#,
16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#,
16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#1C#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#60#, 16#7E#, 16#03#, 16#E0#, 16#7F#,
16#FF#, 16#C0#, 16#7F#, 16#FF#, 16#00#, 16#3F#, 16#FC#, 16#00#, 16#1F#,
16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#F0#, 16#03#,
16#FF#, 16#F8#, 16#07#, 16#FF#, 16#F8#, 16#07#, 16#FF#, 16#F8#, 16#03#,
16#81#, 16#F8#, 16#07#, 16#00#, 16#F0#, 16#0E#, 16#00#, 16#F0#, 16#1C#,
16#01#, 16#E0#, 16#38#, 16#01#, 16#C0#, 16#70#, 16#03#, 16#80#, 16#E0#,
16#07#, 16#01#, 16#C0#, 16#0E#, 16#03#, 16#80#, 16#1C#, 16#07#, 16#00#,
16#78#, 16#0E#, 16#00#, 16#F0#, 16#1C#, 16#03#, 16#E0#, 16#38#, 16#0F#,
16#81#, 16#FF#, 16#FF#, 16#07#, 16#FF#, 16#FC#, 16#0F#, 16#FF#, 16#E0#,
16#0F#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#,
16#FF#, 16#83#, 16#FF#, 16#FF#, 16#07#, 16#FF#, 16#FE#, 16#07#, 16#FF#,
16#FC#, 16#03#, 16#C0#, 16#38#, 16#07#, 16#80#, 16#70#, 16#0F#, 16#1C#,
16#E0#, 16#1E#, 16#38#, 16#C0#, 16#3F#, 16#F0#, 16#00#, 16#7F#, 16#E0#,
16#00#, 16#FF#, 16#C0#, 16#01#, 16#FF#, 16#80#, 16#03#, 16#C7#, 16#00#,
16#07#, 16#8E#, 16#38#, 16#0F#, 16#1C#, 16#70#, 16#1E#, 16#00#, 16#E0#,
16#3C#, 16#01#, 16#C1#, 16#FF#, 16#FF#, 16#87#, 16#FF#, 16#FF#, 16#0F#,
16#FF#, 16#FE#, 16#0F#, 16#FF#, 16#FC#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FF#, 16#FF#, 16#C3#, 16#FF#, 16#FF#, 16#87#, 16#FF#, 16#FF#,
16#07#, 16#FF#, 16#FE#, 16#03#, 16#C0#, 16#1C#, 16#07#, 16#8E#, 16#38#,
16#0F#, 16#1C#, 16#70#, 16#1E#, 16#38#, 16#E0#, 16#3F#, 16#F0#, 16#00#,
16#7F#, 16#E0#, 16#00#, 16#FF#, 16#C0#, 16#01#, 16#FF#, 16#80#, 16#03#,
16#C7#, 16#00#, 16#07#, 16#8E#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#01#, 16#FF#, 16#C0#, 16#07#, 16#FF#,
16#C0#, 16#0F#, 16#FF#, 16#80#, 16#0F#, 16#FE#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#F8#, 16#C0#, 16#0F#, 16#FF#, 16#80#,
16#7F#, 16#FF#, 16#01#, 16#FF#, 16#FE#, 16#03#, 16#E0#, 16#7C#, 16#0F#,
16#80#, 16#38#, 16#1E#, 16#00#, 16#70#, 16#78#, 16#00#, 16#00#, 16#F0#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#, 16#83#,
16#FF#, 16#0F#, 16#07#, 16#FF#, 16#1E#, 16#0F#, 16#FE#, 16#3C#, 16#0F#,
16#F8#, 16#3C#, 16#00#, 16#E0#, 16#7E#, 16#01#, 16#C0#, 16#7F#, 16#FF#,
16#80#, 16#7F#, 16#FF#, 16#00#, 16#7F#, 16#FC#, 16#00#, 16#1F#, 16#C0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#1F#, 16#C0#, 16#FF#,
16#7F#, 16#C1#, 16#FE#, 16#7F#, 16#83#, 16#F8#, 16#FE#, 16#03#, 16#C0#,
16#78#, 16#07#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#E0#, 16#1E#, 16#03#,
16#C0#, 16#3C#, 16#07#, 16#80#, 16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#,
16#01#, 16#FF#, 16#FC#, 16#03#, 16#FF#, 16#F8#, 16#07#, 16#80#, 16#F0#,
16#0F#, 16#01#, 16#E0#, 16#1E#, 16#03#, 16#C0#, 16#3C#, 16#07#, 16#81#,
16#FE#, 16#3F#, 16#C3#, 16#FE#, 16#7F#, 16#87#, 16#FC#, 16#FF#, 16#0F#,
16#F1#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#FF#,
16#80#, 16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#,
16#FC#, 16#03#, 16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#FF#, 16#F0#, 16#07#, 16#FF#, 16#E0#, 16#0F#, 16#FF#, 16#C0#,
16#0F#, 16#FF#, 16#80#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#1C#, 16#03#, 16#80#, 16#38#, 16#07#, 16#00#,
16#70#, 16#0E#, 16#00#, 16#E0#, 16#1C#, 16#01#, 16#C0#, 16#38#, 16#07#,
16#80#, 16#7C#, 16#1F#, 16#00#, 16#FF#, 16#FC#, 16#01#, 16#FF#, 16#F8#,
16#01#, 16#FF#, 16#C0#, 16#00#, 16#7F#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#FF#, 16#8F#, 16#C3#, 16#FF#, 16#3F#, 16#C7#, 16#FE#,
16#7F#, 16#87#, 16#FC#, 16#FF#, 16#03#, 16#C1#, 16#F0#, 16#07#, 16#87#,
16#C0#, 16#0F#, 16#1F#, 16#00#, 16#1E#, 16#7C#, 16#00#, 16#3F#, 16#F0#,
16#00#, 16#7F#, 16#C0#, 16#00#, 16#FF#, 16#E0#, 16#01#, 16#FF#, 16#C0#,
16#03#, 16#E7#, 16#C0#, 16#07#, 16#87#, 16#C0#, 16#0F#, 16#07#, 16#80#,
16#1E#, 16#07#, 16#80#, 16#3C#, 16#0F#, 16#01#, 16#FF#, 16#0F#, 16#C7#,
16#FE#, 16#1F#, 16#CF#, 16#FC#, 16#3F#, 16#8F#, 16#F8#, 16#3E#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#F0#, 16#01#, 16#FF#, 16#E0#,
16#03#, 16#FF#, 16#C0#, 16#03#, 16#FF#, 16#80#, 16#00#, 16#F0#, 16#00#,
16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#, 16#80#, 16#00#,
16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#,
16#78#, 16#00#, 16#00#, 16#F0#, 16#0C#, 16#01#, 16#E0#, 16#1C#, 16#03#,
16#C0#, 16#78#, 16#07#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#E0#, 16#FF#,
16#FF#, 16#C3#, 16#FF#, 16#FF#, 16#87#, 16#FF#, 16#FF#, 16#07#, 16#FF#,
16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#F8#, 16#03#, 16#F3#,
16#F0#, 16#07#, 16#E7#, 16#F0#, 16#1F#, 16#CF#, 16#E0#, 16#3F#, 16#8F#,
16#E0#, 16#FE#, 16#1F#, 16#C1#, 16#FC#, 16#3F#, 16#C7#, 16#F8#, 16#7F#,
16#8F#, 16#F0#, 16#F7#, 16#9F#, 16#E1#, 16#EF#, 16#7B#, 16#C3#, 16#CF#,
16#F7#, 16#87#, 16#9F#, 16#CF#, 16#0F#, 16#1F#, 16#9E#, 16#1E#, 16#3E#,
16#3C#, 16#3C#, 16#3C#, 16#78#, 16#78#, 16#70#, 16#F0#, 16#F0#, 16#01#,
16#E3#, 16#FC#, 16#1F#, 16#E7#, 16#F8#, 16#3F#, 16#EF#, 16#F0#, 16#7F#,
16#DF#, 16#E0#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#F8#,
16#1F#, 16#E3#, 16#F8#, 16#3F#, 16#E7#, 16#F8#, 16#7F#, 16#CF#, 16#F0#,
16#FF#, 16#03#, 16#F0#, 16#3C#, 16#07#, 16#F0#, 16#78#, 16#0F#, 16#E0#,
16#F0#, 16#1F#, 16#E1#, 16#E0#, 16#3B#, 16#E3#, 16#C0#, 16#73#, 16#C7#,
16#80#, 16#E7#, 16#CF#, 16#01#, 16#C7#, 16#DE#, 16#03#, 16#87#, 16#BC#,
16#07#, 16#0F#, 16#F8#, 16#0E#, 16#0F#, 16#F0#, 16#1C#, 16#0F#, 16#E0#,
16#38#, 16#1F#, 16#C1#, 16#FE#, 16#1F#, 16#87#, 16#FE#, 16#1F#, 16#0F#,
16#FC#, 16#3E#, 16#0F#, 16#F0#, 16#3C#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#03#, 16#F0#, 16#00#, 16#1F#, 16#F8#, 16#00#, 16#7F#, 16#FC#,
16#01#, 16#FF#, 16#FC#, 16#07#, 16#E0#, 16#FC#, 16#0F#, 16#80#, 16#F8#,
16#3E#, 16#00#, 16#F8#, 16#78#, 16#00#, 16#F0#, 16#F0#, 16#01#, 16#E1#,
16#C0#, 16#01#, 16#C3#, 16#80#, 16#03#, 16#87#, 16#00#, 16#07#, 16#0E#,
16#00#, 16#1E#, 16#1E#, 16#00#, 16#3C#, 16#3E#, 16#00#, 16#F8#, 16#3C#,
16#03#, 16#E0#, 16#7E#, 16#0F#, 16#C0#, 16#7F#, 16#FF#, 16#00#, 16#7F#,
16#FC#, 16#00#, 16#7F#, 16#F0#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#FF#, 16#F8#, 16#03#, 16#FF#, 16#FC#, 16#07#,
16#FF#, 16#FC#, 16#07#, 16#FF#, 16#FC#, 16#03#, 16#C0#, 16#F8#, 16#07#,
16#80#, 16#F0#, 16#0F#, 16#00#, 16#E0#, 16#1E#, 16#01#, 16#E0#, 16#3C#,
16#07#, 16#80#, 16#78#, 16#1F#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#,
16#F8#, 16#03#, 16#FF#, 16#E0#, 16#07#, 16#FF#, 16#00#, 16#0F#, 16#00#,
16#00#, 16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#01#, 16#FF#, 16#C0#,
16#07#, 16#FF#, 16#C0#, 16#0F#, 16#FF#, 16#80#, 16#0F#, 16#FE#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#1F#,
16#FC#, 16#00#, 16#7F#, 16#FC#, 16#01#, 16#FF#, 16#FC#, 16#07#, 16#E0#,
16#FC#, 16#0F#, 16#00#, 16#F8#, 16#3E#, 16#00#, 16#F8#, 16#78#, 16#00#,
16#F0#, 16#F0#, 16#01#, 16#E1#, 16#C0#, 16#01#, 16#C3#, 16#80#, 16#03#,
16#87#, 16#00#, 16#07#, 16#0E#, 16#00#, 16#1E#, 16#1E#, 16#00#, 16#3C#,
16#3E#, 16#00#, 16#F8#, 16#3C#, 16#03#, 16#E0#, 16#7E#, 16#0F#, 16#80#,
16#7F#, 16#FF#, 16#00#, 16#7F#, 16#FC#, 16#00#, 16#7F#, 16#F0#, 16#00#,
16#3F#, 16#00#, 16#00#, 16#FF#, 16#1C#, 16#03#, 16#FF#, 16#F8#, 16#0F#,
16#FF#, 16#F0#, 16#1F#, 16#FF#, 16#C0#, 16#1C#, 16#1F#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#F0#,
16#03#, 16#FF#, 16#F8#, 16#07#, 16#FF#, 16#F8#, 16#07#, 16#FF#, 16#F8#,
16#03#, 16#80#, 16#F8#, 16#07#, 16#00#, 16#F0#, 16#0E#, 16#01#, 16#E0#,
16#1C#, 16#03#, 16#C0#, 16#38#, 16#1F#, 16#00#, 16#7F#, 16#FE#, 16#00#,
16#FF#, 16#F8#, 16#01#, 16#FF#, 16#E0#, 16#03#, 16#FF#, 16#C0#, 16#07#,
16#07#, 16#C0#, 16#0E#, 16#07#, 16#C0#, 16#1C#, 16#07#, 16#C0#, 16#38#,
16#0F#, 16#81#, 16#FE#, 16#0F#, 16#E7#, 16#FE#, 16#0F#, 16#CF#, 16#FC#,
16#1F#, 16#8F#, 16#F0#, 16#1F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#F3#, 16#80#, 16#1F#, 16#FF#, 16#00#, 16#7F#, 16#FE#, 16#00#,
16#FF#, 16#FC#, 16#03#, 16#E0#, 16#F8#, 16#07#, 16#80#, 16#70#, 16#0F#,
16#00#, 16#E0#, 16#1E#, 16#00#, 16#00#, 16#3F#, 16#C0#, 16#00#, 16#3F#,
16#F8#, 16#00#, 16#3F#, 16#FC#, 16#00#, 16#3F#, 16#FC#, 16#00#, 16#07#,
16#F8#, 16#06#, 16#00#, 16#F8#, 16#1E#, 16#00#, 16#F0#, 16#3C#, 16#01#,
16#E0#, 16#7E#, 16#0F#, 16#80#, 16#FF#, 16#FF#, 16#01#, 16#FF#, 16#FC#,
16#01#, 16#BF#, 16#F0#, 16#00#, 16#1F#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#FF#, 16#FF#, 16#E1#, 16#FF#, 16#FF#, 16#C3#, 16#FF#,
16#FF#, 16#87#, 16#FF#, 16#FF#, 16#0F#, 16#0E#, 16#1E#, 16#1E#, 16#1C#,
16#3C#, 16#3C#, 16#38#, 16#78#, 16#38#, 16#70#, 16#E0#, 16#70#, 16#E1#,
16#C0#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#1F#, 16#FC#, 16#00#,
16#7F#, 16#FC#, 16#00#, 16#FF#, 16#F8#, 16#00#, 16#FF#, 16#E0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#1F#, 16#E3#, 16#FE#, 16#7F#,
16#E7#, 16#FC#, 16#7F#, 16#C7#, 16#F8#, 16#FF#, 16#07#, 16#80#, 16#3C#,
16#0F#, 16#00#, 16#78#, 16#1E#, 16#00#, 16#F0#, 16#3C#, 16#01#, 16#E0#,
16#78#, 16#03#, 16#C0#, 16#F0#, 16#07#, 16#81#, 16#E0#, 16#0F#, 16#03#,
16#C0#, 16#1E#, 16#07#, 16#80#, 16#3C#, 16#0F#, 16#00#, 16#78#, 16#0E#,
16#00#, 16#E0#, 16#1E#, 16#03#, 16#C0#, 16#3E#, 16#0F#, 16#80#, 16#3F#,
16#FE#, 16#00#, 16#7F#, 16#FC#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#1F#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FE#, 16#0F#, 16#F3#,
16#FE#, 16#1F#, 16#F7#, 16#FC#, 16#3F#, 16#EF#, 16#F0#, 16#7F#, 16#87#,
16#80#, 16#3C#, 16#0F#, 16#00#, 16#78#, 16#0F#, 16#00#, 16#E0#, 16#1E#,
16#03#, 16#C0#, 16#1C#, 16#07#, 16#00#, 16#3C#, 16#1E#, 16#00#, 16#78#,
16#3C#, 16#00#, 16#78#, 16#F0#, 16#00#, 16#F1#, 16#E0#, 16#00#, 16#F3#,
16#80#, 16#01#, 16#EF#, 16#00#, 16#03#, 16#DE#, 16#00#, 16#03#, 16#F8#,
16#00#, 16#07#, 16#F0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FE#,
16#0F#, 16#F3#, 16#FE#, 16#3F#, 16#E7#, 16#FC#, 16#7F#, 16#CF#, 16#F0#,
16#7F#, 16#8F#, 16#00#, 16#1E#, 16#1E#, 16#1E#, 16#3C#, 16#1C#, 16#7C#,
16#70#, 16#38#, 16#F8#, 16#E0#, 16#71#, 16#F9#, 16#C0#, 16#F7#, 16#F3#,
16#81#, 16#EF#, 16#EF#, 16#03#, 16#DD#, 16#DE#, 16#07#, 16#FB#, 16#FC#,
16#0F#, 16#F7#, 16#F8#, 16#0F#, 16#C7#, 16#E0#, 16#1F#, 16#8F#, 16#C0#,
16#3F#, 16#1F#, 16#80#, 16#7C#, 16#1F#, 16#00#, 16#F8#, 16#3E#, 16#01#,
16#F0#, 16#7C#, 16#03#, 16#C0#, 16#78#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FE#, 16#0F#, 16#E1#, 16#FC#, 16#3F#, 16#C3#, 16#F8#, 16#7F#,
16#87#, 16#F0#, 16#7F#, 16#03#, 16#E0#, 16#F8#, 16#03#, 16#E3#, 16#E0#,
16#03#, 16#C7#, 16#80#, 16#03#, 16#DE#, 16#00#, 16#03#, 16#F8#, 16#00#,
16#03#, 16#E0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#1F#, 16#C0#, 16#00#,
16#7F#, 16#C0#, 16#01#, 16#F7#, 16#C0#, 16#03#, 16#C7#, 16#80#, 16#0F#,
16#07#, 16#80#, 16#3C#, 16#07#, 16#81#, 16#FC#, 16#1F#, 16#C7#, 16#FC#,
16#7F#, 16#CF#, 16#F8#, 16#FF#, 16#8F#, 16#E0#, 16#FE#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#FE#, 16#0F#, 16#E1#, 16#FC#, 16#3F#, 16#C3#,
16#F8#, 16#7F#, 16#87#, 16#F0#, 16#7F#, 16#03#, 16#E0#, 16#F8#, 16#03#,
16#C1#, 16#E0#, 16#03#, 16#C7#, 16#80#, 16#07#, 16#DF#, 16#00#, 16#07#,
16#BC#, 16#00#, 16#07#, 16#F0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#,
16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#1F#, 16#FC#,
16#00#, 16#7F#, 16#FC#, 16#00#, 16#FF#, 16#F8#, 16#00#, 16#FF#, 16#E0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#FF#, 16#80#, 16#7F#,
16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#, 16#03#, 16#C0#,
16#F0#, 16#07#, 16#83#, 16#C0#, 16#0F#, 16#0F#, 16#80#, 16#0C#, 16#3E#,
16#00#, 16#00#, 16#F8#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#07#, 16#80#,
16#00#, 16#1E#, 16#00#, 16#00#, 16#7C#, 16#00#, 16#01#, 16#F0#, 16#70#,
16#03#, 16#C0#, 16#E0#, 16#0F#, 16#01#, 16#C0#, 16#3C#, 16#03#, 16#80#,
16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#, 16#03#,
16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#00#, 16#FF#,
16#00#, 16#01#, 16#FE#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#07#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#,
16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#3F#,
16#80#, 16#00#, 16#7F#, 16#80#, 16#00#, 16#FF#, 16#00#, 16#01#, 16#FC#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#78#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#07#, 16#80#, 16#00#, 16#07#, 16#80#, 16#00#, 16#0F#,
16#00#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#78#,
16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#01#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#F0#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#3F#, 16#C0#, 16#00#, 16#3F#,
16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#,
16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#,
16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#,
16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#03#, 16#F8#, 16#00#, 16#0F#, 16#F0#, 16#00#, 16#1F#,
16#E0#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#20#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#03#, 16#E0#,
16#00#, 16#0F#, 16#E0#, 16#00#, 16#1F#, 16#C0#, 16#00#, 16#7B#, 16#C0#,
16#01#, 16#E3#, 16#C0#, 16#07#, 16#C7#, 16#C0#, 16#1F#, 16#07#, 16#C0#,
16#3C#, 16#07#, 16#80#, 16#70#, 16#07#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#FF#, 16#FF#, 16#F3#, 16#FF#, 16#FF#, 16#E0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#80#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#,
16#80#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#03#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#00#,
16#0F#, 16#FF#, 16#00#, 16#1F#, 16#FF#, 16#00#, 16#1F#, 16#FF#, 16#00#,
16#00#, 16#1E#, 16#00#, 16#1F#, 16#FC#, 16#00#, 16#FF#, 16#F8#, 16#03#,
16#FF#, 16#F0#, 16#0F#, 16#FF#, 16#E0#, 16#1F#, 16#01#, 16#C0#, 16#3C#,
16#03#, 16#80#, 16#F0#, 16#1F#, 16#00#, 16#FF#, 16#FF#, 16#81#, 16#FF#,
16#FF#, 16#81#, 16#FF#, 16#FF#, 16#00#, 16#FE#, 16#7C#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#FC#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#03#, 16#F0#, 16#00#, 16#07#,
16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#,
16#3F#, 16#00#, 16#0E#, 16#FF#, 16#80#, 16#1F#, 16#FF#, 16#C0#, 16#3F#,
16#FF#, 16#80#, 16#7E#, 16#0F#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#C0#,
16#0F#, 16#03#, 16#80#, 16#1E#, 16#07#, 16#00#, 16#3C#, 16#0E#, 16#00#,
16#78#, 16#1E#, 16#00#, 16#F0#, 16#3F#, 16#07#, 16#C3#, 16#FF#, 16#FF#,
16#87#, 16#FF#, 16#FE#, 16#0F#, 16#FF#, 16#F8#, 16#1F#, 16#9F#, 16#C0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3F#, 16#30#, 16#03#, 16#FF#, 16#F0#, 16#0F#, 16#FF#,
16#E0#, 16#3F#, 16#FF#, 16#C0#, 16#7C#, 16#0F#, 16#81#, 16#E0#, 16#0F#,
16#03#, 16#C0#, 16#0C#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#1E#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#60#, 16#3E#, 16#03#, 16#E0#,
16#7F#, 16#FF#, 16#C0#, 16#7F#, 16#FF#, 16#00#, 16#7F#, 16#FC#, 16#00#,
16#3F#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E0#, 16#00#, 16#1F#,
16#C0#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#7E#, 16#78#, 16#03#, 16#FE#, 16#F0#,
16#0F#, 16#FF#, 16#E0#, 16#3F#, 16#FF#, 16#C0#, 16#F8#, 16#3F#, 16#81#,
16#E0#, 16#1F#, 16#07#, 16#80#, 16#1E#, 16#0F#, 16#00#, 16#3C#, 16#1E#,
16#00#, 16#78#, 16#3C#, 16#00#, 16#F0#, 16#3C#, 16#03#, 16#E0#, 16#7C#,
16#0F#, 16#C0#, 16#FF#, 16#FF#, 16#E0#, 16#FF#, 16#FF#, 16#C0#, 16#FF#,
16#FF#, 16#80#, 16#3F#, 16#3F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#03#,
16#FF#, 16#00#, 16#0F#, 16#FF#, 16#00#, 16#3F#, 16#FF#, 16#00#, 16#FC#,
16#1F#, 16#01#, 16#E0#, 16#1E#, 16#07#, 16#80#, 16#1E#, 16#0F#, 16#FF#,
16#FC#, 16#1F#, 16#FF#, 16#F8#, 16#3F#, 16#FF#, 16#F0#, 16#7F#, 16#FF#,
16#E0#, 16#78#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#80#, 16#FF#, 16#FF#,
16#00#, 16#FF#, 16#FC#, 16#00#, 16#3F#, 16#C0#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#3F#, 16#C0#, 16#00#, 16#FF#, 16#E0#, 16#03#, 16#FF#, 16#C0#, 16#0F#,
16#FF#, 16#80#, 16#1E#, 16#00#, 16#00#, 16#38#, 16#00#, 16#03#, 16#FF#,
16#E0#, 16#0F#, 16#FF#, 16#E0#, 16#1F#, 16#FF#, 16#C0#, 16#1F#, 16#FF#,
16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#7F#, 16#FE#, 16#00#,
16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#, 16#03#, 16#FF#, 16#F0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FC#, 16#FC#, 16#07#, 16#FF#, 16#FC#, 16#1F#, 16#FF#, 16#F8#,
16#7F#, 16#FF#, 16#E0#, 16#F8#, 16#3F#, 16#03#, 16#E0#, 16#3E#, 16#07#,
16#80#, 16#3C#, 16#0F#, 16#00#, 16#78#, 16#1E#, 16#00#, 16#F0#, 16#3C#,
16#01#, 16#E0#, 16#3C#, 16#07#, 16#C0#, 16#7C#, 16#1F#, 16#80#, 16#7F#,
16#FF#, 16#00#, 16#FF#, 16#FE#, 16#00#, 16#7F#, 16#FC#, 16#00#, 16#7E#,
16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#07#,
16#C0#, 16#0F#, 16#FF#, 16#00#, 16#1F#, 16#FE#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#03#,
16#F8#, 16#00#, 16#03#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#,
16#C0#, 16#00#, 16#07#, 16#9F#, 16#00#, 16#0F#, 16#7F#, 16#80#, 16#1F#,
16#FF#, 16#80#, 16#3F#, 16#FF#, 16#00#, 16#7E#, 16#1F#, 16#00#, 16#F8#,
16#1E#, 16#01#, 16#E0#, 16#3C#, 16#03#, 16#C0#, 16#78#, 16#07#, 16#80#,
16#F0#, 16#0F#, 16#01#, 16#E0#, 16#1E#, 16#03#, 16#C0#, 16#3C#, 16#07#,
16#81#, 16#FE#, 16#3F#, 16#C3#, 16#FC#, 16#7F#, 16#87#, 16#F8#, 16#FF#,
16#0F#, 16#F1#, 16#FE#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#,
16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#07#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FC#, 16#00#, 16#07#, 16#F8#,
16#00#, 16#0F#, 16#F0#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#7F#, 16#FF#, 16#01#, 16#FF#, 16#FF#, 16#03#,
16#FF#, 16#FE#, 16#03#, 16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3C#,
16#00#, 16#00#, 16#78#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#C0#,
16#0F#, 16#FF#, 16#80#, 16#1F#, 16#FF#, 16#00#, 16#1F#, 16#FE#, 16#00#,
16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#,
16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#,
16#C0#, 16#00#, 16#07#, 16#80#, 16#00#, 16#1F#, 16#00#, 16#1F#, 16#FC#,
16#00#, 16#7F#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#3F#, 16#00#, 16#00#, 16#FE#, 16#00#, 16#01#, 16#FC#, 16#00#, 16#01#,
16#F8#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#,
16#CF#, 16#F0#, 16#07#, 16#9F#, 16#E0#, 16#0F#, 16#3F#, 16#C0#, 16#1E#,
16#7F#, 16#80#, 16#3D#, 16#F0#, 16#00#, 16#7F#, 16#C0#, 16#00#, 16#FF#,
16#00#, 16#01#, 16#FC#, 16#00#, 16#03#, 16#FC#, 16#00#, 16#07#, 16#FE#,
16#00#, 16#0F#, 16#7E#, 16#00#, 16#1E#, 16#3E#, 16#00#, 16#FC#, 16#3F#,
16#83#, 16#F8#, 16#FF#, 16#87#, 16#F1#, 16#FF#, 16#07#, 16#E1#, 16#FC#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#0F#, 16#F0#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#3F#,
16#C0#, 16#00#, 16#7F#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#,
16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#7F#, 16#FF#, 16#01#, 16#FF#, 16#FF#, 16#03#, 16#FF#, 16#FE#, 16#03#,
16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#3E#, 16#F1#, 16#E0#, 16#7F#, 16#F7#, 16#F0#,
16#FF#, 16#FF#, 16#E1#, 16#FF#, 16#FF#, 16#E1#, 16#F1#, 16#E3#, 16#C3#,
16#C3#, 16#87#, 16#87#, 16#87#, 16#0F#, 16#0F#, 16#0E#, 16#1E#, 16#1E#,
16#1C#, 16#3C#, 16#3C#, 16#38#, 16#78#, 16#78#, 16#70#, 16#F0#, 16#F0#,
16#E1#, 16#E3#, 16#F9#, 16#F3#, 16#E7#, 16#F3#, 16#E7#, 16#EF#, 16#E7#,
16#CF#, 16#DF#, 16#8F#, 16#9F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#9F#, 16#00#, 16#3F#,
16#7F#, 16#80#, 16#7F#, 16#FF#, 16#80#, 16#7F#, 16#FF#, 16#00#, 16#7E#,
16#1F#, 16#00#, 16#F0#, 16#1E#, 16#01#, 16#E0#, 16#3C#, 16#03#, 16#C0#,
16#78#, 16#07#, 16#80#, 16#F0#, 16#0F#, 16#01#, 16#E0#, 16#1E#, 16#03#,
16#C0#, 16#3C#, 16#07#, 16#81#, 16#FE#, 16#1F#, 16#83#, 16#FC#, 16#7F#,
16#87#, 16#F8#, 16#FF#, 16#0F#, 16#F0#, 16#FC#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#,
16#00#, 16#03#, 16#FF#, 16#80#, 16#0F#, 16#FF#, 16#80#, 16#3F#, 16#FF#,
16#80#, 16#FC#, 16#1F#, 16#81#, 16#E0#, 16#0F#, 16#03#, 16#80#, 16#0E#,
16#0F#, 16#00#, 16#1E#, 16#1E#, 16#00#, 16#3C#, 16#1C#, 16#00#, 16#70#,
16#3C#, 16#01#, 16#E0#, 16#7E#, 16#0F#, 16#C0#, 16#7F#, 16#FF#, 16#00#,
16#7F#, 16#FC#, 16#00#, 16#7F#, 16#F0#, 16#00#, 16#3F#, 16#80#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#1F#, 16#80#, 16#7E#, 16#FF#, 16#C0#, 16#FF#, 16#FF#, 16#C1#,
16#FF#, 16#FF#, 16#C0#, 16#7E#, 16#0F#, 16#80#, 16#F0#, 16#07#, 16#81#,
16#E0#, 16#07#, 16#03#, 16#80#, 16#0E#, 16#07#, 16#00#, 16#1C#, 16#0F#,
16#00#, 16#78#, 16#1E#, 16#00#, 16#F0#, 16#3F#, 16#07#, 16#E0#, 16#7F#,
16#FF#, 16#80#, 16#FF#, 16#FE#, 16#01#, 16#DF#, 16#F8#, 16#03#, 16#8F#,
16#C0#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#FF#, 16#80#, 16#03#, 16#FF#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#FC#, 16#7C#, 16#07#, 16#FE#, 16#FC#, 16#1F#,
16#FF#, 16#F8#, 16#7F#, 16#FF#, 16#E1#, 16#F8#, 16#3F#, 16#03#, 16#C0#,
16#1E#, 16#07#, 16#00#, 16#3C#, 16#0E#, 16#00#, 16#38#, 16#1C#, 16#00#,
16#70#, 16#3C#, 16#01#, 16#E0#, 16#78#, 16#07#, 16#C0#, 16#FC#, 16#1F#,
16#80#, 16#FF#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#00#, 16#FF#, 16#DC#,
16#00#, 16#7E#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#3F#, 16#E0#, 16#00#, 16#FF#, 16#E0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#F1#, 16#F0#, 16#0F#, 16#E7#,
16#F8#, 16#1F#, 16#FF#, 16#F0#, 16#3F#, 16#FF#, 16#E0#, 16#0F#, 16#F0#,
16#00#, 16#1F#, 16#80#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#78#, 16#00#,
16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#C0#, 16#00#,
16#07#, 16#80#, 16#00#, 16#FF#, 16#FC#, 16#01#, 16#FF#, 16#FC#, 16#03#,
16#FF#, 16#F8#, 16#07#, 16#FF#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#60#,
16#03#, 16#FF#, 16#E0#, 16#0F#, 16#FF#, 16#C0#, 16#1F#, 16#FF#, 16#80#,
16#7C#, 16#1F#, 16#00#, 16#F0#, 16#0C#, 16#00#, 16#FF#, 16#80#, 16#00#,
16#FF#, 16#F0#, 16#00#, 16#1F#, 16#F0#, 16#0E#, 16#01#, 16#E0#, 16#1C#,
16#01#, 16#C0#, 16#3E#, 16#0F#, 16#80#, 16#7F#, 16#FF#, 16#00#, 16#FF#,
16#FC#, 16#01#, 16#FF#, 16#F0#, 16#00#, 16#3F#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#1F#,
16#FF#, 16#C0#, 16#7F#, 16#FF#, 16#80#, 16#FF#, 16#FF#, 16#00#, 16#FF#,
16#FE#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#,
16#00#, 16#0F#, 16#00#, 16#00#, 16#1E#, 16#07#, 16#80#, 16#3F#, 16#FF#,
16#80#, 16#3F#, 16#FE#, 16#00#, 16#7F#, 16#F8#, 16#00#, 16#3F#, 16#80#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#87#, 16#F0#, 16#7F#, 16#0F#, 16#E0#, 16#7E#, 16#1F#,
16#C0#, 16#FC#, 16#3F#, 16#80#, 16#78#, 16#0F#, 16#00#, 16#F0#, 16#1E#,
16#01#, 16#E0#, 16#3C#, 16#03#, 16#C0#, 16#78#, 16#07#, 16#80#, 16#F0#,
16#0F#, 16#01#, 16#E0#, 16#1E#, 16#03#, 16#C0#, 16#3E#, 16#1F#, 16#80#,
16#3F#, 16#FF#, 16#80#, 16#7F#, 16#FF#, 16#80#, 16#7F#, 16#FF#, 16#00#,
16#3E#, 16#7C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#1F#, 16#E3#, 16#FC#, 16#7F#, 16#C7#, 16#FC#,
16#FF#, 16#8F#, 16#F8#, 16#FF#, 16#1F#, 16#E0#, 16#78#, 16#0F#, 16#00#,
16#70#, 16#1C#, 16#00#, 16#F0#, 16#78#, 16#01#, 16#E0#, 16#E0#, 16#01#,
16#E3#, 16#C0#, 16#03#, 16#C7#, 16#00#, 16#03#, 16#DE#, 16#00#, 16#07#,
16#B8#, 16#00#, 16#07#, 16#F0#, 16#00#, 16#0F#, 16#E0#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#1F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#80#, 16#FC#, 16#7F#,
16#83#, 16#FC#, 16#FF#, 16#07#, 16#F8#, 16#FC#, 16#07#, 16#E0#, 16#F1#,
16#C3#, 16#81#, 16#E7#, 16#CF#, 16#01#, 16#CF#, 16#9E#, 16#03#, 16#9F#,
16#B8#, 16#07#, 16#FF#, 16#70#, 16#0F#, 16#FF#, 16#E0#, 16#1F#, 16#DF#,
16#C0#, 16#1F#, 16#BF#, 16#00#, 16#3E#, 16#3E#, 16#00#, 16#7C#, 16#7C#,
16#00#, 16#F8#, 16#F8#, 16#00#, 16#E0#, 16#E0#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#E3#,
16#F8#, 16#3F#, 16#C7#, 16#F0#, 16#7F#, 16#8F#, 16#E0#, 16#7E#, 16#0F#,
16#80#, 16#3F#, 16#7E#, 16#00#, 16#3F#, 16#F8#, 16#00#, 16#3F#, 16#C0#,
16#00#, 16#1F#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#01#, 16#FF#, 16#00#,
16#07#, 16#DF#, 16#00#, 16#1F#, 16#1F#, 16#00#, 16#FC#, 16#1F#, 16#83#,
16#FC#, 16#7F#, 16#87#, 16#F8#, 16#FF#, 16#0F#, 16#F1#, 16#FE#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#1F#, 16#C1#, 16#FC#, 16#3F#, 16#87#, 16#F8#, 16#7F#, 16#0F#, 16#F0#,
16#FE#, 16#0F#, 16#E0#, 16#78#, 16#0F#, 16#00#, 16#F0#, 16#1E#, 16#00#,
16#F0#, 16#78#, 16#01#, 16#E0#, 16#F0#, 16#01#, 16#E3#, 16#C0#, 16#03#,
16#C7#, 16#80#, 16#03#, 16#DE#, 16#00#, 16#07#, 16#B8#, 16#00#, 16#07#,
16#F0#, 16#00#, 16#0F#, 16#C0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#1E#,
16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#F0#, 16#00#, 16#01#, 16#E0#,
16#00#, 16#FF#, 16#E0#, 16#01#, 16#FF#, 16#E0#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#07#, 16#FF#, 16#F0#, 16#0F#, 16#FF#, 16#E0#, 16#1F#,
16#FF#, 16#C0#, 16#3F#, 16#FF#, 16#00#, 16#78#, 16#3C#, 16#00#, 16#70#,
16#F0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#1F#, 16#00#, 16#00#, 16#7C#,
16#00#, 16#01#, 16#F0#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#1F#, 16#03#,
16#80#, 16#7F#, 16#FF#, 16#00#, 16#FF#, 16#FE#, 16#01#, 16#FF#, 16#FC#,
16#03#, 16#FF#, 16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#7E#, 16#00#, 16#00#, 16#FC#, 16#00#, 16#03#, 16#F0#, 16#00#, 16#07#,
16#80#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#,
16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#07#, 16#80#, 16#00#, 16#7E#, 16#00#, 16#00#, 16#FC#, 16#00#,
16#01#, 16#F8#, 16#00#, 16#03#, 16#F0#, 16#00#, 16#00#, 16#F0#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#,
16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#00#,
16#3F#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#00#,
16#78#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#60#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#80#,
16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#,
16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#,
16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#1C#,
16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#80#, 16#00#, 16#0F#, 16#C0#, 16#00#, 16#1F#, 16#80#, 16#00#,
16#1F#, 16#80#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#0E#, 16#00#, 16#00#,
16#1C#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#03#,
16#F0#, 16#00#, 16#07#, 16#E0#, 16#00#, 16#0F#, 16#C0#, 16#00#, 16#1F#,
16#80#, 16#00#, 16#78#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#3C#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#07#, 16#F0#, 16#00#,
16#0F#, 16#C0#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#80#,
16#00#, 16#1F#, 16#C0#, 16#00#, 16#7F#, 16#C3#, 16#01#, 16#FF#, 16#CF#,
16#03#, 16#CF#, 16#FE#, 16#03#, 16#0F#, 16#F8#, 16#00#, 16#0F#, 16#E0#,
16#00#, 16#07#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#);
Font_D : aliased constant Bitmap_Font :=
(
Bytes_Per_Glyph => 101,
Glyph_Width => 23,
Glyph_Height => 35,
Data => FreeMonoBold18pt7bBitmaps'Access);
Font : constant Bitmap_Font_Ref := Font_D'Access;
end GESTE_Fonts.FreeMonoBold18pt7b;
|
zhmu/ananas | Ada | 4,417 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . A L T I V E C . C O N V E R S I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This unit provides the Vector/Views conversions
with GNAT.Altivec.Vector_Types; use GNAT.Altivec.Vector_Types;
with GNAT.Altivec.Vector_Views; use GNAT.Altivec.Vector_Views;
package GNAT.Altivec.Conversions is
---------------------
-- char components --
---------------------
function To_Vector (S : VUC_View) return VUC;
function To_Vector (S : VSC_View) return VSC;
function To_Vector (S : VBC_View) return VBC;
function To_View (S : VUC) return VUC_View;
function To_View (S : VSC) return VSC_View;
function To_View (S : VBC) return VBC_View;
----------------------
-- short components --
----------------------
function To_Vector (S : VUS_View) return VUS;
function To_Vector (S : VSS_View) return VSS;
function To_Vector (S : VBS_View) return VBS;
function To_View (S : VUS) return VUS_View;
function To_View (S : VSS) return VSS_View;
function To_View (S : VBS) return VBS_View;
--------------------
-- int components --
--------------------
function To_Vector (S : VUI_View) return VUI;
function To_Vector (S : VSI_View) return VSI;
function To_Vector (S : VBI_View) return VBI;
function To_View (S : VUI) return VUI_View;
function To_View (S : VSI) return VSI_View;
function To_View (S : VBI) return VBI_View;
----------------------
-- float components --
----------------------
function To_Vector (S : VF_View) return VF;
function To_View (S : VF) return VF_View;
----------------------
-- pixel components --
----------------------
function To_Vector (S : VP_View) return VP;
function To_View (S : VP) return VP_View;
private
-- We want the above subprograms to always be inlined in the case of the
-- hard PowerPC AltiVec support in order to avoid the unnecessary function
-- call. On the other hand there is no problem with inlining these
-- subprograms on little-endian targets.
pragma Inline_Always (To_Vector);
pragma Inline_Always (To_View);
end GNAT.Altivec.Conversions;
|
AdaCore/Ada_Drivers_Library | Ada | 5,143 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2020, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL;
package RISCV.CSR_Generic is
generic
Reg_Name : String;
type Reg_Type is private;
function Read_CSR return Reg_Type
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
procedure Write_CSR (Val : Reg_Type)
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
function Swap_CSR (Val : Reg_Type) return Reg_Type
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
procedure Set_Bits_CSR (Val : Reg_Type)
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
function Read_And_Set_Bits_CSR (Val : Reg_Type) return Reg_Type
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
procedure Clear_Bits_CSR (Val : Reg_Type)
with Inline_Always;
generic
Reg_Name : String;
type Reg_Type is private;
function Read_And_Clear_Bits_CSR (Val : Reg_Type) return Reg_Type
with Inline_Always;
-- Package to access Read/Write CSR
generic
Reg_Name : String;
type Reg_Type is private;
package CSR_RW_Pck is
function Read is new Read_CSR (Reg_Name, Reg_Type);
procedure Write is new Write_CSR (Reg_Name, Reg_Type);
function Swap is new Swap_CSR (Reg_Name, Reg_Type);
procedure Set_Bits is new Set_Bits_CSR (Reg_Name, Reg_Type);
function Read_And_Set_Bits is new Read_And_Set_Bits_CSR (Reg_Name, Reg_Type);
procedure Clear_Bits is new Clear_Bits_CSR (Reg_Name, Reg_Type);
function Read_And_Clear_Bits is new Read_And_Clear_Bits_CSR (Reg_Name, Reg_Type);
end CSR_RW_Pck;
-- Package to access Read-only CSR
generic
Reg_Name : String;
type Reg_Type is private;
package CSR_RO_Pck is
function Read is new Read_CSR (Reg_Name, Reg_Type);
end CSR_RO_Pck;
generic
Reg_Name : String;
function Read_CSR_64 return HAL.UInt64
with Inline_Always;
-- Some CSR always have a 64bit precision on all RV32 and RV64 systems.
-- This function abstracts the hanlding of low and high CSRs on RV32.
generic
Reg_Name : String;
procedure Write_CSR_64 (Val : HAL.UInt64)
with Inline_Always;
-- Some CSR always have a 64bit precision on all RV32 and RV64 systems.
-- This function abstracts the hanlding of low and high CSRs on RV32.
generic
Reg_Name : String;
package CSR_RW_64_Pck is
function Read is new Read_CSR_64 (Reg_Name);
procedure Write is new Write_CSR_64 (Reg_Name);
end CSR_RW_64_Pck;
generic
Reg_Name : String;
package CSR_RO_64_Pck is
function Read is new Read_CSR_64 (Reg_Name);
end CSR_RO_64_Pck;
end RISCV.CSR_Generic;
|
reznikmm/matreshka | Ada | 24,960 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Parameters is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Parameter
(AMF.UML.Parameters.UML_Parameter_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Parameter
(AMF.UML.Parameters.UML_Parameter_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Parameter_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Parameter
(Visitor,
AMF.UML.Parameters.UML_Parameter_Access (Self),
Control);
end if;
end Visit_Element;
-----------------
-- Get_Default --
-----------------
overriding function Get_Default
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Default (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Default;
-----------------
-- Set_Default --
-----------------
overriding procedure Set_Default
(Self : not null access UML_Parameter_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.UML_Attributes.Internal_Set_Default
(Self.Element, null);
else
AMF.Internals.Tables.UML_Attributes.Internal_Set_Default
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Default;
-----------------------
-- Get_Default_Value --
-----------------------
overriding function Get_Default_Value
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access is
begin
return
AMF.UML.Value_Specifications.UML_Value_Specification_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Default_Value
(Self.Element)));
end Get_Default_Value;
-----------------------
-- Set_Default_Value --
-----------------------
overriding procedure Set_Default_Value
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Default_Value
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Default_Value;
-------------------
-- Get_Direction --
-------------------
overriding function Get_Direction
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.UML_Parameter_Direction_Kind is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Direction
(Self.Element);
end Get_Direction;
-------------------
-- Set_Direction --
-------------------
overriding procedure Set_Direction
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.UML_Parameter_Direction_Kind) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Direction
(Self.Element, To);
end Set_Direction;
----------------
-- Get_Effect --
----------------
overriding function Get_Effect
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Optional_UML_Parameter_Effect_Kind is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Effect
(Self.Element);
end Get_Effect;
----------------
-- Set_Effect --
----------------
overriding procedure Set_Effect
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Optional_UML_Parameter_Effect_Kind) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Effect
(Self.Element, To);
end Set_Effect;
----------------------
-- Get_Is_Exception --
----------------------
overriding function Get_Is_Exception
(Self : not null access constant UML_Parameter_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Exception
(Self.Element);
end Get_Is_Exception;
----------------------
-- Set_Is_Exception --
----------------------
overriding procedure Set_Is_Exception
(Self : not null access UML_Parameter_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Exception
(Self.Element, To);
end Set_Is_Exception;
-------------------
-- Get_Is_Stream --
-------------------
overriding function Get_Is_Stream
(Self : not null access constant UML_Parameter_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Stream
(Self.Element);
end Get_Is_Stream;
-------------------
-- Set_Is_Stream --
-------------------
overriding procedure Set_Is_Stream
(Self : not null access UML_Parameter_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Stream
(Self.Element, To);
end Set_Is_Stream;
-------------------
-- Get_Operation --
-------------------
overriding function Get_Operation
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Operations.UML_Operation_Access is
begin
return
AMF.UML.Operations.UML_Operation_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Operation
(Self.Element)));
end Get_Operation;
-------------------
-- Set_Operation --
-------------------
overriding procedure Set_Operation
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Operations.UML_Operation_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Operation
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Operation;
-----------------------
-- Get_Parameter_Set --
-----------------------
overriding function Get_Parameter_Set
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Parameter_Sets.Collections.Set_Of_UML_Parameter_Set is
begin
return
AMF.UML.Parameter_Sets.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Parameter_Set
(Self.Element)));
end Get_Parameter_Set;
-------------
-- Get_End --
-------------
overriding function Get_End
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End is
begin
return
AMF.UML.Connector_Ends.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End
(Self.Element)));
end Get_End;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access is
begin
return
AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
--------------
-- Get_Type --
--------------
overriding function Get_Type
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Types.UML_Type_Access is
begin
return
AMF.UML.Types.UML_Type_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
(Self.Element)));
end Get_Type;
--------------
-- Set_Type --
--------------
overriding procedure Set_Type
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Types.UML_Type_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Type
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Type;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
-------------
-- Default --
-------------
overriding function Default
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Default unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Default";
return Default (Self);
end Default;
---------------------
-- Compatible_With --
---------------------
overriding function Compatible_With
(Self : not null access constant UML_Parameter_Proxy;
Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Compatible_With";
return Compatible_With (Self, Other);
end Compatible_With;
--------------------------
-- Includes_Cardinality --
--------------------------
overriding function Includes_Cardinality
(Self : not null access constant UML_Parameter_Proxy;
C : Integer)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Includes_Cardinality unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Includes_Cardinality";
return Includes_Cardinality (Self, C);
end Includes_Cardinality;
---------------------------
-- Includes_Multiplicity --
---------------------------
overriding function Includes_Multiplicity
(Self : not null access constant UML_Parameter_Proxy;
M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Includes_Multiplicity unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Includes_Multiplicity";
return Includes_Multiplicity (Self, M);
end Includes_Multiplicity;
---------
-- Iss --
---------
overriding function Iss
(Self : not null access constant UML_Parameter_Proxy;
Lowerbound : Integer;
Upperbound : Integer)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Iss unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Iss";
return Iss (Self, Lowerbound, Upperbound);
end Iss;
----------
-- Ends --
----------
overriding function Ends
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connector_Ends.Collections.Set_Of_UML_Connector_End is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Ends unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Ends";
return Ends (Self);
end Ends;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Parameter_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Namespace";
return Namespace (Self);
end Namespace;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Parameter_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Parameter_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
end AMF.Internals.UML_Parameters;
|
reznikmm/matreshka | Ada | 4,549 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Db.Scale_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Db_Scale_Attribute_Node is
begin
return Self : Db_Scale_Attribute_Node do
Matreshka.ODF_Db.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Db_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Db_Scale_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Scale_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Db_URI,
Matreshka.ODF_String_Constants.Scale_Attribute,
Db_Scale_Attribute_Node'Tag);
end Matreshka.ODF_Db.Scale_Attributes;
|
io7m/coreland-sdl-ada | Ada | 1,263 | adb | package body SDL.RWops is
function RWClose (Context : RWops_Access_t) return C.int is
begin
return Context.all.Close (Context);
end RWClose;
function RWRead
(Context : RWops_Access_t;
Ptr : Void_Ptr_t;
Size : C.int;
Num : C.int) return C.int is
begin
return Context.all.Read (Context, Ptr, Size, Num);
end RWRead;
function RWSeek
(Context : RWops_Access_t;
Offset : C.int;
Whence : C.int) return C.int is
begin
return Context.all.Seek (Context, Offset, Whence);
end RWSeek;
function RWTell (Context : RWops_Access_t) return C.int is
begin
return Context.all.Seek (Context, 0, C.int (C_Streams.SEEK_CUR));
end RWTell;
function RWWrite
(Context : RWops_Access_t;
Ptr : Void_Ptr_t;
Size : C.int;
Num : C.int) return C.int is
begin
return Context.all.Write (Context, Ptr, Size, Num);
end RWWrite;
function RWFromFile
(File : String;
Mode : String) return RWops_Access_t
is
Ch_File : aliased C.char_array := C.To_C (File);
Ch_Mode : aliased C.char_array := C.To_C (Mode);
begin
return RWFromFile (CS.To_Chars_Ptr (Ch_File'Unchecked_Access), CS.To_Chars_Ptr (Ch_Mode'Unchecked_Access));
end RWFromFile;
end SDL.RWops;
|
reznikmm/matreshka | Ada | 3,719 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Svg_Stop_Opacity_Attributes is
pragma Preelaborate;
type ODF_Svg_Stop_Opacity_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Svg_Stop_Opacity_Attribute_Access is
access all ODF_Svg_Stop_Opacity_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Svg_Stop_Opacity_Attributes;
|
reznikmm/matreshka | Ada | 4,016 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Asis;
with Engines.Contexts;
with League.Strings;
package Properties.Definitions.Modular is
function Typed_Array_Item_Type
(Engine : access Engines.Contexts.Context;
Element : Asis.Definition;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Size
(Engine : access Engines.Contexts.Context;
Element : Asis.Definition;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Alignment
(Engine : access Engines.Contexts.Context;
Element : Asis.Definition;
Name : Engines.Integer_Property) return Integer;
end Properties.Definitions.Modular;
|
zhmu/ananas | Ada | 146 | ads | generic
type T is private;
None : T;
package Warn20_Pkg is
generic
with procedure Dispatch (X : T) is null;
procedure Foo;
end;
|
reznikmm/matreshka | Ada | 3,809 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Draw_Text_Path_Same_Letter_Heights_Attributes is
pragma Preelaborate;
type ODF_Draw_Text_Path_Same_Letter_Heights_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Draw_Text_Path_Same_Letter_Heights_Attribute_Access is
access all ODF_Draw_Text_Path_Same_Letter_Heights_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Text_Path_Same_Letter_Heights_Attributes;
|
reznikmm/matreshka | Ada | 3,594 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.UML.Actions.Hash is
new AMF.Elements.Generic_Hash (UML_Action, UML_Action_Access);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.