Browse Source

AP_Math: compiler warnings: float to double

mission-4.1.18
Tom Pittenger 10 years ago committed by Andrew Tridgell
parent
commit
a5d2f3a82f
  1. 2
      libraries/AP_Math/examples/eulers/eulers.pde
  2. 8
      libraries/AP_Math/examples/location/location.pde
  3. 4
      libraries/AP_Math/examples/polygon/polygon.pde
  4. 2
      libraries/AP_Math/examples/rotations/rotations.pde

2
libraries/AP_Math/examples/eulers/eulers.pde

@ -268,7 +268,7 @@ void test_frame_transforms(void) @@ -268,7 +268,7 @@ void test_frame_transforms(void)
static float rand_num(void)
{
float ret = ((unsigned)random()) % 2000000;
return (ret - 1.0e6) / 1.0e6;
return (ret - 1.0e6f) / 1.0e6f;
}
void test_matrix_rotate(void)

8
libraries/AP_Math/examples/location/location.pde

@ -69,8 +69,8 @@ static const struct { @@ -69,8 +69,8 @@ static const struct {
static struct Location location_from_point(Vector2f pt)
{
struct Location loc = {0};
loc.lat = pt.x * 1.0e7;
loc.lng = pt.y * 1.0e7;
loc.lat = pt.x * 1.0e7f;
loc.lng = pt.y * 1.0e7f;
return loc;
}
@ -130,8 +130,8 @@ static void test_offset(void) @@ -130,8 +130,8 @@ static void test_offset(void)
{
struct Location loc;
loc.lat = -35*1.0e7;
loc.lng = 149*1.0e7;
loc.lat = -35*1.0e7f;
loc.lng = 149*1.0e7f;
for (uint8_t i=0; i<ARRAY_LENGTH(test_offsets); i++) {
test_one_offset(loc,

4
libraries/AP_Math/examples/polygon/polygon.pde

@ -89,8 +89,8 @@ void setup(void) @@ -89,8 +89,8 @@ void setup(void)
result = Polygon_outside(test_points[i].point,
OBC_boundary, ARRAY_LENGTH(OBC_boundary));
hal.console->printf_P(PSTR("%10f,%10f %s %s\n"),
1.0e-7*test_points[i].point.x,
1.0e-7*test_points[i].point.y,
1.0e-7f*test_points[i].point.x,
1.0e-7f*test_points[i].point.y,
result ? "OUTSIDE" : "INSIDE ",
result == test_points[i].outside ? "PASS" : "FAIL");
if (result != test_points[i].outside) {

2
libraries/AP_Math/examples/rotations/rotations.pde

@ -81,7 +81,7 @@ static void test_euler(enum Rotation rotation, float roll, float pitch, float ya @@ -81,7 +81,7 @@ static void test_euler(enum Rotation rotation, float roll, float pitch, float ya
{
Vector3f v, v1, v2, diff;
Matrix3f rotmat;
const float accuracy = 1.0e-6;
const float accuracy = 1.0e-6f;
v.x = 1;
v.y = 2;

Loading…
Cancel
Save