AP_Math: compiler warnings: float to double

This commit is contained in:
Tom Pittenger 2015-05-02 02:10:44 -07:00 committed by Andrew Tridgell
parent d09ef4783d
commit a5d2f3a82f
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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