diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-09-06 09:53:26 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-09-06 09:53:26 +0000 |
commit | f17384a0ca128691571d04ccd053a214d93c604e (patch) | |
tree | 200f9323be7b1e9e04f3981e5d437d3636865685 /gpsdecode.c | |
parent | adf8e931c9f4eaa07a7533d8f245bfa84c5297e4 (diff) | |
download | gpsd-f17384a0ca128691571d04ccd053a214d93c604e.tar.gz |
Remove a duplicative storage declaration.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r-- | gpsdecode.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gpsdecode.c b/gpsdecode.c index 1c084a42..1d1332b5 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -328,6 +328,7 @@ static void decode(FILE *fpin, FILE *fpout) struct gps_packet_t lexer; struct rtcm2_t rtcm2; struct rtcm3_t rtcm3; + struct ais_t ais; struct aivdm_context_t aivdm; char buf[BUFSIZ]; @@ -350,11 +351,11 @@ static void decode(FILE *fpin, FILE *fpout) } else if (lexer.type == AIVDM_PACKET) { /*@ -uniondef */ - if (aivdm_decode((char *)lexer.outbuffer, lexer.outbuflen, &aivdm)){ + if (aivdm_decode((char *)lexer.outbuffer, lexer.outbuflen, &aivdm, &ais)){ if (!json) - aivdm_csv_dump(&aivdm.decoded, buf, sizeof(buf)); + aivdm_csv_dump(&ais, buf, sizeof(buf)); else - aivdm_json_dump(&aivdm.decoded, scaled, buf, sizeof(buf)); + aivdm_json_dump(&ais, scaled, buf, sizeof(buf)); (void)fputs(buf, fpout); (void)fputs("\n", fpout); } @@ -401,6 +402,10 @@ static void encode(FILE *fpin, bool repack, FILE *fpout) rtcm2_json_dump(&gpsdata.rtcm2, outbuf, sizeof(outbuf)); (void)fputs(outbuf, fpout); } + } if ((gpsdata.set & AIS_SET) != 0) { + char outbuf[BUFSIZ]; + aivdm_json_dump(&gpsdata.ais, false, outbuf, sizeof(outbuf)); + (void)fputs(outbuf, fpout); } } } |