Fixed implicit conversion from float to double in lighting output and color.

This commit is contained in:
Steve Karg
2024-08-06 17:22:27 -05:00
parent 19f276b7f2
commit 350bbe3331
5 changed files with 50 additions and 37 deletions
+4 -2
View File
@@ -386,7 +386,8 @@ static void testLoadControlStateMachine(void)
} else {
zassert_true(false, NULL);
}
zassert_false(islessgreater(90.0f, level), "AO Present Value = %f", level);
zassert_false(islessgreater(90.0f, level), "AO Present Value = %f",
(double)level);
/* FinishedSuccessfulShed */
datetime_set_values(&bdatetime, 2007, 2, 27, 23, 0, 0, 0);
Load_Control_State_Machine(0, &bdatetime);
@@ -399,7 +400,8 @@ static void testLoadControlStateMachine(void)
} else {
zassert_true(false, NULL);
}
zassert_false(islessgreater(100.0f, level), "AO Present Value = %f", level);
zassert_false(islessgreater(100.0f, level), "AO Present Value = %f",
(double)level);
}
#ifndef MAX_LOAD_CONTROLS
+6 -6
View File
@@ -42,7 +42,7 @@ static void test_color_rgb_xy_gamma_unit(
float y_coordinate,
uint8_t brightness)
{
float test_x_coordinate = 0.0, test_y_coordinate = 0.0;
float test_x_coordinate = 0.0f, test_y_coordinate = 0.0f;
uint8_t test_brightness = 0;
uint8_t test_red = 0, test_green = 0, test_blue = 0;
@@ -55,10 +55,10 @@ static void test_color_rgb_xy_gamma_unit(
brightness);
zassert_true(
is_float_equal(x_coordinate, test_x_coordinate), "(x=%.3f,test_x=%.3f)",
x_coordinate, test_x_coordinate);
(double)x_coordinate, (double)test_x_coordinate);
zassert_true(
is_float_equal(y_coordinate, test_y_coordinate), "(y=%.3f,test_y=%.3f)",
y_coordinate, test_y_coordinate);
(double)y_coordinate, (double)test_y_coordinate);
zassert_equal(
brightness, test_brightness, "b=%u, test_b=%u", brightness,
test_brightness);
@@ -75,7 +75,7 @@ static void test_color_rgb_xy_unit(
float y_coordinate,
uint8_t brightness)
{
float test_x_coordinate = 0.0, test_y_coordinate = 0.0;
float test_x_coordinate = 0.0f, test_y_coordinate = 0.0f;
uint8_t test_brightness = 0;
uint8_t test_red = 0, test_green = 0, test_blue = 0;
@@ -87,10 +87,10 @@ static void test_color_rgb_xy_unit(
brightness);
zassert_true(
is_float_equal(x_coordinate, test_x_coordinate), "(x=%.3f,test_x=%.3f)",
x_coordinate, test_x_coordinate);
(double)x_coordinate, (double)test_x_coordinate);
zassert_true(
is_float_equal(y_coordinate, test_y_coordinate), "(y=%.3f,test_y=%.3f)",
y_coordinate, test_y_coordinate);
(double)y_coordinate, (double)test_y_coordinate);
zassert_equal(
brightness, test_brightness, "b=%u, test_b=%u", brightness,
test_brightness);