[Git][NTPsec/ntpsec][master] 5 commits: missing include with needed externs, found by clang.

Gary E. Miller gitlab at mg.gitlab.com
Wed Feb 15 19:57:06 UTC 2017


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


Commits:
bfae3b9e by Gary E. Miller at 2017-02-15T11:43:16-08:00
missing include with needed externs, found by clang.

- - - - -
8a26ae4b by Gary E. Miller at 2017-02-15T11:46:01-08:00
missing statics and a cast.  Found by clang.

- - - - -
7deee636 by Gary E. Miller at 2017-02-15T11:49:15-08:00
Whoops, bad include file name.

- - - - -
c7f215e8 by Gary E. Miller at 2017-02-15T11:49:34-08:00
put extern where it belongs.  Found by clang.

- - - - -
ad061ee8 by Gary E. Miller at 2017-02-15T11:56:43-08:00
missing refclock externs.  found by clang.

- - - - -


7 changed files:

- include/ntp_config.h
- include/ntp_refclock.h
- include/refclock_pps.h
- libntp/getopt.c
- libntp/initnetwork.c
- ntpd/ntp_config.c
- ntpd/refclock_trimble.c


Changes:

=====================================
include/ntp_config.h
=====================================
--- a/include/ntp_config.h
+++ b/include/ntp_config.h
@@ -280,6 +280,8 @@ extern struct REMOTE_CONFIG_INFO remote_config;
 void config_remotely(sockaddr_u *);
 
 extern bool have_interface_option;
+extern char *stats_drift_file;	/* name of the driftfile */
+
 
 void ntp_rlimit(int, rlim_t, int, const char *);
 


=====================================
include/ntp_refclock.h
=====================================
--- a/include/ntp_refclock.h
+++ b/include/ntp_refclock.h
@@ -192,12 +192,21 @@ extern	size_t	refclock_gtraw	(struct recvbuf *, char *, size_t, l_fp *);
 extern	bool	indicate_refclock_packet(struct refclockio *,
 					 struct recvbuf *);
 extern	void	process_refclock_packet(struct recvbuf *);
+extern struct   refclock refclock_arbiter;
 extern struct   refclock refclock_gpsdjson;
 extern struct	refclock refclock_hpgps;
 extern struct   refclock refclock_jjy;
+extern struct   refclock refclock_local;
+extern struct   refclock refclock_modem;
 extern struct   refclock refclock_neoclock4x;
 extern struct   refclock refclock_nmea;
 extern struct   refclock refclock_parse;
+extern struct   refclock refclock_shm;
+extern struct   refclock refclock_spectracom;
+extern struct   refclock refclock_trimble;
+extern struct   refclock refclock_true;
+extern struct   refclock refclock_zyfer;
+
 #endif /* REFCLOCK */
 
 #endif /* GUARD_NTP_REFCLOCK_H */


=====================================
include/refclock_pps.h
=====================================
--- a/include/refclock_pps.h
+++ b/include/refclock_pps.h
@@ -19,4 +19,3 @@ typedef enum {
 extern	bool	refclock_ppsapi(int, struct refclock_ppsctl *);
 extern	bool	refclock_params(int, struct refclock_ppsctl *);
 extern pps_status refclock_catcher(struct peer *, struct refclock_ppsctl *, int);
-extern	struct refclock refclock_shm;


=====================================
libntp/getopt.c
=====================================
--- a/libntp/getopt.c
+++ b/libntp/getopt.c
@@ -12,10 +12,10 @@
 /* const int optional_argument = 2; UNUSED */
 
 char* ntp_optarg;
-int ntp_optopt;
+static int ntp_optopt;
 /* The variable ntp_optind [...] shall be initialized to 1 by the system. */
 int ntp_optind = 1;
-int ntp_opterr;
+static int ntp_opterr;
 
 /* Implemented based on [1] and [2] for optional arguments.
    ntp_optopt is handled FreeBSD-style, per [3].
@@ -175,7 +175,7 @@ int ntp_getopt_long(int argc, char *const argv[], const char *optstring,
 	/* If longindex is not NULL, it points to a variable which is set to the
 	   index of the long option relative to longopts. */
 	if (longindex)
-	    *longindex = (match - longopts);
+	    *longindex = (int)(match - longopts);
 
 	/* If flag is NULL, then getopt_long() shall return val.
 	   Otherwise, getopt_long() returns 0, and flag shall point to


=====================================
libntp/initnetwork.c
=====================================
--- a/libntp/initnetwork.c
+++ b/libntp/initnetwork.c
@@ -3,7 +3,8 @@
  */
 #include "config.h"
 
-#include <isc/net.h>
+#include "isc/net.h"
+#include "ntp_stdlib.h"
 
 /*
  * Storage declarations


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -193,8 +193,6 @@ bool old_config_style = true;	/* A boolean flag, which when set,
 		  		 * every command is being used
 			 	 */
 
-extern char *stats_drift_file;	/* name of the driftfile */
-
 /* FUNCTION PROTOTYPES */
 
 static void init_syntax_tree(config_tree *);


=====================================
ntpd/refclock_trimble.c
=====================================
--- a/ntpd/refclock_trimble.c
+++ b/ntpd/refclock_trimble.c
@@ -185,7 +185,7 @@ static  void	init_acutime		(int fd);
 
 
 /* Table to get from month to day of the year */
-const int days_of_year [12] = {
+static const int days_of_year [12] = {
 	0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334
 };
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/3c938b42f68fe448acae2abece8207168f0cfc66...ad061ee86c10f397e0c8183b261d51c452beb3b0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170215/8495924a/attachment.html>


More information about the vc mailing list