diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-09-20 21:21:56 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-09-20 21:42:00 -0400 |
commit | 6fad04c30c493b0896cca20fab13974ba0b7ad55 (patch) | |
tree | cbd6b6ff7fc2e23b076e96ec5cacff3e65614a34 /libgpsd_core.c | |
parent | f66460894d1a1f1b6af01a3ea323d400bc0fdf93 (diff) | |
download | gpsd-6fad04c30c493b0896cca20fab13974ba0b7ad55.tar.gz |
Change the traversal order of the DOP computation loop...
...so we can easily check that it's independent of order in the
list of satellites.
All regression tests pass.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index c35d98f7..8753c5bb 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -668,8 +668,8 @@ static gps_mask_t fill_dop(const struct gpsd_errout_t *errout, memset(satpos, 0, sizeof(satpos)); gpsd_report(errout, LOG_INF, "Sats used (%d):\n", gpsdata->satellites_used); - for (n = k = 0; k < gpsdata->satellites_used; k++) { - for (i = 0; i < gpsdata->satellites_visible; i++) { + for (n = i = 0; i < gpsdata->satellites_visible; i++) { + for (k = 0; k < gpsdata->satellites_used; k++) { if (gpsdata->PRN[i] == gpsdata->used[k]) { gpsd_report(errout, LOG_INF, "PRN=%d az=%d el=%d\n", gpsdata->PRN[i], |