diff options
author | Gary E. Miller <gem@rellim.com> | 2016-08-15 17:29:38 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-08-15 17:29:38 -0700 |
commit | 51500bbd427387bb1847f6d00364091f2bc4f455 (patch) | |
tree | ec4d3526ac189f466c31cafe290e1311774eae80 | |
parent | e67e4118a0cbb5b5cecc62e7440299d0b5b35a37 (diff) | |
download | gpsd-51500bbd427387bb1847f6d00364091f2bc4f455.tar.gz |
uint was rmoved in C99. If gpsd enforce C99, then uint must go.
uint is now unsigned int.
-rw-r--r-- | bits.h | 4 | ||||
-rw-r--r-- | driver_ais.c | 6 | ||||
-rw-r--r-- | driver_evermore.c | 2 | ||||
-rw-r--r-- | driver_italk.c | 2 | ||||
-rw-r--r-- | driver_navcom.c | 2 | ||||
-rw-r--r-- | driver_nmea0183.c | 2 | ||||
-rw-r--r-- | driver_oncore.c | 2 | ||||
-rw-r--r-- | driver_rtcm3.c | 12 | ||||
-rw-r--r-- | driver_tsip.c | 2 | ||||
-rw-r--r-- | gpsd.c | 3 | ||||
-rw-r--r-- | gpsdecode.c | 78 |
11 files changed, 59 insertions, 56 deletions
@@ -35,8 +35,8 @@ extern float getlef32(const char *, int); extern double getled64(const char *, int); -#define putle16(buf, off, w) do {putbyte(buf, (off)+1, (uint)(w) >> 8); putbyte(buf, (off), (w));} while (0) -#define putle32(buf, off, l) do {putle16(buf, (off)+2, (uint)(l) >> 16); putle16(buf, (off), (l));} while (0) +#define putle16(buf, off, w) do {putbyte(buf, (off)+1, (unsigned int)(w) >> 8); putbyte(buf, (off), (w));} while (0) +#define putle32(buf, off, l) do {putle16(buf, (off)+2, (unsigned int)(l) >> 16); putle16(buf, (off), (l));} while (0) /* big-endian access */ #define getbes16(buf, off) ((int16_t)(((uint16_t)getub(buf, (off)) << 8) | (uint16_t)getub(buf, (off)+1))) diff --git a/driver_ais.c b/driver_ais.c index 4977bcce..d79e4575 100644 --- a/driver_ais.c +++ b/driver_ais.c @@ -26,7 +26,8 @@ * Parse the data from the device */ -static void from_sixbit_untrimmed(unsigned char *bitvec, uint start, int count, char *to) +static void from_sixbit_untrimmed(unsigned char *bitvec, unsigned int start, + int count, char *to) /* beginning at bitvec bit start, unpack count sixbit characters */ { const char sixchr[64] = @@ -62,7 +63,8 @@ static void trim_spaces_on_right_end(char* to) } } -static void from_sixbit(unsigned char *bitvec, uint start, int count, char *to) +static void from_sixbit(unsigned char *bitvec, unsigned int start, int count, + char *to) /* beginning at bitvec bit start, unpack count sixbit characters and remove trailing * spaces */ { diff --git a/driver_evermore.c b/driver_evermore.c index 0f4b221e..ed1c34b3 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -188,7 +188,7 @@ gps_mask_t evermore_parse(struct gps_device_t * session, unsigned char *buf, (double)getles16(buf2, 25) / 10.0); used = (unsigned char)getub(buf2, 27) & 0x0f; //visible = (getub(buf2, 27) & 0xf0) >> 4; - version = (uint) getleu16(buf2, 28) / 100.0; + version = (unsigned int) getleu16(buf2, 28) / 100.0; /* that's all the information in this packet */ if (used < 3) session->newdata.mode = MODE_NO_FIX; diff --git a/driver_italk.c b/driver_italk.c index 15d1d990..ce949e11 100644 --- a/driver_italk.c +++ b/driver_italk.c @@ -281,7 +281,7 @@ static gps_mask_t italk_parse(struct gps_device_t *session, if (len == 0) return 0; - type = (uint) getub(buf, 4); + type = (unsigned int) getub(buf, 4); /* we may need to dump the raw packet */ gpsd_log(&session->context->errout, LOG_RAW, "raw italk packet type 0x%02x\n", type); diff --git a/driver_navcom.c b/driver_navcom.c index 2680571c..6f1aaaae 100644 --- a/driver_navcom.c +++ b/driver_navcom.c @@ -1109,7 +1109,7 @@ gps_mask_t navcom_parse(struct gps_device_t * session, unsigned char *buf, cmd_id = (unsigned char)getub(buf, 3); //payload = &buf[6]; - msg_len = (uint) getleu16(buf, 4); + msg_len = (unsigned int) getleu16(buf, 4); gpsd_log(&session->context->errout, LOG_RAW, "Navcom: packet type 0x%02x\n", cmd_id); diff --git a/driver_nmea0183.c b/driver_nmea0183.c index 0da9ddf5..58c57ec9 100644 --- a/driver_nmea0183.c +++ b/driver_nmea0183.c @@ -1934,7 +1934,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session) if (!GPS_TIME_EQUAL (session->nmea.this_frac_time, session->nmea.last_frac_time)) { - uint lasttag = session->nmea.lasttag; + unsigned int lasttag = session->nmea.lasttag; retval |= CLEAR_IS; gpsd_log(&session->context->errout, LOG_PROG, "%s starts a reporting cycle.\n", diff --git a/driver_oncore.c b/driver_oncore.c index caeb3575..0063d6a9 100644 --- a/driver_oncore.c +++ b/driver_oncore.c @@ -105,7 +105,7 @@ oncore_msg_navsol(struct gps_device_t *session, unsigned char *buf, unpacked_date.tm_sec = (int)getub(buf, 10); unpacked_date.tm_isdst = 0; unpacked_date.tm_wday = unpacked_date.tm_yday = 0; - nsec = (uint) getbeu32(buf, 11); + nsec = (unsigned int) getbeu32(buf, 11); session->newdata.time = (timestamp_t)mkgmtime(&unpacked_date) + nsec * 1e-9; mask |= TIME_SET; diff --git a/driver_rtcm3.c b/driver_rtcm3.c index a860d07c..7edd69aa 100644 --- a/driver_rtcm3.c +++ b/driver_rtcm3.c @@ -98,8 +98,8 @@ void rtcm3_unpack(const struct gps_context_t *context, //assert(ugrab(6) == 0x00); ugrab(14); - rtcm->length = (uint)ugrab(10); - rtcm->type = (uint)ugrab(12); + rtcm->length = (unsigned int)ugrab(10); + rtcm->type = (unsigned int)ugrab(12); gpsd_log(&context->errout, LOG_RAW, "RTCM3: type %d payload length %d\n", rtcm->type, rtcm->length); @@ -114,7 +114,7 @@ void rtcm3_unpack(const struct gps_context_t *context, case 1001: /* GPS Basic RTK, L1 Only */ - rtcm->rtcmtypes.rtcm3_1001.header.station_id = (uint)ugrab(12); + rtcm->rtcmtypes.rtcm3_1001.header.station_id = (unsigned int)ugrab(12); rtcm->rtcmtypes.rtcm3_1001.header.tow = (time_t)ugrab(30); rtcm->rtcmtypes.rtcm3_1001.header.sync = (bool)ugrab(1); rtcm->rtcmtypes.rtcm3_1001.header.satcount = (unsigned short)ugrab(5); @@ -134,7 +134,7 @@ void rtcm3_unpack(const struct gps_context_t *context, case 1002: /* GPS Extended RTK, L1 Only */ - rtcm->rtcmtypes.rtcm3_1002.header.station_id = (uint)ugrab(12); + rtcm->rtcmtypes.rtcm3_1002.header.station_id = (unsigned int)ugrab(12); rtcm->rtcmtypes.rtcm3_1002.header.tow = (time_t)ugrab(30); rtcm->rtcmtypes.rtcm3_1002.header.sync = (bool)ugrab(1); rtcm->rtcmtypes.rtcm3_1002.header.satcount = (unsigned short)ugrab(5); @@ -156,7 +156,7 @@ void rtcm3_unpack(const struct gps_context_t *context, case 1003: /* GPS Basic RTK, L1 & L2 */ - rtcm->rtcmtypes.rtcm3_1003.header.station_id = (uint)ugrab(12); + rtcm->rtcmtypes.rtcm3_1003.header.station_id = (unsigned int)ugrab(12); rtcm->rtcmtypes.rtcm3_1003.header.tow = (time_t)ugrab(30); rtcm->rtcmtypes.rtcm3_1003.header.sync = (bool)ugrab(1); rtcm->rtcmtypes.rtcm3_1003.header.satcount = (unsigned short)ugrab(5); @@ -185,7 +185,7 @@ void rtcm3_unpack(const struct gps_context_t *context, case 1004: /* GPS Extended RTK, L1 & L2 */ - rtcm->rtcmtypes.rtcm3_1004.header.station_id = (uint)ugrab(12); + rtcm->rtcmtypes.rtcm3_1004.header.station_id = (unsigned int)ugrab(12); rtcm->rtcmtypes.rtcm3_1004.header.tow = (time_t)ugrab(30); rtcm->rtcmtypes.rtcm3_1004.header.sync = (bool)ugrab(1); rtcm->rtcmtypes.rtcm3_1004.header.satcount = (unsigned short)ugrab(5); diff --git a/driver_tsip.c b/driver_tsip.c index 9271c476..5e09433b 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -1145,7 +1145,7 @@ static void tsip_event_hook(struct gps_device_t *session, event_t event) */ session->driver.tsip.parity = session->gpsdata.dev.parity; session->driver.tsip.stopbits = - (uint) session->gpsdata.dev.stopbits; + (unsigned int) session->gpsdata.dev.stopbits; // gpsd_set_speed(session, session->gpsdata.dev.baudrate, 'O', 1); } if (event == event_deactivate) { @@ -11,6 +11,7 @@ #include <sys/time.h> /* for select() */ #include <sys/select.h> #include <stdio.h> +#include <stdint.h> /* for uint32_t, etc. */ #include <time.h> #include <string.h> #include <stdlib.h> @@ -1245,7 +1246,7 @@ static void handle_request(struct subscriber_t *sub, /* interpret defaults */ if (devconf.baudrate == DEVDEFAULT_BPS) devconf.baudrate = - (uint) gpsd_get_speed(device); + (unsigned int) gpsd_get_speed(device); if (devconf.parity == DEVDEFAULT_PARITY) devconf.stopbits = device->gpsdata.dev.stopbits; if (devconf.stopbits == DEVDEFAULT_STOPBITS) diff --git a/gpsdecode.c b/gpsdecode.c index 23c7684b..13779a8a 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -67,14 +67,14 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type1.status, ais->type1.turn, ais->type1.speed, - (uint) ais->type1.accuracy, + (unsigned int) ais->type1.accuracy, ais->type1.lon, ais->type1.lat, ais->type1.course, ais->type1.heading, ais->type1.second, ais->type1.maneuver, - (uint) ais->type1.raim, ais->type1.radio); + (unsigned int) ais->type1.raim, ais->type1.radio); break; case 4: /* Base Station Report */ case 11: /* UTC/Date Response */ @@ -86,11 +86,11 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type4.hour, ais->type4.minute, ais->type4.second, - (uint) ais->type4.accuracy, + (unsigned int) ais->type4.accuracy, ais->type4.lon, ais->type4.lat, ais->type4.epfd, - (uint) ais->type4.raim, ais->type4.radio); + (unsigned int) ais->type4.raim, ais->type4.radio); break; case 5: /* Ship static and voyage related data */ str_appendf(buf, buflen, @@ -117,7 +117,7 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) "%u|%u|%u|%u|%u", ais->type6.seqno, ais->type6.dest_mmsi, - (uint) ais->type6.retransmit, + (unsigned int) ais->type6.retransmit, ais->type6.dac, ais->type6.fid); switch(ais->type6.dac) { @@ -132,9 +132,9 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type6.dac235fid10.ana_ext2, ais->type6.dac235fid10.racon, ais->type6.dac235fid10.light, - (uint)ais->type6.dac235fid10.alarm, + (unsigned int)ais->type6.dac235fid10.alarm, ais->type6.dac235fid10.stat_ext, - (uint)ais->type6.dac235fid10.off_pos); + (unsigned int)ais->type6.dac235fid10.off_pos); imo = true; break; } @@ -260,14 +260,14 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) "%u|%u|%u|%d|%d|%u|%u|0x%x|%u|%u|0x%x", ais->type9.alt, ais->type9.speed, - (uint) ais->type9.accuracy, + (unsigned int) ais->type9.accuracy, ais->type9.lon, ais->type9.lat, ais->type9.course, ais->type9.second, ais->type9.regional, ais->type9.dte, - (uint) ais->type9.raim, ais->type9.radio); + (unsigned int) ais->type9.raim, ais->type9.radio); break; case 10: /* UTC/Date Inquiry */ str_appendf(buf, buflen, "%u", ais->type10.dest_mmsi); @@ -277,7 +277,7 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) "%u|%u|%u|%s", ais->type12.seqno, ais->type12.dest_mmsi, - (uint) ais->type12.retransmit, ais->type12.text); + (unsigned int) ais->type12.retransmit, ais->type12.text); break; case 14: /* Safety Related Broadcast Message */ str_appendf(buf, buflen, "%s", ais->type14.text); @@ -317,26 +317,26 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) "%u|%u|%u|%d|%d|%u|%u|%u|0x%x|%u|%u|%u|%u|%u|%u|0x%x", ais->type18.reserved, ais->type18.speed, - (uint) ais->type18.accuracy, + (unsigned int) ais->type18.accuracy, ais->type18.lon, ais->type18.lat, ais->type18.course, ais->type18.heading, ais->type18.second, ais->type18.regional, - (uint) ais->type18.cs, - (uint) ais->type18.display, - (uint) ais->type18.dsc, - (uint) ais->type18.band, - (uint) ais->type18.msg22, - (uint) ais->type18.raim, ais->type18.radio); + (unsigned int) ais->type18.cs, + (unsigned int) ais->type18.display, + (unsigned int) ais->type18.dsc, + (unsigned int) ais->type18.band, + (unsigned int) ais->type18.msg22, + (unsigned int) ais->type18.raim, ais->type18.radio); break; case 19: str_appendf(buf, buflen, "%u|%u|%u|%d|%d|%u|%u|%u|0x%x|%s|%u|%u|%u|%u|%u|%u|%u|%u|%u", ais->type19.reserved, ais->type19.speed, - (uint) ais->type19.accuracy, + (unsigned int) ais->type19.accuracy, ais->type19.lon, ais->type19.lat, ais->type19.course, @@ -350,8 +350,8 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type19.to_port, ais->type19.to_starboard, ais->type19.epfd, - (uint) ais->type19.raim, - ais->type19.dte, (uint) ais->type19.assigned); + (unsigned int) ais->type19.raim, + ais->type19.dte, (unsigned int) ais->type19.assigned); break; case 20: /* Data Link Management Message */ str_appendf(buf, buflen, @@ -377,7 +377,7 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) "%u|%s|%u|%d|%d|%u|%u|%u|%u|%u|%u|%u|0x%x|%u|%u", ais->type21.aid_type, ais->type21.name, - (uint) ais->type21.accuracy, + (unsigned int) ais->type21.accuracy, ais->type21.lon, ais->type21.lat, ais->type21.to_bow, @@ -387,9 +387,9 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type21.epfd, ais->type21.second, ais->type21.regional, - (uint) ais->type21.off_position, - (uint) ais->type21.raim, - (uint) ais->type21.virtual_aid); + (unsigned int) ais->type21.off_position, + (unsigned int) ais->type21.raim, + (unsigned int) ais->type21.virtual_aid); break; case 22: /* Channel Management */ if (!ais->type22.addressed) @@ -398,26 +398,26 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) ais->type22.channel_a, ais->type22.channel_b, ais->type22.txrx, - (uint) ais->type22.power, + (unsigned int) ais->type22.power, ais->type22.area.ne_lon, ais->type22.area.ne_lat, ais->type22.area.sw_lon, ais->type22.area.sw_lat, - (uint) ais->type22.addressed, - (uint) ais->type22.band_a, - (uint) ais->type22.band_b, ais->type22.zonesize); + (unsigned int) ais->type22.addressed, + (unsigned int) ais->type22.band_a, + (unsigned int) ais->type22.band_b, ais->type22.zonesize); else str_appendf(buf, buflen, "%u|%u|%u|%u|%u|%u|%u|%u|%u|%u", ais->type22.channel_a, ais->type22.channel_b, ais->type22.txrx, - (uint) ais->type22.power, + (unsigned int) ais->type22.power, ais->type22.mmsi.dest1, ais->type22.mmsi.dest2, - (uint) ais->type22.addressed, - (uint) ais->type22.band_a, - (uint) ais->type22.band_b, ais->type22.zonesize); + (unsigned int) ais->type22.addressed, + (unsigned int) ais->type22.band_a, + (unsigned int) ais->type22.band_b, ais->type22.zonesize); break; case 23: /* Group Management Command */ str_appendf(buf, buflen, @@ -452,8 +452,8 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) case 25: /* Binary Message, Single Slot */ str_appendf(buf, buflen, "%u|%u|%u|%u|%zd:%s", - (uint) ais->type25.addressed, - (uint) ais->type25.structured, + (unsigned int) ais->type25.addressed, + (unsigned int) ais->type25.structured, ais->type25.dest_mmsi, ais->type25.app_id, ais->type25.bitcount, @@ -464,8 +464,8 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) case 26: /* Binary Message, Multiple Slot */ str_appendf(buf, buflen, "%u|%u|%u|%u|%zd:%s:%u", - (uint) ais->type26.addressed, - (uint) ais->type26.structured, + (unsigned int) ais->type26.addressed, + (unsigned int) ais->type26.structured, ais->type26.dest_mmsi, ais->type26.app_id, ais->type26.bitcount, @@ -478,13 +478,13 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) str_appendf(buf, buflen, "%u|%u|%d|%d|%u|%u|%u|%u", ais->type27.status, - (uint)ais->type27.accuracy, + (unsigned int)ais->type27.accuracy, ais->type27.lon, ais->type27.lat, ais->type27.speed, ais->type27.course, - (uint)ais->type27.raim, - (uint)ais->type27.gnss); + (unsigned int)ais->type27.raim, + (unsigned int)ais->type27.gnss); break; default: str_appendf(buf, buflen, "unknown AIVDM message content."); |