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

Fix code to get less warnings at build time

parent 5764cf6a
......@@ -72,13 +72,13 @@ void ada_wrappers_preamble(FV * fv)
/* wrappers.adb top header */
fprintf(adb,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(adb,
"-- pragma Style_Checks (Off);\n"
"-- pragma Warnings (Off);\n\n"
"with PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI.Utils;\n"
"use PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI.Utils;\n\n");
// fprintf(adb,
// "-- pragma Style_Checks (Off);\n"
// "-- pragma Warnings (Off);\n\n"
// "with PolyORB_HI_Generated.Activity,\n"
// " PolyORB_HI.Utils;\n"
// "use PolyORB_HI_Generated.Activity,\n"
// " PolyORB_HI.Utils;\n\n");
fprintf(ads, "with Interfaces.C;\n");
......@@ -158,7 +158,7 @@ void ada_wrappers_preamble(FV * fv)
fprintf(ads, "\npackage %s_Wrappers is\n\n", fv->name);
// To debug backdoor-related misuse of the passive functions stack:
fprintf(adb, "with PolyORB_HI.Output;\n\n");
// fprintf(adb, "with PolyORB_HI.Output;\n\n");
fprintf(adb, "package body %s_Wrappers is\n\n", fv->name);
......@@ -308,7 +308,7 @@ void add_PI_to_ada_wrappers(Interface * i)
" ------------------------------------------------------\n"
" -- Provided Interface \"%s\"\n"
" ------------------------------------------------------\n"
" procedure %s (Entity : PolyORB_HI_Generated.Deployment.Entity_Type",
" procedure %s (dummy_Entity : PolyORB_HI_Generated.Deployment.Entity_Type",
i->name,
i->name);
......@@ -327,7 +327,7 @@ void add_PI_to_ada_wrappers(Interface * i)
" ------------------------------------------------------\n"
" -- Asynchronous Provided Interface \"%s\"\n"
" ------------------------------------------------------\n"
" procedure %s (Entity : PolyORB_HI_Generated.Deployment.Entity_Type",
" procedure %s (dummy_Entity : PolyORB_HI_Generated.Deployment.Entity_Type",
i->name,
i->name);
......
......@@ -46,6 +46,7 @@ void c_preamble(FV * fv)
" #include <stdio.h>\n"
"#else\n"
" typedef unsigned size_t;\n"
" typedef int ssize_t;\n"
"#endif\n\n");
fprintf(vm_if_h, "#ifdef __cplusplus\n"
......@@ -543,7 +544,7 @@ void add_RI_to_c_invoke_ri(Interface * i)
}
FOREACH(p, Parameter, i->in, {
fprintf(invoke_ri,
" static char IN_buf_%s[%sasn1Scc%s%s] = {0};\n size_t size_IN_buf_%s=0;\n",
" static char IN_buf_%s[%sasn1Scc%s%s] = {0};\n ssize_t size_IN_buf_%s=0;\n",
p->name,
(native == p->encoding) ? "sizeof(" : "",
p->type,
......@@ -685,12 +686,13 @@ void GLUE_C_InvokeRI(Interface * i)
/* Discard duplicate RI (with different synchronism) - keep only the sync one */
if (asynch == i->synchronism) {
FOREACH(interface, Interface, i->parent_fv->interfaces, {
if (RI == interface->direction &&
!strcmp(interface->name, i->name) &&
synch == interface->synchronism) {
return;}
}
);
if (RI == interface->direction &&
!strcmp(interface->name, i->name) &&
synch == interface->synchronism)
{
return;
}
});
}
add_RI_to_c_invoke_ri(i);
}
......
......@@ -369,9 +369,7 @@ void create_queues_initialization_function(FV *fv)
//
fprintf(code_id, "void %s_startup(void)\n"
"{\n"
" int res_RI = 0;\n"
" int res_PI = 0;\n"
" int msgsize_max = 8192;\n"
" unsigned msgsize_max = 8192;\n"
" FILE *f = fopen(\"/proc/sys/fs/mqueue/msgsize_max\", \"r\");\n"
" fscanf(f, \"%%d\", &msgsize_max);\n\n",
fv->name);
......@@ -430,7 +428,7 @@ int create_maxelement_queue_size_compute_function_on_IF(T_RI_PI_NAME_LIST *
IF_TYPE_STRING);
fprintf(code_id, "{\n");
fprintf(code_id,
" int MAX_SIZE = sizeof(int); // The minimum size of a message (id + functional data) is the size of the id alone !\n\n");
" size_t MAX_SIZE = sizeof(int); // The minimum size of a message (id + functional data) is the size of the id alone !\n\n");
//Initiate iterator on the linked list of IF provided
iterator = IF_LIST;
......@@ -506,11 +504,10 @@ void create_incomming_data_pooler(char *NODE_NAME)
fprintf(code_id, "{\n");
//Creates necessary local varaiables
fprintf(code_id, " int msgsz = 0;\n");
fprintf(code_id, " unsigned int sender = 0;\n");
//fprintf(code_id, " int msgsz = 0;\n");
//fprintf(code_id, " unsigned int sender = 0;\n");
fprintf(code_id, " struct mq_attr msgq_attr;\n");
fprintf(code_id, " char* msgcontent = NULL;\n");
fprintf(code_id, " int msg_cnt = 0;\n");
fprintf(code_id, " T_%s_RI_list message_recieved_type;\n\n\n",
NODE_NAME);
......
......@@ -51,16 +51,16 @@ void rtds_glue_preamble(FV * fv)
fv->name);
fprintf(glue_h, "#include \"%s_p_decl.h\"\n\n", fv->name);
fprintf(glue_h, "static RTDS_Proc %s_instanceDescriptor;\n", fv->name); /* Declare the SDL instance descriptor */
fprintf(glue_h, "static RTDS_GlobalProcessInfo %s_instanceContext;\n", fv->name); /* Declare the SDL instance context */
fprintf(glue_h, "static RTDS_MessageHeader currentMessage;\n\n"); /* Declare the RTDS message header */
/* b. glue_.c preamble */
fprintf(glue_c,
"/* This file was generated automatically: DO NOT MODIFY IT ! */\n\n");
fprintf(glue_c, "#include \"glue_%s.h\"\n\n", fv->name);
fprintf(glue_c, "static RTDS_Proc %s_instanceDescriptor;\n", fv->name); /* Declare the SDL instance descriptor */
fprintf(glue_c, "static RTDS_GlobalProcessInfo %s_instanceContext;\n", fv->name); /* Declare the SDL instance context */
fprintf(glue_c, "static RTDS_MessageHeader currentMessage;\n\n"); /* Declare the RTDS message header */
fprintf(glue_c,
"RTDS_Proc* %s_instanceDescriptor_ptr = NULL;\n",
fv->name);
......
......@@ -1244,7 +1244,7 @@ void List_C_Params_And_Size(Parameter * p, FILE ** file)
comma ? ", " : "",
(param_in == p->param_direction) ? "IN" : "OUT",
p->name,
(param_in == p->param_direction) ? "size_IN" : "&size_OUT",
(param_in == p->param_direction) ? "(size_t)size_IN" : "&size_OUT",
p->name);
}
......
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