From a5a4102ddba7e8f873a83d08328949c64240db96 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Thu, 30 Apr 2015 13:43:33 -0700 Subject: Trailing whitespace fixup. --- Tachometer.c | 4 ++-- serial.c | 4 ++-- srecord.c | 4 ++-- subframe.c | 2 +- test_bits.c | 4 ++-- test_json.c | 6 +++--- test_matrix.c | 4 ++-- test_timespec.c | 4 ++-- timebase.c | 4 ++-- timehint.c | 30 +++++++++++++++--------------- timespec_str.c | 4 ++-- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Tachometer.c b/Tachometer.c index 059d9600..f87791e6 100644 --- a/Tachometer.c +++ b/Tachometer.c @@ -545,13 +545,13 @@ static void Destroy(Widget w) /* Exported Procedures */ -// cppcheck-suppress unusedFunction +// cppcheck-suppress unusedFunction int TachometerGetValue(Widget w) { return (((TachometerWidget) w)->tachometer.value); } -// cppcheck-suppress unusedFunction +// cppcheck-suppress unusedFunction int TachometerSetValue(Widget w, int i) { int old; diff --git a/serial.c b/serial.c index 29f14d17..b1a3462f 100644 --- a/serial.c +++ b/serial.c @@ -407,7 +407,7 @@ void gpsd_set_speed(struct gps_device_t *session, } int gpsd_serial_open(struct gps_device_t *session) -/* open a device for access to its data +/* open a device for access to its data * return: the opened file descriptor * PLACEHOLDING_FD - for /dev/ppsX * UNALLOCATED_FD - for open failure @@ -419,7 +419,7 @@ int gpsd_serial_open(struct gps_device_t *session) session->sourcetype = gpsd_classify(session->gpsdata.dev.path); session->servicetype = service_sensor; - /* we may need to hold on to this slot without opening the device */ + /* we may need to hold on to this slot without opening the device */ if (source_pps == session->sourcetype) { (void)gpsd_switch_driver(session, "PPS"); return PLACEHOLDING_FD; diff --git a/srecord.c b/srecord.c index 49aba590..4c4f6e7a 100644 --- a/srecord.c +++ b/srecord.c @@ -54,13 +54,13 @@ bin2srec(unsigned int type, unsigned int offset, unsigned int num, return 0; } -// cppcheck-suppress unusedFunction +// cppcheck-suppress unusedFunction int srec_hdr(unsigned int num, unsigned char *bbuf, unsigned char *sbuf) { return bin2srec(0, 0, num, bbuf, sbuf); } -// cppcheck-suppress unusedFunction +// cppcheck-suppress unusedFunction int srec_fin(unsigned int num, unsigned char *sbuf) { unsigned char bbuf[4], sum; diff --git a/subframe.c b/subframe.c index 58afa53d..58204634 100644 --- a/subframe.c +++ b/subframe.c @@ -748,7 +748,7 @@ gps_mask_t gpsd_interpret_subframe(struct gps_device_t *session, subp->is_almanac = 1; subframe_almanac(&session->context->errout, subp->tSVID, words, subp->subframe_num, - (uint8_t)sv, subp->data_id, + (uint8_t)sv, subp->data_id, &subp->sub4.almanac); } else if ( -2 == sv ) { /* unknown or secret page */ diff --git a/test_bits.c b/test_bits.c index a1a04ba4..3a30c113 100644 --- a/test_bits.c +++ b/test_bits.c @@ -209,11 +209,11 @@ int main(int argc, char *argv[]) success ? "succeeded" : "FAILED"); } - + shiftleft(buf, 28, 30); if (!quiet) printf("Left-shifted 30 bits: %s\n", hexdump(buf, 28)); - /* + /* * After the 24-bit shift, the bit array loses its first three bytes: * 0x0405060708 = 00000100 00000101 00000110 00000111 00001000 * By inspection, the results of the 6-bit shift are diff --git a/test_json.c b/test_json.c index 1976b171..03d039fd 100644 --- a/test_json.c +++ b/test_json.c @@ -247,7 +247,7 @@ static const struct json_array_t json_array_Bool = { /* Case 14: Read array of reals */ static const char *json_str14 = "[23.1,-17.2,5.3]"; -static double realstore[4]; +static double realstore[4]; static int realcount; static const struct json_array_t json_array_14 = { @@ -264,7 +264,7 @@ static void jsontest(int i) { int status = 0; - switch (i) + switch (i) { case 1: status = libgps_json_unpack(json_str1, &gpsdata, NULL); @@ -355,7 +355,7 @@ static void jsontest(int i) break; case 9: - /* yes, the '6' in the next line is correct */ + /* yes, the '6' in the next line is correct */ status = json_read_object(json_str9, json_attrs_6, NULL); assert_case(9, status); assert_integer("dumbcount", dumbcount, 0); diff --git a/test_matrix.c b/test_matrix.c index d342a364..a1249cba 100644 --- a/test_matrix.c +++ b/test_matrix.c @@ -1,7 +1,7 @@ /* * Unit test for matrix-algebra code * - * Check examples computed at + * Check examples computed at * http://www.elektro-energetika.cz/calculations/matreg.php */ #include @@ -55,7 +55,7 @@ static bool check_diag(int n, double a[4][4], double b[4][4]) if (approx(b[0][0], a[0][0]) && approx(b[1][1], a[1][1]) && approx(b[2][2], a[2][2]) && approx(b[3][3], a[3][3])) return true; - + dump("a", a); dump("b", b); printf("Test %d residuals: %f %f %f %f\n", diff --git a/test_timespec.c b/test_timespec.c index c2351658..8d11771c 100644 --- a/test_timespec.c +++ b/test_timespec.c @@ -110,7 +110,7 @@ static int test_subtract( int verbose ) timespec_str( &p->c, buf_c, sizeof(buf_c) ); timespec_str( &r, buf_r, sizeof(buf_r) ); if ( (p->c.tv_sec != r.tv_sec) || (p->c.tv_nsec != r.tv_nsec) ) { - printf("%21s - %21s = %21s, FAIL s/b %21s\n", + printf("%21s - %21s = %21s, FAIL s/b %21s\n", buf_a, buf_b, buf_r, buf_c); fail_count++; } else if ( verbose ) { @@ -246,7 +246,7 @@ int main(int argc, char *argv[]) (void)fputs("usage: test_timespec [-v] [-V]\n", stderr); exit(fail_count); case 'V': - (void)fprintf( stderr, "test_timespec %s\n", + (void)fprintf( stderr, "test_timespec %s\n", VERSION); exit(EXIT_SUCCESS); case 'v': diff --git a/timebase.c b/timebase.c index cddd5915..0b3192e4 100644 --- a/timebase.c +++ b/timebase.c @@ -117,7 +117,7 @@ not be available at all when a GPS receiver has just cold-booted. Thus, the time reported from GPS devices, although supposed to be UTC, may be offset by an integer number of seconds between a cold boot or leap second and the following -subframe broadcast. +subframe broadcast. It might be best not to trust time for 20 minutes after GPSD startup if it is more than 500ms from current system time (that is long enough @@ -200,7 +200,7 @@ BSD terms apply: see the file COPYING in the distribution root for details. void gpsd_time_init(struct gps_context_t *context, time_t starttime) /* initialize the GPS context's time fields */ { - /* + /* * gpsd can't work with 'right' timezones (leapseconds inserted in * the timezone offset). Avoid this and all manner of other local * time issues by telling the system we want times returned in UTC. diff --git a/timehint.c b/timehint.c index 14ba5d2b..da828f4e 100644 --- a/timehint.c +++ b/timehint.c @@ -31,13 +31,13 @@ * Ntpd always runs as root (to be able to control the system clock). * After that it often (depending on its host configuration) drops to run as * user ntpd and group ntpd. - * + * * As of February 2015 its rules for the creation of ntpshm segments are: * * Segments 0 and 1: permissions 0600, i.e. other programs can only * read and write as root. * - * Segments 2, 3, and higher: + * Segments 2, 3, and higher: * permissions 0666, i.e. other programs can read * and write as any user. I.e.: if ntpd has been * configured to use these segments, any @@ -74,7 +74,7 @@ * To debug, try looking at the live segments this way: * * ipcs -m - * + * * results should look like this: * ------ Shared Memory Segments -------- * key shmid owner perms bytes nattch status @@ -101,7 +101,7 @@ * ipcrm -M 0x4e545034 * ipcrm -M 0x4e545035 * - * Removing these segments is usually not necessary, as the operating system + * Removing these segments is usually not necessary, as the operating system * garbage-collects them when they have no attached processes. */ @@ -250,7 +250,7 @@ int ntpshm_put(struct gps_device_t *session, volatile struct shmTime *shmseg, st gpsd_log(&session->context->errout, LOG_PROG, "NTP: ntpshm_put(%s %s) %s @ %s\n", session->gpsdata.dev.path, - (precision == -20) ? "pps" : "clock", + (precision == -20) ? "pps" : "clock", real_str, clock_str); return 1; @@ -289,7 +289,7 @@ static void init_hook(struct gps_device_t *session) if (access(chrony_path, F_OK) != 0) { gpsd_log(&session->context->errout, LOG_PROG, - "PPS:%s chrony socket %s doesn't exist\n", + "PPS:%s chrony socket %s doesn't exist\n", session->gpsdata.dev.path, chrony_path); } else { session->chronyfd = netlib_localsocket(chrony_path, SOCK_DGRAM); @@ -300,7 +300,7 @@ static void init_hook(struct gps_device_t *session) chrony_path, session->chronyfd, errno, strerror(errno)); else gpsd_log(&session->context->errout, LOG_RAW, - "PPS:%s using chrony socket: %s\n", + "PPS:%s using chrony socket: %s\n", session->gpsdata.dev.path, chrony_path); } } @@ -317,9 +317,9 @@ static void chrony_send(struct gps_device_t *session, struct timedelta_t *td) struct tm tm; int leap_notify = session->context->leap_notify; - /* insist that leap seconds only happen in june and december + /* insist that leap seconds only happen in june and december * GPS emits leap pending for 3 months prior to insertion - * NTP expects leap pending for only 1 month prior to insertion + * NTP expects leap pending for only 1 month prior to insertion * Per http://bugs.ntp.org/1090 */ (void)gmtime_r( &(td->real.tv_sec), &tm); if ( 5 != tm.tm_mon && 11 != tm.tm_mon ) { @@ -368,8 +368,8 @@ static char *report_hook(volatile struct pps_thread_t *pps_thread, /* * Only listen to PPS after several consecutive fixes, * otherwise time may be inaccurate. (We know this is - * required on all Garmin and u-blox; safest to do it - * for all cases as we have no other general way to know + * required on all Garmin and u-blox; safest to do it + * for all cases as we have no other general way to know * if PPS is good. * * Not sure yet how to handle u-blox UBX_MODE_TMONLY @@ -420,19 +420,19 @@ void ntpshm_link_activate(struct gps_device_t *session) if (session->sourcetype == source_pty) return; - if (session->sourcetype != source_pps ) { + if (session->sourcetype != source_pps ) { /* allocate a shared-memory segment for "NMEA" time data */ session->shm_clock = ntpshm_alloc(session->context); if (session->shm_clock == NULL) { - gpsd_log(&session->context->errout, LOG_WARN, + gpsd_log(&session->context->errout, LOG_WARN, "NTP: ntpshm_alloc() failed\n"); return; } } #if defined(PPS_ENABLE) - if (session->sourcetype == source_usb + if (session->sourcetype == source_usb || session->sourcetype == source_rs232 || session->sourcetype == source_pps) { /* We also have the 1pps capability, allocate a shared-memory segment @@ -440,7 +440,7 @@ void ntpshm_link_activate(struct gps_device_t *session) * transitions */ if ((session->shm_pps = ntpshm_alloc(session->context)) == NULL) { - gpsd_log(&session->context->errout, LOG_WARN, + gpsd_log(&session->context->errout, LOG_WARN, "PPS: ntpshm_alloc(1) failed\n"); } else { init_hook(session); diff --git a/timespec_str.c b/timespec_str.c index 4f2c3e98..93d27741 100644 --- a/timespec_str.c +++ b/timespec_str.c @@ -21,7 +21,7 @@ #include "timespec.h" -/* Convert a normalized timespec to a nice string +/* Convert a normalized timespec to a nice string * put in it *buf, buf should be at least 22 bytes * * the returned buffer will look like, shortest case: @@ -32,7 +32,7 @@ * * So 12 chars, like this: "-0.123456789" * - * Absolute worst case is 10 digits of seconds. + * Absolute worst case is 10 digits of seconds. * So 21 digits like this: "-2147483647.123456789" * */ -- cgit v1.2.1