[vlc-commits] commit: lua: remove "bla ? true : false" ( Rémi Duraffort )

git at videolan.org git at videolan.org
Mon Sep 13 22:51:33 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Sep 13 20:19:44 2010 +0200| [498262cef5133af555f2ce8a8efd775aa163c41b] | committer: Rémi Duraffort 

lua: remove "bla ? true : false"

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

 modules/misc/lua/libs/acl.c       |    8 ++++----
 modules/misc/lua/libs/variables.c |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/misc/lua/libs/acl.c b/modules/misc/lua/libs/acl.c
index bbe0c86..4deb66e 100644
--- a/modules/misc/lua/libs/acl.c
+++ b/modules/misc/lua/libs/acl.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * acl.c: Access list related functions
  *****************************************************************************
- * Copyright (C) 2007-2008 the VideoLAN team
+ * Copyright (C) 2007-2010 the VideoLAN team
  * $Id$
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
@@ -64,7 +64,7 @@ static const luaL_Reg vlclua_acl_reg[] = {
 static int vlclua_acl_create( lua_State *L )
 {
     vlc_object_t *p_this = vlclua_get_this( L );
-    bool b_allow = luaL_checkboolean( L, 1 ) ? true : false;
+    bool b_allow = luaL_checkboolean( L, 1 );
     vlc_acl_t *p_acl = ACL_Create( p_this, b_allow );
     return vlclua_acl_create_inner( L, p_acl );
 }
@@ -117,7 +117,7 @@ static int vlclua_acl_add_host( lua_State *L )
 {
     vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
     const char *psz_ip = luaL_checkstring( L, 2 );
-    bool b_allow = luaL_checkboolean( L, 3 ) ? true : false;
+    bool b_allow = luaL_checkboolean( L, 3 );
     lua_pushinteger( L, ACL_AddHost( *pp_acl, psz_ip, b_allow ) );
     return 1;
 }
@@ -127,7 +127,7 @@ static int vlclua_acl_add_net( lua_State *L )
     vlc_acl_t **pp_acl = (vlc_acl_t**)luaL_checkudata( L, 1, "acl" );
     const char *psz_ip = luaL_checkstring( L, 2 );
     int i_len = luaL_checkint( L, 3 );
-    bool b_allow = luaL_checkboolean( L, 4 ) ? true : false;
+    bool b_allow = luaL_checkboolean( L, 4 );
     lua_pushinteger( L, ACL_AddNet( *pp_acl, psz_ip, i_len, b_allow ) );
     return 1;
 }
diff --git a/modules/misc/lua/libs/variables.c b/modules/misc/lua/libs/variables.c
index 820092f..f0b1cbf 100644
--- a/modules/misc/lua/libs/variables.c
+++ b/modules/misc/lua/libs/variables.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * variables.c: Generic lua<->vlc variables interface
  *****************************************************************************
- * Copyright (C) 2007-2008 the VideoLAN team
+ * Copyright (C) 2007-2010 the VideoLAN team
  * $Id$
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
@@ -257,7 +257,7 @@ int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
         b_bool = !var_GetBool( p_obj, psz_name );
     else /* lua_gettop( L ) == 1 */
     {
-        b_bool = luaL_checkboolean( L, -1 )?true:false;
+        b_bool = luaL_checkboolean( L, -1 );
         lua_pop( L, 1 );
     }
 



More information about the vlc-commits mailing list