summaryrefslogtreecommitdiff
path: root/gpsutils.c
Commit message (Collapse)AuthorAgeFilesLines
* Write scan-build suppressions to it runs clean.Eric S. Raymond2015-03-301-0/+2
| | | | | | Promote scan-build to be onere of the stock pre-release checks. Fix one minor cppcheck nit.
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-26/+11
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Clean up most spint errors. All regression tests pass.Eric S. Raymond2015-03-281-4/+13
|
* Yet more: Line expects to suppress X error, found 0 errorsGary E. Miller2015-03-251-4/+4
|
* Break timespec_str out of gpsutils.c.Eric S. Raymond2015-03-081-29/+1
| | | | | | It's not used on the client side, and it's needed separately for ntplib. All regression tesrs pass. PPS is live.
* Implement POSIX clock_gettime(3) for systems that lack it (like Mac OS X).Eric S. Raymond2015-03-011-6/+0
| | | | | | | On Mac OS X it will get proper nanosecond precision; elsewhere, only microseconds. Hides the conformance failure from the rest of the code. All regression tests pass.
* Remove unused and incorrect retval from timespec_strZbigniew Chyla2015-02-151-6/+2
| | | | | | | All callers ignore value returned by timespec_str. Additionally, the function returns simply the result of snprintf(), which is not necessarily the number of chars written to the buffer (if the buffer provided by the caller was too small).
* timespec_str: add "const" to input argumentZbigniew Chyla2015-02-151-1/+1
|
* Document the output of timespec_str() betterGary E. Miller2015-02-121-0/+12
| | | | | It can be as short as 12 chars: "-0.123456789" Or as long as 21 chars: "-2147483647.123456789"
* splint cleanup. All regressiion tests pass.Eric S. Raymond2015-02-091-1/+3
|
* Add function timespec_str(), and use it.Gary E. Miller2015-02-051-0/+19
| | | | | Converting a timespec to a printable string is odd, so placed in a new function for ease of use.
* Comment on loss of precision in timestamp().Gary E. Miller2015-02-021-0/+2
| | | | timestamp() should not be used where nanoSec count.
* Revert to using internal mkgmtime() as in 3.11.Eric S. Raymond2015-01-231-8/+7
| | | | | | The experiments since then have failed. All regression tests pass.
* Easy splint cleanups. All regression tests pass.Eric S. Raymond2015-01-211-1/+1
|
* Revert to using timegm() following Hal Murray's report of Fedora flakiness.Eric S. Raymond2015-01-141-3/+6
| | | | All regression tests pass.
* Fix the build in some unusual cases. All regression tests pass.Eric S. Raymond2015-01-131-0/+5
|
* Fixup iso8601_to_unix uninitialized memory bugJon Schlueter2015-01-071-0/+1
| | | | | | | | Initialize struct tm before passing it to strptime The issue is that mktime uses tm_isdst but some versions of strptime don't actually set tm_isdst so you get an uninitialized memory behavior at that point
* Better way to avoid glibc dependency.Eric S. Raymond2014-09-291-0/+30
| | | | | | | Returns us to something amost identical to the original code. Sigh. Timezones are a swamp. All regression tests pass.
* GNU libc timegm() turns out to be buggy when DST is on (glibc-2.19).Eric S. Raymond2014-09-281-1/+1
| | | | | | Fortunately, there's a much simpler way to do the computation correctly. All regression tests pass,
* Remove some custom code, at the cost of introducing a glibc depenency.Eric S. Raymond2014-09-251-29/+1
| | | | Dependency soon to be fixed. All regression tests pass.
* Silence compiler warnings about array subscripts of type 'char'Matt2014-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | Cygwin GCC complains about code like isprint(c), where c is of type char. The isX() and toX() functions/macros (ISO C allows either) all accept an int, whose value should be either that of an unsigned char, or the special value EOF (== -1). So cast to unsigned char each argument to isprint, tolower, etc. Silences several warnings of the form: gpsutils.c: In function 'safe_atof': gpsutils.c:90:5: warning: array subscript has type 'char' [-Wchar-subscripts] while (isspace(*p)) { ^ gpsutils.c:188:2: warning: array subscript has type 'char' [-Wchar-subscripts] while (isdigit(*p)) { ^
* Code is fully cppcheck, splint, and Coverity clean.Eric S. Raymond2013-11-061-2/+3
| | | | All regression tests pass. PPS is live.
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-2/+2
|
* fix building with clock_gettime and newer glibcMike Frysinger2012-05-211-2/+4
| | | | | | | | | | | | | | | | | Building with recent glibc versions fails in gpsutils.c due to missing definitions related to clock_gettime. This is because we define the _XOPEN_SOURCE macro, but not to a new enough value. So set it to a recent spec value that satisfies both strptime and clock_gettime. Example build failure with glibc-2.15: gpsutils.c: In function 'timestamp': gpsutils.c:299:22: error: storage size of 'ts' isn't known gpsutils.c:300:14: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration] gpsutils.c:300:34: error: 'CLOCK_REALTIME' undeclared (first use in this function) gpsutils.c:300:34: note: each undeclared identifier is reported only once for each function it appears in Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Comment out dead code. All regression tests pass.Eric S. Raymond2012-05-171-1/+1
|
* The strptime prototype is not provided unless explicitly requested.Gary E. Miller2012-04-061-0/+5
| | | | | | So add the define that POSIX says to to avoid. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Used clock_gettime() instead of gettimeofday() if possible.Michael Tatarinov2011-10-201-3/+9
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Tweak for time.Michael Tatarinov2011-10-201-9/+0
| | | | | | | | | 1. Tag "week" must be unsigned integer. gpsprof -f instrumented works again. 2. Removed tag "uxtime" duplication "time". 3. Used a more precise timestamp. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Break out prototypes for client library export methgods into a new heasder.Eric S. Raymond2011-09-281-0/+1
| | | | All regression tests pass. All three exports work in gpxlogger.
* Cycle-start detection by timing works on a SiRF at 9600bps.Eric S. Raymond2011-09-211-2/+2
| | | | All regression tests pass.
* splint cleanup.Eric S. Raymond2011-09-211-2/+2
|
* Remove the old latency-profiling machinery.Eric S. Raymond2011-09-201-0/+9
| | | | | | It hasn't actually worked since we switched protocols to JSON. This diff puts the framework in place for new machinery using timing attributes in the TPV sentence.
* Fix some compiler warnings.Eric S. Raymond2011-09-151-0/+1
|
* Typo fix.Eric S. Raymond2011-09-071-1/+1
|
* splint/pychecker cleanup of safe_atof().Eric S. Raymond2011-08-271-1/+3
|
* Avoid locale problems in the NMEA driver, too.Eric S. Raymond2011-08-271-0/+205
|
* Now that gpsd.h is safe to include in libgps, revert an earlier change.Eric S. Raymond2011-08-251-1/+1
|
* Remove an unneeded gpsd.h include.Eric S. Raymond2011-08-251-1/+1
|
* Enable another gcc error messsabe and fix a warning.Eric S. Raymond2011-08-111-1/+0
|
* Typo fixes and scan-build cleanup.Eric S. Raymond2011-08-111-0/+1
|
* Removed duplicate code.Michael Tatarinov2011-06-291-0/+6
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Re-identify most *_IS flags with corresponding *_SET flags.Eric S. Raymond2011-03-271-11/+11
| | | | | | | | | | | Required so clients looking at flag masks in data exported via the shared-memory interface will see the right thing. These were separated originally in order to avoid pushing the reqyuired width of the gpsdata.set flag mask over 32 bits. It became 64 bits in the Version 5 API change, so that constraint went away. All regression tests pass.
* Emit "mode" before its dependent attributes in TPV, and timestamps with .3f.Eric S. Raymond2011-03-221-2/+7
| | | | Required a regression-test rebuild.
* Give timestamps their own typedef. No logic changes.Eric S. Raymond2011-03-101-6/+6
| | | | All regression tests pass, splint and cppcheck pass.
* More splint cleanup.Eric S. Raymond2011-02-211-1/+1
|
* splint cleanup.Eric S. Raymond2011-02-211-1/+1
|
* Bulletproof a formatting function against C library variations.Eric S. Raymond2011-02-191-1/+2
|
* Timestamps in TPV and SKY go from float seconds since Unix epoch to ISO8601.Eric S. Raymond2011-01-291-2/+2
| | | | | | | | Protocol version number is bumped. Python and C test clients are known to work; interfaces of the C and Python client bindings are unchanged. Third-party client-side bindings which rely on naively copying JSON members will break (implementers have been repeatedly warned not to do this).
* Document gpsd's assumption about the host system clock correctly.Eric S. Raymond2011-01-201-11/+0
| | | | | We're more dependent on it than I realized. At least all the dependencies are in one module now, and we may be able to do something about relaxing them.
* All the messy gpstime conversion stuff isin timebase.c now.Eric S. Raymond2011-01-201-33/+2
| | | | All regression tests pass.