Changeset 204 for trunk/src/lua


Ignore:
Timestamp:
08/17/13 21:22:56 (12 years ago)
Author:
cahir
Message:

Fix warnings on MacOSX 64-bit with clang 3.3

Location:
trunk/src/lua
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_area.cc

    r198 r204  
    194194static int nlua_area_corners_closure( lua_State* L )
    195195{
    196         int index = lua_tointeger( L, lua_upvalueindex(2) ) + 1;
     196        int index = static_cast< int >( lua_tointeger( L, lua_upvalueindex(2) ) + 1 );
    197197        lua_pushinteger( L, index );
    198198        lua_replace( L, lua_upvalueindex(2) ); // update
     
    223223{
    224224        nv::rectangle* a = nlua_to_parea( L, 1 );
    225         a->shrink( lua_tointeger( L, 2 ) );
     225        a->shrink( static_cast< int >( lua_tointeger( L, 2 ) ) );
    226226        return 0;
    227227}
     
    230230{
    231231        nv::rectangle* a = nlua_to_parea( L, 1 );
    232         nlua_push_area( L, a->shrinked( lua_tointeger( L, 2 ) ) );
     232        nlua_push_area( L, a->shrinked( static_cast< int >( lua_tointeger( L, 2 ) ) ) );
    233233        return 1;
    234234}
     
    237237{
    238238        nv::rectangle* a = nlua_to_parea( L, 1 );
    239         a->expand( lua_tointeger( L, 2 ) );
     239        a->expand( static_cast< int >( lua_tointeger( L, 2 ) ) );
    240240        return 0;
    241241}
     
    244244{
    245245        nv::rectangle* a = nlua_to_parea( L, 1 );
    246         nlua_push_area( L, a->expanded( lua_tointeger( L, 2 ) ) );
     246        nlua_push_area( L, a->expanded( static_cast< int >( lua_tointeger( L, 2 ) ) ) );
    247247        return 1;
    248248}
     
    327327{
    328328        nv::ivec2 c = nlua_to_coord( L, 1 );
    329         int amount = lua_tointeger( L, 1 );
     329        int amount = static_cast< int >( lua_tointeger( L, 1 ) );
    330330        nv::ivec2 shift( amount, amount );
    331331        nlua_push_area( L, nv::rectangle( c - shift, c + shift ) );
  • trunk/src/lua/lua_aux.cc

    r198 r204  
    9191static int nluaaux_math_dieroll( lua_State* L )
    9292{
    93         int dice  = luaL_checkinteger( L,  1 );
    94         int sides = luaL_checkinteger( L,  2 );
     93        lua_Integer dice  = luaL_checkinteger( L,  1 );
     94        lua_Integer sides = luaL_checkinteger( L,  2 );
    9595        if ( dice < 1 )  luaL_argerror( L, 1, "die count lower than 1!" );
    9696        if ( sides < 1 ) luaL_argerror( L, 2, "side count lower than 1!" );
     
    109109                if ( lua_gettop( L ) == 1 )
    110110                {
    111                         int arg1 = luaL_checkinteger( L, 1 );
     111                        lua_Integer arg1 = luaL_checkinteger( L, 1 );
    112112                        if ( arg1 < 1 ) arg1 = 1;
    113113                        lua_pushunsigned( L, nv::random::get().urange( 1, static_cast<nv::uint32>( arg1 ) ) );
     
    115115                else
    116116                {
    117                         int arg1 = luaL_checkinteger( L, 1 );
    118                         int arg2 = luaL_checkinteger( L, 2 );
     117                        int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) );
     118                        int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) );
    119119                        if (arg2 < arg1) std::swap( arg2, arg1 );
    120120                        lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ) );
  • trunk/src/lua/lua_path.cc

    r198 r204  
    4444}
    4545
    46 void lua::path::push( uint32 e )
     46void lua::path::push( size_t e )
    4747{
    4848        m_elements[ m_count ].value  = e;
     
    5151}
    5252
    53 void lua::path::push( uint32 start, uint32 length )
     53void lua::path::push( size_t start, size_t length )
    5454{
    5555        m_elements[ m_count ].value  = start;
     
    5858}
    5959
    60 void lua::path::push( const char* p, uint32 length )
     60void lua::path::push( const char* p, size_t length )
    6161{
    6262        m_elements[ m_count ].value  = m_path.length();
     
    6666}
    6767
    68 void lua::path::push( const std::string& s, uint32 length )
     68void lua::path::push( const std::string& s, size_t length )
    6969{
    7070        m_elements[ m_count ].value  = m_path.length();
  • trunk/src/lua/lua_state.cc

    r198 r204  
    249249{
    250250        lua_getfield( L->L, -1, element.c_str() );
    251         int result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tointeger( L->L, -1 ) : defval;
    252         lua_pop( L->L, 1 );
    253         return result;
     251        lua_Integer result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tointeger( L->L, -1 ) : defval;
     252        lua_pop( L->L, 1 );
     253        return static_cast< int >( result );
    254254}
    255255
Note: See TracChangeset for help on using the changeset viewer.