diff options
author | Gary E. Miller <gem@rellim.com> | 2016-08-09 18:26:16 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-08-09 18:26:16 -0700 |
commit | 274520ede54b73b4c2628ce5f6fbeb3c2da6182e (patch) | |
tree | c91e39d3368032ac9c0bdb7fac1d8599f1757d2b /ppscheck.c | |
parent | 7d83f7a86f2ab0f74d2057fd7986fe2a2f1c9fd1 (diff) | |
download | gpsd-274520ede54b73b4c2628ce5f6fbeb3c2da6182e.tar.gz |
Fix some picky error messages.
ppscheck.c:58:1: warning: 'static' is not at beginning of declaration
[-Wold-style-declaration]
ppscheck.c:65:6: warning: no previous prototype for 'usage'
[-Wmissing-prototypes]
ppscheck.c:118:6: warning: format '%10ld' expects type 'long int', but
argument 3 has type 'time_t'
ppscheck.c:129:1: warning: control reaches end of non-void function
[-Wreturn-type]
Diffstat (limited to 'ppscheck.c')
-rw-r--r-- | ppscheck.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -55,13 +55,15 @@ struct assoc { * context "DCE" is the GPS. {CD,RI,CTS,DSR} is the * entire set of these. */ -static const struct assoc hlines[] = { +const struct assoc hlines[] = { {TIOCM_CD, "TIOCM_CD"}, {TIOCM_RI, "TIOCM_RI"}, {TIOCM_DSR, "TIOCM_DSR"}, {TIOCM_CTS, "TIOCM_CTS"}, }; +static void usage(void); + static void usage(void) { fprintf(stderr, "usage: ppscheck [-h] [ -V] <device>\n"); @@ -115,7 +117,7 @@ int main(int argc, char *argv[]) (void)clock_gettime(CLOCK_REALTIME, &ts); (void)ioctl(fd, TIOCMGET, &handshakes); - (void)fprintf(stdout, "%10ld %09ld", ts.tv_sec, ts.tv_nsec); + (void)fprintf(stdout, "%10ld %09ld", (long)ts.tv_sec, ts.tv_nsec); for (sp = hlines; sp < hlines + sizeof(hlines)/sizeof(hlines[0]); sp++) @@ -127,7 +129,7 @@ int main(int argc, char *argv[]) } } - return 0; + exit(EXIT_SUCCESS); } /* end */ |