diff --git modules/lua/demux.c modules/lua/demux.c index b732eebd927ebc6f1153ab092066c87fed812078..dea68fae3756f3dc7ffdf75af87b4f201e2d8dfe 100644 --- modules/lua/demux.c +++ modules/lua/demux.c @@ -52,7 +52,7 @@ struct demux_sys_t static int vlclua_demux_peek( lua_State *L ) { demux_t *p_demux = (demux_t *)vlclua_get_this( L ); - int n = luaL_checkint( L, 1 ); + int n = luaL_checkinteger( L, 1 ); const uint8_t *p_peek; int i_peek = stream_Peek( p_demux->s, &p_peek, n ); @@ -67,7 +67,7 @@ static int vlclua_demux_read( lua_State *L ) { demux_t *p_demux = (demux_t *)vlclua_get_this( L ); const uint8_t *p_read; - int n = luaL_checkint( L, 1 ); + int n = luaL_checkinteger( L, 1 ); int i_read = stream_Peek( p_demux->s, &p_read, n ); if( i_read > 0 ) diff --git modules/lua/libs/configuration.c modules/lua/libs/configuration.c index 7394e52790373d66afb191785b1505b1b9df9d15..41d0a20c4a12ce1ebec1ee9146235987550526f7 100644 --- modules/lua/libs/configuration.c +++ modules/lua/libs/configuration.c @@ -84,7 +84,7 @@ static int vlclua_config_set( lua_State *L ) break; case VLC_VAR_INTEGER: - config_PutInt( p_this, psz_name, luaL_checkint( L, 2 ) ); + config_PutInt( p_this, psz_name, luaL_checkinteger( L, 2 ) ); break; case VLC_VAR_BOOL: diff --git modules/lua/libs/net.c modules/lua/libs/net.c index 92d7b586d6808db0640f60097c1fa70be3b5a6d8..2a5351071b4fa7937e9756bf2ed998ec2a830529 100644 --- modules/lua/libs/net.c +++ modules/lua/libs/net.c @@ -202,7 +202,7 @@ static int vlclua_net_listen_tcp( lua_State *L ) { vlc_object_t *p_this = vlclua_get_this( L ); const char *psz_host = luaL_checkstring( L, 1 ); - int i_port = luaL_checkint( L, 2 ); + int i_port = luaL_checkinteger( L, 2 ); int *pi_fd = net_ListenTCP( p_this, psz_host, i_port ); if( pi_fd == NULL ) return luaL_error( L, "Cannot listen on %s:%d", psz_host, i_port ); @@ -274,7 +274,7 @@ static int vlclua_net_connect_tcp( lua_State *L ) { vlc_object_t *p_this = vlclua_get_this( L ); const char *psz_host = luaL_checkstring( L, 1 ); - int i_port = luaL_checkint( L, 2 ); + int i_port = luaL_checkinteger( L, 2 ); int i_fd = net_Connect( p_this, psz_host, i_port, SOCK_STREAM, IPPROTO_TCP ); lua_pushinteger( L, vlclua_fd_map_safe( L, i_fd ) ); return 1; @@ -282,26 +282,26 @@ static int vlclua_net_connect_tcp( lua_State *L ) static int vlclua_net_close( lua_State *L ) { - int i_fd = luaL_checkint( L, 1 ); + int i_fd = luaL_checkinteger( L, 1 ); vlclua_fd_unmap_safe( L, i_fd ); return 0; } static int vlclua_net_send( lua_State *L ) { - int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); + int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); size_t i_len; const char *psz_buffer = luaL_checklstring( L, 2, &i_len ); - i_len = luaL_optint( L, 3, i_len ); + i_len = luaL_optinteger( L, 3, i_len ); lua_pushinteger( L, (fd != -1) ? send( fd, psz_buffer, i_len, 0 ) : -1 ); return 1; } static int vlclua_net_recv( lua_State *L ) { - int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); - size_t i_len = luaL_optint( L, 2, 1 ); + int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len = luaL_optinteger( L, 2, 1 ); char psz_buffer[i_len]; ssize_t i_ret = (fd != -1) ? recv( fd, psz_buffer, i_len, 0 ) : -1; @@ -382,19 +382,19 @@ static int vlclua_fd_open( lua_State *L ) #ifndef _WIN32 static int vlclua_fd_write( lua_State *L ) { - int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); + int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); size_t i_len; const char *psz_buffer = luaL_checklstring( L, 2, &i_len ); - i_len = luaL_optint( L, 3, i_len ); + i_len = luaL_optinteger( L, 3, i_len ); lua_pushinteger( L, (fd != -1) ? write( fd, psz_buffer, i_len ) : -1 ); return 1; } static int vlclua_fd_read( lua_State *L ) { - int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); - size_t i_len = luaL_optint( L, 2, 1 ); + int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len = luaL_optinteger( L, 2, 1 ); char psz_buffer[i_len]; ssize_t i_ret = (fd != -1) ? read( fd, psz_buffer, i_len ) : -1; diff --git modules/lua/libs/osd.c modules/lua/libs/osd.c index 341cd62d03a7d0f605dd1312197253a72be75608..799b1f6b45455eae888dcc29933a0c4497f1daf4 100644 --- modules/lua/libs/osd.c +++ modules/lua/libs/osd.c @@ -67,7 +67,7 @@ static int vlclua_osd_icon( lua_State *L ) { const char *psz_icon = luaL_checkstring( L, 1 ); int i_icon = vlc_osd_icon_from_string( psz_icon ); - int i_chan = luaL_optint( L, 2, SPU_DEFAULT_CHANNEL ); + int i_chan = luaL_optinteger( L, 2, SPU_DEFAULT_CHANNEL ); if( !i_icon ) return luaL_error( L, "\"%s\" is not a valid osd icon.", psz_icon ); @@ -114,9 +114,9 @@ static int vlc_osd_position_from_string( const char *psz_name ) static int vlclua_osd_message( lua_State *L ) { const char *psz_message = luaL_checkstring( L, 1 ); - int i_chan = luaL_optint( L, 2, SPU_DEFAULT_CHANNEL ); + int i_chan = luaL_optinteger( L, 2, SPU_DEFAULT_CHANNEL ); const char *psz_position = luaL_optstring( L, 3, "top-right" ); - mtime_t duration = luaL_optint( L, 4, 1000000 ); + mtime_t duration = luaL_optinteger( L, 4, 1000000 ); input_thread_t *p_input = vlclua_get_input_internal( L ); if( p_input ) @@ -154,10 +154,10 @@ static int vlc_osd_slider_type_from_string( const char *psz_name ) static int vlclua_osd_slider( lua_State *L ) { - int i_position = luaL_checkint( L, 1 ); + int i_position = luaL_checkinteger( L, 1 ); const char *psz_type = luaL_checkstring( L, 2 ); int i_type = vlc_osd_slider_type_from_string( psz_type ); - int i_chan = luaL_optint( L, 3, SPU_DEFAULT_CHANNEL ); + int i_chan = luaL_optinteger( L, 3, SPU_DEFAULT_CHANNEL ); if( !i_type ) return luaL_error( L, "\"%s\" is not a valid slider type.", psz_type ); @@ -198,7 +198,7 @@ static int vlclua_spu_channel_register( lua_State *L ) static int vlclua_spu_channel_clear( lua_State *L ) { - int i_chan = luaL_checkint( L, 1 ); + int i_chan = luaL_checkinteger( L, 1 ); input_thread_t *p_input = vlclua_get_input_internal( L ); if( !p_input ) return luaL_error( L, "Unable to find input." ); diff --git modules/lua/libs/playlist.c modules/lua/libs/playlist.c index cdfd9509b8d6e8fc634d98583e49b0232a34c1ac..5838214523b88860e034340aef40229ac6302e97 100644 --- modules/lua/libs/playlist.c +++ modules/lua/libs/playlist.c @@ -69,7 +69,7 @@ static int vlclua_playlist_next( lua_State * L ) static int vlclua_playlist_skip( lua_State * L ) { - int i_skip = luaL_checkint( L, 1 ); + int i_skip = luaL_checkinteger( L, 1 ); playlist_t *p_playlist = vlclua_get_playlist_internal( L ); playlist_Skip( p_playlist, i_skip ); return 0; @@ -127,7 +127,7 @@ static int vlclua_playlist_random( lua_State * L ) static int vlclua_playlist_gotoitem( lua_State * L ) { - int i_id = luaL_checkint( L, 1 ); + int i_id = luaL_checkinteger( L, 1 ); playlist_t *p_playlist = vlclua_get_playlist_internal( L ); PL_LOCK; int i_ret = playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, @@ -139,7 +139,7 @@ static int vlclua_playlist_gotoitem( lua_State * L ) static int vlclua_playlist_delete( lua_State * L ) { - int i_id = luaL_checkint( L, 1 ); + int i_id = luaL_checkinteger( L, 1 ); playlist_t *p_playlist = vlclua_get_playlist_internal( L ); PL_LOCK; playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id ); @@ -155,8 +155,8 @@ static int vlclua_playlist_delete( lua_State * L ) static int vlclua_playlist_move( lua_State * L ) { - int i_item = luaL_checkint( L, 1 ); - int i_target = luaL_checkint( L, 2 ); + int i_item = luaL_checkinteger( L, 1 ); + int i_target = luaL_checkinteger( L, 2 ); playlist_t *p_playlist = vlclua_get_playlist_internal( L ); PL_LOCK; playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_item ); diff --git modules/lua/libs/stream.c modules/lua/libs/stream.c index 0f9ef8b866fbc7dc9e89c93c1e10d49998f6d864..330df464815384bb0d468b331d4405e02e1be868 100644 --- modules/lua/libs/stream.c +++ modules/lua/libs/stream.c @@ -101,7 +101,7 @@ static int vlclua_stream_read( lua_State *L ) { int i_read; stream_t **pp_stream = (stream_t **)luaL_checkudata( L, 1, "stream" ); - int n = luaL_checkint( L, 2 ); + int n = luaL_checkinteger( L, 2 ); uint8_t *p_read = malloc( n ); if( !p_read ) return vlclua_error( L ); diff --git modules/lua/libs/variables.c modules/lua/libs/variables.c index 7a106af5ec9624fe3148e3035eb238363a60431b..5c64dc5e114092efbee9b33f5065cf7699c98ae3 100644 --- modules/lua/libs/variables.c +++ modules/lua/libs/variables.c @@ -103,7 +103,7 @@ static int vlclua_tovalue( lua_State *L, int i_type, vlc_value_t *val ) val->b_bool = luaL_checkboolean( L, -1 ); break; case VLC_VAR_INTEGER: - val->i_int = luaL_checkint( L, -1 ); + val->i_int = luaL_checkinteger( L, -1 ); break; case VLC_VAR_STRING: val->psz_string = (char*)luaL_checkstring( L, -1 ); /* XXX: Beware, this only stays valid as long as (L,-1) stays in the stack */ diff --git modules/lua/libs/volume.c modules/lua/libs/volume.c index 8e7a392e654054e267345468ef502cccdfddafdd..00fbcab15d21ee25453c516466f56e302aed49fe 100644 --- modules/lua/libs/volume.c +++ modules/lua/libs/volume.c @@ -48,7 +48,7 @@ static int vlclua_volume_set( lua_State *L ) { playlist_t *p_this = vlclua_get_playlist_internal( L ); - int i_volume = luaL_checkint( L, 1 ); + int i_volume = luaL_checkinteger( L, 1 ); if( i_volume < 0 ) i_volume = 0; int i_ret = playlist_VolumeSet( p_this, i_volume/(float)AOUT_VOLUME_DEFAULT ); @@ -68,7 +68,7 @@ static int vlclua_volume_up( lua_State *L ) playlist_t *p_this = vlclua_get_playlist_internal( L ); float volume; - playlist_VolumeUp( p_this, luaL_optint( L, 1, 1 ), &volume ); + playlist_VolumeUp( p_this, luaL_optinteger( L, 1, 1 ), &volume ); lua_pushnumber( L, lroundf(volume * AOUT_VOLUME_DEFAULT) ); return 1; } @@ -78,7 +78,7 @@ static int vlclua_volume_down( lua_State *L ) playlist_t *p_this = vlclua_get_playlist_internal( L ); float volume; - playlist_VolumeDown( p_this, luaL_optint( L, 1, 1 ), &volume ); + playlist_VolumeDown( p_this, luaL_optinteger( L, 1, 1 ), &volume ); lua_pushnumber( L, lroundf(volume * AOUT_VOLUME_DEFAULT) ); return 1; } diff --git modules/lua/libs/win.c modules/lua/libs/win.c index 67f6b930d5fd69f141f295cb434d5ea7ef2ea619..24a84760a928befad091b14ec8508ab785583fc0 100644 --- modules/lua/libs/win.c +++ modules/lua/libs/win.c @@ -123,7 +123,7 @@ static int vlclua_console_init( lua_State *L ) static int vlclua_console_wait( lua_State *L ) { - int i_timeout = luaL_optint( L, 1, 0 ); + int i_timeout = luaL_optinteger( L, 1, 0 ); DWORD status = WaitForSingleObject( GetConsole( L ), i_timeout ); lua_pushboolean( L, status == WAIT_OBJECT_0 ); return 1;