Browse Source

AP_GPS: avoid some float conversion warnings

mission-4.1.18
Andrew Tridgell 11 years ago
parent
commit
59de5a8465
  1. 2
      libraries/AP_GPS/AP_GPS_NMEA.cpp
  2. 2
      libraries/AP_GPS/AP_GPS_SBP.cpp

2
libraries/AP_GPS/AP_GPS_NMEA.cpp

@ -227,7 +227,7 @@ uint32_t AP_GPS_NMEA::_parse_degrees() @@ -227,7 +227,7 @@ uint32_t AP_GPS_NMEA::_parse_degrees()
}
ret = (deg * (int32_t)10000000UL);
ret += (min * (int32_t)10000000UL / 60);
ret += (int32_t) (frac_min * (1.0e7 / 60.0f));
ret += (int32_t) (frac_min * (1.0e7f / 60.0f));
return ret;
}

2
libraries/AP_GPS/AP_GPS_SBP.cpp

@ -891,7 +891,7 @@ AP_GPS_SBP::logging_log_baseline_ecef(struct sbp_baseline_ecef_t* b) @@ -891,7 +891,7 @@ AP_GPS_SBP::logging_log_baseline_ecef(struct sbp_baseline_ecef_t* b)
float x = b->x / 1000.0;
float y = b->y / 1000.0;
float z = b->z / 1000.0;
int32_t len = (int32_t) (safe_sqrt(x*x+y*y+z*z) * 1000.0);
int32_t len = (int32_t) (safe_sqrt(x*x+y*y+z*z) * 1000.0f);
struct log_SbpBaseline pkt = {
LOG_PACKET_HEADER_INIT(LOG_MSG_SBPBASELINE),

Loading…
Cancel
Save