Skip to content

Commit

Permalink
Fix warning generating TypeObject from IDL file (#266)
Browse files Browse the repository at this point in the history
* Refs #20003. Fix warnings.

Signed-off-by: Ricardo González Moreno <[email protected]>

* Refs #20003: do not generate empty namespaces

Signed-off-by: JLBuenoLopez-eProsima <[email protected]>

* Refs #20003. Fix warnings and new ReturnCode_t

Signed-off-by: Ricardo González Moreno <[email protected]>

---------

Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Co-authored-by: JLBuenoLopez-eProsima <[email protected]>
  • Loading branch information
richiware and JLBuenoLopez committed Feb 26, 2024
1 parent 7f6d32d commit ad7dd11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ $definition_list$
>>

annotation(ctx, annotation) ::= <<
$if(annotation.enums || annotation.typeDefs || annotation.constDecls)$
namespace $annotation.name$ {
$annotation.enums : { enum | $enum_type(ctx=ctx, parent=annotation, enum=enum)$}; separator="\n"$

Expand All @@ -90,6 +91,7 @@ namespace $annotation.name$ {
$annotation.constDecls : { const | $const_decl(ctx=ctx, parent=annotation, const=const)$}; separator="\n"$

} // namespace $annotation.name$
$endif$
>>

interface(ctx, parent, interface, export_list) ::= <<
Expand Down Expand Up @@ -382,7 +384,9 @@ public:
$union.members:{ member | $unionmember_compare(member)$}; separator="\n"$
$unionmemberdefault_compare(union.defaultMember)$
}
$if(!union.defaultMember)$
return false;
$endif$
}

/*!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void $ctx.filename$Subscriber::SubListener::on_data_available(
$ctx.m_lastStructureScopedName$ st;
SampleInfo info;

if (reader->take_next_sample(&st, &info) == ReturnCode_t::RETCODE_OK)
if (reader->take_next_sample(&st, &info) == RETCODE_OK)
{
if (info.valid_data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,10 @@ eProsima_user_DllExport void deserialize(
$if(struct.annotationFinal || struct.annotationAppendable)$eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR$elseif(struct.annotationMutable)$eprosima::fastcdr::EncodingAlgorithmFlag::PL_CDR$endif$,
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
{
$if(struct.allMembers)$
bool ret_value = true;
switch (mid.id)
{
$if(!struct.allMembers)$
static_cast<void>(dcdr);
$endif$
$struct.allMembers : { member |
case $if(struct.annotationMutable)$$member.id$$else$$member.index$$endif$:
$if(!member.annotationNonSerialized)$
Expand All @@ -139,6 +137,11 @@ eProsima_user_DllExport void deserialize(
break;
}
return ret_value;
$else$
static_cast<void>(dcdr);
static_cast<void>(mid);
return false;
$endif$
});
}

Expand Down

0 comments on commit ad7dd11

Please sign in to comment.