Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19236] Fix bitmask code generation #223

Merged
merged 7 commits into from
Sep 13, 2023
Merged

[19236] Fix bitmask code generation #223

merged 7 commits into from
Sep 13, 2023

Conversation

JLBuenoLopez
Copy link
Contributor

This PR supersedes #205

Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
@JLBuenoLopez
Copy link
Contributor Author

Manual CI action

Copy link
Member

@richiware richiware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bitmask members should be initialized to 0. Right now, when a user creates an structure with a bitmask member, this one contains garbage.

@JLBuenoLopez
Copy link
Contributor Author

bitmask members should be initialized to 0. Right now, when a user creates an structure with a bitmask member, this one contains garbage.

You have just asked for an IDL-Parser v1.7.2 release! 🤣 The initial value was removed in:

@JLBuenoLopez
Copy link
Contributor Author

JLBuenoLopez commented Sep 13, 2023

Manual CI action: SUCCESS

$bitmask.name$* topic)
{
printf("$bitmask.scopedname$: { \n");
$bitmask.members:{ member | printf("$member.name$: %s\n", *topic & $bitmask.name$Bits::$member.name$ == $bitmask.name$Bits::$member.name$ ? "true" : "false");}; separator="\n"$
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print always all values true or all values false. Fix:

Suggested change
$bitmask.members:{ member | printf("$member.name$: %s\n", *topic & $bitmask.name$Bits::$member.name$ == $bitmask.name$Bits::$member.name$ ? "true" : "false");}; separator="\n"$
$bitmask.members:{ member | printf("$member.name$: %s\n", ((*topic & $bitmask.name$Bits::$member.name$) == $bitmask.name$Bits::$member.name$) ? "true" : "false");}; separator="\n"$

Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
@JLBuenoLopez
Copy link
Contributor Author

Manual CI action

@richiware richiware merged commit da185d2 into master Sep 13, 2023
5 of 9 checks passed
@richiware richiware deleted the bugfix/fix-bitmask branch September 13, 2023 09:19
Sign up for free to 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