Skip to content

Commit

Permalink
core: Use c_int where applicable
Browse files Browse the repository at this point in the history
This patch applies those changes from
#69 that affect the core
crate.
  • Loading branch information
robin-nitrokey committed Aug 15, 2024
1 parent 95fd60a commit 85ac816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/fs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::cmp;
use core::{cmp, ffi::c_int};

use bitflags::bitflags;

Expand All @@ -8,7 +8,7 @@ bitflags! {
/// Definition of file open flags which can be mixed and matched as appropriate. These definitions
/// are reminiscent of the ones defined by POSIX.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct FileOpenFlags: i32 {
pub struct FileOpenFlags: c_int {
/// Open file in read only mode.
const READ = 0x1;
/// Open file in write only mode.
Expand Down
2 changes: 1 addition & 1 deletion core/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl SeekFrom {
}
}

pub fn whence(self) -> i32 {
pub fn whence(self) -> c_int {
match self {
SeekFrom::Start(_) => 0,
SeekFrom::End(_) => 2,
Expand Down

0 comments on commit 85ac816

Please sign in to comment.