Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
PolyORB-HI-C
Commits
988adce9
Commit
988adce9
authored
Mar 27, 2018
by
yoogx
Browse files
* (__po_hi_marshall_float): correct type in sizeof
For openaadl/ocarina#140
parent
c137ce03
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/po_hi_marshallers.c
View file @
988adce9
...
...
@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
8
ESA & ISAE.
*/
#include
<po_hi_config.h>
...
...
@@ -54,21 +54,35 @@ void __po_hi_unmarshall_##THE_TYPE (__po_hi_##THE_TYPE##_t* value, __po_hi_msg_t
void
__po_hi_marshall_port
(
__po_hi_port_t
value
,
__po_hi_msg_t
*
msg
)
{
__po_hi_msg_append_data
(
msg
,
&
value
,
sizeof
(
__po_hi_port_t
));
__po_hi_port_t
tmpvalue
=
value
;
if
(
sizeof
(
__po_hi_port_t
)
>
1
&&
__po_hi_get_endianness
(
__PO_HI_MY_NODE
)
==
__PO_HI_BIGENDIAN
)
{
__po_hi_msg_swap_value
(
&
value
,
&
tmpvalue
,
sizeof
(
__po_hi_port_t
));
}
__po_hi_msg_append_data
(
msg
,
&
tmpvalue
,
sizeof
(
__po_hi_port_t
));
}
void
__po_hi_unmarshall_port
(
__po_hi_port_t
*
value
,
__po_hi_msg_t
*
msg
)
{
/* The operation is always written by the local machine, or received
* with the raw protocol. So, we don't have to check byte order */
__po_hi_port_t
tmpvalue
;
__po_hi_msg_get_data
(
value
,
msg
,
0
,
sizeof
(
__po_hi_port_t
));
__po_hi_msg_get_data
(
value
,
msg
,
0
,
sizeof
(
__po_hi_port_t
));
if
(
sizeof
(
__po_hi_port_t
)
>
1
&&
__po_hi_get_endianness
(
__PO_HI_MY_NODE
)
==
__PO_HI_BIGENDIAN
)
{
__po_hi_msg_swap_value
(
value
,
&
tmpvalue
,
sizeof
(
__po_hi_port_t
));
*
value
=
tmpvalue
;
}
}
/* array marshallers */
void
__po_hi_marshall_array
(
void
*
value
,
__po_hi_msg_t
*
msg
,
__po_hi_uint32_t
size
,
__po_hi_uint32_t
*
offset
)
{
// XXX
__po_hi_msg_append_data
(
msg
,
value
,
size
);
*
offset
=
*
offset
+
size
;
}
...
...
@@ -136,7 +150,7 @@ void __po_hi_marshall_float (float value, __po_hi_msg_t* msg,__po_hi_uint32_t* o
{
float
tmpvalue
=
value
;
if
(
sizeof
(
in
t
)
>
1
&&
__po_hi_get_endianness
(
__PO_HI_MY_NODE
)
==
__PO_HI_BIGENDIAN
)
if
(
sizeof
(
floa
t
)
>
1
&&
__po_hi_get_endianness
(
__PO_HI_MY_NODE
)
==
__PO_HI_BIGENDIAN
)
{
__po_hi_msg_swap_value
(
&
value
,
&
tmpvalue
,
sizeof
(
float
));
}
...
...
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