Skip to content

Commit

Permalink
fastbuffer memcpy and long double ptr fix (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffviola authored Mar 27, 2020
1 parent 8496269 commit 9f5b455
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions include/fastcdr/FastBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ namespace eprosima
inline
void operator<<(const _T &data)
{
#if defined(FASTCDR_ARM32)
memcpy(m_currentPosition, &data, sizeof(_T));
#else
*(reinterpret_cast<_T*>(m_currentPosition)) = data;
#endif
}

/*!
Expand All @@ -108,13 +104,7 @@ namespace eprosima
inline
void operator>>(_T &data)
{
#if defined(FASTCDR_ARM32)
_T val;
memcpy(&val, m_currentPosition, sizeof(_T));
data = val;
#else
data = *(reinterpret_cast<_T*>(m_currentPosition));
#endif
memcpy(&data, m_currentPosition, sizeof(_T));
}

/*!
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/Cdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2249,7 +2249,7 @@ Cdr& Cdr::deserializeArray(long double *ldouble_t, size_t numElements)

if(m_swapBytes)
{
char *dst = reinterpret_cast<char*>(&ldouble_t);
char *dst = reinterpret_cast<char*>(ldouble_t);
char *end = dst + totalSize;

for(; dst < end; dst += sizeof(*ldouble_t))
Expand Down

0 comments on commit 9f5b455

Please sign in to comment.