|
2 | 2 | //! |
3 | 3 | //! Based on github.com/keplerproject/lua-compat-5.3 |
4 | 4 |
|
5 | | -use std::mem; |
6 | 5 | use std::os::raw::{c_char, c_int, c_void}; |
7 | | -use std::ptr; |
| 6 | +use std::{mem, ptr}; |
8 | 7 |
|
9 | 8 | use super::lauxlib::*; |
10 | 9 | use super::lua::*; |
@@ -328,12 +327,7 @@ pub unsafe fn lua_setuservalue(L: *mut lua_State, idx: c_int) { |
328 | 327 | } |
329 | 328 |
|
330 | 329 | #[inline(always)] |
331 | | -pub unsafe fn lua_dump( |
332 | | - L: *mut lua_State, |
333 | | - writer: lua_Writer, |
334 | | - data: *mut c_void, |
335 | | - _strip: c_int, |
336 | | -) -> c_int { |
| 330 | +pub unsafe fn lua_dump(L: *mut lua_State, writer: lua_Writer, data: *mut c_void, _strip: c_int) -> c_int { |
337 | 331 | lua_dump_(L, writer, data) |
338 | 332 | } |
339 | 333 |
|
@@ -365,12 +359,7 @@ pub unsafe fn lua_pushglobaltable(L: *mut lua_State) { |
365 | 359 | } |
366 | 360 |
|
367 | 361 | #[inline(always)] |
368 | | -pub unsafe fn lua_resume( |
369 | | - L: *mut lua_State, |
370 | | - _from: *mut lua_State, |
371 | | - narg: c_int, |
372 | | - nres: *mut c_int, |
373 | | -) -> c_int { |
| 362 | +pub unsafe fn lua_resume(L: *mut lua_State, _from: *mut lua_State, narg: c_int, nres: *mut c_int) -> c_int { |
374 | 363 | let ret = lua_resume_(L, narg); |
375 | 364 | if (ret == LUA_OK || ret == LUA_YIELD) && !(nres.is_null()) { |
376 | 365 | *nres = lua_gettop(L); |
@@ -446,12 +435,7 @@ pub unsafe fn luaL_len(L: *mut lua_State, idx: c_int) -> lua_Integer { |
446 | 435 | res |
447 | 436 | } |
448 | 437 |
|
449 | | -pub unsafe fn luaL_traceback( |
450 | | - L: *mut lua_State, |
451 | | - L1: *mut lua_State, |
452 | | - msg: *const c_char, |
453 | | - mut level: c_int, |
454 | | -) { |
| 438 | +pub unsafe fn luaL_traceback(L: *mut lua_State, L1: *mut lua_State, msg: *const c_char, mut level: c_int) { |
455 | 439 | let mut ar: lua_Debug = mem::zeroed(); |
456 | 440 | let top = lua_gettop(L); |
457 | 441 | let numlevels = compat53_countlevels(L1); |
@@ -543,12 +527,7 @@ pub unsafe fn luaL_getsubtable(L: *mut lua_State, idx: c_int, fname: *const c_ch |
543 | 527 | 0 |
544 | 528 | } |
545 | 529 |
|
546 | | -pub unsafe fn luaL_requiref( |
547 | | - L: *mut lua_State, |
548 | | - modname: *const c_char, |
549 | | - openf: lua_CFunction, |
550 | | - glb: c_int, |
551 | | -) { |
| 530 | +pub unsafe fn luaL_requiref(L: *mut lua_State, modname: *const c_char, openf: lua_CFunction, glb: c_int) { |
552 | 531 | luaL_checkstack(L, 3, cstr!("not enough stack slots available")); |
553 | 532 | luaL_getsubtable(L, LUA_REGISTRYINDEX, cstr!("_LOADED")); |
554 | 533 | if lua_getfield(L, -1, modname) == LUA_TNIL { |
|
0 commit comments