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

Remove comparing NexusDataType codes with NDDataTypeCodes #513

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marcomontevechi1
Copy link

HI! We stumbled upon this when trying to add vector options to NDAttrDataType_t.

Regardless if vector options are actually going to be added, when NDAttrUndefined was moved to the 21th position of NDAttrDataType_t it collided with NX_UINT8 in NDFileNexus.cpp:663:

../ADApp/pluginSrc/NDFileNexus.cpp: In member function 'void NDFileNexus::constTextToDataType(char*, int, void*)':
../ADApp/pluginSrc/NDFileNexus.cpp:726:5: error: duplicate case value
     case NDAttrUndefined:
     ^~~~
../ADApp/pluginSrc/NDFileNexus.cpp:681:5: note: previously used here
     case NX_UINT8:
     ^~~~

Since that case condition actually does nothing but fall to the default case, we thought it would be healthy to remove it.

marcofilho added 2 commits September 20, 2024 15:09
NDAttribute was being compared with NX attributes.
Not only did the code do nothing after the the comparison (it simply
fell to default case), this also risks breaking the compilation after new
additions to NDAttrDataType_t.

For example: NX_CHAR = 4, which is the same of NDAttrInt32.
Another example: after trying to add types to NDAttrDataType_t I got:

../ADApp/pluginSrc/NDFileNexus.cpp: In member function 'void NDFileNexus::constTextToDataType(char*, int, void*)':
../ADApp/pluginSrc/NDFileNexus.cpp:726:5: error: duplicate case value
     case NDAttrUndefined:
     ^~~~
../ADApp/pluginSrc/NDFileNexus.cpp:681:5: note: previously used here
     case NX_UINT8:
     ^~~~
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.

1 participant