Skip to content

Commit

Permalink
ramp: fix warning for integer ramps
Browse files Browse the repository at this point in the history
This fixes the following warning:

| ../../../git/std_blocks/ramp/ramp.c: In function 'ramp_init':
| ../../../git/std_blocks/ramp/ramp.c:47:25: error: using floating point absolute value function 'fabs' when argument is of integer type 'uint16_t' {aka 'short unsigned int'} [-Werror=absolute-value]
|    47 |  inf->slope = ((double) fabs(inf->slope) > 10e-6) ? inf->slope : 1;
|       |                         ^~~~

Signed-off-by: Markus Klotzbuecher <mk@mkio.de>
  • Loading branch information
kmarkus committed Nov 22, 2019
1 parent a066967 commit ea5d631
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion std_blocks/ramp/ramp.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int ramp_init(ubx_block_t *b)
goto out;

inf->slope = (len > 0) ? *val : 1;
inf->slope = (fabs(inf->slope) > 10e-6) ? inf->slope : 1;
inf->slope = (fabs((double) inf->slope) > 10e-6) ? inf->slope : 1;

ret=0;
out:
Expand Down

0 comments on commit ea5d631

Please sign in to comment.