Skip to content

Commit 80dfa1b

Browse files
Refs #22202. Remove Windows warnings
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
1 parent ed9425d commit 80dfa1b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/cpp/fastdds/xtypes/serializers/json/dynamic_data_json.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ ReturnCode_t json_serialize_basic_member(
761761
std::wstring aux_wstring_value({value});
762762
std::string utf8_value("\0", 1);
763763
#if defined(MINGW_COMPILER)
764-
// WARNING: it is the user responsibility to set the appropiate UTF-8 locale before calling this method
764+
// WARNING: it is the user responsibility to set the appropriate UTF-8 locale before calling this method
765765
int size_needed = std::wcstombs(nullptr, aux_wstring_value.c_str(), 0);
766766
if (size_needed < 0)
767767
{
@@ -823,7 +823,7 @@ ReturnCode_t json_serialize_basic_member(
823823
// Insert UTF-8 converted value
824824
std::string utf8_value;
825825
#ifdef MINGW_COMPILER
826-
// WARNING: it is the user responsibility to set the appropiate UTF-8 locale before calling this method
826+
// WARNING: it is the user responsibility to set the appropriate UTF-8 locale before calling this method
827827
int size_needed = std::wcstombs(nullptr, value.c_str(), 0);
828828
if (size_needed < 0)
829829
{

src/cpp/fastdds/xtypes/serializers/json/json_dynamic_data.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ ReturnCode_t json_deserialize_basic_member(
902902
std::string j_string = j.get<std::string>();
903903
std::wstring aux_wstring({L'\0'});
904904
#if defined(MINGW_COMPILER)
905-
// WARNING: it is the user responsibility to set the appropiate UTF-8 locale before calling this method
905+
// WARNING: it is the user responsibility to set the appropriate UTF-8 locale before calling this method
906906
int size_needed = std::mbstowcs(nullptr, j_string.c_str(), 0);
907907
if (size_needed < 0)
908908
{
@@ -971,7 +971,7 @@ ReturnCode_t json_deserialize_basic_member(
971971
std::string j_string = j.get<std::string>();
972972
std::wstring value;
973973
#if defined(MINGW_COMPILER)
974-
// WARNING: it is the user responsibility to set the appropiate UTF-8 locale before calling this method
974+
// WARNING: it is the user responsibility to set the appropriate UTF-8 locale before calling this method
975975
int size_needed = std::mbstowcs(nullptr, j_string.c_str(), 0);
976976
if (size_needed < 0)
977977
{
@@ -1039,7 +1039,7 @@ ReturnCode_t json_deserialize_basic_member(
10391039
enum_type = traits<DynamicType>::narrow<DynamicTypeImpl>(enum_desc->type())->resolve_alias_enclosed_type();
10401040
}
10411041

1042-
// Get enclosing type kind to parse the value accordingly, and later user the appropiate setter
1042+
// Get enclosing type kind to parse the value accordingly, and later user the appropriate setter
10431043
assert(enum_type->get_kind() == TK_ENUM);
10441044
TypeKind enclosing_kind = traits<DynamicType>::narrow<DynamicTypeImpl>(enum_type->get_all_members_by_index().at(0)->get_descriptor().type())->get_kind(); // Unfortunately DynamicDataImpl::get_enclosing_typekind is private
10451045

@@ -1339,15 +1339,15 @@ Target numeric_get(
13391339
int64_t v = j.get<int64_t>(); // Integers are stored as int64 or uint64 in JSON
13401340
if (std::is_unsigned<Target>::value)
13411341
{
1342-
if (v < 0 || static_cast<uint64_t>(v) > std::numeric_limits<Target>::max())
1342+
if (v < 0 || static_cast<uint64_t>(v) > static_cast<uint64_t>(std::numeric_limits<Target>::max()))
13431343
{
13441344
throw std::out_of_range(std::string{"Unsigned value " + std::to_string(v) + " out of range"});
13451345
}
13461346
}
13471347
else
13481348
{
1349-
if (v < std::numeric_limits<Target>::min() ||
1350-
v > std::numeric_limits<Target>::max())
1349+
if (v < static_cast<int64_t>(std::numeric_limits<Target>::min()) ||
1350+
v > static_cast<int64_t>(std::numeric_limits<Target>::max()))
13511351
{
13521352
throw std::out_of_range(std::string{"Signed value " + std::to_string(v) + " out of range"});
13531353
}

0 commit comments

Comments
 (0)