[vlc-commits] modules: remove empty curly braces initialization

Steve Lhomme git at videolan.org
Mon Apr 23 13:41:03 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Apr 23 12:13:22 2018 +0200| [d6a4f1d32d8a084b7c344ab2d34cefe0af16f866] | committer: Steve Lhomme

modules: remove empty curly braces initialization

They are not allowed per ยง6.7.9 of the 2011 ISO C Standard:

initializer:
         assignment-expression
         { initializer-list }
         { initializer-list , }
initializer-list:
         designation(opt) initializer
         initializer-list , designation(opt) initializer

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6a4f1d32d8a084b7c344ab2d34cefe0af16f866
---

 modules/codec/avcodec/encoder.c | 2 +-
 modules/codec/flac.c            | 2 +-
 modules/codec/vpx.c             | 4 ++--
 modules/demux/avformat/demux.c  | 2 +-
 modules/mux/mp4/libmp4mux.c     | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index c244b3b728..c1fef935df 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -741,7 +741,7 @@ int InitVideoEnc( vlc_object_t *p_this )
          * Copied from audio.c
          */
         const unsigned i_order_max = 8 * sizeof(p_context->channel_layout);
-        uint32_t pi_order_dst[AOUT_CHAN_MAX] = { };
+        uint32_t pi_order_dst[AOUT_CHAN_MAX] = { 0 };
         int i_channels_src = 0;
 
         if( p_context->channel_layout )
diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index 03cdd55955..31c9cca04b 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -98,7 +98,7 @@ static const int pi_channels_maps[FLAC__MAX_CHANNELS + 1] =
 /* XXX it supposes our internal format is WG4 */
 static const uint8_t ppi_reorder[1+FLAC__MAX_CHANNELS][FLAC__MAX_CHANNELS] =
 {
-    { },
+    { 0 },
     { 0, },
     { 0, 1 },
     { 0, 1, 2 },
diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c
index 643665023b..5d09e949d2 100644
--- a/modules/codec/vpx.c
+++ b/modules/codec/vpx.c
@@ -405,7 +405,7 @@ static int OpenEncoder(vlc_object_t *p_this)
         return VLC_EGENERIC;
     }
 
-    struct vpx_codec_enc_cfg enccfg = {};
+    struct vpx_codec_enc_cfg enccfg = {0};
     vpx_codec_enc_config_default(iface, &enccfg, 0);
     enccfg.g_threads = __MIN(vlc_GetCPUCount(), 4);
     enccfg.g_w = p_enc->fmt_in.video.i_visible_width;
@@ -451,7 +451,7 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict)
 
     if (!p_pict) return NULL;
 
-    vpx_image_t img = {};
+    vpx_image_t img = {0};
     unsigned i_w = p_enc->fmt_in.video.i_visible_width;
     unsigned i_h = p_enc->fmt_in.video.i_visible_height;
 
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 04dbb810f6..dc27a58abb 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -155,7 +155,7 @@ static int avformat_ProbeDemux( vlc_object_t *p_this,
                                 AVInputFormat **pp_fmt, const char *psz_url )
 {
     demux_t       *p_demux = (demux_t*)p_this;
-    AVProbeData   pd = { };
+    AVProbeData   pd = { 0 };
     const uint8_t *peek;
 
     /* Init Probe data */
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 578a9d2276..98f78bb768 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -587,7 +587,7 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt, bool b_completeness)
         return hvcC;
     }
 
-    struct hevc_dcr_params params = { };
+    struct hevc_dcr_params params = { 0 };
     const uint8_t *p_nal;
     size_t i_nal;
 



More information about the vlc-commits mailing list