Skip to content

Commit b79da6d

Browse files
authored
Cleanup all the remaining libc refs to use imports (#7)
* Cleanup all the remaining libc refs to use imports * cargo fmt
1 parent b6c5bbb commit b79da6d

File tree

6 files changed

+86
-107
lines changed

6 files changed

+86
-107
lines changed

src/bin/lua.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
use libc::{c_char, c_int};
2+
13
extern "C" {
2-
pub fn lua_main(argc: libc::c_int, argv: *mut *mut libc::c_char) -> libc::c_int;
4+
pub fn lua_main(argc: c_int, argv: *mut *mut c_char) -> c_int;
35
}
46

57
fn main() {
6-
let mut args: Vec<*mut libc::c_char> = Vec::new();
8+
let mut args: Vec<*mut c_char> = Vec::new();
79
for arg in ::std::env::args() {
810
args.push(
911
(::std::ffi::CString::new(arg))
@@ -14,8 +16,8 @@ fn main() {
1416
args.push(::core::ptr::null_mut());
1517
unsafe {
1618
::std::process::exit(lua_main(
17-
(args.len() - 1) as libc::c_int,
18-
args.as_mut_ptr() as *mut *mut libc::c_char,
19+
(args.len() - 1) as c_int,
20+
args.as_mut_ptr() as *mut *mut c_char,
1921
) as i32)
2022
}
2123
}

0 commit comments

Comments
 (0)