Skip to content

Commit 1ee6fa6

Browse files
committed
Use correct integer types in version
1 parent b60f6ce commit 1ee6fa6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/sdl2/version.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ pub use sys::version as ll;
1111
#[derive(PartialEq, Copy, Clone)]
1212
pub struct Version {
1313
/// major version
14-
pub major: isize,
14+
pub major: u8,
1515
/// minor version
16-
pub minor: isize,
16+
pub minor: u8,
1717
/// update version (patchlevel)
18-
pub patch: isize,
18+
pub patch: u8,
1919
}
2020

2121
impl Version {
2222
/// Convert a raw *SDL_version to Version.
2323
pub fn from_ll(sv: *const ll::SDL_version) -> Version {
2424
unsafe {
2525
let ref v = *sv;
26-
Version{ major: v.major as isize, minor: v.minor as isize, patch: v.patch as isize }
26+
Version{ major: v.major, minor: v.minor, patch: v.patch }
2727
}
2828
}
2929
}
@@ -52,8 +52,8 @@ pub fn get_revision() -> String {
5252
}
5353

5454
/// Get the revision number of SDL that is linked against your program.
55-
pub fn get_revision_number() -> isize {
55+
pub fn get_revision_number() -> i32 {
5656
unsafe {
57-
ll::SDL_GetRevisionNumber() as isize
57+
ll::SDL_GetRevisionNumber()
5858
}
5959
}

0 commit comments

Comments
 (0)