Skip to content

Commit 8866159

Browse files
authored
Merge pull request #169 from j123b567/issue-168
Fix compiler warnings
2 parents befb37b + 14fbf59 commit 8866159

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

libscpi/inc/scpi/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ extern "C" {
199199
#elif USE_CUSTOM_DTOSTRE
200200
#define SCPIDEFINE_floatToStr(v, s, l) SCPI_dtostre((v), (s), (l), 6, 0)
201201
#elif HAVE_SNPRINTF
202-
#define SCPIDEFINE_floatToStr(v, s, l) snprintf((s), (l), "%g", (v))
202+
#define SCPIDEFINE_floatToStr(v, s, l) snprintf((s), (l), "%g", (double)(v))
203203
#else
204204
#define SCPIDEFINE_floatToStr(v, s, l) SCPI_dtostre((v), (s), (l), 6, 0)
205205
#endif

libscpi/src/utils.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
#include "utils_private.h"
4545
#include "scpi/utils.h"
4646

47+
#if HAVE_STRNCASECMP
48+
#include <strings.h>
49+
#endif // HAVE_STRNCASECMP
50+
4751
static size_t patternSeparatorShortPos(const char * pattern, size_t len);
4852
static size_t patternSeparatorPos(const char * pattern, size_t len);
4953
static size_t cmdSeparatorPos(const char * cmd, size_t len);

0 commit comments

Comments
 (0)