summaryrefslogtreecommitdiff
path: root/gpsdecode.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-02-28 21:51:39 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-02-28 21:51:39 -0500
commit049cfc6b80f96d56eb8e1a470cbef7e66db4e8aa (patch)
tree62a8d99012d92c84e6a3ff23cbe8bdb30d892cf8 /gpsdecode.c
parent421ad6171b3b9b7164dcc0b2fd92f0374af105ba (diff)
downloadgpsd-049cfc6b80f96d56eb8e1a470cbef7e66db4e8aa.tar.gz
splint and cosmetic cleanup.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r--gpsdecode.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gpsdecode.c b/gpsdecode.c
index 6ea84946..6ccfb104 100644
--- a/gpsdecode.c
+++ b/gpsdecode.c
@@ -359,7 +359,7 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen)
#endif
/*@ -compdestroy -compdef -usedef -uniondef @*/
-static void decode(FILE *fpin, FILE *fpout)
+static void decode(FILE *fpin, FILE*fpout)
/* sensor data on fpin to dump format on fpout */
{
struct gps_device_t session;
@@ -410,10 +410,8 @@ static void decode(FILE *fpin, FILE *fpout)
}
}
}
-/*@ +compdestroy +compdef +usedef +uniondef @*/
-/*@ -compdestroy @*/
-static void encode(FILE * fpin, FILE * fpout)
+static void encode(FILE *fpin, FILE *fpout)
/* JSON format on fpin to JSON on fpout - idempotency test */
{
char inbuf[BUFSIZ];
@@ -422,7 +420,7 @@ static void encode(FILE * fpin, FILE * fpout)
int lineno = 0;
memset(&policy, '\0', sizeof(policy));
- policy.json = json;
+ policy.json = true;
while (fgets(inbuf, (int)sizeof(inbuf), fpin) != NULL) {
int status;
@@ -433,7 +431,7 @@ static void encode(FILE * fpin, FILE * fpout)
status = libgps_json_unpack(inbuf, &gpsdata, NULL);
if (status != 0) {
(void)fprintf(stderr,
- "gpsdecode: bailing out with status %d (%s) on line %d\n",
+ "gpsdecode: dying with status %d (%s) on line %d\n",
status, json_error_string(status), lineno);
exit(1);
}
@@ -443,8 +441,7 @@ static void encode(FILE * fpin, FILE * fpout)
(void)fputs(inbuf, fpout);
}
}
-
-/*@ +compdestroy @*/
+/*@ +compdestroy +compdef +usedef @*/
int main(int argc, char **argv)
{