Skip to content

Commit

Permalink
Merge pull request #233 from nasa/devel
Browse files Browse the repository at this point in the history
lestarch: release 1.5.3 delivery
  • Loading branch information
LeStarch committed Nov 5, 2020
2 parents dedce16 + b905cdd commit 8e5fd5a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Fw/Types/Serializable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ namespace Fw {
SerializeStatus SerializeBufferBase::serialize(F64 val) {
// floating point values need to be byte-swapped as well, so copy to U64 and use that routine
U64 u64Val;

*reinterpret_cast<F64*>(&u64Val) = val;
(void) memcpy(&u64Val, &val, sizeof(val));
return this->serialize(u64Val);

}
Expand All @@ -203,8 +202,7 @@ namespace Fw {

// floating point values need to be byte-swapped as well, so copy to U32 and use that routine
U32 u32Val;

*reinterpret_cast<F32*>(&u32Val) = val;
(void) memcpy(&u32Val, &val, sizeof(val));
return this->serialize(u32Val);

}
Expand Down Expand Up @@ -446,9 +444,8 @@ namespace Fw {
if (stat != FW_SERIALIZE_OK) {
return stat;
}

// copy to argument
val = *reinterpret_cast<F64*>(&tempVal);
(void) memcpy(&val, &tempVal, (NATIVE_UINT_TYPE)sizeof(val));

return FW_SERIALIZE_OK;
}
Expand Down Expand Up @@ -487,9 +484,7 @@ namespace Fw {
if (stat != FW_SERIALIZE_OK) {
return stat;
}

// copy to argument
val = *reinterpret_cast<F32*>(&tempVal);
(void) memcpy(&val, &tempVal, sizeof(val));

return FW_SERIALIZE_OK;
}
Expand Down

0 comments on commit 8e5fd5a

Please sign in to comment.