From 7f3d9c0c0238b1fec92fff04f87730668100b73b Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周二, 04 8月 2015 00:39:04 +0800
Subject: [PATCH] Cleanup of macros and defines

---
 libscpi/src/utils.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libscpi/src/utils.c b/libscpi/src/utils.c
index 26e4973..be9f93e 100644
--- a/libscpi/src/utils.c
+++ b/libscpi/src/utils.c
@@ -338,7 +338,7 @@
     int rightFlag = 0; // flag for ']' on right
     int cmd_sep_pos = 0;
 
-    int32_t numbers_idx = -1;         /* Lutz Hoerl, Thorlabs: changed type from size_t to int, size_t is positive only, int does not produce unsigne warnings */
+    size_t numbers_idx = 0;
     int32_t *number_ptr = NULL;
 
     const char * pattern_ptr = pattern;
@@ -379,13 +379,13 @@
         }
 
         if (pattern_ptr[pattern_sep_pos - 1] == '#') {
-            numbers_idx++;
             if (numbers && (numbers_idx < numbers_len)) {
                 number_ptr = numbers + numbers_idx;
                 *number_ptr = 1; // default value
             } else {
                 number_ptr = NULL;
             }
+            numbers_idx++;
         } else {
             number_ptr = NULL;
         }
@@ -548,7 +548,7 @@
         if (c1 != c2) {
             return c1 - c2;
         }
-        if (c1 == '\0') {        /* Lutz Hoerl, Thorlabs: think this (c1 = '\0') was really a bug */
+        if (c1 == '\0') {
             return 0;
         }
     }

--
Gitblit v1.9.1