summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-26 05:49:54 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-26 05:49:54 -0400
commit226ae06fb3c9fb81f621dd98cac35f6b7e819a80 (patch)
tree2ce5b52966a31786f0026e5b8107ce2857182b60
parentedffc9e7a4ac93f34d71016c5602a75de8c85cf7 (diff)
downloadgpsd-226ae06fb3c9fb81f621dd98cac35f6b7e819a80.tar.gz
splint cleanup.
-rw-r--r--gpsd_json.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index e754888c..d3fd5d75 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -1805,8 +1805,8 @@ void json_aivdm_dump(const struct ais_t *ais,
if (scaled)
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"lon\":%.3f,\"lat\":%.3f",
- ais->type6.dac1fid18.lon * AIS_LATLON3_UNIT,
- ais->type6.dac1fid18.lat * AIS_LATLON3_UNIT);
+ ais->type6.dac1fid18.lon / AIS_LATLON3_SCALE,
+ ais->type6.dac1fid18.lat / AIS_LATLON3_SCALE);
else
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"lon\":%d,\"lat\":%d",
@@ -1870,14 +1870,14 @@ void json_aivdm_dump(const struct ais_t *ais,
"\"berth_lon\":%.3f,"
"\"berth_lat\":%.3f,"
"\"berth_depth\":%.1f,}\r\n",
- ais->type6.dac1fid20.berth_lon * AIS_LATLON3_UNIT,
- ais->type6.dac1fid20.berth_lat * AIS_LATLON3_UNIT,
+ ais->type6.dac1fid20.berth_lon / AIS_LATLON3_SCALE,
+ ais->type6.dac1fid20.berth_lat / AIS_LATLON3_SCALE,
ais->type6.dac1fid20.berth_depth * 0.1);
else
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"berth_lon\":%d,"
"\"berth_lat\":%d,"
- "\"berth_depth\":%d}\r\n",
+ "\"berth_depth\":%u}\r\n",
ais->type6.dac1fid20.berth_lon,
ais->type6.dac1fid20.berth_lat,
ais->type6.dac1fid20.berth_depth);
@@ -1942,8 +1942,8 @@ void json_aivdm_dump(const struct ais_t *ais,
if (scaled)
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"lat\":%.3f,\"lon\":%.3f,",
- ais->type8.dac1fid31.lat * AIS_LATLON3_UNIT,
- ais->type8.dac1fid31.lon * AIS_LATLON3_UNIT);
+ ais->type8.dac1fid31.lat / AIS_LATLON3_SCALE,
+ ais->type8.dac1fid31.lon / AIS_LATLON3_SCALE);
else
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"lat\":%d,\"lon\":%d,",