Commit Graph

9 Commits

Author SHA1 Message Date
Andrew Johnson
da9982f875 libCom: Fix unsigned overflow limits in epicsParse*
The strtoul() routine accepts negative numbers.  This fix
ensures we handle them properly, and adds suitable tests.

Also fix the test for 1e300, in case the compiler gives a
slightly different literal constant than strtod() returns.
2012-06-30 15:34:29 -05:00
Andrew Johnson
fb61234431 Change the epicsParse APIs to return a units pointer.
This lets us use epicsParseDouble() for scan rate parsing.

Ensure the scanOnce thread is a higher priority than the fastest
periodic scan thread, irrespective of how many threads there are.
2012-06-29 14:41:35 -05:00
Andrew Johnson
269fb01c63 libCom: Add routines for parsing strings into epicsTypes
Adds new routines for converting numeric strings into the
standard epicsInt8, epicsUInt8, epicsInt16, epicsUInt16,
epicsInt32 and epicsUInt32 types, along with Long, ULong,
Double and Float.  These all provide error checking and
detection of extraneous characters.  The epicsScanDouble
and epicsScanFloat routines originally in epicsStdlib.h
are replaced by macros that call the epicsParse routine,
and this also provides epicsScanLong and epicsScanULong
to match.

A test file is added to ensure conversions work properly
and report appropriate errors.  This file also checks the
native strtod() routine if not used to check whether the
epicsStrtod() code is required on this platform.
2012-06-22 14:06:52 -05:00
Andrew Johnson
31d149d8d9 Fixed 64 bit compiler warnings from Tom Palaia/MacOS. 2009-04-23 18:49:40 +00:00
Andrew Johnson
52ab7f6d6b A char with the top bit set doesn't cast properly when its signed. 2007-09-11 19:11:55 +00:00
Andrew Johnson
5a561ca613 Make epicsStrtod() parse the full "Infinity" and not stop after "Inf". 2006-10-26 21:18:05 +00:00
Andrew Johnson
7aa6a2ca98 Better fix to the epicsStrtod problem: Don't compile our function if epicsStrtod
is a macro; that way you can't set a breakpoint on it which would never fire.
2006-01-05 21:08:02 +00:00
W. Eric Norum
8d3dc9eb33 Avoid infinite recursion on systems with 'working' strtod() functions. 2005-12-26 18:32:43 +00:00
Marty Kraimer
3499fbe51d get rid of epicsShareAPI; epicsStrtok_r is new; clean up epicsStdlib 2005-12-12 19:54:48 +00:00