Skip to content

Commit 9ce2e68

Browse files
committed
Merge pull request #2 from phaylon/fspm-size_t-to-malloc
Pass FPSmanager size as size_t to malloc instead of u64.
2 parents 81c88d5 + e3ead0b commit 9ce2e68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sdl2_gfx/framerate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Framerate control
22
33
use libc;
4-
use libc::{c_void, uint32_t, malloc};
4+
use libc::{c_void, uint32_t, malloc, size_t};
55
use std::mem;
66
use sdl2::SdlResult;
77

@@ -35,7 +35,8 @@ impl FPSManager {
3535
/// Create the framerate manager.
3636
pub fn new() -> FPSManager {
3737
unsafe {
38-
let raw = libc::malloc(mem::size_of::<ll::FPSmanager>() as u64) as *mut ll::FPSmanager;
38+
let size = mem::size_of::<ll::FPSmanager>() as size_t;
39+
let raw = libc::malloc(size) as *mut ll::FPSmanager;
3940
ll::SDL_initFramerate(raw);
4041
FPSManager { raw: raw }
4142
}

0 commit comments

Comments
 (0)