diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-03-06 18:20:29 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-03-06 18:20:29 +0000 |
commit | 3f1145637e2cd29c49b3bc1bc3ea62478b390137 (patch) | |
tree | 1443e59e3d2e724ee4fccb78456955ba9fc8e250 | |
parent | 6c41ffe1621b68a1e5ae961e9487d617909cd6a7 (diff) | |
download | gpsd-3f1145637e2cd29c49b3bc1bc3ea62478b390137.tar.gz |
Compiler warning and partial splint cleanup.
-rw-r--r-- | driver_navcom.c | 1 | ||||
-rw-r--r-- | driver_superstar2.c | 24 | ||||
-rw-r--r-- | monitor_superstar2.c | 6 | ||||
-rw-r--r-- | monitor_ubx.c | 2 |
4 files changed, 18 insertions, 15 deletions
diff --git a/driver_navcom.c b/driver_navcom.c index 1dacdef9..0e21669a 100644 --- a/driver_navcom.c +++ b/driver_navcom.c @@ -1244,7 +1244,6 @@ static bool navcom_speed(struct gps_device_t *session, different than the old one */ return true; } - return false; } #endif /* ALLOW_RECONFIGURE */ diff --git a/driver_superstar2.c b/driver_superstar2.c index 71890050..14159884 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -80,9 +80,11 @@ superstar2_msg_navsol_lla(struct gps_device_t *session, gpsd_report(LOG_PROG, "superstar2 #20 - user navigation data\n"); mask = ONLINE_SET; + /*@ +charint @*/ flags = getub(buf, 72); if ((flags & 0x0f) != 0x03) /* mode 3 is navigation */ return mask; + /*@ -charint @*/ /* extract time data */ (void)memset(&tm, '\0', sizeof(tm)); @@ -106,7 +108,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session, session->gpsdata.fix.climb = getlef(buf,54); mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET ; - session->gpsdata.satellites_used = getub(buf,71) & 0x0f; + session->gpsdata.satellites_used = (int)getub(buf,71) & 0x0f; session->gpsdata.hdop = getleuw(buf,66) * 0.1; session->gpsdata.vdop = getleuw(buf,68) * 0.1; /* other DOP if available */ @@ -158,9 +160,11 @@ superstar2_msg_navsol_ecef(struct gps_device_t *session, gpsd_report(LOG_PROG, "superstar2 #21 - ecef navigation data\n"); mask = ONLINE_SET; + /*@ +charint @*/ flags = getub(buf, 79) & 0x1f; if ((flags < 2) || (flags > 5)) return mask; + /*@ -charint @*/ /* extract time data */ tow = getled(buf, 4); @@ -219,7 +223,7 @@ static gps_mask_t superstar2_msg_svinfo(struct gps_device_t *session, unsigned char *buf, size_t data_len) { - unsigned char i, st, nchan, nsv; + int i, st, nchan, nsv; if (data_len != 67) return 0; @@ -232,11 +236,11 @@ superstar2_msg_svinfo(struct gps_device_t *session, for (i = st = 0; i < nchan; i++) { /* get info for one channel/satellite */ int off = i*5 + 5; - int porn; + unsigned int porn; if ((porn = getub(buf, off) & 0x1f) == 0) porn = (getub(buf, off+3) >> 1) + 87; - session->gpsdata.PRN[i] = porn; + session->gpsdata.PRN[i] = (int)porn; session->gpsdata.ss[i] = getub(buf, off+4); session->gpsdata.elevation[i] = getsb(buf, off+1); session->gpsdata.azimuth[i] = (unsigned short)getub(buf, off+2) + ((unsigned short)(getub(buf, off+3) & 0x1) << 1); @@ -373,12 +377,12 @@ superstar2_dispatch(struct gps_device_t *session, unsigned char *buf, **********************************************************/ /* canned config messages */ /* Initiate Link ID# 63 */ -static unsigned char link_msg[] = {0x01, 0x3f, 0xc0, 0x08, +static char link_msg[] = {0x01, 0x3f, 0xc0, 0x08, 0x55, 0x47, 0x50, 0x53, 0x2d, 0x30, 0x30, 0x30, 0x00, 0x00}; /* Request Hardware/Software Identification ID# 45 */ -static unsigned char version_msg[] = {0x01, 0x2d, 0xd2, 0x00, 0x00, 0x01}; +static char version_msg[] = {0x01, 0x2d, 0xd2, 0x00, 0x00, 0x01}; static void superstar2_probe_wakeup(struct gps_device_t *session) @@ -414,8 +418,8 @@ static void superstar2_configurator(struct gps_device_t *session, unsigned char message2_list[] = { SUPERSTAR2_MEASUREMENT, SUPERSTAR2_DUMMY}; - unsigned char tmpl_msg[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}; - unsigned char tmpl2_msg[] = { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; + char tmpl_msg[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}; + char tmpl2_msg[] = { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; for(a = 0; message_list[a] != 0; a++){ /* set high bit to enable continuous output */ @@ -485,7 +489,7 @@ static bool superstar2_set_speed(struct gps_device_t *session, /* high bit 0 in the mode word means set NMEA mode */ speed_msg[4] = (char)(speed / 300); - return (superstar2_write(session, &speed_msg, 7) == 7); + return (superstar2_write(session, speed_msg, 7) == 7); } } #endif /* ALLOW_RECONFIGURE */ @@ -497,7 +501,7 @@ static void superstar2_set_mode(struct gps_device_t *session, int mode) /* high bit 0 in the mode word means set NMEA mode */ mode_msg[4] = (char)(session->gpsdata.baudrate / 300); - (void)superstar2_write(session, &mode_msg, 7); + (void)superstar2_write(session, mode_msg, 7); } else { session->back_to_nmea = false; } diff --git a/monitor_superstar2.c b/monitor_superstar2.c index 09621279..23a973bd 100644 --- a/monitor_superstar2.c +++ b/monitor_superstar2.c @@ -68,12 +68,12 @@ static void display_superstar2_svinfo(unsigned char *buf, size_t data_len) az = (unsigned short)getub(buf, off+2) + ((unsigned short)(getub(buf, off+3) & 0x1) << 1); fl = getub(buf, off) & 0xe0; - wmove(satwin, i+2, 4); - wprintw(satwin, "%3u %3d %2d %02d %02x %c", + (void)wmove(satwin, i+2, 4); + (void)wprintw(satwin, "%3u %3d %2d %02d %02x %c", porn, az, el, ss, fl, ((fl & 0x60) == 0x60)? 'Y' : ' '); } - wnoutrefresh(satwin); + (void)wnoutrefresh(satwin); return; } diff --git a/monitor_ubx.c b/monitor_ubx.c index a6b02c03..274911ba 100644 --- a/monitor_ubx.c +++ b/monitor_ubx.c @@ -69,7 +69,7 @@ static void display_nav_svinfo(unsigned char *buf, size_t data_len) ss = getub(buf, off+4); el = getsb(buf, off+5); az = getlesw(buf, off+6); - wmove(satwin, i+2, 4); + wmove(satwin, (int)(i+2), 4); wprintw(satwin, "%3d %3d %3d %2d %04x %c", prn, az, el, ss, fl, (fl & UBX_SAT_USED)? 'Y' : ' '); |