File tree 4 files changed +25
-25
lines changed
4 files changed +25
-25
lines changed Original file line number Diff line number Diff line change 1
1
pub use sys:: cpuinfo as ll;
2
2
3
- pub const CACHELINESIZE : isize = 128 ;
3
+ pub const CACHELINESIZE : u8 = 128 ;
4
4
5
- pub fn get_cpu_count ( ) -> isize {
6
- unsafe { ll:: SDL_GetCPUCount ( ) as isize }
5
+ pub fn get_cpu_count ( ) -> i32 {
6
+ unsafe { ll:: SDL_GetCPUCount ( ) }
7
7
}
8
8
9
- pub fn get_cpu_cache_line_size ( ) -> isize {
10
- unsafe { ll:: SDL_GetCPUCacheLineSize ( ) as isize }
9
+ pub fn get_cpu_cache_line_size ( ) -> i32 {
10
+ unsafe { ll:: SDL_GetCPUCacheLineSize ( ) }
11
11
}
12
12
13
13
pub fn has_rdtsc ( ) -> bool {
@@ -50,6 +50,6 @@ pub fn has_avx() -> bool {
50
50
unsafe { ll:: SDL_HasAVX ( ) == 1 }
51
51
}
52
52
53
- pub fn get_system_ram ( ) -> isize {
54
- unsafe { ll:: SDL_GetSystemRAM ( ) as isize }
53
+ pub fn get_system_ram ( ) -> i32 {
54
+ unsafe { ll:: SDL_GetSystemRAM ( ) }
55
55
}
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ use libc::{uint32_t, c_void};
2
2
3
3
pub use sys:: timer as ll;
4
4
5
- pub fn get_ticks ( ) -> usize {
6
- unsafe { ll:: SDL_GetTicks ( ) as usize }
5
+ pub fn get_ticks ( ) -> u32 {
6
+ unsafe { ll:: SDL_GetTicks ( ) }
7
7
}
8
8
9
9
pub fn get_performance_counter ( ) -> u64 {
@@ -14,8 +14,8 @@ pub fn get_performance_frequency() -> u64 {
14
14
unsafe { ll:: SDL_GetPerformanceFrequency ( ) }
15
15
}
16
16
17
- pub fn delay ( ms : usize ) {
18
- unsafe { ll:: SDL_Delay ( ms as u32 ) }
17
+ pub fn delay ( ms : u32 ) {
18
+ unsafe { ll:: SDL_Delay ( ms) }
19
19
}
20
20
21
21
pub type TimerCallback = extern "C" fn ( interval : uint32_t , param : * const c_void ) -> u32 ;
Original file line number Diff line number Diff line change @@ -5,20 +5,20 @@ pub use sys::touch as ll;
5
5
pub type Finger = ll:: Finger ;
6
6
pub type TouchDevice = ll:: TouchDevice ;
7
7
8
- pub fn get_num_touch_devices ( ) -> isize {
9
- unsafe { ll:: SDL_GetNumTouchDevices ( ) as isize }
8
+ pub fn get_num_touch_devices ( ) -> i32 {
9
+ unsafe { ll:: SDL_GetNumTouchDevices ( ) }
10
10
}
11
11
12
- pub fn get_touch_device ( index : isize ) -> TouchDevice {
13
- unsafe { ll:: SDL_GetTouchDevice ( index as i32 ) }
12
+ pub fn get_touch_device ( index : i32 ) -> TouchDevice {
13
+ unsafe { ll:: SDL_GetTouchDevice ( index) }
14
14
}
15
15
16
- pub fn get_num_touch_fingers ( touch : TouchDevice ) -> isize {
17
- unsafe { ll:: SDL_GetNumTouchFingers ( touch) as isize }
16
+ pub fn get_num_touch_fingers ( touch : TouchDevice ) -> i32 {
17
+ unsafe { ll:: SDL_GetNumTouchFingers ( touch) }
18
18
}
19
19
20
- pub fn get_touch_finger ( touch : TouchDevice , index : isize ) -> Option < Finger > {
21
- let raw = unsafe { ll:: SDL_GetTouchFinger ( touch, index as i32 ) } ;
20
+ pub fn get_touch_finger ( touch : TouchDevice , index : i32 ) -> Option < Finger > {
21
+ let raw = unsafe { ll:: SDL_GetTouchFinger ( touch, index) } ;
22
22
23
23
if raw == ptr:: null ( ) {
24
24
None
Original file line number Diff line number Diff line change @@ -11,19 +11,19 @@ pub use sys::version as ll;
11
11
#[ derive( PartialEq , Copy , Clone ) ]
12
12
pub struct Version {
13
13
/// major version
14
- pub major : isize ,
14
+ pub major : u8 ,
15
15
/// minor version
16
- pub minor : isize ,
16
+ pub minor : u8 ,
17
17
/// update version (patchlevel)
18
- pub patch : isize ,
18
+ pub patch : u8 ,
19
19
}
20
20
21
21
impl Version {
22
22
/// Convert a raw *SDL_version to Version.
23
23
pub fn from_ll ( sv : * const ll:: SDL_version ) -> Version {
24
24
unsafe {
25
25
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 }
27
27
}
28
28
}
29
29
}
@@ -52,8 +52,8 @@ pub fn get_revision() -> String {
52
52
}
53
53
54
54
/// 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 {
56
56
unsafe {
57
- ll:: SDL_GetRevisionNumber ( ) as isize
57
+ ll:: SDL_GetRevisionNumber ( )
58
58
}
59
59
}
You can’t perform that action at this time.
0 commit comments