[vlc-commits] ebml: Use init list when possible.

Hugo Beauzée-Luyssen git at videolan.org
Tue Oct 18 12:26:54 CEST 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Oct 17 17:05:55 2011 +0200| [21186ef62d22c33cc583365aabde0cbdfaf1b59a] | committer: Jean-Baptiste Kempf

ebml: Use init list when possible.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/Ebml_parser.cpp |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
index 53857d4..45c30b5 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -29,20 +29,16 @@
 /*****************************************************************************
  * Ebml Stream parser
  *****************************************************************************/
-EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux )
+EbmlParser::EbmlParser( EbmlStream *es, EbmlElement *el_start, demux_t *p_demux ) :
+    m_es( es ),
+    mi_level( 1 ),
+    m_got( NULL ),
+    mi_user_level( 1 ),
+    mb_keep( false )
 {
-    m_es = es;
-    m_got = NULL;
-    m_el[0] = el_start;
     mi_remain_size[0] = el_start->GetSize();
-
-    for( int i = 1; i < 6; i++ )
-    {
-        m_el[i] = NULL;
-    }
-    mi_level = 1;
-    mi_user_level = 1;
-    mb_keep = false;
+    memset( m_el, 0, 6 * sizeof( *m_el ) );
+    m_el[0] = el_start;
     mb_dummy = var_InheritBool( p_demux, "mkv-use-dummy" );
 }
 



More information about the vlc-commits mailing list