Skip to content

Commit f0eecb3

Browse files
committed
changes to the color addons
1 parent af52f80 commit f0eecb3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext_mod/lvgl_addons/src/color_addons.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ float soft_atan2( float y, float x )
1818
static const float b = 0.596227f;
1919

2020
// Extract the sign bits
21-
uint32_t ux_s = sign_mask & (uint32_t &)x;
22-
uint32_t uy_s = sign_mask & (uint32_t &)y;
21+
uint32_t ux_s = sign_mask & ((uint32_t) &)x;
22+
uint32_t uy_s = sign_mask & ((uint32_t) &)y;
2323

2424
// Determine the quadrant offset
2525
float q = (float)( ( ~ux_s & uy_s ) >> 29 | ux_s >> 30 );
2626

2727
// Calculate the arctangent in the first quadrant
28-
float bxy_a = fabs( b * x * y );
28+
float bxy_a = (float)fabs( b * x * y );
2929
float num = bxy_a + y * y;
3030
float atan_1q = num / ( x * x + bxy_a + num );
3131

3232
// Translate it to the proper quadrant
33-
uint32_t uatan_2q = (ux_s ^ uy_s) | (uint32_t &)atan_1q;
34-
return q + (float &)uatan_2q;
33+
uint32_t uatan_2q = (ux_s ^ uy_s) | ((uint32_t) &)atan_1q;
34+
return q + ((float) &)uatan_2q;
3535
}
3636

3737
#endif /* MP_SOFT_ATAN */

0 commit comments

Comments
 (0)