]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Changed "char * progname;" variable to be "char const * progname;", so now it is...
authorTomek Mrugalski <tomasz@isc.org>
Sat, 25 Jul 2015 16:08:16 +0000 (18:08 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Sat, 25 Jul 2015 16:08:16 +0000 (18:08 +0200)
Many files:
  changed a variable to be const
  autogenerated

bk: 55b3b470JN_mBREj_DI4u0fSmOyJag

24 files changed:
adjtimed/adjtimed.c
clockstuff/chutest.c
clockstuff/propdelay.c
libntp/msyslog.c
libntp/ntp_lineedit.c
ntpdate/ntpdate.c
ntpdc/ntpdc.c
ntpq/ntpq.c
sntp/log.c
sntp/log.h
sntp/tests/run-crypto.c
sntp/tests/run-keyFile.c
sntp/tests/run-kodDatabase.c
sntp/tests/run-kodFile.c
sntp/tests/run-networking.c
sntp/tests/run-packetHandling.c
sntp/tests/run-packetProcessing.c
sntp/tests/run-utilities.c
tests/ntpd/run-ntp_restrict.c
tests/sandbox/run-modetoa.c
tests/sandbox/run-uglydate.c
tests/sandbox/run-ut-2803.c
util/ntp-keygen.c
util/ntptime.c

index f38e66dd0f758dcbb5bb3afdbe803525d63a2c52..fd28dfb1be075b4c548c977f0a592563184d821d 100644 (file)
@@ -58,7 +58,7 @@ void Exit (int);
 /* emacs cc-mode goes nuts if we split the next line... */
 #define tvtod(tv)      ((double)tv.tv_sec + ((double)tv.tv_usec / (double)MILLION))
 
-char *progname = NULL;
+char const *progname = NULL;
 int verbose = 0;
 int sysdebug = 0;
 static int mqid;
index 488a0d16e0ffed01f166a3aa14cb9679141e4db4..78f6c5fe9818a90da0217e6b5d2c9b86d9b83628 100644 (file)
@@ -56,7 +56,7 @@ struct chucode {
 
 #define        STREQ(a, b)     (*(a) == *(b) && strcmp((a), (b)) == 0)
 
-char *progname;
+char const *progname;
 
 int dofilter = 0;      /* set to 1 when we should run filter algorithm */
 int showtimes = 0;     /* set to 1 when we should show char arrival times */
index 52c20320cdc453df36b9447029d4573a24c1c88e..a3b9fc0b28509068a6c5aec2a81a387a2601b36b 100644 (file)
@@ -117,7 +117,7 @@ int Cflag = 0;
 int Gflag = 0;
 int height;
 
-char *progname;
+char const *progname;
 
 static void    doit            (double, double, double, double, double, char *);
 static double  latlong         (char *, int);
index 4e0aee5db07095984d34bd29d7c4ab3c81a57484..a2068255b078c79b0e3e010032c088fff6ac7672 100644 (file)
@@ -38,7 +38,7 @@ char *        syslog_abs_fname;
 #define INIT_NTP_SYSLOGMASK    ~(u_int32)0
 u_int32 ntp_syslogmask = INIT_NTP_SYSLOGMASK;
 
-extern char  progname;
+extern char const * progname;
 
 /* Declare the local functions */
 void   addto_syslog    (int, const char *);
@@ -145,8 +145,8 @@ addto_syslog(
        const char *    msg
        )
 {
-       static char *   prevcall_progname;
-       static char *   prog;
+       static char const *     prevcall_progname;
+       static char const *     prog;
        const char      nl[] = "\n";
        const char      empty[] = "";
        FILE *          term_file;
index e3bc0022a292ecfe2b60cb4c963016d50bb5fa13..a2b2d293470512f08c24b7fb86b6f2be00636e36 100644 (file)
@@ -36,7 +36,7 @@
  * external references
  */
 
-extern char *  progname;
+extern char const *    progname;
 
 /*
  * globals, private prototypes
index 08edc8be4a7f76b451492e5ecf5be7b95d1a878f..9831929c490b498d92b0ab1d5168d10c3b75898f 100644 (file)
@@ -149,7 +149,7 @@ int unpriv_port = 0;
 /*
  * Program name.
  */
-char *progname;
+char const *progname;
 
 /*
  * Systemwide parameters and flags
index 8c07dac978e780e29f952cc957285e0c352058ff..ab177885b9a562c4c165bc5dd136fdc216441ef0 100644 (file)
@@ -240,7 +240,7 @@ static      FILE *current_output;
  */
 extern struct xcmd opcmds[];
 
-char *progname;
+char const *progname;
 
 #ifdef NO_MAIN_ALLOWED
 CALL(ntpdc,"ntpdc",ntpdcmain);
index fa7d59339e72947e1c1b58a0f51f821b033bbd20..ee853f985cd2739bc88eab9b980946fb2c73ba21 100644 (file)
@@ -405,7 +405,7 @@ FILE *current_output;
  */
 extern struct xcmd opcmds[];
 
-char *progname;
+char const *progname;
 
 #ifdef NO_MAIN_ALLOWED
 #ifndef BUILD_AS_LIB
index d7034951528e4d277801770019b290ee53328d8b..d27e885e25863dfd3c084db236efcfab88cc6d99 100644 (file)
@@ -2,7 +2,7 @@
 
 #include "log.h"
 
-char *progname;                /* for msyslog use too */
+char const *progname;          /* for msyslog use too */
 
 static void cleanup_log(void);
 
index fdb2ba21bcad93bfd8702f2a8989a226f1fb0a5d..2d047babcb12f710b7b4c836de6e245c008bb573 100644 (file)
@@ -22,6 +22,6 @@
 void sntp_init_logging(const char *program);
 void open_logfile(const char *logfile);
 
-extern char *progname;         /* for msyslog use too */
+extern char const *progname;           /* for msyslog use too */
 
 #endif
index d4f811f0e92bdda50ee2bc9a4b0c0998cb24db86..8b2a73528f4a85abf58ae21ac03dd3ce9b4bb938 100644 (file)
@@ -46,7 +46,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index f55c035206546a0e3454c9ec2db03b31c2214959..862910903f9c7e94e807a6f6e923926b475773b2 100644 (file)
@@ -46,7 +46,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index 6de7bacd00af2372f93361cf3f19d4cc8ee47a3c..e5bf3d728e12f1f22826fe0569e8f331b6cfe3b5 100644 (file)
@@ -48,7 +48,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index 3c2553c26362acc181d9d0405d2d799cb8bd760f..3943550391e98f5f1bb9230eefa860ef7e8e79b5 100644 (file)
@@ -47,7 +47,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index ae21349af204588bcd0eac5315fba1c64de1af22..70caaa034fea60525b6742bc8c6f96bbd0f5f0dd 100644 (file)
@@ -39,7 +39,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index 3a34590b6d3635a34faac822e658be52c75fee7f..bc20d7f48ba40b64d1a566ee6e8e3c1468d566da 100644 (file)
@@ -55,7 +55,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index b987d4a262581b6df0c262ee654b68b39b8668b0..bf3a63eb1cf59debe505619c644b0a816285820e 100644 (file)
@@ -58,7 +58,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index 0eb0ba90b90ca9dd869a9567932565ba9a74ba40..7c2237bbe1598d20e76ee0bebf203cbe8f41500c 100644 (file)
@@ -49,7 +49,7 @@ void resetTest(void)
   setUp();
 }
 
-char *progname;
+char const *progname;
 
 
 //=======MAIN=====
index 89fd457342c9d72ddc05ab84341662cf89be75f9..0d945eb338327a877b154434f5534be8aa73cdfe 100644 (file)
@@ -47,7 +47,7 @@ void resetTest(void)
   setUp();
 }
 
-char const * progname;
+char const *progname;
 
 
 //=======MAIN=====
index 776dda485dd5fe9a1e1251d9c990cbb69bacca92..143bd756c5fd91e206433f9555c6d32f5cd5760b 100644 (file)
@@ -31,18 +31,21 @@ extern void test_UnknownMode(void);
 
 
 //=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
 {
   tearDown();
   setUp();
 }
 
+char const *progname;
+
 
 //=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
 {
-  Unity.TestFile = "modetoa.c";
-  UnityBegin("");
+  progname = argv[0];
+  UnityBegin("modetoa.c");
   RUN_TEST(test_KnownMode, 8);
   RUN_TEST(test_UnknownMode, 15);
 
index dd909adb046a7f7cc3912e8fcd03af531be1e670..e65cd01097ad32903efaef0c91617b432a43c66e 100644 (file)
@@ -22,6 +22,8 @@
 #include "unity.h"
 #include <setjmp.h>
 #include <stdio.h>
+#include "config.h"
+#include "ntp_fp.h"
 
 //=======External Functions This Runner Calls=====
 extern void setUp(void);
@@ -30,18 +32,21 @@ extern void test_ConstantDateTime(void);
 
 
 //=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
 {
   tearDown();
   setUp();
 }
 
+char const *progname;
+
 
 //=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
 {
-  Unity.TestFile = "uglydate.c";
-  UnityBegin("");
+  progname = argv[0];
+  UnityBegin("uglydate.c");
   RUN_TEST(test_ConstantDateTime, 9);
 
   return (UnityEnd());
index d6ca2ee7df172aaa9bb6cf02682a5916484bcd9d..b948c4a3876bc51cf17f756ae10d7a8a1e0cc852 100644 (file)
@@ -35,18 +35,21 @@ extern void test_ignored(void);
 
 
 //=======Test Reset Option=====
-void resetTest()
+void resetTest(void);
+void resetTest(void)
 {
   tearDown();
   setUp();
 }
 
+char const *progname;
+
 
 //=======MAIN=====
-int main(void)
+int main(int argc, char *argv[])
 {
-  Unity.TestFile = "ut-2803.c";
-  UnityBegin("");
+  progname = argv[0];
+  UnityBegin("ut-2803.c");
   RUN_TEST(test_main, 30);
   RUN_TEST(test_XPASS, 37);
   RUN_TEST(test_XFAIL, 49);
index 86d040ddeea2e6997ec74bb10d32763da137912f..9568adc8d2fefc48364752f71b950ef96de6f022 100644 (file)
@@ -154,7 +154,7 @@ u_long      asn2ntp         (ASN1_TIME *);
  * Program variables
  */
 extern char *optarg;           /* command line argument */
-char   *progname;
+char   const *progname;
 u_int  lifetime = DAYSPERYEAR; /* certificate lifetime (days) */
 int    nkeys;                  /* MV keys */
 time_t epoch;                  /* Unix epoch (seconds) since 1970 */
index 4b45f245721e39bdb125ef48456fb286901dea29..c47e356dd79619060dacd8f8a1b423f0dee149c9 100644 (file)
@@ -73,7 +73,7 @@ static sigjmp_buf env;                /* environment var. for pll_trap() */
 static volatile int pll_control; /* (0) daemon, (1) kernel loop */
 static volatile int status;    /* most recent status bits */
 static volatile int flash;     /* most recent ntp_adjtime() bits */
-char* progname;
+char const * progname;
 static char optargs[] = "MNT:cde:f:hm:o:rs:t:";
 
 int