diff --git a/src/header/stdio/constants.rs b/src/header/stdio/constants.rs index 60f8f354b7a4f8d62e38c971d296f776ab2d714b..2adea19182e650b87265dbf2b69de99808d44d1f 100644 --- a/src/header/stdio/constants.rs +++ b/src/header/stdio/constants.rs @@ -1,9 +1,9 @@ use platform::types::*; pub const EOF: c_int = -1; -pub const BUFSIZ: size_t = 1024; +pub const BUFSIZ: c_int = 1024; -pub const UNGET: size_t = 8; +pub const UNGET: c_int = 8; pub const FILENAME_MAX: c_int = 4096; diff --git a/src/header/stdio/default.rs b/src/header/stdio/default.rs index 6014a6ccf134cd620700ebd84a13559d8c5d45fc..315d5f7505a4ef2eedc57139b10f5f06ec9105ea 100644 --- a/src/header/stdio/default.rs +++ b/src/header/stdio/default.rs @@ -17,7 +17,7 @@ impl GlobalFile { file, flags: constants::F_PERM | flags, - read_buf: Buffer::Owned(vec![0; BUFSIZ]), + read_buf: Buffer::Owned(vec![0; BUFSIZ as usize]), read_pos: 0, read_size: 0, unget: None, diff --git a/src/header/stdio/mod.rs b/src/header/stdio/mod.rs index 789aaee96125614abd3fb42b6c16d8cf9ddd550c..8c20ba6e0d83403b42b358bace3a10832d6b1b9b 100644 --- a/src/header/stdio/mod.rs +++ b/src/header/stdio/mod.rs @@ -709,7 +709,7 @@ pub extern "C" fn setvbuf(stream: *mut FILE, buf: *mut c_char, mode: c_int, mut // Set a buffer of size `size` if no buffer is given stream.read_buf = if buf.is_null() || size == 0 { if size == 0 { - size = BUFSIZ; + size = BUFSIZ as usize; } // TODO: Make it unbuffered if _IONBF // if mode == _IONBF {