[Git][NTPsec/ntpsec][master] Constify a variable that can be immutable.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Jun 26 04:24:30 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
bdf057d3 by Eric S. Raymond at 2016-06-26T00:23:04-04:00
Constify a variable that can be immutable.

- - - - -


2 changed files:

- include/ntpd.h
- ntpd/refclock_conf.c


Changes:

=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -516,6 +516,6 @@ extern int accept_wildcard_if_for_winnt;
 #ifdef REFCLOCK
 /* refclock configuration table */
 extern struct refclock * const refclock_conf[];
-extern uint8_t	num_refclock_conf;
+extern const uint8_t	num_refclock_conf;
 #endif
 


=====================================
ntpd/refclock_conf.c
=====================================
--- a/ntpd/refclock_conf.c
+++ b/ntpd/refclock_conf.c
@@ -1,5 +1,8 @@
 /*
  * refclock_conf.c - reference clock configuration
+ *
+ * This is the only place in the code that knows how to map driver numeric types
+ * to driver method tables and their attributes.
  */
 #include <config.h>
 
@@ -201,4 +204,4 @@ struct refclock * const refclock_conf[] = {
 	&refclock_gpsdjson	/* 46 REFCLK_GPSDJSON */
 };
 
-uint8_t num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);
+const uint8_t num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/bdf057d35bf1c8fce3beae9bf9e726c4cab9afec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160626/cbf59812/attachment.html>


More information about the vc mailing list