diff mbox series

[FFmpeg-devel] tests/audiomatch: removes a warning when compiling tests/audiomatch

Message ID 20201019060853.7606-1-liuqi05@kuaishou.com
State Accepted
Commit bc90145fa3b6e8d26dafe057252a17cdd3a9a095
Headers show
Series [FFmpeg-devel] tests/audiomatch: removes a warning when compiling tests/audiomatch
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

liuqi05 Oct. 19, 2020, 6:08 a.m. UTC
the warning message:
warning: using floating point absolute value function
'fabs' when argument is of integer type
use FFABS to set the absolute value.

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
---
 tests/audiomatch.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Steven Liu Oct. 20, 2020, 9:45 a.m. UTC | #1
liuqi05 <liuqi05@kuaishou.com> 于2020年10月19日周一 下午2:10写道:
>
> the warning message:
> warning: using floating point absolute value function
> 'fabs' when argument is of integer type
> use FFABS to set the absolute value.
>
> Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
> ---
>  tests/audiomatch.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tests/audiomatch.c b/tests/audiomatch.c
> index d44c4070e0..bb9deca624 100644
> --- a/tests/audiomatch.c
> +++ b/tests/audiomatch.c
> @@ -24,6 +24,7 @@
>
>  #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
>  #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
> +#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
>
>  static int64_t fsize(FILE *f) {
>      int64_t end, pos = ftell(f);
> @@ -101,9 +102,9 @@ int main(int argc, char **argv) {
>              int j = pos + i;
>              c += signal[i] * data[j];
>          }
> -        if (fabs(c) > sigamp * 0.94)
> -            maxshift = FFMIN(maxshift, fabs(pos)+32);
> -        if (fabs(c) > fabs(bestc)) {
> +        if (FFABS(c) > sigamp * 0.94)
> +            maxshift = FFMIN(maxshift, FFABS(pos)+32);
> +        if (FFABS(c) > FFABS(bestc)) {
>              bestc = c;
>              bestpos = pos;
>          }
> --
> 2.25.0
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".


Any comments?


Thanks
Steven
Steven Liu Oct. 21, 2020, 1:07 a.m. UTC | #2
> 2020年10月20日 下午5:45,Steven Liu <lingjiujianke@gmail.com> 写道:
> 
> liuqi05 <liuqi05@kuaishou.com> 于2020年10月19日周一 下午2:10写道:
>> 
>> the warning message:
>> warning: using floating point absolute value function
>> 'fabs' when argument is of integer type
>> use FFABS to set the absolute value.
>> 
>> Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
>> ---
>> tests/audiomatch.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>> 
>> diff --git a/tests/audiomatch.c b/tests/audiomatch.c
>> index d44c4070e0..bb9deca624 100644
>> --- a/tests/audiomatch.c
>> +++ b/tests/audiomatch.c
>> @@ -24,6 +24,7 @@
>> 
>> #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
>> #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
>> +#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
>> 
>> static int64_t fsize(FILE *f) {
>>     int64_t end, pos = ftell(f);
>> @@ -101,9 +102,9 @@ int main(int argc, char **argv) {
>>             int j = pos + i;
>>             c += signal[i] * data[j];
>>         }
>> -        if (fabs(c) > sigamp * 0.94)
>> -            maxshift = FFMIN(maxshift, fabs(pos)+32);
>> -        if (fabs(c) > fabs(bestc)) {
>> +        if (FFABS(c) > sigamp * 0.94)
>> +            maxshift = FFMIN(maxshift, FFABS(pos)+32);
>> +        if (FFABS(c) > FFABS(bestc)) {
>>             bestc = c;
>>             bestpos = pos;
>>         }
>> --
>> 2.25.0
>> 
>> 
>> 
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 
> 
> Any comments?
Will apply if no objections.
> 
> 
> Thanks
> Steven
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Thanks

Steven Liu
diff mbox series

Patch

diff --git a/tests/audiomatch.c b/tests/audiomatch.c
index d44c4070e0..bb9deca624 100644
--- a/tests/audiomatch.c
+++ b/tests/audiomatch.c
@@ -24,6 +24,7 @@ 
 
 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
 
 static int64_t fsize(FILE *f) {
     int64_t end, pos = ftell(f);
@@ -101,9 +102,9 @@  int main(int argc, char **argv) {
             int j = pos + i;
             c += signal[i] * data[j];
         }
-        if (fabs(c) > sigamp * 0.94)
-            maxshift = FFMIN(maxshift, fabs(pos)+32);
-        if (fabs(c) > fabs(bestc)) {
+        if (FFABS(c) > sigamp * 0.94)
+            maxshift = FFMIN(maxshift, FFABS(pos)+32);
+        if (FFABS(c) > FFABS(bestc)) {
             bestc = c;
             bestpos = pos;
         }