diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2017-11-02 01:10:11 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2017-11-03 19:41:32 +0100 |
commit | 0555cb2ea9bdc8e210e87e009154954a9bbc3a55 (patch) | |
tree | b873918aca10f27e4f7b722b265dd1085867bd2d /tests/jittertest/plotJittervsFill.c | |
parent | 475bf707b958f37844534b7b45c905521c7401a2 (diff) |
jittertest: Use the appropriate versions of abs()
When passing a long argument, actually use labs().
The other case of passing a float to "int abs(int)" and
casting the result to an int doesn't really make sense.
Pull the cast inside the abs().
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests/jittertest/plotJittervsFill.c')
-rw-r--r-- | tests/jittertest/plotJittervsFill.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/jittertest/plotJittervsFill.c b/tests/jittertest/plotJittervsFill.c index 8d71a33..03929a9 100644 --- a/tests/jittertest/plotJittervsFill.c +++ b/tests/jittertest/plotJittervsFill.c @@ -267,7 +267,7 @@ int main( } /* Is the jitter value > threshold value? */ - if(abs(jitter_ms) > JitterThreshold_ms) + if(abs((int)jitter_ms) > JitterThreshold_ms) { /* Found a jitter line that matches our crietrion. Now set flag to be on the look out for the next @@ -276,7 +276,7 @@ int main( if(saveJitterCnt < MAX_SAVE_BUFFER) { - saveJitter[saveJitterCnt] = (int)abs(jitter_ms); /* why keep the (ms) jitter in float */ + saveJitter[saveJitterCnt] = abs((int)jitter_ms); /* why keep the (ms) jitter in float */ dataLineNo[saveJitterCnt] = lineNo; saveJitterCnt++; lookFor_df = TRUE; |