Browse Source

Merge pull request #90 from rust3ds/refresh

Refresh libctru to the latest version
pull/92/head
Meziu 2 years ago committed by GitHub
parent
commit
3939f0c57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ctru-rs/src/linear.rs
  2. 4
      ctru-rs/src/services/ps.rs
  3. 6
      ctru-sys/bindgen.sh
  4. 9755
      ctru-sys/src/bindings.rs

3
ctru-rs/src/linear.rs

@ -29,8 +29,7 @@ impl LinearAllocator { @@ -29,8 +29,7 @@ impl LinearAllocator {
unsafe impl Allocator for LinearAllocator {
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
let pointer =
unsafe { ctru_sys::linearMemAlign(layout.size() as u32, layout.align() as u32) };
let pointer = unsafe { ctru_sys::linearMemAlign(layout.size(), layout.align()) };
NonNull::new(pointer.cast())
.map(|ptr| NonNull::slice_from_raw_parts(ptr, layout.size()))

4
ctru-rs/src/services/ps.rs

@ -45,9 +45,7 @@ pub fn device_id() -> crate::Result<u32> { @@ -45,9 +45,7 @@ pub fn device_id() -> crate::Result<u32> {
}
pub fn generate_random_bytes(out: &mut [u8]) -> crate::Result<()> {
ResultCode(unsafe {
ctru_sys::PS_GenerateRandomBytes(out as *mut _ as *mut _, out.len() as u32)
})?;
ResultCode(unsafe { ctru_sys::PS_GenerateRandomBytes(out as *mut _ as *mut _, out.len()) })?;
Ok(())
}

6
ctru-sys/bindgen.sh

@ -11,9 +11,9 @@ bindgen "$DEVKITPRO/libctru/include/3ds.h" \ @@ -11,9 +11,9 @@ bindgen "$DEVKITPRO/libctru/include/3ds.h" \
--ctypes-prefix "::libc" \
--no-prepend-enum-name \
--generate "functions,types,vars" \
--blacklist-type "u(8|16|32|64)" \
--blacklist-type "__builtin_va_list" \
--blacklist-type "__va_list" \
--blocklist-type "u(8|16|32|64)" \
--blocklist-type "__builtin_va_list" \
--blocklist-type "__va_list" \
--opaque-type "MiiData" \
--with-derive-default \
-- \

9755
ctru-sys/src/bindings.rs

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save