From 94ccbc305cac38eb9c54384b9f47d3da6527299b Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周六, 25 4月 2015 22:29:42 +0800 Subject: [PATCH] Solve #16 Multiple Identical Capabilities --- libscpi/src/units.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libscpi/src/units.c b/libscpi/src/units.c index ac0a0bb..2f1f7a7 100644 --- a/libscpi/src/units.c +++ b/libscpi/src/units.c @@ -38,6 +38,7 @@ #include "scpi/parser.h" #include "scpi/units.h" #include "scpi/utils_private.h" +#include "scpi/utils.h" #include "scpi/error.h" @@ -111,6 +112,7 @@ {/* name */ "NAN", /* type */ SCPI_NUM_NAN}, {/* name */ "INFinity", /* type */ SCPI_NUM_INF}, {/* name */ "NINF", /* type */ SCPI_NUM_NINF}, + {/* name */ "AUTO", /* type */ SCPI_NUM_AUTO}, SCPI_SPECIAL_NUMBERS_LIST_END, }; @@ -134,7 +136,7 @@ } for (i = 0; specs[i].name != NULL; i++) { - if (matchPattern(specs[i].name, strlen(specs[i].name), str, len)) { + if (matchPattern(specs[i].name, strlen(specs[i].name), str, len, NULL)) { value->type = specs[i].type; return TRUE; } @@ -311,7 +313,7 @@ return min(strlen(type), len); } - result = doubleToStr(value->value, str, len); + result = SCPI_DoubleToStr(value->value, str, len); unit = translateUnitInverse(context->units, value->unit); -- Gitblit v1.9.1