areaDetector / ADCore

The home of the core components of the EPICS areaDetector software. It includes base classes for drivers and code for all of the standard plugins.
https://areadetector.github.io/areaDetector
Other
20 stars 69 forks source link

Remove comparing NexusDataType codes with NDDataTypeCodes #513

Closed marcomontevechi1 closed 1 week ago

marcomontevechi1 commented 2 months ago

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.