Changeset 204 for trunk/src/lua
- Timestamp:
- 08/17/13 21:22:56 (12 years ago)
- Location:
- trunk/src/lua
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_area.cc
r198 r204 194 194 static int nlua_area_corners_closure( lua_State* L ) 195 195 { 196 int index = lua_tointeger( L, lua_upvalueindex(2) ) + 1;196 int index = static_cast< int >( lua_tointeger( L, lua_upvalueindex(2) ) + 1 ); 197 197 lua_pushinteger( L, index ); 198 198 lua_replace( L, lua_upvalueindex(2) ); // update … … 223 223 { 224 224 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 ) ) ); 226 226 return 0; 227 227 } … … 230 230 { 231 231 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 ) ) ) ); 233 233 return 1; 234 234 } … … 237 237 { 238 238 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 ) ) ); 240 240 return 0; 241 241 } … … 244 244 { 245 245 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 ) ) ) ); 247 247 return 1; 248 248 } … … 327 327 { 328 328 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 ) ); 330 330 nv::ivec2 shift( amount, amount ); 331 331 nlua_push_area( L, nv::rectangle( c - shift, c + shift ) ); -
trunk/src/lua/lua_aux.cc
r198 r204 91 91 static int nluaaux_math_dieroll( lua_State* L ) 92 92 { 93 intdice = luaL_checkinteger( L, 1 );94 intsides = luaL_checkinteger( L, 2 );93 lua_Integer dice = luaL_checkinteger( L, 1 ); 94 lua_Integer sides = luaL_checkinteger( L, 2 ); 95 95 if ( dice < 1 ) luaL_argerror( L, 1, "die count lower than 1!" ); 96 96 if ( sides < 1 ) luaL_argerror( L, 2, "side count lower than 1!" ); … … 109 109 if ( lua_gettop( L ) == 1 ) 110 110 { 111 intarg1 = luaL_checkinteger( L, 1 );111 lua_Integer arg1 = luaL_checkinteger( L, 1 ); 112 112 if ( arg1 < 1 ) arg1 = 1; 113 113 lua_pushunsigned( L, nv::random::get().urange( 1, static_cast<nv::uint32>( arg1 ) ) ); … … 115 115 else 116 116 { 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 ) ); 119 119 if (arg2 < arg1) std::swap( arg2, arg1 ); 120 120 lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ) ); -
trunk/src/lua/lua_path.cc
r198 r204 44 44 } 45 45 46 void lua::path::push( uint32e )46 void lua::path::push( size_t e ) 47 47 { 48 48 m_elements[ m_count ].value = e; … … 51 51 } 52 52 53 void lua::path::push( uint32 start, uint32length )53 void lua::path::push( size_t start, size_t length ) 54 54 { 55 55 m_elements[ m_count ].value = start; … … 58 58 } 59 59 60 void lua::path::push( const char* p, uint32length )60 void lua::path::push( const char* p, size_t length ) 61 61 { 62 62 m_elements[ m_count ].value = m_path.length(); … … 66 66 } 67 67 68 void lua::path::push( const std::string& s, uint32length )68 void lua::path::push( const std::string& s, size_t length ) 69 69 { 70 70 m_elements[ m_count ].value = m_path.length(); -
trunk/src/lua/lua_state.cc
r198 r204 249 249 { 250 250 lua_getfield( L->L, -1, element.c_str() ); 251 intresult = 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 ); 254 254 } 255 255
Note: See TracChangeset
for help on using the changeset viewer.