Commit ae62b0e3 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Avoid generating empty CONNECTIONS section in CV

parent 46b453f2
......@@ -718,6 +718,7 @@ void DeclareProcessFeatures (Aplc_binding *b,
void ProcessConnectInterfaces(Interface *i, Process **current_process)
{
bool remote_in_same_process = true;
char *connection = NULL;
/*
* Don't connect synchronous and cyclic blocks
......@@ -745,11 +746,6 @@ void ProcessConnectInterfaces(Interface *i, Process **current_process)
}
if (0==(*current_process)->connections) {
fprintf(process,"connections\n");
(*current_process)->connections = 1;
}
switch (i->direction) {
case PI:
if (true == remote_in_same_process) {
......@@ -762,7 +758,7 @@ void ProcessConnectInterfaces(Interface *i, Process **current_process)
/*
* distant FV not in the same process
*/
fprintf(process, "\tPORT INPORT_%s_%s -> %s.INPORT_%s;\n",
connection = make_string("\tPORT INPORT_%s_%s -> %s.INPORT_%s;\n",
i->parent_fv->name,
i->port_name,
i->parent_fv->name,
......@@ -774,7 +770,7 @@ void ProcessConnectInterfaces(Interface *i, Process **current_process)
/* if distant FV is in the same process */
/* We do it only for RI and not for PI (see above) because RIs
* have a unique, thus more reliable Distant FV value. */
fprintf(process, "\tPORT %s.OUTPORT_%s -> %s.INPORT_%s;\n",
connection = make_string("\tPORT %s.OUTPORT_%s -> %s.INPORT_%s;\n",
i->parent_fv->name,
i->name,
i->distant_fv,
......@@ -782,7 +778,7 @@ void ProcessConnectInterfaces(Interface *i, Process **current_process)
);
}
else { /* Distant RI not in the same process */
fprintf(process, "\tPORT %s.OUTPORT_%s -> OUTPORT_%s_%s;\n",
connection = make_string("\tPORT %s.OUTPORT_%s -> OUTPORT_%s_%s;\n",
i->parent_fv->name,
i->name,
i->parent_fv->name,
......@@ -790,6 +786,16 @@ void ProcessConnectInterfaces(Interface *i, Process **current_process)
}
break;
}
if (NULL != connection) {
if (0==(*current_process)->connections) {
fprintf(process,"connections\n");
(*current_process)->connections = 1;
}
fprintf(process, "%s", connection);
free(connection);
}
}
void ProcessMakeConnections (Aplc_binding *b, Process **p)
......
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