Commit 3c6cca85 authored by Maxime Perrotin's avatar Maxime Perrotin

Fix code that was generating warnings at compile time

parent 336c16b0
......@@ -62,6 +62,7 @@ procedure BuildSupport is
Interface_Root : Node_Id := No_Node;
Deployment_root : Node_Id := No_Node;
Dataview_root : Node_ID := No_Node;
Success : Boolean;
OutDir : Integer := 0;
Stack_Val : Integer := 0;
......@@ -75,6 +76,7 @@ procedure BuildSupport is
procedure Parse_Command_Line;
procedure Process_Deployment_View (My_Root : Node_Id);
-- procedure Process_DataView (My_Root : Node_Id);
procedure Process_Interface_View (My_System : Node_Id);
procedure Browse_Deployment_View_System
(My_System : Node_Id; NodeName : String);
......@@ -677,6 +679,29 @@ procedure BuildSupport is
end if;
end Process_Interface_View;
-----------------------------
-- Process_DataView --
-----------------------------
-- procedure Process_DataView (My_Root : Node_Id) is
-- CI : Node_Id;
-- begin
-- Subs := My_Root;
-- while Present (Subs) loop
-- CI := Subs;
-- if Get_Category_Of_Component (CI) = CC_Data then
-- declare
-- SourceText : constant Name_Array := Get_Source_Text (CI);
-- begin
-- if SourceText'Length > 0 then
-- Put_Line (Get_Name_String (SourceText (1)));
-- end if;
-- end;
-- end if;
-- Subs := Next_Node (Subs);
-- end loop;
-- end Process_DataView;
-----------------------------
-- Process_Deployment_View --
-----------------------------
......@@ -687,7 +712,7 @@ procedure BuildSupport is
Root_Instance : Node_Id;
begin
if My_Root /= No_Node and then Concurrency_view /= 0 then
if My_Root /= No_Node and then Concurrency_view /= 0 then
-- Analyze the tree
Success := Ocarina.Analyzer.Analyze (AADL_Language, My_Root);
......@@ -1533,6 +1558,8 @@ procedure BuildSupport is
Deployment_Root := Ocarina.Parser.Parse
(AADL_Language, Deployment_Root, B);
end if;
Dataview_root := Ocarina.Parser.Parse
(AADL_Language, Dataview_root, B);
end if;
Exit_On_Error (No (Interface_Root), "Internal error");
......@@ -1558,6 +1585,8 @@ begin
Ocarina.Options.Root_System_Name :=
Get_String_Name ("interfaceview.others");
-- Process_DataView (Dataview_root);
Process_Interface_View
(Root_System (Instantiate_Model (Root => Interface_Root)));
......
......@@ -51,8 +51,10 @@ void c_preamble(FV * fv)
if (c == fv->language || cpp == fv->language) {
fprintf(vm_if, "#include \"%s.h\"\n\n", fv->name);
}
if (rtds == fv->language) {
else if (gui == fv->language) {
fprintf(vm_if, "#include \"%s_gui_header.h\"\n\n", fv->name);
}
else if (rtds == fv->language) {
fprintf(vm_if, "#include \"glue_%s.h\"\n\n", fv->name);
}
......
......@@ -96,7 +96,7 @@ void build_function_parameter_list(char **generated_code,
{
if (*generated_code != NULL)
build_string(generated_code, ",", strlen(","));
build_string(generated_code, "asn1Scc", strlen("asn1Scc"));
build_string(generated_code, "const asn1Scc", strlen("const asn1Scc"));
build_string(generated_code, parameter_type, strlen(parameter_type));
build_string(generated_code, "* ", strlen("* "));
build_string(generated_code, parameter_name, strlen(parameter_name));
......@@ -114,8 +114,7 @@ void build_assignation_code(char **generated_code, char *IF_name,
{
build_string(generated_code, " ", strlen(" "));
build_string(generated_code, IF_name, strlen(IF_name));
build_string(generated_code, "_", strlen("_"));
build_string(generated_code, "data.", strlen("data."));
build_string(generated_code, "__data.", strlen("__data."));
build_string(generated_code, parameter_name, strlen(parameter_name));
build_string(generated_code, " = *", strlen(" = *"));
build_string(generated_code, parameter_name, strlen(parameter_name));
......@@ -170,13 +169,13 @@ void create_local_Q_recption_variables(char
PI_name, strlen(PI_name));
build_string(pgenerated_function_local_message_list,
"_data ", strlen("_data "));
"__data ", strlen("__data "));
build_string(pgenerated_function_local_message_list,
PI_name, strlen(PI_name));
build_string(pgenerated_function_local_message_list,
"_data_receptacle;\n", strlen("_data_receptacle;\n"));
"__data_receptacle;\n", strlen("__data_receptacle;\n"));
}
......@@ -199,7 +198,7 @@ void create_assignation_code(char **pgenerated_assignation_code,
build_string(pgenerated_assignation_code, IF_name, strlen(IF_name));
build_string(pgenerated_assignation_code,
"_data_receptacle.", strlen("_data_receptacle."));
"__data_receptacle.", strlen("__data_receptacle."));
build_string(pgenerated_assignation_code,
param_name, strlen(param_name));
......@@ -238,14 +237,14 @@ void create_switch_structure(char **pgenerated_switch_structure,
PI_name, strlen(PI_name));
build_string(pgenerated_switch_structure,
"_data_receptacle, message_data_received, sizeof(T_",
strlen("_data_receptacle, message_data_received, sizeof(T_"));
"__data_receptacle, message__data_received, sizeof(T_",
strlen("__data_receptacle, message__data_received, sizeof(T_"));
build_string(pgenerated_switch_structure,
PI_name, strlen(PI_name));
build_string(pgenerated_switch_structure,
"_data));\n", strlen("_data));\n"));
"__data));\n", strlen("__data));\n"));
build_string(pgenerated_switch_structure,
PI_related_assignation_code,
......@@ -674,9 +673,9 @@ void create_outcomming_data_sender(FV * FV_NODE)
// to the structure to be stored in the queue
if (generated_function_parameter_list != NULL) {
fprintf(code_id,
" //Create a variable of type T_%s_data to be contained in the queue\n",
" //Create a variable of type T_%s__data to be contained in the queue\n",
IF_list_iterator->value->name);
fprintf(code_id, " T_%s_data %s_data;\n",
fprintf(code_id, " T_%s__data %s__data;\n",
IF_list_iterator->value->name,
IF_list_iterator->value->name);
}
......@@ -690,7 +689,7 @@ void create_outcomming_data_sender(FV * FV_NODE)
//Call the queue manager to store the data
if (strcmp (FV_NODE->name, "taste_probe_console")) {
fprintf(code_id,
" write_message_to_queue(%s_PI_queue_id, sizeof(T_%s_data), (void*)&%s_data, i_%s);\n\n",
" write_message_to_queue(%s_PI_queue_id, sizeof(T_%s__data), (void*)&%s__data, i_%s);\n\n",
FV_NODE->name,
IF_list_iterator->value->name,
IF_list_iterator->value->name,
......@@ -699,7 +698,7 @@ void create_outcomming_data_sender(FV * FV_NODE)
// Same for the Python TM queue
fprintf(code_id,
" write_message_to_queue(%s_PI_Python_queue_id, sizeof(T_%s_data), (void*)&%s_data, i_%s);\n\n",
" write_message_to_queue(%s_PI_Python_queue_id, sizeof(T_%s__data), (void*)&%s__data, i_%s);\n\n",
FV_NODE->name,
IF_list_iterator->value->name,
IF_list_iterator->value->name,
......@@ -709,14 +708,14 @@ void create_outcomming_data_sender(FV * FV_NODE)
//call directly the queue manager to store the data
if (strcmp (FV_NODE->name, "taste_probe_console")) {
fprintf(code_id,
" write_message_to_queue(%s_PI_queue_id, sizeof(T_%s_data), NULL, i_%s);\n\n",
" write_message_to_queue(%s_PI_queue_id, sizeof(T_%s__data), NULL, i_%s);\n\n",
FV_NODE->name,
IF_list_iterator->value->name,
IF_list_iterator->value->name);
}
// Same for the Python TM queue
fprintf(code_id,
" write_message_to_queue(%s_PI_Python_queue_id, sizeof(T_%s_data), NULL, i_%s);\n\n",
" write_message_to_queue(%s_PI_Python_queue_id, sizeof(T_%s__data), NULL, i_%s);\n\n",
FV_NODE->name,
IF_list_iterator->value->name,
IF_list_iterator->value->name);
......@@ -954,7 +953,7 @@ void add_RI_to_gui_glue(Interface * i)
}
//End the struct definition of the functional data
fprintf(header_id, "} T_%s_data;\n\n", i->name);
fprintf(header_id, "} T_%s__data;\n\n", i->name);
//
// 3. Creates the structure to contain the message related to the RI
......@@ -962,7 +961,7 @@ void add_RI_to_gui_glue(Interface * i)
fprintf(header_id, "typedef struct\n{\n");
fprintf(header_id, "\tT_%s_RI_list\tmessage_identifier;\n",
i->parent_fv->name);
fprintf(header_id, "\tT_%s_data\tmessage;\n} T_%s_message;\n\n\n",
fprintf(header_id, "\tT_%s__data\tmessage;\n} T_%s_message;\n\n\n",
i->name, i->name);
......@@ -974,7 +973,7 @@ void add_RI_to_gui_glue(Interface * i)
fprintf(header_id, "void %s_RI_%s(", i->parent_fv->name, i->name);
bool comma = false;
FOREACH (param, Parameter, i->in, {
fprintf(header_id, "%sasn1Scc%s *", comma? ", ": "", param->type);
fprintf(header_id, "%sconst asn1Scc%s *", comma? ", ": "", param->type);
comma = true;
});
fprintf(header_id, ");\n\n"
......@@ -985,7 +984,7 @@ void add_RI_to_gui_glue(Interface * i)
tmp = i->in;
// Add parameters
while (NULL != tmp) {
fprintf(header_id, "%s&((T_%s_data*)params)->%s",
fprintf(header_id, "%s&((T_%s__data*)params)->%s",
(tmp != i->in) ? ", " : "", i->name, tmp->value->name);
tmp = tmp->next;
}
......@@ -1036,7 +1035,7 @@ void add_PI_to_gui_glue(Interface * i)
}
//End the struct definition of the functional data
fprintf(header_id, "} T_%s_data;\n\n", i->name);
fprintf(header_id, "} T_%s__data;\n\n", i->name);
//
// 3. Creates the structure to contain the message related to the PI
......@@ -1044,7 +1043,7 @@ void add_PI_to_gui_glue(Interface * i)
fprintf(header_id, "typedef struct\n{\n");
fprintf(header_id, "\tT_%s_PI_list\tmessage_identifier;\n",
i->parent_fv->name);
fprintf(header_id, "\tT_%s_data\tmessage;\n} T_%s_message;\n\n\n",
fprintf(header_id, "\tT_%s__data\tmessage;\n} T_%s_message;\n\n\n",
i->name, i->name);
}
}
......
......@@ -134,6 +134,9 @@ void c_wrappers_preamble(FV * fv)
}
}
/* Include polyorb-hi header containing po_hi_get_task_id */
fprintf(cfile, "#include \"po_hi_task.h\"\n");
/* Include the header files to get the function prototypes */
if (!fv->artificial) {
if (blackbox_device != fv->language
......
......@@ -893,6 +893,9 @@ void Add_api(Process *node, FV_list *all_fv)
"static bool debugCheckQ = false;\n"
"#endif\n\n");
fprintf (code, "#ifdef __unix__\n"
" #include <stdio.h>\n"
"#endif\n\n");
fprintf (header, "void %s_startup();\n\n", fv->name);
fprintf (code, "void %s_startup()\n"
......
Markdown is supported
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