summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-08 10:42:04 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-08 10:42:04 -0400
commit0deeeb2b1fb55d78c4abedbf88c8f46d9b300ed6 (patch)
tree153b73860dff8d769cbbb3006cdb64d6014e23f0 /gpsutils.c
parent93f417401f02b85e936d93cf5f7ba54d75de49de (diff)
downloadgpsd-0deeeb2b1fb55d78c4abedbf88c8f46d9b300ed6.tar.gz
Break timespec_str out of gpsutils.c.
It's not used on the client side, and it's needed separately for ntplib. All regression tesrs pass. PPS is live.
Diffstat (limited to 'gpsutils.c')
-rw-r--r--gpsutils.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/gpsutils.c b/gpsutils.c
index e7000f70..ea5c45bb 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -479,32 +479,4 @@ double earth_distance(double lat1, double lon1, double lat2, double lon2)
return earth_distance_and_bearings(lat1, lon1, lat2, lon2, NULL, NULL);
}
-/* Convert a normailized timespec to a nice string
- * put in it *buf, buf should be at least 22 bytes
- *
- * the returned buffer will look like, shortest case:
- * sign character ' ' or '-'
- * one digit of seconds
- * decmal point '.'
- * 9 digits of nanoSec
- *
- * So 12 chars, like this: "-0.123456789"
- *
- * Absolute worst case is 10 digits of seconds.
- * So 21 digits like this: "-2147483647.123456789"
- *
-*/
-void timespec_str(const struct timespec *ts, /*@out@*/char *buf, int buf_size)
-{
- char sign = ' ';
-
- /*@-type@*//* splint is confused about timespec*/
- if ( (0 > ts->tv_nsec ) || ( 0 > ts->tv_sec ) ) {
- sign = '-';
- }
- (void) snprintf( buf, buf_size, "%c%ld.%09ld",
- sign,
- (long)labs(ts->tv_sec),
- (long)labs(ts->tv_nsec));
- /*@+type@*/
-}
+/* end */