text stringlengths 0 234 |
|---|
Accum : Number := Value; |
Shift : Integer; |
begin |
Exponent := 0; |
if Accum < 2.0**Fraction_Bits then |
Shift := 24; |
while Shift > 0 loop |
if Accum < 2.0**(Mantissa_Bits - Shift) then |
Accum := Accum * 2.0**Shift; |
Exponent := Exponent - Shift; |
else |
Shift := Shift / 2; |
end if; |
end loop; |
elsif Accum >= 2.0**Mantissa_Bits then |
Shift := 8; |
while Shift > 0 loop |
if Accum >= 2.0**(Fraction_Bits + Shift) then |
Accum := Accum / 2.0**Shift; |
Exponent := Exponent + Shift; |
else |
Shift := Shift / 2; |
end if; |
end loop; |
end if; |
Mantissa := Unsigned_64 (Accum); |
Function Definition: procedure Select_Table_1 is new Select_Table_N (1); |
Function Body: procedure Select_Table_10 is new Select_Table_N (10); |
procedure Select_Table_100 is new Select_Table_N (100); |
procedure Select_Table_500 is new Select_Table_N (500); |
procedure Select_Table_1000 is new Select_Table_N (1000); |
Create_SQL : Ada.Strings.Unbounded.Unbounded_String; |
procedure Register (Tests : in out Context_Type) is |
Driver : constant String := Tests.Get_Driver_Name; |
begin |
if Driver /= "sqlite" and Driver /= "postgresql" then |
Tests.Register (Do_Static'Access, "DO 1"); |
end if; |
Tests.Register (Select_Static'Access, "SELECT 1"); |
Tests.Register (Connect_Select_Static'Access, "CONNECT; SELECT 1; CLOSE"); |
Tests.Register (Drop_Create'Access, "DROP table; CREATE table", 1); |
Tests.Register (Insert'Access, "INSERT INTO table", 10); |
Tests.Register (Select_Table_1'Access, "SELECT * FROM table LIMIT 1"); |
Tests.Register (Select_Table_10'Access, "SELECT * FROM table LIMIT 10"); |
Tests.Register (Select_Table_100'Access, "SELECT * FROM table LIMIT 100"); |
Tests.Register (Select_Table_500'Access, "SELECT * FROM table LIMIT 500"); |
Tests.Register (Select_Table_1000'Access, "SELECT * FROM table LIMIT 1000"); |
Util.Files.Read_File (Tests.Get_Config_Path ("create-table.sql"), Create_SQL); |
end Register; |
procedure Do_Static (Context : in out Context_Type) is |
Stmt : ADO.Statements.Query_Statement := Context.Session.Create_Statement ("DO 1"); |
begin |
for I in 1 .. Context.Repeat loop |
Stmt.Execute; |
end loop; |
end Do_Static; |
procedure Select_Static (Context : in out Context_Type) is |
Stmt : ADO.Statements.Query_Statement := Context.Session.Create_Statement ("SELECT 1"); |
begin |
for I in 1 .. Context.Repeat loop |
Stmt.Execute; |
end loop; |
end Select_Static; |
procedure Connect_Select_Static (Context : in out Context_Type) is |
begin |
for I in 1 .. Context.Repeat loop |
declare |
DB : constant ADO.Sessions.Session := Context.Factory.Get_Session; |
Stmt : ADO.Statements.Query_Statement := DB.Create_Statement ("SELECT 1"); |
begin |
Stmt.Execute; |
Function Definition: procedure Main is |
Function Body: WG : World_Grid (16); |
B : Boolean; |
begin |
WG := New_World (16); |
B := Get_Spot (WG, 1, 1); |
Put_Line ("World Size: " & Integer'Image(WG.Size)); |
Put_Line ("Hello Ada!"); |
--Gtk.Main.Init; |
--Gtk_New (Life_Value); |
--Gtk.Main.Main; |
Function Definition: function on_is_Label_clicked (the_Label : access Gtk_Label_Record'Class; |
Function Body: Self : in aIDE.Editor.of_enumeration_type.view) return Boolean |
is |
pragma Unreferenced (the_Label); |
begin |
Self.Target.add_Literal ("literal"); |
Self.freshen; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.