From 3592124b3fc00f919302097e5c90d0af14a58d92 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周一, 21 10月 2013 17:38:24 +0800
Subject: [PATCH] Merge error definitions from experimental branch

---
 libscpi/src/parser.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c
index fb6396f..b4d018e 100644
--- a/libscpi/src/parser.c
+++ b/libscpi/src/parser.c
@@ -579,7 +579,7 @@
 }
 
 /**
- * Parse boolean parameter
+ * Parse boolean parameter as described in the spec SCPI-99 7.3 Boolean Program Data
  * @param context
  * @param value
  * @param mandatory
@@ -625,7 +625,7 @@
  * @param mandatory
  * @return 
  */
-bool_t SCPI_ParamChoice(scpi_t * context, const char * options[], size_t * value, bool_t mandatory) {
+bool_t SCPI_ParamChoice(scpi_t * context, const char * options[], int32_t * value, bool_t mandatory) {
     const char * param;
     size_t param_len;
     size_t res;
@@ -638,14 +638,14 @@
         return FALSE;
     }
 
-	for (res = 0; options[res]; ++res) {
-	    if (matchPattern(options[res], strlen(options[res]), param, param_len)) {
-			*value = res;
-			return TRUE;
-		}
+    for (res = 0; options[res]; ++res) {
+        if (matchPattern(options[res], strlen(options[res]), param, param_len)) {
+            *value = res;
+            return TRUE;
+        }
     }
 
-	SCPI_ErrorPush(context, SCPI_ERROR_ILLEGAL_PARAMETER_VALUE);
+    SCPI_ErrorPush(context, SCPI_ERROR_ILLEGAL_PARAMETER_VALUE);
     return FALSE;
 }
 

--
Gitblit v1.9.1