Ignore:
Timestamp:
05/29/15 17:28:16 (10 years ago)
Author:
epyon
Message:
  • oops, missed src : got rid of to_string and other std::string utilities (except slurp) string no longer in nv namespace
File:
1 edited

Legend:

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

    r368 r380  
    1111std::string nlua_typecontent( lua_State* L, int idx )
    1212{
    13         switch ( lua_type( L, idx ) )
     13        int type = lua_type( L, idx );
     14        switch ( type )
    1415        {
    1516        case LUA_TNONE          : return "NONE";
    1617        case LUA_TNIL               : return "NIL";
    1718        case LUA_TBOOLEAN               : return lua_toboolean( L, idx ) == 0 ? "false" : "true";
    18         case LUA_TLIGHTUSERDATA : return nv::to_string( nv::uint64( lua_touserdata( L, idx ) ) );
    19         case LUA_TNUMBER                : return nv::to_string( lua_tonumber( L, idx ) );
     19        //case LUA_TLIGHTUSERDATA       : return std::to_string( nv::uint64( lua_touserdata( L, idx ) ) );
     20        //case LUA_TNUMBER              : return std::to_string( lua_tonumber( L, idx ) );
    2021        case LUA_TSTRING                : return lua_tostring( L, idx );
    2122        case LUA_TTABLE             : return "TABLE";
    2223        case LUA_TFUNCTION              : return "FUNCTION";
    23         case LUA_TUSERDATA              : return nv::to_string( nv::uint64( lua_touserdata( L, idx ) ) );
     24//      case LUA_TUSERDATA              : return std::to_string( nv::uint64( lua_touserdata( L, idx ) ) );
    2425        case LUA_TTHREAD                : return "THREAD";
    25         default : return "UNKNOWN!";
    26         }
     26        default : break;
     27        }
     28        char buffer[64];
     29        if ( type == LUA_TLIGHTUSERDATA || type == LUA_TUSERDATA )
     30        {
     31                size_t l = nv::uint64_to_buffer( nv::uint64( lua_touserdata( L, idx ) ), buffer );
     32                return std::string( buffer, l );
     33        }
     34        else if ( type == LUA_TNUMBER )
     35        {
     36                size_t l = nv::f64_to_buffer( lua_tonumber( L, idx ), buffer );
     37                return std::string( buffer, l );
     38        }
     39        return "UNKNOWN!";
    2740}
    2841
Note: See TracChangeset for help on using the changeset viewer.