[vlc-commits] Lua: add an assertion

Rémi Denis-Courmont git at videolan.org
Tue Jul 10 16:20:31 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 10 17:19:52 2012 +0300| [6e5c406511afee29d983cc1dc22c04987fec1640] | committer: Rémi Denis-Courmont

Lua: add an assertion

(The underlying assumption was previously implicit.)

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

 modules/lua/libs/input.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index 7b413e2..a9c167d 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -344,6 +344,9 @@ static int vlclua_input_item_set_meta( lua_State *L )
     };
 #undef META_TYPE
 
+    static_assert( sizeof(pp_meta_types)
+                      == VLC_META_TYPE_COUNT * sizeof(pp_meta_types[0]),
+                   "Inconsistent meta data types" );
     vlc_meta_type_t type = vlc_meta_Title;
     for( unsigned i = 0; i < VLC_META_TYPE_COUNT; i++ )
     {



More information about the vlc-commits mailing list