diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-04-30 23:04:53 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-04-30 23:05:37 -0400 |
commit | 321c7710c3f3a17d56e9e5eede9aebadbaf16e3e (patch) | |
tree | fae8712111ede1cd948e8846a3bbdafeb8dfd45a /driver_evermore.c | |
parent | 5aa7ce8d00de15c832ab90113ef5b08221746e7f (diff) | |
download | gpsd-321c7710c3f3a17d56e9e5eede9aebadbaf16e3e.tar.gz |
Fix static-checker warnings. All regression tests pass.
cppchecker now finds variables that could have reduced scope;
that's most of these.
Diffstat (limited to 'driver_evermore.c')
-rw-r--r-- | driver_evermore.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/driver_evermore.c b/driver_evermore.c index 69de6ee9..808e1197 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -581,17 +581,16 @@ static bool evermore_rate_switcher(struct gps_device_t *session, double rate) /* change the sample rate of the GPS */ { /*@ +charint @*/ - unsigned char evrm_rate_config[] = { - 0x84, /* 1: msg ID, Operating Mode Configuration */ - 0x02, /* 2: normal mode with 1PPS */ - 0x00, /* 3: navigation update rate */ - 0x00, /* 4: RF/GPSBBP On Time */ - }; - if (rate < 1 || rate > 10) { gpsd_report(LOG_ERROR, "valid rate range is 1-10.\n"); return false; } else { + unsigned char evrm_rate_config[] = { + 0x84, /* 1: msg ID, Operating Mode Configuration */ + 0x02, /* 2: normal mode with 1PPS */ + 0x00, /* 3: navigation update rate */ + 0x00, /* 4: RF/GPSBBP On Time */ + }; evrm_rate_config[2] = (unsigned char)trunc(rate); return (evermore_control_send(session, (char *)evrm_rate_config, sizeof(evrm_rate_config)) != -1); |