text
stringlengths
0
234
country_forecast := QLineSeries_create;
QPen_setWidth(pen_forecast, 3);
QAreaSeries_setPen(country_forecast, pen_forecast);
Function Definition: procedure reset_chart is
Function Body: begin
country_forecast_entries.clear;
update_chart;
update_forecast_range_chart;
Function Definition: procedure set_initial_date_limits is
Function Body: function find_first_case_date return integer is
begin
for i in country_entries.first_index .. country_entries.last_index loop
if country_entries.element (i).cumulative_cases > 0.0 then
return i;
end if;
end loop;
return -1;
Function Definition: procedure update_min_max_date_limits is
Function Body: function get_maximum_start_time(end_time : time) return Time is
begin
return ada.calendar.arithmetic."-" (end_time, 5);
Function Definition: procedure slot_compute_xph is
Function Body: c : country := country'val(QComboBox_currentIndex (country_choice));
steps : integer := QSpinBox_value (steps_value);
i,j,k,l,m : integer := steps + 1;
size : integer := i*j*k*l*m;
covid_data : country_entries_array := to_country_entries_array (country_entries);
start_date : QDateH := QDateTimeEdit_date (start_date_value);
start_time : Time := Ada.Calendar.Formatting.time_of (QDate_year (start_date), QDate_month (start_date), QDate_day (start_date));
end_date : QDateH := QDateTimeEdit_date (end_date_value);
end_time : Time := Ada.Calendar.Formatting.time_of (QDate_year (end_date), QDate_month (end_date), QDate_day (end_date));
function get_date_index (date_time : time) return integer is
begin
for i in covid_data'range loop
if covid_data (i).date = date_time then
return i;
end if;
end loop;
return -1;
Function Definition: procedure slot_export_to_csv;
Function Body: pragma Convention (C, slot_export_to_csv);
Function Definition: function Conversion is new Ada.Unchecked_Conversion(
Function Body: Source => Stream_Element_Array,
Target => Element_Type
);
begin
Stream.Read(Buffer, Buffer_Last);
Element_Count := Natural(Buffer_Last / Element_Length);
Last := Item'First; -- + (Element_Count - 1);
Buffer_I := 1;
for I in 1..Element_Count loop
Item(Last) := Conversion(Buffer(Buffer_I .. Buffer_I + Element_Length - 1));
Last := Index_Type'Succ(Last);
Buffer_I := Buffer_I + Element_Length;
end loop;
Last := Index_Type'Pred(Last);
Function Definition: procedure Inst is new Read_Array(Element_Type => Character, Index_Type => Positive, Array_Type => String);
Function Body: begin
Inst(Stream, Item, Last);
Function Definition: procedure Test is
Function Body: B : Block_Header;
C : Block_Header := Block_Header'(Status => Occupied,
Prev_Block_Address => Address_Null,
Prev_Block_Status => Absent,
Next_Block_Status => Free,
Size => 1);
A : System.Address := SSE.To_Address(0);
begin
Set_Block_At_Address(A, 0, C);
pragma Assert(Proof.Block_Present_At_Address(0));
pragma Assert(Proof.Block_At_Address(0) = C);
end Test;
---------------------------
-- Work with Free Blocks --
---------------------------
procedure Unlink_From_Free_List (Base : System.Address;
Address : Aligned_Address;
Block : in out Block_Header;
Free_List : in out Free_Blocks_List)
is
Prev_Address : constant Aligned_Address := Block.Free_List.Prev_Address;
Next_Address : constant Aligned_Address := Block.Free_List.Next_Address;
begin