Fix warnings

This commit is contained in:
Jeremy Soller
2018-07-13 09:52:53 -06:00
parent 52e02286f2
commit 4c4ce80fcd
8 changed files with 15 additions and 21 deletions
+3 -3
View File
@@ -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! {
+2 -3
View File
@@ -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;
+2 -2
View File
@@ -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]