Commit a50d13ab authored by Rémi Duraffort's avatar Rémi Duraffort

lua: use var_ToggleBool.

parent 7046783c
...@@ -254,16 +254,15 @@ int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj, ...@@ -254,16 +254,15 @@ int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
if( lua_gettop( L ) > 1 ) return vlclua_error( L ); if( lua_gettop( L ) > 1 ) return vlclua_error( L );
if( lua_gettop( L ) == 0 ) if( lua_gettop( L ) == 0 )
b_bool = !var_GetBool( p_obj, psz_name ); b_bool = var_ToggleBool( p_obj, psz_name );
else /* lua_gettop( L ) == 1 */ else /* lua_gettop( L ) == 1 */
{ {
b_bool = luaL_checkboolean( L, -1 ); b_bool = luaL_checkboolean( L, -1 );
lua_pop( L, 1 ); lua_pop( L, 1 );
if( b_bool != var_GetBool( p_obj, psz_name ) )
var_SetBool( p_obj, psz_name, b_bool );
} }
if( b_bool != var_GetBool( p_obj, psz_name ) )
var_SetBool( p_obj, psz_name, b_bool );
lua_pushboolean( L, b_bool ); lua_pushboolean( L, b_bool );
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment