Skip to content

Commit

Permalink
Fix bitmasks and enumerations
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Dec 5, 2024
1 parent 268717b commit 6b45f8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/extensions/cpp/freemarker/Bitmask.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<#if underlyingTypeInfo.arrayTraits.isTemplated && underlyingTypeInfo.arrayTraits.requiresElementDynamicBitSize>
uint8_t ${name}::ZserioElementBitSize::get()
{
return ${bitSize.value};
return static_cast<uint8_t>(${bitSize.value});
}

</#if>
Expand Down
2 changes: 1 addition & 1 deletion compiler/extensions/cpp/freemarker/Enumeration.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ constexpr const char* EnumTraits<${fullName}>::enumName;

uint8_t EnumTraits<${fullName}>::ZserioElementBitSize::get()
{
return ${bitSize.value};
return static_cast<uint8_t>(${bitSize.value});
}
</#if>
<#if withTypeInfoCode>
Expand Down

0 comments on commit 6b45f8d

Please sign in to comment.