diff mbox series

[FFmpeg-devel,2/3] checkasm/vp9dsp: rename the iszero function to is_zero

Message ID 20210607022036.960-2-jamrial@gmail.com
State Accepted
Commit b27ae2c0b704e83f950980102bc3f12f9ec17cb0
Headers show
Series [FFmpeg-devel,1/3] avutil/tests/lzo: remove timer macros | expand

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 success Make fate finished

Commit Message

James Almer June 7, 2021, 2:20 a.m. UTC
From: Matthieu Patou <mpatou@fb.com>

The function name iszero() may collide with a function in glibc.

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
---
 tests/checkasm/vp9dsp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ronald S. Bultje June 7, 2021, 9:23 p.m. UTC | #1
Hi,

On Sun, Jun 6, 2021 at 10:42 PM James Almer <jamrial@gmail.com> wrote:

> From: Matthieu Patou <mpatou@fb.com>
>
> The function name iszero() may collide with a function in glibc.
>
> Suggested-by: ffmpeg@fb.com
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  tests/checkasm/vp9dsp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
> index 99c023899f..44b02d60a2 100644
> --- a/tests/checkasm/vp9dsp.c
> +++ b/tests/checkasm/vp9dsp.c
> @@ -294,7 +294,7 @@ static int copy_subcoefs(int16_t *out, const int16_t
> *in, enum TxfmMode tx,
>      return eob;
>  }
>
> -static int iszero(const int16_t *c, int sz)
> +static int is_zero(const int16_t *c, int sz)
>  {
>      int n;
>
> @@ -362,8 +362,8 @@ static void check_itxfm(void)
>                          call_ref(dst0, sz * SIZEOF_PIXEL, subcoef0, eob);
>                          call_new(dst1, sz * SIZEOF_PIXEL, subcoef1, eob);
>                          if (memcmp(dst0, dst1, sz * sz * SIZEOF_PIXEL) ||
> -                            !iszero(subcoef0, sz * sz * SIZEOF_COEF) ||
> -                            !iszero(subcoef1, sz * sz * SIZEOF_COEF))
> +                            !is_zero(subcoef0, sz * sz * SIZEOF_COEF) ||
> +                            !is_zero(subcoef1, sz * sz * SIZEOF_COEF))
>                              fail();
>
>                          bench_new(dst, sz * SIZEOF_PIXEL, coef, eob);
> --
> 2.31.1
>

LGTM.

Ronald
James Almer June 8, 2021, 4:29 p.m. UTC | #2
On 6/7/2021 6:23 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Jun 6, 2021 at 10:42 PM James Almer <jamrial@gmail.com> wrote:
> 
>> From: Matthieu Patou <mpatou@fb.com>
>>
>> The function name iszero() may collide with a function in glibc.
>>
>> Suggested-by: ffmpeg@fb.com
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   tests/checkasm/vp9dsp.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
>> index 99c023899f..44b02d60a2 100644
>> --- a/tests/checkasm/vp9dsp.c
>> +++ b/tests/checkasm/vp9dsp.c
>> @@ -294,7 +294,7 @@ static int copy_subcoefs(int16_t *out, const int16_t
>> *in, enum TxfmMode tx,
>>       return eob;
>>   }
>>
>> -static int iszero(const int16_t *c, int sz)
>> +static int is_zero(const int16_t *c, int sz)
>>   {
>>       int n;
>>
>> @@ -362,8 +362,8 @@ static void check_itxfm(void)
>>                           call_ref(dst0, sz * SIZEOF_PIXEL, subcoef0, eob);
>>                           call_new(dst1, sz * SIZEOF_PIXEL, subcoef1, eob);
>>                           if (memcmp(dst0, dst1, sz * sz * SIZEOF_PIXEL) ||
>> -                            !iszero(subcoef0, sz * sz * SIZEOF_COEF) ||
>> -                            !iszero(subcoef1, sz * sz * SIZEOF_COEF))
>> +                            !is_zero(subcoef0, sz * sz * SIZEOF_COEF) ||
>> +                            !is_zero(subcoef1, sz * sz * SIZEOF_COEF))
>>                               fail();
>>
>>                           bench_new(dst, sz * SIZEOF_PIXEL, coef, eob);
>> --
>> 2.31.1
>>
> 
> LGTM.
> 
> Ronald

Applied, thanks.
diff mbox series

Patch

diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c
index 99c023899f..44b02d60a2 100644
--- a/tests/checkasm/vp9dsp.c
+++ b/tests/checkasm/vp9dsp.c
@@ -294,7 +294,7 @@  static int copy_subcoefs(int16_t *out, const int16_t *in, enum TxfmMode tx,
     return eob;
 }
 
-static int iszero(const int16_t *c, int sz)
+static int is_zero(const int16_t *c, int sz)
 {
     int n;
 
@@ -362,8 +362,8 @@  static void check_itxfm(void)
                         call_ref(dst0, sz * SIZEOF_PIXEL, subcoef0, eob);
                         call_new(dst1, sz * SIZEOF_PIXEL, subcoef1, eob);
                         if (memcmp(dst0, dst1, sz * sz * SIZEOF_PIXEL) ||
-                            !iszero(subcoef0, sz * sz * SIZEOF_COEF) ||
-                            !iszero(subcoef1, sz * sz * SIZEOF_COEF))
+                            !is_zero(subcoef0, sz * sz * SIZEOF_COEF) ||
+                            !is_zero(subcoef1, sz * sz * SIZEOF_COEF))
                             fail();
 
                         bench_new(dst, sz * SIZEOF_PIXEL, coef, eob);