Fix warnings
This commit is contained in:
@@ -16,17 +16,17 @@ unsafe impl Sync for GlobalFile {}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn __stdin() -> *mut FILE {
|
||||
unsafe { default_stdin.get() }
|
||||
default_stdin.get()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn __stdout() -> *mut FILE {
|
||||
unsafe { default_stdout.get() }
|
||||
default_stdout.get()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn __stderr() -> *mut FILE {
|
||||
unsafe { default_stderr.get() }
|
||||
default_stderr.get()
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::constants::*;
|
||||
use super::{internal, BUFSIZ, FILE, UNGET};
|
||||
use super::{BUFSIZ, FILE, UNGET};
|
||||
use core::sync::atomic::AtomicBool;
|
||||
use core::{mem, ptr};
|
||||
use core::mem;
|
||||
use errno;
|
||||
use fcntl::*;
|
||||
use platform;
|
||||
@@ -38,7 +38,6 @@ pub unsafe fn parse_mode_flags(mode_str: *const c_char) -> i32 {
|
||||
|
||||
/// Open a file with the file descriptor `fd` in the mode `mode`
|
||||
pub unsafe fn _fdopen(fd: c_int, mode: *const c_char) -> Option<*mut FILE> {
|
||||
use core::mem::size_of;
|
||||
use string::strchr;
|
||||
if *mode != b'r' as i8 && *mode != b'w' as i8 && *mode != b'a' as i8 {
|
||||
platform::errno = errno::EINVAL;
|
||||
|
||||
@@ -899,7 +899,7 @@ pub unsafe extern "C" fn vfprintf(file: &mut FILE, format: *const c_char, ap: va
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn vprintf(format: *const c_char, ap: va_list) -> c_int {
|
||||
vfprintf(unsafe { &mut *__stdout() }, format, ap)
|
||||
vfprintf(&mut *__stdout(), format, ap)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@@ -928,7 +928,7 @@ pub unsafe extern "C" fn vfscanf(file: &mut FILE, format: *const c_char, ap: va_
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn vscanf(format: *const c_char, ap: va_list) -> c_int {
|
||||
vfscanf(unsafe { &mut *__stdin() }, format, ap)
|
||||
vfscanf(&mut *__stdin(), format, ap)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user