From 7a9407d7abbe6c0e6661a192b39ac45d7340c0bb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 4 Sep 2014 11:07:59 -0500 Subject: [PATCH] libCom: Clean up MS compiler warnings. This doesn't fix the Microsoft link failure though, that may need an upgrade of MS Visual Studio on our Hudson Windows VM. --- src/libCom/misc/epicsStdlib.c | 12 ++++++------ src/libCom/misc/epicsString.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libCom/misc/epicsStdlib.c b/src/libCom/misc/epicsStdlib.c index faf6ca75c..e61269a1f 100644 --- a/src/libCom/misc/epicsStdlib.c +++ b/src/libCom/misc/epicsStdlib.c @@ -129,7 +129,7 @@ epicsParseInt8(const char *str, epicsInt8 *to, int base, char **units) if (value < -0x80 || value > 0x7f) return S_stdlib_overflow; - *to = value; + *to = (epicsInt8) value; return 0; } @@ -145,7 +145,7 @@ epicsParseUInt8(const char *str, epicsUInt8 *to, int base, char **units) if (value > 0xff && value <= ~0xffUL) return S_stdlib_overflow; - *to = value; + *to = (epicsUInt8) value; return 0; } @@ -161,7 +161,7 @@ epicsParseInt16(const char *str, epicsInt16 *to, int base, char **units) if (value < -0x8000 || value > 0x7fff) return S_stdlib_overflow; - *to = value; + *to = (epicsInt16) value; return 0; } @@ -177,7 +177,7 @@ epicsParseUInt16(const char *str, epicsUInt16 *to, int base, char **units) if (value > 0xffff && value <= ~0xffffUL) return S_stdlib_overflow; - *to = value; + *to = (epicsUInt16) value; return 0; } @@ -232,12 +232,12 @@ epicsParseFloat(const char *str, float *to, char **units) if (finite(value) && abs >= FLT_MAX) return S_stdlib_overflow; - *to = value; + *to = (float) value; return 0; } -/* If strtod() works properly, osdStrtod.h defines this macro: +/* If strtod() works properly, the OS-specific osdStrtod.h does: * #define epicsStrtod strtod * * If strtod() is broken, osdStrtod.h defines this prototype: diff --git a/src/libCom/misc/epicsString.c b/src/libCom/misc/epicsString.c index f5c61944d..79be7bf22 100644 --- a/src/libCom/misc/epicsString.c +++ b/src/libCom/misc/epicsString.c @@ -41,7 +41,7 @@ int epicsStrnRawFromEscaped(char *to, size_t outsize, const char *from, const char *pfrom = from; char *pto = to; char c; - int nto = 0, nfrom = 0; + size_t nto = 0, nfrom = 0; while ((c = *pfrom++) && nto < outsize && nfrom < inlen) { nfrom++;