Commit 364eb12d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Cleanup here and there

parent 4021c3a6
......@@ -258,15 +258,6 @@ package body TASTE.Concurrency_View is
for T of Partition.Threads loop
declare
-- There is no "&" operator for Translate sets...
function Join_Sets (S1, S2 : Translate_Set)
return Translate_Set is
Result : Translate_Set := S1;
begin
Insert (Result, S2);
return Result;
end Join_Sets;
-- Render each thread
Name : constant String := To_String (T.Name);
Thread_Assoc : constant Translate_Set :=
......@@ -365,7 +356,9 @@ package body TASTE.Concurrency_View is
RI_Assoc & Assoc
("Partition_Name", Partition_Name)));
end loop;
Block_Assoc := Block_Assoc
Block_Assoc :=
Join_Sets (Block_Assoc, CV.Configuration.To_Template)
& Assoc ("Protected_PIs", Pro_PI_Tag)
& Assoc ("Unprotected_PIs", Unpro_PI_Tag)
& Assoc ("Required", RI_Tag);
......
......@@ -289,4 +289,12 @@ package body TASTE.Parser_Utils is
Ocarina.FE_AADL.Parser.Add_Pre_Prop_Sets := True;
end Initialize_Ocarina;
-- There is no "&" operator for Translate sets...
function Join_Sets (S1, S2 : Translate_Set) return Translate_Set is
Result : Translate_Set := S1;
begin
Insert (Result, S2);
return Result;
end Join_Sets;
end TASTE.Parser_Utils;
......@@ -153,6 +153,10 @@ package TASTE.Parser_Utils is
-- Define a vector for template_parser translate sets
package Translate_Sets is new Indefinite_Vectors (Natural, Translate_Set);
-- There is no "&" operator for Translate sets...
function Join_Sets (S1, S2 : Translate_Set) return Translate_Set;
private
Debug_Mode : Boolean := False;
end TASTE.Parser_Utils;
......@@ -7,6 +7,10 @@
@@-- @_Protected_PIs_@ : Protected Provided interfaces (from pi.tmplt)
@@-- @_Unprotected_PIs_@ : Unprotected Provided interfaces (from pi.tmplt)
@@-- @_Required_@ : Required interfaces (from ri.tmplt)
@@IF@@ @_Protected_PIs_@ /= ""
@@-- And all the system configuration obtained from the command line:
@@-- Interface_View, Deployment_View, Data_View, Binary_Path, Check_Data_View,
@@-- Output_Dir, Skeletons, Glue, Use_POHIC, Timer_Resolution, Debug_Flag,
@@-- No_Stdlib_Flag, Timer_Resolution, Other_Files (list of aadl files)
@@IF@@ @_Protected_PIs_@ /= "" and @_Use_POHIC_@
@_LOWER:Name_@_protected : data TASTE_Protected.Object;
@@END_IF@@
......@@ -44,17 +44,17 @@ public
@@END_TABLE@@
@@-- POHIC-only: declare protected objects to have runtime mutex
@@-- @@IF@@ @_Use_POHIC_@
data Taste_Protected
@@IF@@ @_Use_POHIC_@
data TASTE_Protected
properties
Concurrency_Control_Protocol => Protected_Access;
end Taste_Protected;
end TASTE_Protected;
data implementation Taste_Protected.Object
data implementation TASTE_Protected.Object
properties
Concurrency_Control_Protocol => Protected_Access;
end Taste_Protected.Object;
@@-- @@END_IF@@
end TASTE_Protected.Object;
@@END_IF@@
@_Nodes_@
......
......@@ -13,7 +13,7 @@
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@()
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@(void)
@@ELSE@@ @@-- contains param(s)
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\)\n)@@
......
......@@ -13,7 +13,7 @@
@@-- @_Calling_Threads_@ : Calling threads of the containing block
@@IF@@ @_Kind_@ = PROTECTED_OPERATION
@@IF@@ @_Param_Names'Length_@ = 0 @@-- zero param
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@();
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@(void);
@@ELSE@@ @@-- contains param(s)
void pro_@_LOWER:Parent_Function_@_@_LOWER:Name_@
@@INLINE( \()(,\n )(\);)@@
......
......@@ -40,6 +40,10 @@
#include <stdio.h>
#endif
@@IF@@ @_Language_@ = Ada or @_Language_@ = SDL
extern void adainit(void);
@@END_IF@@
void init_@_LOWER:Name_@()
{
static bool init = false;
......@@ -52,7 +56,6 @@ void init_@_LOWER:Name_@()
@_LOWER:Name_@_startup();
@@ELSIF@@ @_Language_@ = Ada or @_Language_@ = SDL
// Initialize Ada runtime to call elaboration functions
extern void adainit();
adainit();
@@END_IF@@
@@IF@@ @_EXIST:Sync_RIs_Parent_@
......@@ -60,7 +63,7 @@ void init_@_LOWER:Name_@()
// init function. Multiple calls are prevented by the "init" guard.
@@END_IF@@
@@TABLE@@
extern void init_@_LOWER:Sync_RIs_Parent_@();
extern void init_@_LOWER:Sync_RIs_Parent_@(void);
init_@_LOWER:Sync_RIs_Parent_@();
@@END_TABLE@@
puts ("[TASTE] Initialization completed for function @_Name_@");
......
......@@ -85,7 +85,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@()
// Directly call user code, no parameters to pass
// This could be done directly from the concurrency glue...
@@IF@@ @_Language_@ /= GUI
extern void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@();
extern void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(void);
@_LOWER:Parent_Function_@_PI_@_LOWER:Name_@();
// puts ("@_LOWER:Parent_Function_@_@_LOWER:Name_@ called");
@@END_IF@@
......
......@@ -67,10 +67,10 @@ extern "C" {
@@END_IF@@
// Function initialization - calls user startup code of all dependent functions
void init_@_LOWER:Name_@();
void init_@_LOWER:Name_@(void);
@@IF@@ @_Language_@ = "Ada" or @_Language_@ = "QGenAda"
extern void adainit();
extern void adainit(void);
@@END_IF@@
@@IF@@ @_EXIST:Provided_Interfaces_@ and @_Language_@ /= "Blackbox_C"
......
......@@ -24,6 +24,6 @@ void *OUT_@_LOWER:Param_Names_@, size_t *OUT_@_LOWER:Param_Names_@_len
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@();
void @_LOWER:Parent_Function_@_@_LOWER:Name_@(void);
@@END_IF@@
@@END_IF@@
......@@ -126,7 +126,7 @@ For example this is an extract of the C template:
extern "C" {
#endif
void @_LOWER:Name_@_startup();
void @_LOWER:Name_@_startup(void);
/* Provided interfaces */
@@TABLE@@
......
......@@ -20,7 +20,7 @@ void @_LOWER:Parent_Function_@_@_LOWER:Name_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_@_LOWER:Name_@(void)
@@END_IF@@
{
// Write your code here
......
......@@ -39,7 +39,7 @@
#include "Context-@_LOWER:Name_@.h"
@@END_IF@@
void @_LOWER:Name_@_startup()
void @_LOWER:Name_@_startup(void)
{
// Write your initialisation code, but DO NOT CALL REQUIRED INTERFACES
// puts ("[@_Name_@] Startup");
......@@ -51,7 +51,7 @@ void @_LOWER:Name_@_startup()
@@END_TABLE@@
@@TABLE@@
void @_LOWER:Name_@_PI_@_Timers_@()
void @_LOWER:Name_@_PI_@_Timers_@(void)
{
// This function is called when the timer expires
}
......
......@@ -22,7 +22,7 @@ asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *OUT_@_LOWER:Param_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(void)
@@END_IF@@
{
// Write your code here
......
......@@ -48,7 +48,7 @@ extern "C" {
typedef unsigned size_t;
#endif
void @_LOWER:Name_@_startup();
void @_LOWER:Name_@_startup(void);
/* Provided interfaces */
@@TABLE@@
......@@ -61,10 +61,10 @@ void @_LOWER:Name_@_startup();
@@END_TABLE@@
@@TABLE@@
void @_LOWER:Name_@_PI_@_Timers_@();
void @_LOWER:Name_@_PI_@_Timers_@(void);
/* Call these functions to set/reset @_Timers_@ (value in milliseconds)*/
void @_LOWER:Name_@_RI_SET_@_Timers_@(asn1SccT_UInt32 *);
void @_LOWER:Name_@_RI_RESET_@_Timers_@();
void @_LOWER:Name_@_RI_RESET_@_Timers_@(void);
@@END_TABLE@@
#ifdef __cplusplus
......
......@@ -19,7 +19,7 @@ asn1Scc@_REPLACE_ALL((-)/_):Param_Types_@ *OUT_@_LOWER:Param_Names_@
@@END_TABLE@@
@@END_INLINE@@
@@ELSE@@
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@()
void @_LOWER:Parent_Function_@_PI_@_LOWER:Name_@(void)
@@END_IF@@
{
// Write your code here
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment