mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 11:33:34 +08:00
Change fabsf() to abs for int arg
Clang complains that fabsf() is being used for an int arg. Use abs() instead. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -106,7 +106,7 @@ int test_rc(int argc, char *argv[])
|
|||||||
|
|
||||||
/* go and check values */
|
/* go and check values */
|
||||||
for (unsigned i = 0; i < rc_input.channel_count; i++) {
|
for (unsigned i = 0; i < rc_input.channel_count; i++) {
|
||||||
if (fabsf(rc_input.values[i] - rc_last.values[i]) > 20) {
|
if (abs(rc_input.values[i] - rc_last.values[i]) > 20) {
|
||||||
PX4_ERR("comparison fail: RC: %d, expected: %d", rc_input.values[i], rc_last.values[i]);
|
PX4_ERR("comparison fail: RC: %d, expected: %d", rc_input.values[i], rc_last.values[i]);
|
||||||
(void)close(_rc_sub);
|
(void)close(_rc_sub);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user