diff mbox series

[FFmpeg-devel,1/4] avcodec/libaribb24, ttmlenc, avutil/tx: Remove redundant init of AVBPrint

Message ID AS8P250MB0744B225ACBAE17540C9E6A28FF2A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit c1714a483fa9a3b35b8e391c7a29c4393736d294
Headers show
Series [FFmpeg-devel,1/4] avcodec/libaribb24, ttmlenc, avutil/tx: Remove redundant init of AVBPrint | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 11, 2023, 3:30 p.m. UTC
An AVBPrint is initialized via av_bprint_init() (or
av_bprint_init_for_buffer()) which expects uninitialized
AVBPrints; it is therefore not necessary to zero them before
the actual initialization.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/libaribb24.c | 2 +-
 libavcodec/ttmlenc.c    | 2 +-
 libavutil/tx.c          | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Andreas Rheinhardt Sept. 13, 2023, 7:44 p.m. UTC | #1
Andreas Rheinhardt:
> An AVBPrint is initialized via av_bprint_init() (or
> av_bprint_init_for_buffer()) which expects uninitialized
> AVBPrints; it is therefore not necessary to zero them before
> the actual initialization.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/libaribb24.c | 2 +-
>  libavcodec/ttmlenc.c    | 2 +-
>  libavutil/tx.c          | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
> index 8032536b22..551be89ffd 100644
> --- a/libavcodec/libaribb24.c
> +++ b/libavcodec/libaribb24.c
> @@ -227,7 +227,7 @@ static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub)
>      Libaribb24Context *b24 = avctx->priv_data;
>      const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder);
>      unsigned int profile_font_size = get_profile_font_size(avctx);
> -    AVBPrint buf = { 0 };
> +    AVBPrint buf;
>      int ret = 0;
>  
>      av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
> diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c
> index fb05c38968..6a2ab23cab 100644
> --- a/libavcodec/ttmlenc.c
> +++ b/libavcodec/ttmlenc.c
> @@ -45,7 +45,7 @@ typedef struct {
>  static void ttml_text_cb(void *priv, const char *text, int len)
>  {
>      TTMLContext *s = priv;
> -    AVBPrint cur_line = { 0 };
> +    AVBPrint cur_line;
>      AVBPrint *buffer = &s->buffer;
>  
>      av_bprint_init(&cur_line, len, AV_BPRINT_SIZE_UNLIMITED);
> diff --git a/libavutil/tx.c b/libavutil/tx.c
> index 24b2015b44..d6740071b9 100644
> --- a/libavutil/tx.c
> +++ b/libavutil/tx.c
> @@ -595,7 +595,7 @@ static void print_type(AVBPrint *bp, enum AVTXType type)
>  
>  static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio)
>  {
> -    AVBPrint bp = { 0 };
> +    AVBPrint bp;
>      av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
>  
>      av_bprintf(&bp, "%s - type: ", cd->name);
> @@ -718,7 +718,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
>      int codelet_list_idx = codelet_list_num;
>      int nb_cd_matches = 0;
>  #if !CONFIG_SMALL
> -    AVBPrint bp = { 0 };
> +    AVBPrint bp;
>  #endif
>  
>      /* We still accept functions marked with SLOW, even if the CPU is

Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
index 8032536b22..551be89ffd 100644
--- a/libavcodec/libaribb24.c
+++ b/libavcodec/libaribb24.c
@@ -227,7 +227,7 @@  static int libaribb24_handle_regions(AVCodecContext *avctx, AVSubtitle *sub)
     Libaribb24Context *b24 = avctx->priv_data;
     const arib_buf_region_t *region = arib_decoder_get_regions(b24->decoder);
     unsigned int profile_font_size = get_profile_font_size(avctx);
-    AVBPrint buf = { 0 };
+    AVBPrint buf;
     int ret = 0;
 
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c
index fb05c38968..6a2ab23cab 100644
--- a/libavcodec/ttmlenc.c
+++ b/libavcodec/ttmlenc.c
@@ -45,7 +45,7 @@  typedef struct {
 static void ttml_text_cb(void *priv, const char *text, int len)
 {
     TTMLContext *s = priv;
-    AVBPrint cur_line = { 0 };
+    AVBPrint cur_line;
     AVBPrint *buffer = &s->buffer;
 
     av_bprint_init(&cur_line, len, AV_BPRINT_SIZE_UNLIMITED);
diff --git a/libavutil/tx.c b/libavutil/tx.c
index 24b2015b44..d6740071b9 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -595,7 +595,7 @@  static void print_type(AVBPrint *bp, enum AVTXType type)
 
 static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio)
 {
-    AVBPrint bp = { 0 };
+    AVBPrint bp;
     av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
 
     av_bprintf(&bp, "%s - type: ", cd->name);
@@ -718,7 +718,7 @@  av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
     int codelet_list_idx = codelet_list_num;
     int nb_cd_matches = 0;
 #if !CONFIG_SMALL
-    AVBPrint bp = { 0 };
+    AVBPrint bp;
 #endif
 
     /* We still accept functions marked with SLOW, even if the CPU is