From 8fc5973eb21954be39ca48256371bc959047745d Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Thu, 30 Jun 2022 21:33:26 -0400 Subject: [PATCH] Update to upstream libc and fix some clippy lints I still didn't add any `# Safety` docs which was the last clippy lint here. --- Cargo.toml | 4 ++-- src/lib.rs | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b38445a..2785b89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "linker-fix-3ds" -authors = [ "Andrea Ciliberti " ] +authors = ["Andrea Ciliberti "] version = "0.1.0" license = "MIT/Apache 2.0" edition = "2018" [dependencies] ctru-sys = { git = "https://github.com/Meziu/ctru-rs.git" } -libc = { git = "https://github.com/Meziu/libc.git" } +libc = "0.2.126" diff --git a/src/lib.rs b/src/lib.rs index f5836a8..7c90719 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ const ECTRU: libc::c_int = -1; /// Call this somewhere to force Rust to link this module. /// The call doesn't need to execute, just exist. /// -/// See https://github.com/rust-lang/rust/issues/47384 +/// See pub fn init() {} extern "C" { @@ -20,14 +20,12 @@ extern "C" { } #[no_mangle] -pub extern "C" fn posix_memalign( +pub unsafe extern "C" fn posix_memalign( memptr: *mut *mut libc::c_void, align: libc::size_t, size: libc::size_t, ) -> libc::c_int { - unsafe { - *memptr = libc::memalign(align, size); - } + *memptr = libc::memalign(align, size); 0 }