Skip to content

Commit

Permalink
Trailing whitespace fixup.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyemiller committed Apr 30, 2015
1 parent d20c318 commit a5a4102
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Tachometer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions srecord.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion subframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions test_bits.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test_matrix.c
Original file line number Diff line number Diff line change
@@ -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 <stdlib.h>
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions test_timespec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions timebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
30 changes: 15 additions & 15 deletions timehint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
*/

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -420,27 +420,27 @@ 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
* for the 1pps time data and launch a thread to capture the 1pps
* 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);
Expand Down
4 changes: 2 additions & 2 deletions timespec_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
*
*/
Expand Down

0 comments on commit a5a4102

Please sign in to comment.