-
Notifications
You must be signed in to change notification settings - Fork 62
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
Conversation
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
src/main/java/com/eprosima/fastdds/idl/templates/SerializationSource.stg
Outdated
Show resolved
Hide resolved
src/main/java/com/eprosima/fastdds/idl/templates/SerializationSource.stg
Outdated
Show resolved
Hide resolved
src/main/java/com/eprosima/fastdds/idl/templates/SerializationSource.stg
Outdated
Show resolved
Hide resolved
src/main/java/com/eprosima/fastdds/idl/templates/SerializationSource.stg
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
You have just asked for an IDL-Parser v1.7.2 release! 🤣 The initial value was removed in: |
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
Signed-off-by: JLBuenoLopez-eProsima <[email protected]>
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"$ |
There was a problem hiding this comment.
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:
$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]>
This PR supersedes #205