diff mbox series

[FFmpeg-devel,1/2] lavu/internal: add FF_FIELD_AT().

Message ID 20210724152947.258052-1-george@nsup.org
State Accepted
Commit 1d8e1afc009f2a916f672fc57f4971504bb13fb3
Headers show
Series [FFmpeg-devel,1/2] lavu/internal: add FF_FIELD_AT(). | 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

Nicolas George July 24, 2021, 3:29 p.m. UTC
Signed-off-by: Nicolas George <george@nsup.org>
---
 libavutil/internal.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Nicolas George July 28, 2021, 9:20 a.m. UTC | #1
Nicolas George (12021-07-24):
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  libavutil/internal.h | 5 +++++
>  1 file changed, 5 insertions(+)

Will push soon unless somebody wants to comment.

Regards,
Nicolas George Aug. 14, 2021, 8:12 a.m. UTC | #2
Nicolas George (12021-07-24):
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  libavutil/internal.h | 5 +++++
>  1 file changed, 5 insertions(+)

Patch series pushed after more time than expected.

Regards,
diff mbox series

Patch

diff --git a/libavutil/internal.h b/libavutil/internal.h
index a33e8700c3..2011813932 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -103,6 +103,11 @@ 
 
 #define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr))
 
+/**
+ * Access a field in a structure by its offset.
+ */
+#define FF_FIELD_AT(type, off, obj) (*(type *)((char *)&(obj) + (off)))
+
 #include "libm.h"
 
 /**