diff mbox series

[FFmpeg-devel,v2] avfilter/dnn: fix incompatible integer to pointer conversion warning

Message ID 1639060632-2096-1-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2] avfilter/dnn: fix incompatible integer to pointer conversion warning
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Limin Wang Dec. 9, 2021, 2:37 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

---
 libavfilter/dnn/dnn_backend_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Guo, Yejun Dec. 11, 2021, 3:06 a.m. UTC | #1
-----Original Message-----
From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of lance.lmwang@gmail.com
Sent: 2021年12月9日 22:37
To: ffmpeg-devel@ffmpeg.org
Cc: Limin Wang <lance.lmwang@gmail.com>
Subject: [FFmpeg-devel] [PATCH v2] avfilter/dnn: fix incompatible integer to pointer conversion warning

From: Limin Wang <lance.lmwang@gmail.com>

---
 libavfilter/dnn/dnn_backend_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_common.c b/libavfilter/dnn/dnn_backend_common.c
index 6a9c4cc..dd7bdf4 100644
--- a/libavfilter/dnn/dnn_backend_common.c
+++ b/libavfilter/dnn/dnn_backend_common.c
@@ -83,10 +83,10 @@ static void *async_thread_routine(void *args)
     void *request = async_module->args;
 
     if (async_module->start_inference(request) != DNN_SUCCESS) {
-        return DNN_ASYNC_FAIL;
+        return (void*)DNN_ASYNC_FAIL;

there is already (void*) in DNN_ASYNC_FAIL

     }
     async_module->callback(request);
-    return DNN_ASYNC_SUCCESS;
+    return (void*)DNN_ASYNC_SUCCESS;
 }
 
 DNNReturnType ff_dnn_async_module_cleanup(DNNAsyncExecModule *async_module)
--
1.8.3.1
Limin Wang Dec. 11, 2021, 3:47 a.m. UTC | #2
On Sat, Dec 11, 2021 at 03:06:42AM +0000, Guo, Yejun wrote:
> 
> 
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of lance.lmwang@gmail.com
> Sent: 2021年12月9日 22:37
> To: ffmpeg-devel@ffmpeg.org
> Cc: Limin Wang <lance.lmwang@gmail.com>
> Subject: [FFmpeg-devel] [PATCH v2] avfilter/dnn: fix incompatible integer to pointer conversion warning
> 
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> ---
>  libavfilter/dnn/dnn_backend_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/dnn/dnn_backend_common.c b/libavfilter/dnn/dnn_backend_common.c
> index 6a9c4cc..dd7bdf4 100644
> --- a/libavfilter/dnn/dnn_backend_common.c
> +++ b/libavfilter/dnn/dnn_backend_common.c
> @@ -83,10 +83,10 @@ static void *async_thread_routine(void *args)
>      void *request = async_module->args;
>  
>      if (async_module->start_inference(request) != DNN_SUCCESS) {
> -        return DNN_ASYNC_FAIL;
> +        return (void*)DNN_ASYNC_FAIL;
> 
> there is already (void*) in DNN_ASYNC_FAIL

Sorry, it's my mistake. please ignore the patch.
Can we check the thread_join status with void* and void* error code? 
if (status == DNN_ASYNC_FAIL) {

For the compiler doesnt know what type of address the pointer is pointing at,
it doesnt know how many bytes to read from the pointer address and compare. 

> 
>      }
>      async_module->callback(request);
> -    return DNN_ASYNC_SUCCESS;
> +    return (void*)DNN_ASYNC_SUCCESS;
>  }
>  
>  DNNReturnType ff_dnn_async_module_cleanup(DNNAsyncExecModule *async_module)
> --
> 1.8.3.1
> 
> _______________________________________________
> 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".
> _______________________________________________
> 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".
Hendrik Leppkes Dec. 11, 2021, 9:20 a.m. UTC | #3
On Sat, Dec 11, 2021 at 4:47 AM <lance.lmwang@gmail.com> wrote:
>
> On Sat, Dec 11, 2021 at 03:06:42AM +0000, Guo, Yejun wrote:
> >
> >
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of lance.lmwang@gmail.com
> > Sent: 2021年12月9日 22:37
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Limin Wang <lance.lmwang@gmail.com>
> > Subject: [FFmpeg-devel] [PATCH v2] avfilter/dnn: fix incompatible integer to pointer conversion warning
> >
> > From: Limin Wang <lance.lmwang@gmail.com>
> >
> > ---
> >  libavfilter/dnn/dnn_backend_common.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavfilter/dnn/dnn_backend_common.c b/libavfilter/dnn/dnn_backend_common.c
> > index 6a9c4cc..dd7bdf4 100644
> > --- a/libavfilter/dnn/dnn_backend_common.c
> > +++ b/libavfilter/dnn/dnn_backend_common.c
> > @@ -83,10 +83,10 @@ static void *async_thread_routine(void *args)
> >      void *request = async_module->args;
> >
> >      if (async_module->start_inference(request) != DNN_SUCCESS) {
> > -        return DNN_ASYNC_FAIL;
> > +        return (void*)DNN_ASYNC_FAIL;
> >
> > there is already (void*) in DNN_ASYNC_FAIL
>
> Sorry, it's my mistake. please ignore the patch.
> Can we check the thread_join status with void* and void* error code?
> if (status == DNN_ASYNC_FAIL) {
>
> For the compiler doesnt know what type of address the pointer is pointing at,
> it doesnt know how many bytes to read from the pointer address and compare.
>

Pointers are always the same size, the compiler doesn't read any data
from the pointer for comparison, it only compares the address itself.

- Hendrik
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_common.c b/libavfilter/dnn/dnn_backend_common.c
index 6a9c4cc..dd7bdf4 100644
--- a/libavfilter/dnn/dnn_backend_common.c
+++ b/libavfilter/dnn/dnn_backend_common.c
@@ -83,10 +83,10 @@  static void *async_thread_routine(void *args)
     void *request = async_module->args;
 
     if (async_module->start_inference(request) != DNN_SUCCESS) {
-        return DNN_ASYNC_FAIL;
+        return (void*)DNN_ASYNC_FAIL;
     }
     async_module->callback(request);
-    return DNN_ASYNC_SUCCESS;
+    return (void*)DNN_ASYNC_SUCCESS;
 }
 
 DNNReturnType ff_dnn_async_module_cleanup(DNNAsyncExecModule *async_module)