Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
Ocarina
Commits
3c00296d
Commit
3c00296d
authored
Sep 19, 2019
by
Jerome Hugues
Browse files
* Generate a value of 0 for __PO_HI_NB_PORTS if the process has no
local ports For openaadl/ocarina#236
parent
c91fe22a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/backends/po_hi_c/ocarina-backends-po_hi_c-deployment.adb
View file @
3c00296d
...
...
@@ -1300,11 +1300,25 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Value
=>
Nb_Entities_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Total_Ports_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
-- If there are ports in the local process, we generate a
-- macro indicating the total number of ports in the
-- application, otherwise we generate a value of 0 to avoid
-- dragging the whole transport logic. This may happen in
-- corner cases when using external API for communication.
if
Nb_Ports_In_Process
>
0
then
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Total_Ports_Node
);
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
else
N
:=
Make_Define_Statement
(
Defining_Identifier
=>
RE
(
RE_Nb_Ports
),
Value
=>
Make_Literal
(
New_Int_Value
(
0
,
1
,
10
)));
Append_Node_To_List
(
N
,
CTN
.
Declarations
(
Current_File
));
end
if
;
if
not
Is_Empty
(
Global_Port_List
)
then
if
not
Invalid_Global_Port_Added
then
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment