mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
rust: use std::ffi instead of std::os::raw
This is allowed since Rust 1.64.0. Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e0b2b74f70
commit
e4fb0be1d1
12 changed files with 20 additions and 18 deletions
|
@ -10,11 +10,10 @@
|
|||
//! called.
|
||||
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
ffi::{c_int, c_void, CStr},
|
||||
fmt::{self, Debug},
|
||||
io::{self, ErrorKind, Write},
|
||||
marker::PhantomPinned,
|
||||
os::raw::{c_int, c_void},
|
||||
ptr::addr_of_mut,
|
||||
slice,
|
||||
};
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
|
||||
//! Bindings for interrupt sources
|
||||
|
||||
use std::{ffi::CStr, marker::PhantomData, os::raw::c_int, ptr};
|
||||
use std::{
|
||||
ffi::{c_int, CStr},
|
||||
marker::PhantomData,
|
||||
ptr,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
bindings::{self, qemu_set_irq},
|
||||
|
|
|
@ -33,7 +33,7 @@ pub mod zeroable;
|
|||
|
||||
use std::{
|
||||
alloc::{GlobalAlloc, Layout},
|
||||
os::raw::c_void,
|
||||
ffi::c_void,
|
||||
};
|
||||
|
||||
#[cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)]
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
//! Bindings for `MemoryRegion`, `MemoryRegionOps` and `MemTxAttrs`
|
||||
|
||||
use std::{
|
||||
ffi::{CStr, CString},
|
||||
ffi::{c_uint, c_void, CStr, CString},
|
||||
marker::PhantomData,
|
||||
os::raw::{c_uint, c_void},
|
||||
};
|
||||
|
||||
pub use bindings::{hwaddr, MemTxAttrs};
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
//! Bindings to create devices and access device functionality from Rust.
|
||||
|
||||
use std::{
|
||||
ffi::{CStr, CString},
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void, CStr, CString},
|
||||
ptr::NonNull,
|
||||
};
|
||||
|
||||
|
|
|
@ -93,11 +93,10 @@
|
|||
//! without incurring into violations of orphan rules for traits.
|
||||
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
ffi::{c_void, CStr},
|
||||
fmt,
|
||||
mem::ManuallyDrop,
|
||||
ops::{Deref, DerefMut},
|
||||
os::raw::c_void,
|
||||
ptr::NonNull,
|
||||
};
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use std::{
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void},
|
||||
pin::Pin,
|
||||
};
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//! functionality that is missing from `vmstate_of!`.
|
||||
|
||||
use core::{marker::PhantomData, mem, ptr::NonNull};
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use std::ffi::{c_int, c_void};
|
||||
|
||||
pub use crate::bindings::{VMStateDescription, VMStateField};
|
||||
use crate::{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue