[Git][NTPsec/ntpsec][master] 4 commits: dns_cancel(): remove function that does nothing...

Gary E. Miller gitlab at mg.gitlab.com
Sat Apr 15 02:28:24 UTC 2017


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


Commits:
46ac6c3a by Gary E. Miller at 2017-04-14T18:19:33-07:00
dns_cancel(): remove function that does nothing...

- - - - -
faf79eeb by Gary E. Miller at 2017-04-14T18:25:20-07:00
dns_new_interface() remove empty function.

- - - - -
92ee9847 by Gary E. Miller at 2017-04-14T18:50:52-07:00
time64_to_time() remove unused function.

- - - - -
48baa251 by Gary E. Miller at 2017-04-14T19:23:03-07:00
Add attribute const to some functions.

- - - - -


8 changed files:

- include/ntp_calendar.h
- include/ntp_dns.h
- include/ntp_stdlib.h
- include/refidsmear.h
- libntp/ntp_calendar.c
- libntp/ntp_dns.c
- ntpd/ntp_io.c
- ntpd/ntp_peer.c


Changes:

=====================================
include/ntp_calendar.h
=====================================
--- a/include/ntp_calendar.h
+++ b/include/ntp_calendar.h
@@ -52,13 +52,7 @@ extern systime_func_ptr ntpcal_set_timefunc(systime_func_ptr);
 #define	SECSPERWEEK	(DAYSPERWEEK * SECSPERDAY)
 #define	SECSPERYEAR	(365 * SECSPERDAY)	/* regular year */
 #define	SECSPERLEAPYEAR	(366 * SECSPERDAY)	/* leap year */
-#define	SECSPERAVGYEAR	31556952		/* mean year length over 400yrs */
-
-/*
- * Convert between 'time_t' and 'time64_t'
- */
-extern time64_t time_to_time64(const time_t);
-extern time_t time64_to_time(const time64_t);
+#define	SECSPERAVGYEAR	31556952	/* mean year length over 400yrs */
 
 /*
  * Get the build date & time. ATTENTION: The time zone is not specified!
@@ -98,13 +92,13 @@ ntpcal_daysplit(const time64_t);
  * expressed in 64 bits to avoid overflow.
  */
 extern time64_t
-ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */);
+ntpcal_dayjoin(int32_t /* days */, int32_t /* seconds */) __attribute__((const));
 
 /*
  * Convert elapsed years in Era into elapsed days in Era.
  */
 extern int32_t
-ntpcal_days_in_years(int32_t /* years */);
+ntpcal_days_in_years(int32_t /* years */) __attribute__((const));
 
 /*
  * Convert a number of elapsed month in a year into elapsed days
@@ -130,7 +124,8 @@ ntpcal_edate_to_eradays(int32_t /* years */, int32_t /* months */, int32_t /* md
  * Convert a time spec to seconds. No range checks done here!
  */
 extern int32_t
-ntpcal_etime_to_seconds(int32_t /* hours */, int32_t /* minutes */, int32_t /* seconds */);
+ntpcal_etime_to_seconds(int32_t /* hours */, int32_t /* minutes */,
+                        int32_t /* seconds */) __attribute__((const));
 
 /*
  * Convert ELAPSED years/months/days of gregorian calendar to elapsed
@@ -219,7 +214,7 @@ ntpcal_time_to_date(struct calendar * /* jd */, const time64_t /* ts */);
 /* used by ntpd/refclock_nmea.c */
 extern int32_t
 ntpcal_periodic_extend(int32_t /* pivot */, int32_t /* value */,
-		       int32_t /* cycle */);
+		       int32_t /* cycle */) __attribute__((const));
 
 extern int
 ntpcal_ntp64_to_date(struct calendar * /* jd */, const time64_t /* ntp */);


=====================================
include/ntp_dns.h
=====================================
--- a/include/ntp_dns.h
+++ b/include/ntp_dns.h
@@ -20,7 +20,5 @@ extern void server_take_dns(struct peer*, struct addrinfo*);
 extern void pool_take_dns(struct peer*, struct addrinfo*);
 
 extern void dns_check(void);	/* called by main thread */
-extern void dns_cancel(struct peer*);
-extern void dns_new_interface(void);
 
 #endif	/* GUARD_NTP_DNS_H */


=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -55,7 +55,7 @@ extern	bool	authusekey	(keyid_t, int, const uint8_t *);
 extern	const char *clockname	(int);
 extern	int	clocktime	(int, int, int, int, int, uint32_t, uint32_t *, uint32_t *);
 extern	void	init_auth	(void);
-extern	void	init_lib	(void);
+extern	void	init_lib	(void) __attribute__((const));
 extern	void	init_network	(void);
 extern	void	auth_moremem	(int);
 extern	void	auth_prealloc_symkeys(int);


=====================================
include/refidsmear.h
=====================================
--- a/include/refidsmear.h
+++ b/include/refidsmear.h
@@ -1,3 +1,3 @@
 
-extern l_fp	convertRefIDToLFP(uint32_t r);
-extern uint32_t	convertLFPToRefID(l_fp num);
+extern l_fp	convertRefIDToLFP(uint32_t r) __attribute__((const));
+extern uint32_t	convertLFPToRefID(l_fp num) __attribute__((const));


=====================================
libntp/ntp_calendar.c
=====================================
--- a/libntp/ntp_calendar.c
+++ b/libntp/ntp_calendar.c
@@ -50,52 +50,6 @@ now(void)
 
 /*
  *---------------------------------------------------------------------
- * Convert between 'time_t' and 'time64_t'
- *---------------------------------------------------------------------
- */
-time64_t
-time_to_time64(
-	const time_t tt
-	)
-{
-	time64_t res;
-
-#if NTP_SIZEOF_TIME_T <= 4
-	settime64u(res, 0);
-	if (tt < 0) {
-		settime64lo(res, (uint32_t)-tt);
-		res = negtime64(res);
-	} else {
-		settime64lo(res, (uint32_t)tt);
-	}
-
-#else
-	settime64s(res, tt);
-#endif
-
-	return res;
-}
-
-
-time_t
-time64_to_time(
-	const time64_t tv
-	)
-{
-	time_t res;
-
-#if NTP_SIZEOF_TIME_T <= 4
-	res = (time_t)time64lo(tv);
-
-#else
-	res = (time_t)time64s(tv);
-#endif
-
-	return res;
-}
-
-/*
- *---------------------------------------------------------------------
  * Get the build date & time
  *---------------------------------------------------------------------
  */


=====================================
libntp/ntp_dns.c
=====================================
--- a/libntp/ntp_dns.c
+++ b/libntp/ntp_dns.c
@@ -103,15 +103,6 @@ void dns_check(void)
 	active = NULL;
 };
 
-void dns_cancel(struct peer* pp)
-{
-	UNUSED_ARG(pp);
-};
-
-void dns_new_interface(void)
-{
-};
-
 static void* dns_lookup(void* arg)
 {
 	struct peer *pp = (struct peer *) arg;


=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -141,7 +141,6 @@ static int maxactivefd;
  */
 static  u_short		sys_interphase = 0;
 
-static endpt *	new_interface(endpt *);
 static void	add_interface(endpt *);
 static bool	update_interfaces(u_short, interface_receiver_t,
 				  void *);
@@ -1246,7 +1245,6 @@ interface_update(
 #ifdef DEBUG
 	msyslog(LOG_DEBUG, "new interface(s) found: waking up resolver");
 #endif
-	dns_new_interface();
 }
 
 


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -489,7 +489,6 @@ unpeer(
 	struct peer *peer
 	)
 {
-	dns_cancel(peer);
 	mprintf_event(PEVNT_DEMOBIL, peer, "assoc %u", peer->associd);
 	restrict_source(&peer->srcadr, true, 0);
 	set_peerdstadr(peer, NULL);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/3d0a867d1321d4587fccbd9653a63401c9a994cd...48baa251642e2b1ed47eb19469ed9463852ae54e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/3d0a867d1321d4587fccbd9653a63401c9a994cd...48baa251642e2b1ed47eb19469ed9463852ae54e
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/20170415/62810cf3/attachment.html>


More information about the vc mailing list