From e0beddef34daa0690acd468ac6480c5df3bd9d0f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 24 Feb 2015 13:24:42 -0500 Subject: gpsmon: refactoring step, make utility function for TOS display. --- monitor_nmea0183.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'monitor_nmea0183.c') diff --git a/monitor_nmea0183.c b/monitor_nmea0183.c index 39eae9d7..8ba58882 100644 --- a/monitor_nmea0183.c +++ b/monitor_nmea0183.c @@ -320,25 +320,7 @@ static void nmea_update(void) } #ifdef NTP_ENABLE - /*@-compdef@*/ - /*@-type -noeffect@*/ /* splint is confused about struct timespec */ - if (time_offset.real.tv_sec != 0) - { - /* NOTE: can not use double here due to precision requirements */ - struct timespec timedelta; - TS_SUB(&timedelta, &time_offset.clock, &time_offset.real); - if ( 86400 < (long)labs(timedelta.tv_sec) ) { - /* more than one day off, overflow */ - /* need a bigger field to show it */ - (void)mvwprintw(gpgsawin, TOFF_LINE, 7, "> 1 day"); - } else { - char buf[TIMESPEC_LEN]; - timespec_str( &timedelta, buf, sizeof(buf) ); - (void)mvwprintw(gpgsawin, TOFF_LINE, 7, "%s", buf); - } - } - /*@+type +noeffect@*/ - /*@+compdef@*/ + toff_update(gpgsawin, TOFF_LINE, 7); #endif /* NTP_ENABLE */ if (strcmp(fields[0], "GPGGA") == 0 -- cgit v1.2.1