content
stringlengths
23
1.05M
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Incr.Lexers.Batch_Lexers.Generic_Lexers is --------------- -- Get_Token -- --------------- overriding ...
-- Ada regular expression library -- (c) Kristian Klomsten Skordal 2020-2021 <kristian.skordal@wafflemail.net> -- Report bugs and issues on <https://github.com/skordal/ada-regex> with Ada.Characters.Latin_1; with AUnit.Assertions; use AUnit.Assertions; with Regex.Matchers; use Regex.Matchers; with Rege...
pragma SPARK_Mode; -- @summary -- This package enables reading and waiting on a button -- package Zumo_Pushbutton is -- True if the package has be init'd Initd : Boolean := False; -- The init sequence which does pin muxing and whatnot procedure Init with Global => (In_Out => Initd), Pre => ...
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Incr.Lexers.Batch_Lexers.Generic_Lexers; with Matreshka.Internals.Unicode; package Tests.Lexers is package Tables is ...
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired) -- -- Copyright William A. Whitaker (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is C...
-- Copyright (c) 2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Incr.Version_Trees; with Ada_LSP.Completion_Tokens; package body Ada_LSP.Contexts is type Version_Tree_Access is access all ...
with Ada.Exceptions; with Ada.Strings.Fixed; package body ARM_Texinfo is -- Copyright (C) 2003, 2007, 2010 - 2013, 2015, 2017, 2018 Stephen Leake. All Rights Reserved. -- E-Mail: stephen_leake@acm.org -- -- This library is free software; you can redistribute it and/or -- modify it under ter...
with Ada.Text_IO; with HAL; use HAL; with Hex_Dump; procedure TC_Hexdump is Data : UInt8_Array (1 .. 650); Cnt : UInt8 := 0; begin for Elt of Data loop Elt := Cnt; Cnt := Cnt + 1; end loop; Hex_Dump.Hex_Dump (Data => Data, Put_Line => Ada.Text_IO.Put_Lin...
with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; with Ada.Calendar.Formatting; use Ada.Calendar.Formatting; with Ada.Calendar.Conversions; use Ada.Calendar.Conversions; procedure ShowEpoch is etime : Time := To_Ada_Time (0); begin Put_Line (Image (Date => etime)); end ShowEpoch;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- ...
pragma License (Unrestricted); -- implementation unit with Ada.Tags; -- [gcc-5] is confused in C390004 if this line is "private with" package System.Storage_Pools.Standard_Pools is pragma Preelaborate; type Standard_Pool is limited new Storage_Pools.Root_Storage_Pool with null record with Disable_Co...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- ...
with Trendy_Test.Reports; with Trendy_Terminal.Histories.Tests; with Trendy_Terminal.Lines.Tests; procedure Trendy_Terminal_Tests is begin Trendy_Test.Register (Trendy_Terminal.Histories.Tests.All_Tests); Trendy_Test.Register (Trendy_Terminal.Lines.Tests.All_Tests); Trendy_Test.Reports.Print_Basic_Report ...
-- { dg-do run } with Interfaces.C; use Interfaces.C; procedure Sizetype1 is TC_String : String(1..8) := "abcdefgh"; TC_No_nul : constant char_array := To_C(TC_String, False); begin if TC_No_nul(0) /= To_C('a') then raise Program_Error; end if; end;
----------------------------------------------------------------------- -- package Predictor_1, 17th order Predictor-Corrector integrator -- Copyright (C) 2008-2018 Jonathan S. Parker. -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provi...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
---------------------------------------------------------------------- -- -- The Dining Philosophers' Problem -- -- written by -- -- Edmond Schonberg -- and -- Gerry Fisher -- -- Ada Project -- ...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
with Father.Son; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Children is A : Father.Son.Son_Type := 5; -- you can make it constant B : Father.Father_Type := 100; -- idem C : constant Father.Son.Sonic_Type := 20; R : Integer; --use type Father.Son.Son_Type; use type Father.Son.Sonic_Type;-- com...
with System.Wid_Enum; package body System.WWd_Enum is function Wide_Width_Enumeration_8 ( Names : String; Indexes : Address; Lo, Hi : Natural; EM : WC_Encoding_Method := 1) return Natural is pragma Unreferenced (EM); begin return Wid_Enum.Width_Enumeration_8 (Names, I...
package with_dot_issue.sub is --begin Bytes_In_Word : constant := 2; end with_dot_issue.sub;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2018, AdaCore -- -- -- -- ...
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" private with Ada.Containers.Indefinite_Hashed_Sets; private with System.Storage_Elements; with Yaml.Dom.Node; private package Yaml.Dom.Node_Memory is type Instance is tagged limited private; p...
package body Cards is function Image(Self : Card) return String is begin case Self.Face is when 11 => return " JACK of " & Self.Suit'Image; when 12 => return " QUEEN of " & Self.Suit'Image; when 13 => return " KING of " & Self.Suit'Image; when 14 => return " ACE of " & Self.Suit'Image; when others =...
------------------------------------------------------------------------------ -- AGAR GUI LIBRARY -- -- A G A R . S U R F A C E -- -- S p e c -- ----...
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired) -- -- Copyright William A. Whitaker (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is C...
-- { dg-do compile } package body Noreturn1 is procedure Error (E : in Exception_Occurrence) is Occurrence_Message : constant String := Exception_Message (E); begin if Occurrence_Message = "$" then raise Program_Error; else raise Constraint_Error; end if; end; end N...
-- Institution: Technische Universitaet Muenchen -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Module: Console -- Authors: Emanuel Regnath (emanuel.regnath@tum.de) -- -- ToDo: -- [ ] Implementation -- @summary Command Line Interface for user interactions package Console with SPA...
-- Abstract : -- -- Utilities for navigating syntax trees produced by an LR parser. -- -- Design : -- -- It would be safer if Cursor contained a pointer to Iterator; then -- Copy and Splice could just take Cursor arguments. But that -- requires mode 'aliased in' for First, Last, which is not -- conformant with A...
with ARM_Format, ARM_Contents; package ARM_Master is -- -- Ada reference manual formatter (ARM_Form). -- -- This package contains the routines to parse the master file, and -- execute it. -- -- --------------------------------------- -- Copyright 2006, 2011, 2012, 2016 --...
with DDS.Request_Reply.Replier.Typed_Replier_Generic; with Dds.Builtin_String_DataReader; with Dds.Builtin_String_DataWriter; package DDS.Request_Reply.Tests.Simple.String_Replier is new DDS.Request_Reply.Replier.Typed_Replier_Generic (Reply_DataWriter => Dds.Builtin_String_DataWriter, Request_DataReader...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
-- Copyright 2016-2019 NXP -- All rights reserved.SPDX-License-Identifier: BSD-3-Clause -- This spec has been automatically generated from LPC55S6x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package NXP_SVD.SPI is pragma Preelaborate; ...
package body Lto19_Pkg2 is function UB return Natural is begin return 8; end; end Lto19_Pkg2;
-- Link with -lnosig.o with Ada.Formatting; with Interfaces; with System.Machine_Code; procedure nosignal is use type Interfaces.Unsigned_16; CW : aliased Interfaces.Unsigned_16 := 0; X : Integer := 10; Y : Integer := 20; procedure Divide_By_Zero is pragma Suppress (All_Checks); begin X := X / Y; -- may cause...
with Ada.Finalization; generic type Element_Type(<>) is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada_Containers_Indefinite_Holders is pragma Preelaborate(Ada_Containers_Indefinite_Holders); type Holder is tagged private; pragma Preelaborable_Initialization (...
package Inline13_Pkg is subtype Padded_T is String (1..8); type T is new Padded_T; function Padded (Value : T) return Padded_T; pragma Inline_Always (Padded); end Inline13_Pkg;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Real_Time; use Ada.Real_Time; with Ada.Calendar; use Ada.Calendar; procedure Tetris is Rows: Integer := 38; Cols: Integer := 22; FPS: Integer := 240; -- Höjd: Integer ...
-- The Cupcake GUI Toolkit -- (c) Kristian Klomsten Skordal 2012 <kristian.skordal@gmail.com> -- Report bugs and issues on <http://github.com/skordal/cupcake/issues> -- vim:ts=3:sw=3:et:si:sta package body Cupcake.Primitives is -- Adds two points together: function "+" (Left, Right : in Point) return Point...
with Interfaces.C.Strings, System; use type Interfaces.C.int, Interfaces.C.Strings.chars_ptr, System.Address; package body FLTK.Widgets.Inputs is procedure input_set_draw_hook (W, D : in System.Address); pragma Import (C, input_set_draw_hook, "input_set_draw_hook"); p...
with Ada.Text_IO, Miller_Rabin; procedure Mr_Tst is type Number is range 0 .. (2**48)-1; package Num_IO is new Ada.Text_IO.Integer_IO (Number); package Pos_IO is new Ada.Text_IO.Integer_IO (Positive); package MR is new Miller_Rabin(Number); use MR; N : Number; K : Positive; begin for I in ...
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016, AdaCore -- -- -- -- ...
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Expressions; with Program.Lexical_Elements; package Program.Elements.Parenthesized_Expressions is pragma Pure (Program.Elements.P...
with Resources1; with Ada.Command_Line; with Ada.Text_IO; procedure Test1 is use Resources1; C : Content_Access := Get_Content ("main.html"); begin if C = null then Ada.Text_IO.Put_Line ("FAIL: No content 'main.html'"); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); return; ...
--////////////////////////////////////////////////////////// -- SFML - Simple and Fast Multimedia Library -- Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) -- 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...
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- ...
-- -- Raytracer implementation in Ada -- by John Perry (github: johnperry-math) -- 2021 -- -- implementation for Bitmap, a Bitmap of Color_With_Transparency_Type, -- along with a procedure to save the Bitmap to a BMP file -- pragma Ada_2020; -- use Ada_202x features -- Ada packages with Interfaces.C; use Interfaces....
with A, B, Person; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Pkg is begin Put_Line ("Test_Pkg: " & Integer'Image (Person.Unit_Age)); A.Print_Modify; Put_Line ("Test_Pkg: " & Integer'Image (Person.Unit_Age)); B.Print_Modify; Put_Line ("Test_Pkg: " & Integer'Image (Person.Unit_Age)); end Test_P...
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2021 onox <denkpadje@gmail.com> -- -- 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/L...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- ...
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2016 onox <denkpadje@gmail.com> -- -- 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/L...
-- C41301A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimit...
-- SPDX-License-Identifier: MIT -- -- Copyright (c) 1999 - 2018 Gautier de Montmollin -- SWITZERLAND -- -- 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...
with any_Math.any_Geometry.any_d3; package float_math.Geometry.d3 is new float_Math.Geometry.any_d3; pragma Pure (float_math.Geometry.d3);
pragma License (Unrestricted); -- Ada 2012 private with System.Finalization_Masters; private with System.Storage_Barriers; package System.Storage_Pools.Subpools is pragma Preelaborate; type Root_Storage_Pool_With_Subpools is abstract limited new Root_Storage_Pool with private; type Root_Subpool is abs...
-- Copyright 2017-2021 Bartek thindil Jasicki -- -- This file is part of Steam Sky. -- -- Steam Sky 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 -- (a...
------------------------------------------------------------------------------- -- BUILD FILE : Terminal_Colours.gpr -- -- Description : Demo of Ada terminal color support -- -- Author : Simon Rowe <simon@wiremoons.com> --...
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Text_IO; use Ada.Text_IO; with Generic_Stack; procedure RPN_to_Infix is -- The code above begin Put_Line ("3 4 2 * 1 5 - 2 3 ^ ^ / + = "); Put_Line (Convert ("3 4 2 * 1 5 - 2 3 ^ ^ / +")); Put_Line ("1 2 + 3 4 + ^ 5 6 + ^ = "); ...
with Ada.text_io; use Ada.Text_IO; procedure main is task type Server_Task is entry A; entry B; end Server_Task; task body Server_Task is begin loop Put_Line("Server starts next cycle"); select accept A do Put_Line("A start"); d...
with Ada.Containers.Vectors; with Readable_Sequences.Generic_Sequences; package Readable_Sequences.String_Sequences is package Basic_String_Sequences is new Generic_Sequences (Element_Type => Character, Element_Array => String); type Sequence (<>) is new Basic_String_Seque...
-- AoC 2020, Day 21 with Ada.Text_IO; with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Containers.Ordered_Sets; with Ada.Containers.Vectors; use Ada.Containers; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Hash; package body Day is packag...
------------------------------------------------------------------------------ -- G P S -- -- -- -- Copyright (C) 2000-2016, AdaCore -- -- ...
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Display; package PortScan.Ops is package DPY renames Display; function port_name (id : port_id) return String; function next_ignored_port return port_id; function ignore_reason (id : port_id) re...
generic type Parent_Random_Int is mod <>; package Xor_Shift with Spark_Mode => On is pragma Pure (Xor_Shift); pragma Assert (Parent_Random_Int'Modulus >= 2**61); subtype Valid_XOR_Shift_Range is Parent_Random_Int range 1 .. 2**61-1; -- Seeds need to be in this range. Input of 0 gives period o...
-- Helper types and Create operations for frequently combined Gnoga widgets -- -- Copyright (C) 2018 by PragmAda Software Engineering -- -- Released under the terms of the 3-Clause BSD License. See https://opensource.org/licenses/BSD-3-Clause with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with Gnoga.Gui.Elem...
with System.Synchronous_Objects.Abortable; with System.Tasks; package body Ada.Synchronous_Task_Control.EDF is procedure Suspend_Until_True_And_Set_Deadline ( S : in out Suspension_Object; TS : Real_Time.Time_Span) is Dummy : Boolean; begin Suspend_Until_True_And_Set_Deadline (S, TS, D...
package Parse_Shift_Reduce is type Small_Integer is range -32_000 .. 32_000; type Shift_Reduce_Entry is record T : Small_Integer; Act : Small_Integer; end record; pragma Pack(Shift_Reduce_Entry); subtype Row is Integer range -1 .. Integer'Last; --pragma suppress(index_check);...
with Ada.Unchecked_Deallocation; package body Liste_Generique is procedure Liberer is new Ada.Unchecked_Deallocation(Cellule, Pointeur); procedure Vider(L : in out Liste) is Cour : Pointeur := L.Debut; Next : Pointeur; begin while Cour /= null loop Next := Cour.Suivant...
with Memory.Wrapper; use Memory.Wrapper; with Applicative; use Applicative; package Memory.Transform is type Transform_Type is abstract new Wrapper_Type and Applicative_Type with private; type Transform_Pointer is access all Transform_Type'Class; function Get_Name(mem : Transform_Type) retu...
-- This spec has been automatically generated from STM32F40x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.USB_OTG_HS is pragma Preelaborate; --------------- -- Registers -- --------------- subtype OTG_HS_DCFG_DSP...
generic package Accumulator is -- This Ada generic package represents an accumulator factory. -- The required function is provided as The_Function. -- The first call to The_Function sets the initial value. -- (Marius Amado-Alves) function The_Function (X : Integer) return Integer; function The_Function (X :...
with Interfaces; package STM32.F4.FSMC is pragma Pure; type Memory_Type is ( SRAM, PSRAM, NOR_Flash ); type Memory_Databus_Width is ( Databus_8_bit, Databus_16_bit ); for Memory_Databus_Width use ( Databus_8_bit => 2#00#, Databus_16_bit => 2#01# ); type CRAM_Page_Size is ( CRAM_No_Burst_Split...
-- https://adventofcode.com/2020 package Adventofcode is pragma Elaborate_Body; end Adventofcode;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
----------------------------------------------------------------------- -- asf -- XHTML Reader -- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file e...
package body Noinline3_Pkg is function Inner (A, B : Integer) return Integer; pragma No_Inline (Inner); function Inner (A, B : Integer) return Integer is begin return A + B; end; function F (A, B : Integer) return Integer is begin return Inner (A, B) + Inner (A, -B); end; end Noinline3_Pkg;
package Opt10_Pkg is type Rep_Message is record Bit : Boolean; Data : String (1 .. 4); end record; for Rep_Message use record Bit at 0 range 0 .. 0; Data at 0 range 1 .. 32; end record; procedure Safe_Assign (M : in out Rep_Message; Bit : Boolean); end;
-- -- Copyright (C) 2022, AdaCore -- pragma Style_Checks (Off); -- This spec has been automatically generated from STM32F3x4.svd with System; package Interfaces.STM32.SYSCFG is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Registers -- --------------- subtype SYSCFG_...
with Ada.Unchecked_Deallocation; package body Regions.Shared_Lists is procedure Reference (Self : not null List_Node_Access) with Inline; procedure Unreference (Self : in out List_Node_Access) with Inline; procedure Free is new Ada.Unchecked_Deallocation (List_Node, List_Node_Access); --------- ...
-- This spec has been automatically generated from STM32L151.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.FSMC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype BCR_MTYP_Field is HAL...
-- Adds carriage return (0Dh) before line feed (0Ah) if it does not present package Encodings.Line_Endings.CR_LF is pragma Pure; end Encodings.Line_Endings.CR_LF;
-------------------------------------------------------------------------------- -- MIT License -- -- Copyright (c) 2020 Zane Myers -- -- 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 witho...
-- Copyright 2017 Steven Stewart-Gallus -- -- 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 agr...
with Ada.Strings.Unbounded; with Ada.Text_IO; with Trendy_Terminal.Maps; with Trendy_Terminal.Platform; with Trendy_Terminal.VT100; package body Trendy_Terminal.Example.Input is package AIO renames Ada.Text_IO; package ASU renames Ada.Strings.Unbounded; package TT renames Trendy_Terminal; -- Name th...
-- { dg-do compile } with Ada.Streams; use Ada.Streams; procedure Addr9_3 is type Signal_Type is mod 2 ** 16; type A_Item is record I : Signal_Type; Q : Signal_Type; end record with Size => 32; for A_Item use record I at 0 range 0 .. 15; Q at 2 range 0 .. 15; ...
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- ...
I think there is a problem of memory deallocation. For instance when you run the following program, after a moment you get an error of 'swap space' ... In fact, the compiler don't seem to deallocate the locals variables. ------------------------- procedure test2 is procedure x is c : integer; ...
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- This software was developed by John Self of the Arcadia project -- at the University of California, Irvine. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and t...
package agar.gui.widget.radio is use type c.unsigned; type flags_t is new c.unsigned; RADIO_HFILL : constant flags_t := 16#01#; RADIO_VFILL : constant flags_t := 16#02#; RADIO_EXPAND : constant flags_t := RADIO_HFILL or RADIO_VFILL; type radio_t is limited private; type radio_access_t is access all r...
with Ada.Numerics.Discrete_Random; package body Q_Gen_Shuffle is procedure P_Shuffle (List : in out Array_Type) is package Discrete_Random is new Ada.Numerics.Discrete_Random (Result_Subtype => Positive); use Discrete_Random; K : Positive; G : Generator; T : Element_Type; begin ...
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Command_line; use Ada.Command_line; procedure Fib is N : Integer := Integer'Value (Argument(1)); Res : Integer; function Fibonacci (N: Positive) return Positive is begin if N < 3 then return 1; else r...
with GNAT.OS_Lib; use GNAT.OS_Lib; package body FSmaker.Sink.File is ------------ -- Create -- ------------ function Create (Path : String) return Sink.Class is Res : Instance; begin Res.FD := Open_Append (Path, Binary); if Res.FD = Invalid_FD then raise Program_Error with ...
------------------------------------------------------------------------------ -- Copyright (c) 2011, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- p...
with Libadalang.Common; use Libadalang.Common; package body Shared is function Nr_Of_Parameters (S_S : Subp_Spec) return Integer is Return_Value : Integer := 0; begin for Param of S_S.F_Subp_Params.F_Params loop Return_Value := Return_Value + Param.F_Ids.Children'Length; ...
with Ada.Text_IO; use Ada.Text_IO; procedure Mfact is function MultiFact (num : Natural; deg : Positive) return Natural is Result, N : Integer := num; begin if N = 0 then return 1; end if; loop N := N - deg; exit when N <= 0; Result := Result * N; end loop; return Result; end ...
-- Standard I/O Streams with Ada.Integer_Text_Io; procedure APlusB is A, B : Integer; begin Ada.Integer_Text_Io.Get (Item => A); Ada.Integer_Text_Io.Get (Item => B); Ada.Integer_Text_Io.Put (A+B); end APlusB;
-- SPDX-FileCopyrightText: 2021 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Interfaces.C; with Ada.Exceptions; package body Network.Managers.TCP_V4_Out is procedure Change_Watch (Self : in out Out_Socket'Class; ...
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Compilation_Units; with Program.Visibility; private procedure Program.Resolve_Standard (Unit : not null Program.Compil...