diff options
author | Fred Wright <fw@fwright.net> | 2019-03-20 15:41:41 -0700 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2019-03-20 16:41:10 -0700 |
commit | 9a742334e9867d23dc3660f7ad9e2dded3bf946f (patch) | |
tree | 89660eed73a03f01e1117817247de802237bd10b /gpsrinex.c | |
parent | 19ee7ead6be107f50bc51ba47386694546e71ebf (diff) | |
download | gpsd-9a742334e9867d23dc3660f7ad9e2dded3bf946f.tar.gz |
gpsrinex: Fix some compiler warnings.
There were two issues here:
1) The initializer for the obs_cnt array needs two levels of brace,
since it's an array of structs.
2) The obs_cnts array was incorrectly typed as having obs_codes enums
as its *values*, when they're actually only used for its index. This
resulted in a warning about the apparently pointless comparison
against 99999.
TESTED:
Ran "build-all check" on OSX 10.9, 10.13, and 10.5 (PPC), as well as
Ubuntu 14.04.
Diffstat (limited to 'gpsrinex.c')
-rw-r--r-- | gpsrinex.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -138,9 +138,8 @@ typedef enum {C1C = 0, D1C, L1C, C2C, D2C, L2C, CODEMAX} obs_codes; static struct obs_cnt_t { unsigned char gnssid; unsigned char svid; /* svid of 0 means unused slot */ - obs_codes obs_cnts[CODEMAX+1]; - unsigned int count; /* count of obscode */ -} obs_cnt[MAXCNT] = {0}; + unsigned int obs_cnts[CODEMAX+1]; /* count of obscode */ +} obs_cnt[MAXCNT] = {{0}}; static FILE * tmp_file; /* file handle for temp file */ static int sample_count = 20; /* number of measurement sets to get */ |