HAL_SITL: fixed warning building with gcc 9.x

This commit is contained in:
Andrew Tridgell 2020-11-13 19:45:07 +11:00 committed by Peter Barker
parent 3f775205e6
commit 9a026b8068
2 changed files with 4 additions and 4 deletions

View File

@ -151,7 +151,7 @@ private:
void _update_gps_mtk(const struct gps_data *d, uint8_t instance);
void _update_gps_mtk16(const struct gps_data *d, uint8_t instance);
void _update_gps_mtk19(const struct gps_data *d, uint8_t instance);
uint16_t _gps_nmea_checksum(const char *s);
uint8_t _gps_nmea_checksum(const char *s);
void _gps_nmea_printf(uint8_t instance, const char *fmt, ...);
void _update_gps_nmea(const struct gps_data *d, uint8_t instance);
void _sbp_send_message(uint16_t msg_type, uint16_t sender_id, uint8_t len, uint8_t *payload, uint8_t instance);

View File

@ -649,9 +649,9 @@ void SITL_State::_update_gps_mtk19(const struct gps_data *d, uint8_t instance)
/*
NMEA checksum
*/
uint16_t SITL_State::_gps_nmea_checksum(const char *s)
uint8_t SITL_State::_gps_nmea_checksum(const char *s)
{
uint16_t cs = 0;
uint8_t cs = 0;
const uint8_t *b = (const uint8_t *)s;
for (uint16_t i=1; s[i]; i++) {
cs ^= b[i];
@ -665,7 +665,7 @@ uint16_t SITL_State::_gps_nmea_checksum(const char *s)
void SITL_State::_gps_nmea_printf(uint8_t instance, const char *fmt, ...)
{
char *s = nullptr;
uint16_t csum;
uint8_t csum;
char trailer[6];
va_list ap;