[Git][NTPsec/ntpsec][master] OCD: chomp trailing whitespace(s)

Hal Murray gitlab at mg.gitlab.com
Mon May 18 23:48:20 UTC 2020



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
f0dd4645 by James Browning at 2020-05-18T16:09:07-07:00
OCD: chomp trailing whitespace(s)

- - - - -


25 changed files:

- attic/clocks.c
- attic/random.c
- contrib/keygone.py
- devel/README.adoc
- devel/hacking.adoc
- devel/tour.adoc
- docs/NTS-QuickStart.adoc
- include/ntp_endian.h
- include/ntp_filegen.h
- include/nts.h
- libaes_siv/demo.c
- libaes_siv/tests.c
- libntp/lib_strbuf.c
- libparse/clk_meinberg.c
- libparse/clk_rawdcf.c
- libparse/clk_rcc8000.c
- libparse/clk_trimtsip.c
- libparse/clk_varitext.c
- ntpd/ntp_peer.c
- ntpd/ntp_proto.c
- ntpd/nts_client.c
- ntpd/refclock_nmea.c
- ntpfrob/jitter.c
- tests/ntpd/leapsec.c
- tests/unity/unity_memory.h


Changes:

=====================================
attic/clocks.c
=====================================
@@ -221,7 +221,7 @@ int main(int argc, char *argv[]) {
 			}
 			printf("Found faster: %d => %d\n", fastest, faster);
 			fastest = faster;
-		} 
+		}
 	}
 
 	return 0;


=====================================
attic/random.c
=====================================
@@ -251,11 +251,11 @@ int main(int argc, char *argv[]) {
 
 	printf(" times in ns         avg  fastest  lng\n");
 
-	average = getpid_average();   
+	average = getpid_average();
 	printf("getpid():          %5d            (simple kernel call)\n",
 		average);
 
-	average = clock_average();   
+	average = clock_average();
 	printf("clock_gettime:     %5d            (overhead of fastest)\n",
 		average);
 


=====================================
contrib/keygone.py
=====================================
@@ -57,7 +57,7 @@ types_lengths_list = [
 for type_length_tuple in types_lengths_list:
     length = min(type_length_tuple[0], max_bytes)
     for _ in group_iterator:
-        print("%3d %12s\t%s" % 
+        print("%3d %12s\t%s" %
         (key_number, type_length_tuple[1],
          secrets.token_hex(length)))
         key_number += 1


=====================================
devel/README.adoc
=====================================
@@ -17,7 +17,7 @@ hacking.adoc::
 	Notes to folks who want to hack on the code.
 
 ifdex-ignores::
-	Lists and explains a large number of internal configuration symbols.	
+	Lists and explains a large number of internal configuration symbols.
 
 make-tarball::
 	The script for building a release tarball.


=====================================
devel/hacking.adoc
=====================================
@@ -196,7 +196,7 @@ likes. It's a bit archaic, but we've stuck with it to preserve
 continuity; you should, too.
 
 *Do* always add the optional braces around if/for/while/do bodies.
-It helps readability, staves off some subtle errors, and will be 
+It helps readability, staves off some subtle errors, and will be
 helpful if the code is ever moved to Go.
 
 A discussion about using uncrustify to mass convert all the C sources


=====================================
devel/tour.adoc
=====================================
@@ -410,14 +410,14 @@ injects that into the peer buffer for the refclock.
 
 Another way of looking at it: there are two parts to the refclock code.
 
-The first operates on the second time scale.  The main thread calls the 
-refclock receive routine when a "packet" arrives over the serial port and/or 
-the timer routine every second so it can poll SHM and cleanup of the serial 
+The first operates on the second time scale.  The main thread calls the
+refclock receive routine when a "packet" arrives over the serial port and/or
+the timer routine every second so it can poll SHM and cleanup of the serial
 port gets unplugged.  That level of code puts samples into a FIFO.
- 
-The other is at the poll-interval level,16 seconds to 64 seconds.  That takes 
-data out of the FIFO, discards outliers, averages, and injects a sample into 
-the normal NTP processing pipeline where it shows up as a 1 bit in the peers 
+
+The other is at the poll-interval level,16 seconds to 64 seconds.  That takes
+data out of the FIFO, discards outliers, averages, and injects a sample into
+the normal NTP processing pipeline where it shows up as a 1 bit in the peers
 reach mask.  (or a 0 if there weren't any good samples)
 
 == Asynchronous DNS lookup


=====================================
docs/NTS-QuickStart.adoc
=====================================
@@ -74,7 +74,7 @@ the server's certificate.  IP addresses will not work.
 This assumes that the server is using a certificate covered by
 your OS/distro's root certificate collection.
 
-NetBSD needs the +mozilla-rootcerts-openssl+ package and `ca /etc/openssl/certs/` added to the +server+ line. 
+NetBSD needs the +mozilla-rootcerts-openssl+ package and `ca /etc/openssl/certs/` added to the +server+ line.
 
 Restart `ntpd`, and skip to link:#verify[Verification], below.
 
@@ -83,14 +83,14 @@ Restart `ntpd`, and skip to link:#verify[Verification], below.
 
 Being an NTS server requires a well-formed SSL certificate.  The
 easiest way to do this is to use Let's Encrypt.  It needs a FQDN.
-Please see the 
+Please see the
 https://certbot.eff.org/[certbot client site] for instructions.
 
 The following worked on Fedora:
 
 ------------------------------------------------------------
 $ sudo dnf install certbot
-  
+
 # Install
 $ sudo certbot certonly --standalone
 


=====================================
include/ntp_endian.h
=====================================
@@ -3,7 +3,7 @@
  * Copyright the NTPsec project contributors
  * SPDX-License-Identifier: BSD-2-Clause
  *
- * These are portable reimplementations of what BSD provides 
+ * These are portable reimplementations of what BSD provides
  * in <sys/endian.h>.
  */
 #ifndef GUARD_NTP_ENDIAN_H


=====================================
include/ntp_filegen.h
=====================================
@@ -1,7 +1,7 @@
 /*
  * definitions for NTP file generations support
  *
- * Copyright Rainer Pruy, 
+ * Copyright Rainer Pruy,
  *           Friedrich-Alexander Universitaet Erlangen-Nuernberg, Germany
  * SPDX-License-Identifier: BSD-2-Clause
  */


=====================================
include/nts.h
=====================================
@@ -52,7 +52,7 @@ bool nts_ke_setup_send(struct BufCtl_t *buf, int aead,
 
 /***********************************************************/
 
-/* buffer packing/unpacking routines. 
+/* buffer packing/unpacking routines.
  * NB: The length field in NTP extensions includes the header
  * while the length field in NTS-KE data streams does not.
  *


=====================================
libaes_siv/demo.c
=====================================
@@ -164,7 +164,7 @@ int main(int argc, char const* argv[])
     fprintf(stderr, "Invalid key length %zu bytes, must be one of 32, 48, or 64\n", key_len);
     goto fail;
   }
-  
+
   if(load_file(ad_file, &ad, &ad_len) < 0)
   {
     fprintf(stderr, "Could not load associated data file %s : %s\n", ad_file, strerror(errno));
@@ -245,7 +245,7 @@ int main(int argc, char const* argv[])
     perror("fwrite");
     goto fail;
   }
-  
+
   free(plaintext);
   free(key);
   free(ad);


=====================================
libaes_siv/tests.c
=====================================
@@ -72,7 +72,7 @@ static void test_malloc_failure(void) {
         int ret, i=0;
         AES_SIV_CTX *ctx;
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L	
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
         ret = CRYPTO_set_mem_functions(mock_malloc, realloc, free);
 #else
 	ret = CRYPTO_set_mem_functions(mock_malloc_ex, mock_realloc_ex, mock_free_ex);
@@ -97,7 +97,7 @@ static void test_cleanup_before_free(void) {
 	AES_SIV_CTX_cleanup(ctx);
 	AES_SIV_CTX_free(ctx);
 	printf("OK\n");
-}	
+}
 
 static void test_vector_1(void) {
         const unsigned char key[] = {


=====================================
libntp/lib_strbuf.c
=====================================
@@ -25,7 +25,7 @@ void getbuf_init(void) {
 
 /*
  * Function to get a pointer to the next buffer.  Needs to be thread-safe because
- * it's used in callers that need to be thread-safe, notably msyslog.  For the 
+ * it's used in callers that need to be thread-safe, notably msyslog.  For the
  * same reason, we don't try to log a lock-acquisition failure.
  *
  * ESR: Yes, this is ugly and kludgy. I'm not getting rid of of it
@@ -46,7 +46,7 @@ char *lib_getbuf(void)
 	static int		lib_nextbuf;
 	char *bufp;
 
-// FIXME - need this until python tests can call getbuf_init 
+// FIXME - need this until python tests can call getbuf_init
 	static bool init_done = false;
 	if (!init_done) {
 		getbuf_init();


=====================================
libparse/clk_meinberg.c
=====================================
@@ -338,7 +338,7 @@ cvt_meinberg(
 		if (f[0] == '#') {
 			clock_time->flags |= PARSEB_POWERUP;
 		}
-			
+
 		if (f[1] == '*') {
 			clock_time->flags |= PARSEB_NOSYNC;
 		}
@@ -346,7 +346,7 @@ cvt_meinberg(
 		if (f[3] == '!') {
 			clock_time->flags |= PARSEB_ANNOUNCE;
 		}
-			
+
 		/*
 		 * oncoming leap second
 		 * 'a' code not confirmed - earth is not
@@ -355,7 +355,7 @@ cvt_meinberg(
 		if (f[3] == 'A') {
 			clock_time->flags |= PARSEB_LEAPADD;
 		}
-			
+
 		if (f[3] == 'a') {
 			clock_time->flags |= PARSEB_LEAPDEL;
 		}
@@ -490,14 +490,14 @@ cvt_mgps(
 			if (clock_time->utcoffset == 0) {
 			    clock_time->flags |= PARSEB_UTC;
 			}
-			    
+
 			/*
 			 * no sv's seen - no time & position
 			 */
 			if (f[0] == '#') {
 			    clock_time->flags |= PARSEB_POWERUP;
 			}
-			    
+
 			/*
 			 * at least one sv seen - time (for last position)
 			 */
@@ -512,7 +512,7 @@ cvt_mgps(
 			if (f[3] == '!') {
 			    clock_time->flags |= PARSEB_ANNOUNCE;
 			}
-			    
+
 			/*
 			 * oncoming leap second
 			 * 'a' code not confirmed - earth is not
@@ -521,11 +521,11 @@ cvt_mgps(
 			if (f[4] == 'A') {
 			    clock_time->flags |= PARSEB_LEAPADD;
 			}
-			    
+
 			if (f[4] == 'a') {
 			    clock_time->flags |= PARSEB_LEAPDEL;
 			}
-			    
+
 			/*
 			 * f[5] == ' '
 			 */
@@ -536,7 +536,7 @@ cvt_mgps(
 			if ((f[6] == 'L') || (clock_time->second == 60)) {
 			    clock_time->flags |= PARSEB_LEAPSECOND;
 			}
-			    
+
 			return CVT_OK;
 		}
 	}
@@ -566,7 +566,7 @@ gps_input(
 	if (!msg_buf) {
 		return PARSE_INP_SKIP;
 	}
-		
+
 	if ( msg_buf->phase == MBG_NONE ) {                  /* not receiving yet */
 		switch (ch)
 		{
@@ -604,7 +604,7 @@ gps_input(
 	    (parseio->parse_index < parseio->parse_dsize)) {
 		parseio->parse_data[parseio->parse_index++] = ch;
 	}
-		
+
 	parseio->parse_dtime.parse_msg[parseio->parse_dtime.parse_msglen++] \
 	    = (unsigned char)ch;
 


=====================================
libparse/clk_rawdcf.c
=====================================
@@ -273,7 +273,7 @@ convert_rawdcf(
 		if (ext_bf(buffer, DCF_A2, dcfprm->zerobits)) {
 		    clock_time->flags |= PARSEB_LEAPADD; /* default: DCF77 data format deficiency */
 		}
-		    
+
 		if (ext_bf(buffer, DCF_R, dcfprm->zerobits)) {
 		    clock_time->flags |= PARSEB_CALLBIT;
 		}
@@ -606,7 +606,7 @@ inp_rawdcf(
 			} else {
 				delta_usec = -1;
 			}
-			
+
 			if (delta_usec < (NS_PER_S/2000) && delta_usec >= 0) {
 				parseprintf(DD_RAWDCF, ("inp_rawdcf: timeout time difference %ld usec - minute marker set\n", delta_usec));
 				/* collect minute markers only if spaced by 60 seconds */


=====================================
libparse/clk_rcc8000.c
=====================================
@@ -33,7 +33,7 @@
  */
 
 #define	O_USEC		O_WDAY
-static struct format rcc8000_fmt = { 
+static struct format rcc8000_fmt = {
 	{ { 13, 2 }, {16, 2}, { 19, 2}, /* Day, Month, Year */
 	  {  0, 2 }, { 3, 2}, {  6, 2}, /* Hour, Minute, Second */
 	  {  9, 3 }, {28, 1}, {  0, 0}, /* uSec, Status (Valid,Reject,BST,Leapyear) */  },


=====================================
libparse/clk_trimtsip.c
=====================================
@@ -249,7 +249,7 @@ cvt_trimtsip(
 			    if (t->t_leap == DELSECOND) {
 				    clock_time->flags |= PARSEB_LEAPDEL;
 			    }
-				    
+
 			    switch (t->t_operable) {
 				case STATUS_SYNC:
 				    clock_time->flags &= ~(PARSEB_POWERUP|PARSEB_NOSYNC);
@@ -276,7 +276,7 @@ cvt_trimtsip(
 
 		    } /* case 0x41 */
 
-		    case CMD_RRECVHEALTH: 
+		    case CMD_RRECVHEALTH:
 		    {
 			    /* TRIMBLE health */
 			    uint8_t status = mb(0);
@@ -318,7 +318,7 @@ cvt_trimtsip(
 			    if (t->t_weekleap < GPSWRAP) {
 				    t->t_weekleap = (unsigned short)(t->t_weekleap + GPSWEEKS);
 			    }
-				    
+
 			    /* day in week of leap correction */
 			    t->t_dayleap = get_msb_ushort(&mb(22));
 			    /* current week no */
@@ -327,7 +327,7 @@ cvt_trimtsip(
 				    /* coverity[copy_paste_error] */
 				    t->t_week = (unsigned short)(t->t_weekleap + GPSWEEKS);
 			    }
-				    
+
 			    lbp = (unsigned char *)&mb(14); /* last update time */
 			    if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK) {
 				    return CVT_FAIL|CVT_BADFMT;


=====================================
libparse/clk_varitext.c
=====================================
@@ -163,11 +163,11 @@ inp_varitext(
 	if (!t) {
 		return PARSE_INP_SKIP;	/* local data not allocated - sigh! */
 	}
-		
+
 	if (ch == 'T') {
 		t->tstamp = *tstamp;
 	}
-		
+
 	if ((t->previous_ch == 'T') && (ch == ':')) {
 		parseprintf(DD_PARSE, ("inp_varitext: START seen\n"));
 


=====================================
ntpd/ntp_peer.c
=====================================
@@ -557,7 +557,7 @@ newpeer(
 	if (NULL != hostname) {
 		name = hostname;
 	} else {
-		name = socktoa(srcadr); 
+		name = socktoa(srcadr);
 	}
 
 	/*


=====================================
ntpd/ntp_proto.c
=====================================
@@ -2993,7 +2993,7 @@ void maybe_log_junk(const char *tag, struct recvbuf *rbufp) {
       junk_last = rbufp->recv_time;
       junk_score *= expf(-since_last/junk_decay);
       if (junk_limit < junk_score)
-	return; 
+	return;
     }
     junk_print++;
     junk_score += 1.0/junk_decay;  /* only count the ones we print */


=====================================
ntpd/nts_client.c
=====================================
@@ -121,7 +121,7 @@ bool nts_probe(struct peer * peer) {
 	if (NULL == peer->cfg.nts_cfg.ca)
 		ssl = SSL_new(client_ctx);
 	else {
-		SSL_CTX *ctx; 
+		SSL_CTX *ctx;
 		ctx = make_ssl_client_ctx(peer->cfg.nts_cfg.ca);
 		if (NULL == ctx) {
 			close(server);


=====================================
ntpd/refclock_nmea.c
=====================================
@@ -1087,7 +1087,7 @@ nmea_receive(
 	 * timecode timestamp, but only if the PPS is not in control.
 	 * Discard sentence if reference time did not change.
 	 */
-	rd_reftime = eval_gps_time(refclock_name(peer), &date, &tofs, 
+	rd_reftime = eval_gps_time(refclock_name(peer), &date, &tofs,
 				   (peer->cfg.mode & NMEA_DATETRUST_MASK), &up->epoch_warp, &rd_timestamp);
 	if (up->last_reftime == rd_reftime) {
 		/* Do not touch pp->a_lastcode on purpose! */


=====================================
ntpfrob/jitter.c
=====================================
@@ -65,7 +65,7 @@ get_clocktime(
 // modified from https://stackoverflow.com/questions/11931547/qsort-does-not-work-for-double-array
 static int doublecmp(const void * a, const void * b)
 {
-	if (*(const double*)a > *(const double*)b) { 
+	if (*(const double*)a > *(const double*)b) {
 		return -1;
 	} else if (*(const double*)a < *(const double*)b) {
 		return 1;


=====================================
tests/ntpd/leapsec.c
=====================================
@@ -246,7 +246,7 @@ static int stringreader(void* farg)
 	if (**cpp) {
 		return *(*cpp)++;
 	} else {
-	    return EOF; 
+	    return EOF;
 	}
 }
 


=====================================
tests/unity/unity_memory.h
=====================================
@@ -57,4 +57,4 @@ void UnityMalloc_MakeMallocFailAfterCount(int countdown);
 }
 #endif
 
-#endif 
+#endif



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/f0dd4645f45e2cf2a37b7b1b98d0fc6d26d28fda

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/f0dd4645f45e2cf2a37b7b1b98d0fc6d26d28fda
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/20200518/d244c80c/attachment-0001.htm>


More information about the vc mailing list