Changeset 435 for trunk/src/lua


Ignore:
Timestamp:
07/22/15 21:00:30 (10 years ago)
Author:
epyon
Message:
  • short_string implementation - first usages
Location:
trunk/src/lua
Files:
2 edited

Legend:

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

    r399 r435  
    8888                {
    8989                        *current++ = '[';
    90                         current += uint32_to_buffer( e.value, current );
     90                        current += uint32_to_buffer( array_ref< char >( current, current - start ), e.value );
    9191                        *current++ = ']';
    9292                        dot = false;
  • trunk/src/lua/lua_raw.cc

    r406 r435  
    2626        default : break;
    2727        }
    28         char buffer[64];
     28        char buffer_data[64];
     29        nv::array_ref< char > buffer( buffer_data, 64 );
    2930        if ( type == LUA_TLIGHTUSERDATA || type == LUA_TUSERDATA )
    3031        {
    31                 size_t l = nv::uint64_to_buffer( nv::uint64( lua_touserdata( L, idx ) ), buffer );
    32                 return std::string( buffer, l );
     32                size_t l = nv::uint64_to_buffer( buffer, nv::uint64( lua_touserdata( L, idx ) ) );
     33                return std::string( buffer_data, l );
    3334        }
    3435        else if ( type == LUA_TNUMBER )
    3536        {
    36                 size_t l = nv::f64_to_buffer( lua_tonumber( L, idx ), buffer );
    37                 return std::string( buffer, l );
     37                size_t l = nv::f64_to_buffer( buffer, lua_tonumber( L, idx ) );
     38                return std::string( buffer_data, l );
    3839        }
    3940        return "UNKNOWN!";
Note: See TracChangeset for help on using the changeset viewer.