[vlc-commits] remove empty curly braces initialization

Steve Lhomme git at videolan.org
Mon Apr 23 12:58:46 CEST 2018


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

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=30940ed4b73ea30987f659b98cd224650aa15527
---

 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 +-
 modules/video_chroma/copy.h     | 2 ++
 src/input/input.c               | 2 +-
 7 files changed, 9 insertions(+), 7 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;
 
diff --git a/modules/video_chroma/copy.h b/modules/video_chroma/copy.h
index 5fbc75b7c9..26ad0b7574 100644
--- a/modules/video_chroma/copy.h
+++ b/modules/video_chroma/copy.h
@@ -30,6 +30,8 @@ typedef struct {
 # ifdef CAN_COMPILE_SSE2
     uint8_t *buffer;
     size_t  size;
+# elif defined(_MSC_VER)
+    char dummy;
 # endif
 } copy_cache_t;
 
diff --git a/src/input/input.c b/src/input/input.c
index 36a8b6e0fa..98c679f0af 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1720,7 +1720,7 @@ static void ControlNav( input_thread_t *p_input, int i_type )
         return; /* The demux handled the navigation control */
 
     /* Handle Up/Down/Left/Right if the demux can't navigate */
-    vlc_viewpoint_t vp = {};
+    vlc_viewpoint_t vp = {0};
     int vol_direction = 0;
     int seek_direction = 0;
     switch( i_type )



More information about the vlc-commits mailing list