* [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
@ 2022-07-09 4:31 Amir Mazzarella
2022-07-19 18:32 ` Amir Mazzarella
2022-07-19 19:08 ` Nicolas George
0 siblings, 2 replies; 9+ messages in thread
From: Amir Mazzarella @ 2022-07-09 4:31 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Amir Mazzarella
Signed-off-by: Amir Mazzarella <amirmazz@google.com>
---
libavutil/vulkan_loader.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
index 3f1ee6aa46..fa8e5ed171 100644
--- a/libavutil/vulkan_loader.h
+++ b/libavutil/vulkan_loader.h
@@ -82,7 +82,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext *ctx,
uint64_t extensions_mask,
int has_inst, int has_dev)
{
- AVVulkanDeviceContext *hwctx = ctx->hwctx;
+ AVVulkanDeviceContext *hwctx = (AVVulkanDeviceContext *) ctx->hwctx;
static const struct FunctionLoadInfo {
int req_inst;
--
2.37.0.rc0.161.g10f37bed90-goog
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-09 4:31 [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit Amir Mazzarella
@ 2022-07-19 18:32 ` Amir Mazzarella
2022-07-19 19:08 ` Nicolas George
1 sibling, 0 replies; 9+ messages in thread
From: Amir Mazzarella @ 2022-07-19 18:32 UTC (permalink / raw)
To: ffmpeg-devel
Ping
On Fri, Jul 8, 2022 at 9:31 PM Amir Mazzarella <amirmazz@google.com> wrote:
> Signed-off-by: Amir Mazzarella <amirmazz@google.com>
> ---
> libavutil/vulkan_loader.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
> index 3f1ee6aa46..fa8e5ed171 100644
> --- a/libavutil/vulkan_loader.h
> +++ b/libavutil/vulkan_loader.h
> @@ -82,7 +82,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext
> *ctx,
> uint64_t extensions_mask,
> int has_inst, int has_dev)
> {
> - AVVulkanDeviceContext *hwctx = ctx->hwctx;
> + AVVulkanDeviceContext *hwctx = (AVVulkanDeviceContext *) ctx->hwctx;
>
> static const struct FunctionLoadInfo {
> int req_inst;
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-09 4:31 [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit Amir Mazzarella
2022-07-19 18:32 ` Amir Mazzarella
@ 2022-07-19 19:08 ` Nicolas George
2022-07-19 21:21 ` Amir Mazzarella
1 sibling, 1 reply; 9+ messages in thread
From: Nicolas George @ 2022-07-19 19:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Amir Mazzarella
[-- Attachment #1.1: Type: text/plain, Size: 902 bytes --]
Hi. Thanks for the patch.
Amir Mazzarella (12022-07-09):
> Signed-off-by: Amir Mazzarella <amirmazz@google.com>
> ---
> libavutil/vulkan_loader.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
> index 3f1ee6aa46..fa8e5ed171 100644
> --- a/libavutil/vulkan_loader.h
> +++ b/libavutil/vulkan_loader.h
> @@ -82,7 +82,7 @@ static inline int ff_vk_load_functions(AVHWDeviceContext *ctx,
> uint64_t extensions_mask,
> int has_inst, int has_dev)
> {
> - AVVulkanDeviceContext *hwctx = ctx->hwctx;
> + AVVulkanDeviceContext *hwctx = (AVVulkanDeviceContext *) ctx->hwctx;
>
> static const struct FunctionLoadInfo {
> int req_inst;
Why? What is it supposed to fix?
Regards,
--
Nicolas George
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 19:08 ` Nicolas George
@ 2022-07-19 21:21 ` Amir Mazzarella
2022-07-19 21:23 ` Hendrik Leppkes
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Amir Mazzarella @ 2022-07-19 21:21 UTC (permalink / raw)
To: ffmpeg-devel
Thank you for your response! A C++ compiler can't do implicit casts like a
C compiler can, in this instance. This is fine for most of FFmpeg's
codebase, since these tricks are in C source files, but in this instance it
is in a header file. If any C++ code includes this header file, even with
extern "C", it won't be able to be compiled.
On Tue, Jul 19, 2022 at 12:08 PM Nicolas George <george@nsup.org> wrote:
> Hi. Thanks for the patch.
>
> Amir Mazzarella (12022-07-09):
> > Signed-off-by: Amir Mazzarella <amirmazz@google.com>
> > ---
> > libavutil/vulkan_loader.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h
> > index 3f1ee6aa46..fa8e5ed171 100644
> > --- a/libavutil/vulkan_loader.h
> > +++ b/libavutil/vulkan_loader.h
> > @@ -82,7 +82,7 @@ static inline int
> ff_vk_load_functions(AVHWDeviceContext *ctx,
> > uint64_t extensions_mask,
> > int has_inst, int has_dev)
> > {
> > - AVVulkanDeviceContext *hwctx = ctx->hwctx;
> > + AVVulkanDeviceContext *hwctx = (AVVulkanDeviceContext *) ctx->hwctx;
> >
> > static const struct FunctionLoadInfo {
> > int req_inst;
>
> Why? What is it supposed to fix?
>
> Regards,
>
> --
> Nicolas George
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 21:21 ` Amir Mazzarella
@ 2022-07-19 21:23 ` Hendrik Leppkes
2022-07-19 21:23 ` Nicolas George
2022-07-28 14:11 ` Anton Khirnov
2 siblings, 0 replies; 9+ messages in thread
From: Hendrik Leppkes @ 2022-07-19 21:23 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, Jul 19, 2022 at 11:21 PM Amir Mazzarella
<amirmazz-at-google.com@ffmpeg.org> wrote:
>
> Thank you for your response! A C++ compiler can't do implicit casts like a
> C compiler can, in this instance. This is fine for most of FFmpeg's
> codebase, since these tricks are in C source files, but in this instance it
> is in a header file. If any C++ code includes this header file, even with
> extern "C", it won't be able to be compiled.
>
While this is true, extremely little code in FFmpeg is C++, as it is
avoided unless absolutely necessary.
We're more likely to fix such cases when needed, rather than blanket
them "just in case".
- Hendrik
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 21:21 ` Amir Mazzarella
2022-07-19 21:23 ` Hendrik Leppkes
@ 2022-07-19 21:23 ` Nicolas George
2022-07-19 22:12 ` Amir Mazzarella
2022-07-28 14:11 ` Anton Khirnov
2 siblings, 1 reply; 9+ messages in thread
From: Nicolas George @ 2022-07-19 21:23 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 810 bytes --]
Amir Mazzarella (12022-07-19):
> Thank you for your response! A C++ compiler can't do implicit casts like a
> C compiler can, in this instance. This is fine for most of FFmpeg's
> codebase, since these tricks are in C source files, but in this instance it
> is in a header file. If any C++ code includes this header file, even with
> extern "C", it won't be able to be compiled.
Thanks for clarifying. I confess I had more or less guessed. FFmpeg is
C, and its headers, public or not, as a rule do not contain
accommodations to be included as is in other languages.
> On Tue, Jul 19, 2022 at 12:08 PM Nicolas George <george@nsup.org> wrote:
Please remember that top-posting is forbidden on this mailing-list. If
you do not know what it means, look it up.
Regards,
--
Nicolas George
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 21:23 ` Nicolas George
@ 2022-07-19 22:12 ` Amir Mazzarella
2022-07-20 9:01 ` Nicolas George
0 siblings, 1 reply; 9+ messages in thread
From: Amir Mazzarella @ 2022-07-19 22:12 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, Jul 19, 2022 at 2:24 PM Nicolas George <george@nsup.org> wrote:
> Thanks for clarifying. I confess I had more or less guessed. FFmpeg is
> C, and its headers, public or not, as a rule do not contain
> accommodations to be included as is in other languages.
I understand that FFmpeg does not contain accommodations, but in my
opinion it is less of an accommodation and more for readability, avoiding
an implicit cast. An explicit void pointer cast, like the one presented in
my patch, is done elsewhere in FFmpeg code as well.
See https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext_qsv.c#L316
What's the harm in including this one too?
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 22:12 ` Amir Mazzarella
@ 2022-07-20 9:01 ` Nicolas George
0 siblings, 0 replies; 9+ messages in thread
From: Nicolas George @ 2022-07-20 9:01 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 691 bytes --]
Amir Mazzarella (12022-07-19):
> I understand that FFmpeg does not contain accommodations, but in my
> opinion it is less of an accommodation and more for readability, avoiding
> an implicit cast. An explicit void pointer cast, like the one presented in
The arguments against useless casts have been worded a thousand times,
let us not waste everybody's energy with one more.
> my patch, is done elsewhere in FFmpeg code as well.
> See https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/hwcontext_qsv.c#L316
It is not the only coding style inconsistency around this line. Coding
style inconsistencies cannot be considered precedents.
Regards,
--
Nicolas George
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit
2022-07-19 21:21 ` Amir Mazzarella
2022-07-19 21:23 ` Hendrik Leppkes
2022-07-19 21:23 ` Nicolas George
@ 2022-07-28 14:11 ` Anton Khirnov
2 siblings, 0 replies; 9+ messages in thread
From: Anton Khirnov @ 2022-07-28 14:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Quoting Amir Mazzarella (2022-07-19 23:21:00)
> Thank you for your response! A C++ compiler can't do implicit casts like a
> C compiler can, in this instance. This is fine for most of FFmpeg's
> codebase, since these tricks are in C source files, but in this instance it
> is in a header file. If any C++ code includes this header file, even with
> extern "C", it won't be able to be compiled.
This header is private, no external c++ code should be including it.
--
Anton Khirnov
_______________________________________________
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".
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-07-28 14:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09 4:31 [FFmpeg-devel] [PATCH] Make implicit void pointer cast explicit Amir Mazzarella
2022-07-19 18:32 ` Amir Mazzarella
2022-07-19 19:08 ` Nicolas George
2022-07-19 21:21 ` Amir Mazzarella
2022-07-19 21:23 ` Hendrik Leppkes
2022-07-19 21:23 ` Nicolas George
2022-07-19 22:12 ` Amir Mazzarella
2022-07-20 9:01 ` Nicolas George
2022-07-28 14:11 ` Anton Khirnov
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git