Skip to content

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:
     ^~~~
@MarkRivers MarkRivers merged commit 5a172c3 into areaDetector:master Nov 18, 2024
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