Changeset 204 for trunk/src


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
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/formats/md2_loader.cc

    r200 r204  
    357357        uint32 stats_collision  = 0;
    358358
    359         std::vector< sint32 > index_translation( md2->header.num_vertices, -1 );
     359        std::vector< sint32 > index_translation( static_cast< uint32 >( md2->header.num_vertices ), -1 );
    360360
    361361        m_new_indexes.clear();
  • trunk/src/formats/obj_loader.cc

    r198 r204  
    130130};
    131131
    132 std::size_t mesh_obj_reader::add_face( uint32* vi, uint32* ti, uint32* ni, size_t count )
     132size_t mesh_obj_reader::add_face( uint32* vi, uint32* ti, uint32* ni, size_t count )
    133133{
    134134        if ( count < 3 )
     
    181181        std::vector< vec4 >& tg = m_tangent->get();
    182182
    183         std::size_t count  = vp.size();
    184         std::size_t tcount = count / 3;
     183        size_t count  = vp.size();
     184        size_t tcount = count / 3;
    185185
    186186        std::vector< vec3 > tan1( count );
     
    188188        tg.resize( count );
    189189
    190         for (std::size_t a = 0; a < tcount; ++a )
    191         {
    192                 uint32 i1 = a * 3;
    193                 uint32 i2 = a * 3 + 1;
    194                 uint32 i3 = a * 3 + 2;
     190        for (size_t a = 0; a < tcount; ++a )
     191        {
     192                size_t i1 = a * 3;
     193                size_t i2 = a * 3 + 1;
     194                size_t i3 = a * 3 + 2;
    195195
    196196                // TODO: simplify
  • trunk/src/gfx/keyframed_mesh.cc

    r183 r204  
    5858}
    5959
    60 uint32 keyframed_mesh::get_max_frames() const
     60size_t keyframed_mesh::get_max_frames() const
    6161{
    6262        return m_data->get_frame_count();
     
    122122void nv::keyframed_mesh::draw( render_state& rstate )
    123123{
    124         nv::uint32 vtx_count = m_data->get_vertex_count();
     124        size_t vtx_count = m_data->get_vertex_count();
    125125        if ( m_gpu_last_frame != m_last_frame )
    126126        {
  • trunk/src/gl/gl_texture2d.cc

    r160 r204  
    4444void nv::gl_texture2d::bind( size_t slot )
    4545{
    46         glActiveTexture( GL_TEXTURE0 + slot );
     46        glActiveTexture( GL_TEXTURE0 + static_cast< GLenum >( slot ) );
    4747        glBindTexture( GL_TEXTURE_2D, m_name.get_value() );
    4848}
  • trunk/src/gui/gui_style.cc

    r121 r204  
    4848        lua::stack_guard guard( m_lua );
    4949        if ( !resolve( e, entry, LUA_TNUMBER ) ) return false;
    50         i = lua_tointeger( m_lua, -1 );
     50        i = static_cast< int >( lua_tointeger( m_lua, -1 ) );
    5151        return true;
    5252}
  • trunk/src/lib/gl.cc

    r170 r204  
    3737                *(void **) (&ext_loader) = gl_library.get("wglGetProcAddress");
    3838#               define NV_GL_LOAD_EXT( symbol ) *(void **) (&symbol) = ext_loader(#symbol);
    39 #       elif NV_PLATFORM == NV_LINUX
     39#       elif (NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE)
    4040#               define NV_GL_LOAD( symbol ) *(void **) (&symbol) = gl_library.get(#symbol);
    4141                *(void **) (&ext_loader) = gl_library.get("glXGetProcAddress");
  • trunk/src/logger.cc

    r121 r204  
    229229#if NV_PLATFORM == NV_WINDOWS
    230230        m_handle = GetStdHandle( STD_OUTPUT_HANDLE );
     231#else
     232  NV_UNUSED( m_handle );
    231233#endif
    232234}
  • 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.