Skip to content

Commit

Permalink
Fix gcc conversion warnings in constants and initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Dec 13, 2024
1 parent cd5476a commit 37c4ee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/freemarker/Constant.h.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<@doc_comments docComments/>
</#if>
constexpr ${typeInfo.typeFullName} ${name} = <#rt>
<#lt><#if typeInfo.isNumeric>static_cast<${typeInfo.typeFullName}>(</#if>${value}<#rt>
<#lt><#if typeInfo.isNumeric>static_cast<${typeInfo.typeFullName}::ValueType>(</#if>${value}<#rt>
<#lt><#if typeInfo.isNumeric>)</#if>;
<@namespace_end package.path/>

Expand Down
4 changes: 3 additions & 1 deletion extension/freemarker/Structure.cpp.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ ${name}::${name}(const AllocatorType&<#if fields_need_allocator(fieldList)> allo
<#lt> :
<#items as field>
<#if field.initializer??>
${field.name}(${field.initializer}<#if field_needs_allocator(field)>, allocator</#if>)<#sep>,</#sep>
${field.name}(<#if field.typeInfo.isNumeric>static_cast<${field.typeInfo.typeFullName}::ValueType>(</#if><#rt>
<#lt>${field.initializer}<#if field.typeInfo.isNumeric>)</#if><#rt>
<#lt><#if field_needs_allocator(field)>, allocator</#if>)<#sep>,</#sep>
<#else>
${field.name}(<#if field_needs_allocator(field)>allocator</#if>)<#sep>,</#sep>
</#if>
Expand Down

0 comments on commit 37c4ee9

Please sign in to comment.