content
stringlengths
23
1.05M
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- 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...
with Interfaces; package ACO.OD_Types is pragma Preelaborate; subtype Object_Index is Interfaces.Unsigned_16; subtype Object_Subindex is Interfaces.Unsigned_8; type Entry_Index is record Object : Object_Index; Sub : Object_Subindex; end record; type Byte_Array is array (Natural ra...
-------------------------------------------------------------------------------- -- -- -- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers. -- -- ...
with Ada.Containers.Hashed_Sets, Ada.Containers.Ordered_Sets, Ada.Containers.Ordered_Maps, Ada.Containers.Vectors; use Ada.Containers; with Ada.Text_IO; use Ada.Text_IO; procedure Day07 is type Edge_Record is record From : Character; To : Character; end record; ...
-- { dg-do compile } with text_io; use text_io; procedure modify_a_constant is type Outer; type Inner (Outer_Ref : access Outer) is limited null record; type Outer is limited record Inner_Field : Inner (Outer_Ref => Outer'Access); Integer_Field : Integer; end record; ...
with GESTE; with Interfaces; use Interfaces; generic Width : Natural; Height : Natural; Pixel_Scale : Natural; Buffer_Size : Positive; package SDL_Display is Screen_Rect : constant GESTE.Pix_Rect := ((0, 0), (Width - 1, Height - 1)); Buffer : GESTE.Output_Buffer (1 .. Buffer_Size); proced...
package Modular4_Pkg is type Word is mod 2**48; Zero : constant Word := 0; function F return Word; end Modular4_Pkg;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2017, AdaCore -- -- -- -- ...
-- Copyright (c) 2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with League.Strings; with LSP.Types; with Ada_LSP.Completions; with Ada_LSP.Documents; package body Ada_LSP.Handlers is functio...
-- Copyright (c) 2021 Bartek thindil Jasicki <thindil@laeran.pl> -- -- 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...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
with Ada.Calendar; use Ada.Calendar; with Ada.Numerics.Float_Random; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Checkpoint is package FR renames Ada.Numerics.Float_Random; No_Of_Cubicles: constant Positive := 3; -- That many workers can work in parallel No_Of_Workers:...
-- Copyright 2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. name = "Searchcode" type = "scrape" function start() set_rate_limit(2) end function vertical(ctx, domain) for i=0,20 do local page, err = request(ctx, {...
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with AdaBase.Interfaces.Driver; -- with AdaBase.Connection.Base.Firebird; with AdaBase.Statement; with AdaBase.DataTypes; package AdaBase.Driver.Base.Firebird is package AID renames AdaBase.Interfaces.Driv...
------------------------------------------------------------------------------ -- -- -- GNAT SYSTEM UTILITIES -- -- -- -- ...
package body System.Tasking.Async_Delays is function Enqueue_Duration ( T : Duration; D : not null access Delay_Block) return Boolean is begin raise Program_Error; -- unimplemented return Enqueue_Duration (T, D); end Enqueue_Duration; procedure Cancel_Async_Delay (D : not nul...
-- testWriter.c -- -- section: xmlWriter -- synopsis: use various APIs for the xmlWriter -- purpose: tests a number of APIs for the xmlWriter, especially -- the various methods to write to a filename, to a memory -- buffer, to a new document, or to a subtree. It shows how to -- do encoding st...
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with Ada.Containers.Hashed_Maps; with Ada.Directories; with Ada.Exceptions; with Ada.Characters.Handling; with Ada.Strings.Fixed; with Ada.Text_IO; with Tokenization; package body Specs is use Ada....
with text_io; package int_io is new text_io.integer_io(integer); -- ERROR -- text_io incorrectly made visible by "with int_io;" -- with int_io; procedure main is begin text_io.put_line("hello"); end;
-- Copyright 2009, 2010, 2011 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....
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016, AdaCore -- -- -- -- ...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- ...
----------------------------------------------------------------------- -- security-oauth-file_registry -- File Based Application and Realm -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you ma...
-- -*- Mode: Ada -*- -- Filename : vga_console.adb -- Description : Implementation of a console for PC using VGA text mode. -- Author : Luke A. Guest -- Created On : Thu Jun 14 12:09:31 2012 -- Licence : See LICENCE in the root directory. --------------...
with Ada.Containers.Hashed_Sets, Ada.Containers.Synchronized_Queue_Interfaces, Ada.Containers.Unbounded_Priority_Queues, Ada.Text_IO; package body Dijkstra is use Ada.Containers; Nil_Node : Node; pragma Unmodified (Nil_Node); type Node_Element_Info is record This : Node; P...
-- Abstract : -- -- See spec. -- -- Copyright (C) 2017 - 2020 Free Software Foundation, Inc. -- -- This file is part of the WisiToken package. -- -- The WisiToken package is free software; you can redistribute it -- and/or modify it under terms of the GNU General Public License as -- published by the Free Softwa...
----------------------------------------------------------------------- -- helios-tools-files -- File parsing utilities for Helios -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use...
----------------------------------------------------------------------- -- are-installer-copies -- Copy based distribution artifact -- Copyright (C) 2012, 2013, 2021 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- yo...
with Ada.Text_IO; use Ada.Text_IO; procedure Test is procedure P(X: in out Integer) is begin new_line; end; begin P(42); end;
-- { dg-do compile } with Size_Attribute1_Pkg1; package Size_Attribute1 is function Num return Natural; pragma Import (Ada, Num); type A is array (Natural range <>) of Integer; type T is record F1 : Long_Float; F2 : A (1 .. Num); end record; package My_Q is new Size_Attribute1_Pkg1 (...
-- { dg-do compile } -- { dg-options "-flto" { target lto } } with Lto12_Pkg; use Lto12_Pkg; package Lto12 is C : constant R := F; end Lto12;
with Text_IO; with System.Multiprocessors;use System.Multiprocessors; package body Dispatch is task body My_Task is begin Text_Io.Put_Line(CPU'First'Img & " " & CPU'Last'Img); for I in 1 .. 100 loop delay 1.0; end loop; end My_Task; end Dispatch;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- ...
-- { dg-do compile } -- { dg-options "-gnatws -O" } with Unchecked_Conversion; package body loop_unchecked_conversion is type Byte is mod 2**8; type List is array (Natural range <>) of Byte; subtype Integer_List is List (1 .. 4); function Integer_Down is new Unchecked_Conversion (Source => Intege...
with Ada.Text_IO; use Ada.Text_IO; procedure Dinesman is subtype Floor is Positive range 1 .. 5; type People is (Baker, Cooper, Fletcher, Miller, Smith); type Floors is array (People'Range) of Floor; type PtFloors is access all Floors; function Constrained (f : PtFloors) return Boolean is begin if...
-- -- Copyright (C) 2019, AdaCore -- -- Copyright (c) 2010 - 2018, Nordic Semiconductor ASA -- -- 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 mu...
with agar.core.event; with agar.core; with agar.gui.widget; with agar.gui.window; with agar.gui; with demo; with slider_callbacks; procedure slider is package gui_event renames agar.core.event; package gui_widget renames agar.gui.widget; package gui_window renames agar.gui.window; begin demo.init ("slider", w...
-- This code is for compiler front end testing only. It does nothing at run time. procedure Requeue_Statement_2 is protected Protected_1 is entry Entry_1; entry Entry_2; private Barrier_Open : Boolean := False; end Protected_1; protected body Protected_1 is entry Entry_1 wh...
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2017, AdaCore -- -- -- -- ...
-- Stnd Binary Rank Test. with text_io; use text_io; with Binary_Rank; with Disorderly.Random; use Disorderly.Random; with Disorderly.Random.Clock_Entropy; with Ada.Numerics.Discrete_Random; with Chi_Gaussian_CDF; procedure rank_tst_demo_1 is type Real is digits 15; Bits_per_Random_Word : constant := 32; ...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
with shell.Commands, gnat.OS_Lib, ada.Strings.fixed, ada.Strings.Maps, ada.Characters.latin_1, ada.Exceptions; package body lace.Environ.OS_Commands is use ada.Exceptions; function Path_to (Command : in String) return Paths.Folder is use Paths; begin return to_...
-- ----------------------------------------------------------------------------- -- Copyright (C) 2003-2019 Stichting Mapcode Foundation (http://www.mapcode.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...
pragma Warnings (Off); with Interfaces; use Interfaces; pragma Warnings (On); package STM32GD is pragma Preelaborate; type UID_Type is array (1 .. 3) of Unsigned_32; procedure Wait_For_Interrupt with Inline_Always; procedure Clear_Event with Inline_Always; procedure Wait_For_Event with Inline_Always;...
-- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, not taking more than you give. -- with Ada.Directories; with Setup; with Ba...
with Interfaces; use Interfaces; package Bitmap_Graphics is type Color is (Black, White); for Color use (Black => 0, White => 255); type Point is record X : Natural; Y : Natural; end record; type Size is record Width : Natural; Height : Natural; end record; type Byte_Array is array...
-- Copyright (c) 2020-2021 Bartek thindil Jasicki <thindil@laeran.pl> -- -- 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 vers...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- Copyright (C) 2018, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- t...
with ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage; use ObjectPack, AbstractStrategyCombinatorPackage, IntrospectorPackage, StrategyPackage; package NoStrategy is ARG : constant Integer := 0; type No is new AbstractStrategyCombinator and Object with null record; ------------...
package Loop_Optimization15 is type B16_T is mod 2 ** 16; for B16_T'Size use 16; for B16_T'Alignment use 1; procedure Proc (L : B16_T); end Loop_Optimization15;
with FSmaker.Commands; procedure Fsmaker_Main is begin FSmaker.Commands.Execute; end Fsmaker_Main;
package body lace.Environ is function to_octal_Mode (Permissions : in permission_Set) return String is function octal_Permissions (Bit_3, Bit_2, Bit_1 : in Boolean) return String is begin if Bit_3 then if Bit_2 then if Bit_1 then return "7"; ...
with Ada.Unchecked_Conversion; with USB.Device.MIDI; with USB.Device; with RP.Device; with Sound; with HAL; package body MIDI is USB_Stack : USB.Device.USB_Device_Stack (Max_Classes => 1); USB_MIDI : aliased USB.Device.MIDI.Default_MIDI_Class (TX_Buffer_Size => 64, RX_Buffer_Size => 64); type C...
-- Hello World in Ada with Text_IO; procedure Hello_World is begin Text_IO.Put_Line("Hello World!"); end Hello_World;
-- This package has been generated automatically by GNATtest. -- Do not edit any part of it, see GNATtest documentation for more details. -- begin read only with GNATtest_Generated; package Tk.Widget.Widget_Options_Test_Data.Widget_Options_Tests is type Test_Widget_Options is abstract new GNATtest_Generated ...
PROCEDURE Private_Access_Type IS PACKAGE P IS TYPE INT_ARRAY IS ARRAY (INTEGER RANGE <>) OF INTEGER; TYPE UNCONSTR_ARRAY_ACCESS IS ACCESS INT_ARRAY; TYPE CONSTR_ARRAY_ACCESS IS PRIVATE; PRIVATE TYPE CONSTR_ARRAY_ACCESS IS ACCESS UNCONSTR_AR...
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- ...
------------------------------------------------------------------------------ -- Copyright (c) 2015, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- p...
package body Father is procedure Father_What (A : in out Father_Type) is begin A := A + 1; end Father_What; end Father;
-- { dg-do compile } -- { dg-options "-gnatW8" } with Ada.Numerics; procedure wide_pi is begin null; end;
with Ada.Text_IO; package body Plop is procedure Print (This : A'Class) is begin Ada.Text_IO.Put_Line (This.Img); end Print; end Plop;
with Simulation; with Ada.Text_IO; use Ada.Text_IO; package body MPU6000.Driver with SPARK_Mode, Refined_State => (State => (Is_Init)) is procedure Init is null; -- Test if the MPU6000 is initialized and connected. function Test return Boolean is (True); -- Test if we are connected to MPU6000 via I2C...
-- CC1304B.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...
package freetype_c.FT_CharMapRec is type Item is record Face : access FT_FaceRec; Encoding : aliased FT_Encoding; Platform_Id : aliased FT_UShort; Encoding_Id : aliased FT_UShort; end record; type Item_array is array (C.Size_t range <>) of aliased FT_Ch...
with TLSF.Config; with TLSF.Block.Types; with TLSF.Context; with TLSF.Proof.Model.Context; with TLSF.Proof.Model.Block; package TLSF.Block.Operations with SPARK_Mode is use TLSF.Config; package BT renames TLSF.Block.Types; package TC renames TLSF.Context; package MB renames TLSF.Proof.Model.Block; ...
with Text_IO; use Text_IO; procedure example is begin -- Hello world in ADA Put_Line("Hello world"); end example;
pragma License (Unrestricted); -- implementation unit required by compiler package System.Wid_Bool is pragma Pure; -- required for Boolean'Width by compiler (s-widboo.ads) function Width_Boolean (Lo, Hi : Boolean) return Natural; end System.Wid_Bool;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
-- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Module: CRC-8 -- -- Authors: Emanuel Regnath (emanuel.regnath@tum.de) -- -- Description: Logs MavLink raw packages on SD-card -- -- ToDo: -- [ ] Implementation with HIL; package CRC8 with S...
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with Glfw.Windows.Context; package Glfw.Windows.Hints is procedure Reset_To_Defaults; ----------------------------------------------------------------------------- -- Window related -----...
pragma Style_Checks (Off); pragma Warnings (Off); with GL; with GLOBE_3D.Textures; -- with Ada.Numerics; use Ada.Numerics; package body Box is package g3d renames GLOBE_3D; procedure Create (object : in out GLOBE_3D.p_Object_3D; Sides : GLOBE_3D.Vector_3D := (1...
with Ada.Exception_Identification.From_Here; package body Ada.Hierarchical_File_Names is use Exception_Identification.From_Here; function Parent_Directory_Name ( Level : Positive) return String; function Parent_Directory_Name ( Level : Positive) return String is begin return R...
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------- -- Copyright (c) 2016, Daniel King -- 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 s...
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. package body Apsepp.Test_Event_Class.Impl is ---------------------------------------------------------------------------- package body Derivation is -------------------------------------------------...
-- Copyright (c) 2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- private package Ada_Pretty.Expressions is type Apply is new Node with private; function New_Apply (Prefix : not null N...
-- Ascon_Check_Padding -- Ensure that associated data of different length are accepted and messages -- of different lengths correctly encrypt and decrypt. This is largely aimed -- at checking the implementation of padding. -- Copyright (c) 2016, James Humphry - see LICENSE file for details with Ada.Text_IO; use Ada....
-- Copyright (c) 2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- private package Ada_Pretty.Clauses is type Aspect is new Node with private; function New_Aspect (Name : not null Node_Ac...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ...
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with League.Strings; with Incr.Nodes.Tokens; package body Incr.Parsers.Incremental is --------- -- Run -- --------- ...
-- { dg-do run } procedure self_aggregate_with_array is type Value_Bounds is array (1 .. 2) of Natural; type Sensor is record Value : Natural; Bounds : Value_Bounds; end record; Pressure : Sensor; begin Pressure.Value := 256; Pressure := (Value => Pressure.Value, Bounds => (1, 2)); ...
------------------------------------------------------------------------------- -- Copyright (c) 2016 Daniel King -- -- 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, in...
pragma Ada_2012; with Ada.Text_IO; package body wa2 is procedure Set_Smth (AB : in out Abstract_Base'Class; smth : Integer) is use Ada.Text_IO; begin Put_Line(" Set_smth(" & smth'img & ")"); -- never gets here declare R : Repr := AB.ToRepr; begin R.smth...
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Extensions; package console_types_h is TCOD_KEY_TEXT_SIZE : constant := 32; -- console_types.h:109 -- BSD 3-Clause License -- * -- * Copyright © 2008-2021, Jice and the libtcod contributors. -- * All righ...
-- { dg-do compile } with Interfaces; use Interfaces; package Alignment2 is pragma Warnings (Off, "*size*"); -- warning type R1 is record A, B, C, D : Integer_8; end record; for R1'Size use 32; for R1'Alignment use 32; -- { dg-warning "suspiciously large alignment" } -- warning type R2 is recor...
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2018 - 2019 Joakim Strandberg <joakim@mequinox.se> -- -- 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.ap...
generic N: positive; package Generic_Perm is subtype Element is Positive range 1 .. N; type Permutation is array(Element) of Element; procedure Set_To_First(P: out Permutation; Is_Last: out Boolean); procedure Go_To_Next(P: in out Permutation; Is_Last: out Boolean); end Generic_Perm;
pragma Check_Policy (Trace => Ignore); with Ada; -- assertions with System.Unwind.Mapping; with System.Unwind.Occurrences; package body System.Unwind.Handling is pragma Suppress (All_Checks); use type Unwind.Representation.Machine_Occurrence_Access; use type Unwind.Representation.Unwind_Exception_Class; --...
------------------------------------------------------------------------ -- Copyright (C) 2004-2020 by <ada.rocks@jlfencey.com> -- -- -- -- This work is free. You can redistribute it and/or modify it under -- -- the terms of the Do ...
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- ...
------------------------------------------------------------------------------ -- Copyright (c) 2015-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- p...
------------------------------------------------------------------------------ -- Copyright (c) 2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- p...
-- { dg-do compile } -- { dg-options "-gnatc" } pragma Restrictions (No_Entry_Queue); package Restricted_Pkg is type Iface is limited interface; protected type PO is new Iface with procedure Dummy; end; end;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- ...
package body dcola is procedure cvacia(qu: out cola) is p: pnodo renames qu.p; q: pnodo renames qu.q; begin p := null; q := null; end cvacia; function esta_vacia(qu: in cola) return Boolean is q: pnodo renames qu.q; begin return q=null; end esta_vacia; function coger...
-- DECLS-DTSIMBOLS.adb -- Procediments de la taula de simbols package body Decls.Dtsimbols is procedure printts (ts : in tsimbols; tn : in taula_de_noms) is begin New_Line; Put_Line(""); Put_Line("tdesc ------------"); for i in 1 .. (id_nom'Last-970) loop Put("tdesc["...
-- -- Copyright 2021 (C) Jeremy Grosser <jeremy@synack.me> -- -- SPDX-License-Identifier: BSD-3-Clause -- with RP.Device; package body Pimoroni_LED_Dot_Matrix is procedure Initialize is Init_Options : constant HAL.UInt8 := 2#00001110#; -- 1110 = 35 mA; 0000 = 40 mA Init_Mode : constant HAL....