From 635cbb9775d80c1ac213eed9426208eb4e4b13ca Mon Sep 17 00:00:00 2001 From: marcofilho Date: Fri, 20 Sep 2024 15:09:29 +0200 Subject: [PATCH] Remove bad NDAttribute cases 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: ^~~~ --- ADApp/pluginSrc/NDFileNexus.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ADApp/pluginSrc/NDFileNexus.cpp b/ADApp/pluginSrc/NDFileNexus.cpp index 31fdb7545..ac5c92952 100644 --- a/ADApp/pluginSrc/NDFileNexus.cpp +++ b/ADApp/pluginSrc/NDFileNexus.cpp @@ -660,7 +660,6 @@ void * NDFileNexus::allocConstValue(int dataType, size_t length ) { case NX_CHAR: pValue = calloc( length + 1 , sizeof(char) ); break; - case NDAttrUndefined: default: pValue = NULL; break; @@ -724,7 +723,6 @@ void NDFileNexus::constTextToDataType(char *inText, int dataType, void *pValue) ((char *)pValue)[strlen(inText)] = '\0'; //sscanf((const char *)inText, "%s", (char *)pValue); break; - case NDAttrUndefined: default: break; }