[Git][NTPsec/ntpsec][master] 8 commits: libparse: remove unused get_mbg_alm()

Gary E. Miller gitlab at mg.gitlab.com
Tue May 23 02:14:08 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
5ef33ae7 by Gary E. Miller at 2017-05-22T18:43:48-07:00
libparse: remove unused get_mbg_alm()

- - - - -
2514c358 by Gary E. Miller at 2017-05-22T18:46:05-07:00
libparse: remove unused get_mbg_iono()

- - - - -
04f0ecf9 by Gary E. Miller at 2017-05-22T18:51:10-07:00
libparse: make parse_restart() static.

- - - - -
b92c6278 by Gary E. Miller at 2017-05-22T18:54:37-07:00
libparse: remove unused parse_iopps()

- - - - -
1e6fd554 by Gary E. Miller at 2017-05-22T19:00:28-07:00
combine two copis of days_per_year() into one.

Probably still redundant to ntpcal_days_in_years().

- - - - -
0d543334 by Gary E. Miller at 2017-05-22T19:04:24-07:00
libparse: remove unused syn_simple()

- - - - -
5b025a10 by Gary E. Miller at 2017-05-22T19:08:42-07:00
libparse: make pps_simple() static.

- - - - -
ebef11ae by Gary E. Miller at 2017-05-22T19:10:48-07:00
libparse: remove unused pps_zero()

- - - - -


6 changed files:

- include/mbg_gps166.h
- include/ntp_calendar.h
- include/parse.h
- libparse/data_mbg.c
- libparse/parse.c
- tests/check_y2k.c


Changes:

=====================================
include/mbg_gps166.h
=====================================
--- a/include/mbg_gps166.h
+++ b/include/mbg_gps166.h
@@ -931,8 +931,6 @@ void get_mbg_cfgh (unsigned char **, CFGH *);
 void get_mbg_utc (unsigned char **, UTC *);
 void get_mbg_lla (unsigned char **, LLA);
 void get_mbg_xyz (unsigned char **, XYZ);
-void get_mbg_alm (unsigned char **, ALM *);
-void get_mbg_iono (unsigned char **, IONO *);
 
 CSUM mbg_csum (unsigned char *, unsigned int) __attribute__((pure));
 


=====================================
include/ntp_calendar.h
=====================================
--- a/include/ntp_calendar.h
+++ b/include/ntp_calendar.h
@@ -98,6 +98,8 @@ ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */) __attribute__((const))
 extern int32_t
 ntpcal_days_in_years(int32_t /* years */) __attribute__((const));
 
+#define days_per_year(x)	((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))
+
 /*
  * Convert ELAPSED years/months/days of gregorian calendar to elapsed
  * days in Gregorian epoch. No range checks done here!


=====================================
include/parse.h
=====================================
--- a/include/parse.h
+++ b/include/parse.h
@@ -281,14 +281,12 @@ extern unsigned short nformats;
 extern bool  parse_ioinit (parse_t *);
 extern void parse_ioend (parse_t *);
 extern int  parse_ioread (parse_t *, char, timestamp_t *);
-extern int  parse_iopps (parse_t *, int, timestamp_t *);
 extern void parse_iodone (parse_t *);
 extern bool  parse_timecode (parsectl_t *, parse_t *);
 extern int  parse_getfmt (parsectl_t *, parse_t *);
 extern bool  parse_setfmt (parsectl_t *, parse_t *);
 extern bool  parse_setcs (parsectl_t *, parse_t *);
 
-extern unsigned int parse_restart (parse_t *, char);
 extern unsigned int parse_addchar (parse_t *, char);
 extern unsigned int parse_end (parse_t *);
 
@@ -298,10 +296,7 @@ extern int Stoi (const unsigned char *, long *, int);
 
 extern time_t parse_to_unixtime (clocktime_t *, unsigned long *);
 extern unsigned long updatetimeinfo (parse_t *, unsigned long);
-extern void syn_simple (parse_t *, timestamp_t *, struct format *, unsigned long);
-extern parse_pps_fnc_t pps_simple;
 extern parse_pps_fnc_t pps_one;
-extern parse_pps_fnc_t pps_zero;
 extern bool parse_timedout (parse_t *, timestamp_t *, struct timespec *);
 
 #endif


=====================================
libparse/data_mbg.c
=====================================
--- a/libparse/data_mbg.c
+++ b/libparse/data_mbg.c
@@ -295,57 +295,6 @@ get_mbg_xyz(
     }
 }
 
-#define FETCH_DOUBLE(src, addr)							\
-	if  (fetch_ieee754(src, IEEE_DOUBLE, addr, mbg_double) != IEEE_OK)	\
-	{									\
-	  *addr = 0;								\
-	}
-
-void
-get_mbg_alm(
-	unsigned char **buffpp,
-	ALM *almp
-	)
-{
-  almp->csum   = (CSUM) get_lsb_uint16(buffpp);
-  almp->valid  = get_lsb_int16(buffpp);
-
-  almp->health = (HEALTH) get_lsb_uint16(buffpp);
-  get_mbg_tgps(buffpp, &almp->t0a);
-
-
-  FETCH_DOUBLE(buffpp, &almp->sqrt_A);
-  FETCH_DOUBLE(buffpp, &almp->e);
-
-  FETCH_DOUBLE(buffpp, &almp->M0);
-  FETCH_DOUBLE(buffpp, &almp->omega);
-  FETCH_DOUBLE(buffpp, &almp->OMEGA0);
-  FETCH_DOUBLE(buffpp, &almp->OMEGADOT);
-  FETCH_DOUBLE(buffpp, &almp->deltai);
-  FETCH_DOUBLE(buffpp, &almp->af0);
-  FETCH_DOUBLE(buffpp, &almp->af1);
-}
-
-void
-get_mbg_iono(
-	unsigned char **buffpp,
-	IONO *ionop
-	)
-{
-  ionop->csum   = (CSUM) get_lsb_uint16(buffpp);
-  ionop->valid  = get_lsb_int16(buffpp);
-
-  FETCH_DOUBLE(buffpp, &ionop->alpha_0);
-  FETCH_DOUBLE(buffpp, &ionop->alpha_1);
-  FETCH_DOUBLE(buffpp, &ionop->alpha_2);
-  FETCH_DOUBLE(buffpp, &ionop->alpha_3);
-
-  FETCH_DOUBLE(buffpp, &ionop->beta_0);
-  FETCH_DOUBLE(buffpp, &ionop->beta_1);
-  FETCH_DOUBLE(buffpp, &ionop->beta_2);
-  FETCH_DOUBLE(buffpp, &ionop->beta_3);
-}
-
 /*
  * data_mbg.c,v
  * Revision 4.8  2006/06/22 18:40:01  kardel


=====================================
libparse/parse.c
=====================================
--- a/libparse/parse.c
+++ b/libparse/parse.c
@@ -25,6 +25,8 @@
 #define SYNC_ONE	0x01
 
 static unsigned long timepacket (parse_t *);
+static unsigned int parse_restart (parse_t *, char);
+static parse_pps_fnc_t pps_simple;
 
 bool
 parse_timedout(
@@ -90,7 +92,7 @@ parse_ioend(
 	    free(parseio->parse_data);
 }
 
-unsigned int
+static unsigned int
 parse_restart(
 	      parse_t *parseio,
 	      char ch
@@ -253,40 +255,6 @@ parse_ioread(
 }
 
 /*
- * parse_iopps
- *
- * take status line indication and derive synchronisation information
- * from it.
- * It can also be used to decode a serial serial data format (such as the
- * ONE, ZERO, MINUTE sync data stream from DCF77)
- */
-/*ARGSUSED*/
-int
-parse_iopps(
-	register parse_t *parseio,
-	register int status,
-	register timestamp_t *ptime
-	)
-{
-	register unsigned int updated = CVT_NONE;
-
-	/*
-	 * PPS pulse information will only be delivered to ONE clock format
-	 * this is either the last successful conversion module with a ppssync
-	 * routine, or a fixed format with a ppssync routine
-	 */
-	parseprintf(DD_PARSE, ("parse_iopps: STATUS %s\n", (status == SYNC_ONE) ? "ONE" : "ZERO"));
-
-	if (clockformats[parseio->parse_lformat]->syncpps)
-	{
-		updated = (unsigned int) clockformats[parseio->parse_lformat]->syncpps(parseio, status == SYNC_ONE, ptime);
-		parseprintf(DD_PARSE, ("parse_iopps: updated = 0x%x\n", updated));
-	}
-
-	return (updated & CVT_MASK) != CVT_NONE;
-}
-
-/*
  * parse_iodone
  *
  * clean up internal status for new round
@@ -309,7 +277,6 @@ parse_iodone(
 /*
  * convert a struct clock to UTC since Jan, 1st 1970 0:00 (the UNIX EPOCH)
  */
-#define days_per_year(x)	((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))
 
 time_t
 parse_to_unixtime(
@@ -495,33 +462,13 @@ updatetimeinfo(
 	return CVT_OK;		/* everything fine and dandy... */
 }
 
-
-/*
- * syn_simple
- *
- * handle a sync time stamp
- */
-/*ARGSUSED*/
-void
-syn_simple(
-	register parse_t *parseio,
-	register timestamp_t *ts,
-	register struct format *format,
-	register unsigned long why
-	)
-{
-	UNUSED_ARG(format);
-	UNUSED_ARG(why);
-	parseio->parse_dtime.parse_stime = *ts;
-}
-
 /*
  * parse_pps_fnc_t pps_simple
  *
  * handle a pps time stamp
  */
 /*ARGSUSED*/
-unsigned long
+static unsigned long
 pps_simple(
 	register parse_t *parseio,
 	register int status,
@@ -555,25 +502,6 @@ pps_one(
 }
 
 /*
- * parse_pps_fnc_t pps_zero
- *
- * handle a pps time stamp in ZERO edge
- */
-/*ARGSUSED*/
-unsigned long
-pps_zero(
-	register parse_t *parseio,
-	register int status,
-	register timestamp_t *ptime
-	)
-{
-	if (!status)
-		return pps_simple(parseio, status, ptime);
-
-	return CVT_NONE;
-}
-
-/*
  * timepacket
  *
  * process a data packet


=====================================
tests/check_y2k.c
=====================================
--- a/tests/check_y2k.c
+++ b/tests/check_y2k.c
@@ -269,8 +269,7 @@ main( void )
 
     clock_time = &Clock_Time;
 
-	/* first test this #define */
-#define days_per_year(x)  ((x) % 4 ? 365 : ((x % 400) ? ((x % 100) ? 366 : 365) : 366))
+    /* first test #define days_per_year(x) */
 
     for ( year = 1400; year <= 2200; year++ )
     {



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/2050064186514db793e6b5bfa32dd675ba2fc8cc...ebef11ae38d4b67cab5f9f04cc299ae3623f63b4

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/2050064186514db793e6b5bfa32dd675ba2fc8cc...ebef11ae38d4b67cab5f9f04cc299ae3623f63b4
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170523/c2af0dca/attachment.html>


More information about the vc mailing list