Skip to content

Commit

Permalink
Refs #18687. Fix warnings on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Jul 4, 2023
1 parent 3bd3b91 commit 17ed0fc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion include/fastcdr/xcdr/MemberId.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@

#include <cstdint>

#include "../fastcdr_dll.h"

namespace eprosima {
namespace fastcdr {

class Cdr;

class MemberId
class Cdr_DllAPI MemberId
{
public:

Expand Down
5 changes: 3 additions & 2 deletions include/fastcdr/xcdr/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <new>
#include <type_traits>

#include "../fastcdr_dll.h"
#include "../exceptions/BadParamException.h"

namespace eprosima {
Expand Down Expand Up @@ -80,7 +81,7 @@ struct nullopt_t
static constexpr nullopt_t nullopt {0};

template<class T>
class optional
class Cdr_DllAPI optional
{
public:

Expand Down Expand Up @@ -140,7 +141,7 @@ class optional
}
}

T& value()&
T& value() &
{
return storage_.engaged_ ? storage_.val_ : throw exception::BadParamException("value not set");
}
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/Cdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Cdr& Cdr::read_encapsulation()


// If it is a different endianness, make changes.
const bool endianness = encapsulation & 0x1_8u;
const uint8_t endianness = encapsulation & 0x1_8u;
if (m_endianness != endianness)
{
m_swapBytes = !m_swapBytes;
Expand Down Expand Up @@ -3102,6 +3102,7 @@ Cdr& Cdr::xcdr1_begin_serialize_member(
Cdr::XCdrHeaderSelection header_selection)
{
static_cast<void>(current_state);
static_cast<void>(is_present);
assert(is_present);
assert(MEMBER_ID_INVALID != member_id);
assert(MEMBER_ID_INVALID == next_member_id_ || member_id == next_member_id_);
Expand Down
6 changes: 3 additions & 3 deletions test/xcdr/basic_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4565,7 +4565,7 @@ TEST_P(XCdrBasicTypesTest, longlong_align_4)
TEST_P(XCdrBasicTypesTest, ulonglong_align_1)
{
const uint8_t align_value {0xAB};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCll};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCull};
constexpr uint8_t ival {0xCD};
constexpr uint8_t fval {0xDC};

Expand Down Expand Up @@ -4682,7 +4682,7 @@ TEST_P(XCdrBasicTypesTest, ulonglong_align_2)
const uint16_t align_value {0xABBA};
constexpr uint8_t iava {0xAB};
constexpr uint8_t fava {0xBA};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCll};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCull};
constexpr uint8_t ival {0xCD};
constexpr uint8_t fval {0xDC};

Expand Down Expand Up @@ -4799,7 +4799,7 @@ TEST_P(XCdrBasicTypesTest, ulonglong_align_4)
const uint32_t align_value {0xABABABBA};
constexpr uint8_t iava {0xAB};
constexpr uint8_t fava {0xBA};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCll};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCull};
constexpr uint8_t ival {0xCD};
constexpr uint8_t fval {0xDC};

Expand Down
4 changes: 2 additions & 2 deletions test/xcdr/optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4132,7 +4132,7 @@ TEST_P(XCdrOptionalTest, ulonglong_align_2_optional)
const uint16_t align_value {0xABBA};
constexpr uint8_t iava {0xAB};
constexpr uint8_t fava {0xBA};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCll};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCull};
constexpr uint8_t ival {0xCD};
constexpr uint8_t fval {0xDC};

Expand Down Expand Up @@ -4253,7 +4253,7 @@ TEST_P(XCdrOptionalTest, ulonglong_align_4_optional)
const uint32_t align_value {0xABABABBA};
constexpr uint8_t iava {0xAB};
constexpr uint8_t fava {0xBA};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCll};
constexpr uint64_t ulonglong_value {0xCDCDCDCDCDCDCDDCull};
constexpr uint8_t ival {0xCD};
constexpr uint8_t fval {0xDC};

Expand Down

0 comments on commit 17ed0fc

Please sign in to comment.