Skip to content

Commit 5d33f9d

Browse files
committed
mem: Use core::ffi::c_int
This alias was added in 9897bfb ("Fix memset arguments for MSP430 target"), which predates `core::ffi`. Now that it exists we can just use `core::ffi::c_int`.
1 parent 59b329a commit 5d33f9d

File tree

1 file changed

+1
-8
lines changed
  • compiler-builtins/src/mem

1 file changed

+1
-8
lines changed

compiler-builtins/src/mem/mod.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
// FIXME(e2024): this eventually needs to be removed.
44
#![allow(unsafe_op_in_unsafe_fn)]
55

6-
#[allow(warnings)]
7-
#[cfg(target_pointer_width = "16")]
8-
type c_int = i16;
9-
#[allow(warnings)]
10-
#[cfg(not(target_pointer_width = "16"))]
11-
type c_int = i32;
12-
136
// memcpy/memmove/memset have optimized implementations on some architectures
147
#[cfg_attr(
158
all(not(feature = "no-asm"), target_arch = "x86_64"),
@@ -38,7 +31,7 @@ intrinsics! {
3831
}
3932

4033
#[mem_builtin]
41-
pub unsafe extern "C" fn memset(s: *mut u8, c: crate::mem::c_int, n: usize) -> *mut u8 {
34+
pub unsafe extern "C" fn memset(s: *mut u8, c: core::ffi::c_int, n: usize) -> *mut u8 {
4235
impls::set_bytes(s, c as u8, n);
4336
s
4437
}

0 commit comments

Comments
 (0)