Browse Source

Address PR comments

pull/23/head
Ian Chamberlain 3 years ago
parent
commit
b504b6f988
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 2
      ctru-rs/Cargo.toml
  2. 2
      ctru-rs/examples/time_rtc.rs

2
ctru-rs/Cargo.toml

@ -15,6 +15,6 @@ ctru-sys = { path = "../ctru-sys", version = "0.4" } @@ -15,6 +15,6 @@ ctru-sys = { path = "../ctru-sys", version = "0.4" }
const-zero = "0.1.0"
linker-fix-3ds = { git = "https://github.com/Meziu/rust-linker-fix-3ds.git" }
pthread-3ds = { git = "https://github.com/Meziu/pthread-3ds.git" }
libc = { version = "0.2" }
libc = "0.2"
bitflags = "1.0.0"
widestring = "0.2.2"

2
ctru-rs/examples/time_rtc.rs

@ -86,7 +86,7 @@ fn main() { @@ -86,7 +86,7 @@ fn main() {
// Get the current time. ctru_sys bindings should be used rather than
// plain libc ones, for reasons I don't understand yet...
let unix_time: ctru_sys::time_t = unsafe { ctru_sys::time(std::ptr::null_mut()) };
let time = unsafe { ptr::read(ctru_sys::gmtime(&unix_time as *const _)) };
let time = unsafe { *ctru_sys::gmtime(&unix_time as *const _) };
let hours = time.tm_hour;
let minutes = time.tm_min;

Loading…
Cancel
Save