From cb9a2ff1daf017a3aee23c70c5210608e19df681 Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周三, 22 4月 2015 02:37:15 +0800
Subject: [PATCH] Add more compile checks and resolve warnings

---
 libscpi/src/parser.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c
index ecf26ec..49080ff 100644
--- a/libscpi/src/parser.c
+++ b/libscpi/src/parser.c
@@ -40,6 +40,7 @@
 #include "scpi/config.h"
 #include "scpi/parser.h"
 #include "scpi/utils_private.h"
+#include "scpi/utils.h"
 #include "scpi/error.h"
 #include "scpi/constants.h"
 
@@ -382,7 +383,7 @@
 size_t SCPI_ResultInt(scpi_t * context, int32_t val) {
     char buffer[12];
     size_t result = 0;
-    size_t len = longToStr(val, buffer, sizeof (buffer));
+    size_t len = SCPI_LongToStr(val, buffer, sizeof (buffer), 10);
     result += writeDelimiter(context);
     result += writeData(context, buffer, len);
     context->output_count++;
@@ -408,7 +409,7 @@
 size_t SCPI_ResultDouble(scpi_t * context, double val) {
     char buffer[32];
     size_t result = 0;
-    size_t len = doubleToStr(val, buffer, sizeof (buffer));
+    size_t len = SCPI_DoubleToStr(val, buffer, sizeof (buffer));
     result += writeDelimiter(context);
     result += writeData(context, buffer, len);
     context->output_count++;
@@ -685,3 +686,7 @@
     const char * pattern = context->paramlist.cmd->pattern;
     return matchCommand (pattern, cmd, strlen (cmd));
 }
+
+scpi_bool_t SCPI_Match(const char * pattern, const char * value, size_t len) {
+    return matchCommand (pattern, value, len);
+}

--
Gitblit v1.9.1