From b7e9d6858699f5ea9a23ecf6587e98e7b0e1bc28 Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周三, 14 10月 2015 16:49:41 +0800 Subject: [PATCH] Resolve #58: Illegal parameter value and unit test --- libscpi/inc/scpi/error.h | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libscpi/inc/scpi/error.h b/libscpi/inc/scpi/error.h index e9892fb..81f74fd 100644 --- a/libscpi/inc/scpi/error.h +++ b/libscpi/inc/scpi/error.h @@ -52,12 +52,12 @@ const char * SCPI_ErrorTranslate(int16_t err); -/* Using X-Macro technique to define everything once - * http://en.wikipedia.org/wiki/X_Macro - * - * X macro is for minimal set of errors for library itself - * XE macro is for full set of SCPI errors available to user application - */ + /* Using X-Macro technique to define everything once + * http://en.wikipedia.org/wiki/X_Macro + * + * X macro is for minimal set of errors for library itself + * XE macro is for full set of SCPI errors available to user application + */ #define LIST_OF_ERRORS \ XE(SCPI_ERROR_COMMAND, -100, "Command error") \ X(SCPI_ERROR_INVALID_CHARACTER, -101, "Invalid character") \ @@ -102,7 +102,7 @@ X(SCPI_ERROR_EXECUTION_ERROR, -200, "Execution error") \ XE(SCPI_ERROR_INVAL_WHILE_IN_LOCAL, -201, "Invalid while in local") \ XE(SCPI_ERROR_SETTINGS_LOST_DUE_TO_RTL, -202, "Settings lost due to rtl") \ - XE(SCPI_ERROR_COMMAND_PROTECTED, -203, "Command protected TK024") \ + XE(SCPI_ERROR_COMMAND_PROTECTED, -203, "Command protected") \ XE(SCPI_ERROR_TRIGGER_ERROR, -210, "Trigger error") \ XE(SCPI_ERROR_TRIGGER_IGNORED, -211, "Trigger ignored") \ XE(SCPI_ERROR_ARM_IGNORED, -212, "Arm ignored") \ @@ -180,21 +180,22 @@ XE(SCPI_ERROR_REQUEST_CONTROL, -700, "Request control") \ XE(SCPI_ERROR_OPERATION_COMPLETE, -800, "Operation complete") \ -enum { + + enum { #define X(def, val, str) def = val, #if USE_FULL_ERROR_LIST #define XE X #else #define XE(def, val, str) #endif -LIST_OF_ERRORS + LIST_OF_ERRORS #if USE_USER_ERROR_LIST -LIST_OF_USER_ERRORS + LIST_OF_USER_ERRORS #endif #undef X #undef XE -}; + }; #ifdef __cplusplus } -- Gitblit v1.9.1