Merge pull request #6 from sajattack/master

wrap all function parameters in Options
This commit is contained in:
Jeremy Soller
2018-03-03 21:04:12 -07:00
committed by GitHub
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -39,7 +39,7 @@ pub extern "C" fn abs(i: c_int) -> c_int {
}
#[no_mangle]
pub unsafe extern "C" fn atexit(func: extern "C" fn()) -> c_int {
pub unsafe extern "C" fn atexit(func: Option<extern "C" fn()>) -> c_int {
for i in 0..ATEXIT_FUNCS.len() {
if ATEXIT_FUNCS[i] == 0 {
ATEXIT_FUNCS[i] = func as usize;
@@ -66,7 +66,7 @@ pub extern "C" fn atol(s: *const c_char) -> c_long {
}
#[no_mangle]
pub extern "C" fn bsearch(key: *const c_void, base: *const c_void, nel: size_t, width: size_t, compar: extern "C" fn(*const c_void, *const c_void) -> c_int) -> *mut c_void {
pub extern "C" fn bsearch(key: *const c_void, base: *const c_void, nel: size_t, width: size_t, compar: Option<extern "C" fn(*const c_void, *const c_void)> -> c_int) -> *mut c_void {
unimplemented!();
}
@@ -265,7 +265,7 @@ pub extern "C" fn putenv(s: *mut c_char) -> c_int {
}
#[no_mangle]
pub extern "C" fn qsort(base: *mut c_void, nel: size_t, width: size_t, compar: extern "C" fn(*const c_void, *const c_void) -> c_int) {
pub extern "C" fn qsort(base: *mut c_void, nel: size_t, width: size_t, compar: Option<extern "C" fn(*const c_void, *const c_void)> -> c_int) {
unimplemented!();
}
+3 -3
View File
@@ -215,7 +215,7 @@ pub extern "C" fn pthread_condattr_setpshared(
pub extern "C" fn pthread_create(
thread: *mut pthread_t,
attr: *const pthread_attr_t,
start_routine: ::std::option::Option<unsafe extern "C" fn(arg1: *mut libc::c_void) -> *mut libc::c_void>,
start_routine: Option<unsafe extern "C" fn(arg1: *mut libc::c_void) -> *mut libc::c_void>,
arg: *mut libc::c_void,
) -> libc::c_int {
unimplemented!();
@@ -263,7 +263,7 @@ pub extern "C" fn pthread_join(thread: pthread_t, value_ptr: *mut *mut libc::c_v
#[no_mangle]
pub extern "C" fn pthread_key_create(
key: *mut pthread_key_t,
destructor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut libc::c_void)>,
destructor: Option<unsafe extern "C" fn(arg1: *mut libc::c_void)>,
) -> libc::c_int {
unimplemented!();
}
@@ -395,7 +395,7 @@ pub extern "C" fn pthread_mutexattr_settype(
#[no_mangle]
pub extern "C" fn pthread_once(
once_control: *mut pthread_once_t,
init_routine: ::std::option::Option<unsafe extern "C" fn()>,
init_routine: Option<unsafe extern "C" fn()>,
) -> libc::c_int {
unimplemented!();
}
+1 -1
View File
@@ -310,7 +310,7 @@ pub extern "C" fn pread(fildes: c_int, buf: *mut c_void, nbyte: size_t, offset:
}
#[no_mangle]
pub extern "C" fn pthread_atfork(prepare: extern "C" fn(), parent: extern "C" fn(), child: extern "C" fn()) -> c_int {
pub extern "C" fn pthread_atfork(prepare: Option<extern "C" fn()>, parent: Option<extern "C" fn()>, child: Option<extern "C" fn()>) -> c_int {
unimplemented!();
}