Skip to content

Correct initial value for the default case - #161

Merged
huangminghuang merged 2 commits into
objectcomputing:masterfrom
martinfantini:initial_vaLue_enum_set
Jul 28, 2025
Merged

Correct initial value for the default case#161
huangminghuang merged 2 commits into
objectcomputing:masterfrom
martinfantini:initial_vaLue_enum_set

Conversation

@martinfantini

Copy link
Copy Markdown
Contributor

Correct the generation of the storage value for the set and enums.

For the definition:

 <template name="Test_3" id="3">
<uInt32 name="field3" id="11"><copy/></uInt32>
<field name="TradeCondition" id="277" presence="optional">
<type name="TradeConditionSet">
<default/>
</type>
</field>
</template>

There is no set or enum value by default.

And storage definition has to be:

const static TradeConditionSet::instruction_type
Test_3__TradeCondition_instruction(
operator_default,
presence_optional,
277, // id
"TradeCondition", // name
"", // ns
nullptr, // opContext
int_value_storage<uint64_t>(), // initial_value
TradeConditionSet::instruction()->elements(), // element names
TradeConditionSet::instruction()->num_elements(),// num elements
nullptr, // ref_instruction
nullptr, // cpp_ns
mfast::instruction_tag(0)); // tag

With the int_value_storage<uint64_t>(), // initial_value as default constructor.

This error is in sets and enums.

@martinfantini
martinfantiniforce-pushed the initial_vaLue_enum_set branch from 6cb6444 to 581e0ceCompareJuly 25, 2025 07:22
@huangminghuang
huangminghuang merged commit 917e4e3 into objectcomputing:masterJul 28, 2025
3 checks passed
@martinfantini
martinfantini deleted the initial_vaLue_enum_set branch July 28, 2025 20:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@martinfantini@huangminghuang