Skip to content

Commit 00dace8

Browse files
author
Jameson Ernst
committed
Change int/uint to isize/usize
1 parent 36d2e86 commit 00dace8

16 files changed

+303
-303
lines changed

src/sdl2/audio.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ pub const AUDIOF32SYS : AudioFormat = ll::AUDIO_F32SYS;
3636
#[repr(C)]
3737
#[derive(Copy, Clone, PartialEq, Hash, Show, FromPrimitive)]
3838
pub enum AudioStatus {
39-
Stopped = ll::SDL_AUDIO_STOPPED as int,
40-
Playing = ll::SDL_AUDIO_PLAYING as int,
41-
Paused = ll::SDL_AUDIO_PAUSED as int,
39+
Stopped = ll::SDL_AUDIO_STOPPED as isize,
40+
Playing = ll::SDL_AUDIO_PLAYING as isize,
41+
Paused = ll::SDL_AUDIO_PAUSED as isize,
4242
}
4343

44-
pub fn get_num_audio_drivers() -> int {
45-
unsafe { ll::SDL_GetNumAudioDrivers() as int }
44+
pub fn get_num_audio_drivers() -> isize {
45+
unsafe { ll::SDL_GetNumAudioDrivers() as isize }
4646
}
4747

48-
pub fn get_audio_driver(index: int) -> String {
48+
pub fn get_audio_driver(index: isize) -> String {
4949
unsafe {
5050
let driver = ll::SDL_GetAudioDriver(index as c_int);
5151
String::from_utf8_lossy(c_str_to_bytes(&driver)).to_string()
5252
}
5353
}
5454

55-
pub fn get_num_audio_devices(iscapture: int) -> int {
56-
unsafe { ll::SDL_GetNumAudioDevices(iscapture as c_int) as int }
55+
pub fn get_num_audio_devices(iscapture: isize) -> isize {
56+
unsafe { ll::SDL_GetNumAudioDevices(iscapture as c_int) as isize }
5757
}
5858

59-
pub fn get_audio_device_name(index: int, iscapture: int) -> String {
59+
pub fn get_audio_device_name(index: isize, iscapture: isize) -> String {
6060
unsafe {
6161
let dev_name = ll::SDL_GetAudioDeviceName(index as c_int, iscapture as c_int);
6262
String::from_utf8_lossy(c_str_to_bytes(&dev_name)).to_string()
@@ -130,7 +130,7 @@ impl AudioSpecWAV {
130130
unsafe {
131131
transmute(Slice {
132132
data: self.audio_buf,
133-
len: self.audio_len as uint
133+
len: self.audio_len as usize
134134
})
135135
}
136136
}
@@ -198,7 +198,7 @@ extern "C" fn audio_callback_marshall<T: AudioFormatNum<T>, CB: AudioCallback<T>
198198
let mut cb_userdata: &mut AudioCallbackUserdata<CB> = transmute(userdata);
199199
let buf: &mut [T] = transmute(Slice {
200200
data: stream,
201-
len: len as uint / size_of::<T>()
201+
len: len as usize / size_of::<T>()
202202
});
203203

204204
cb_userdata.callback.callback(buf);
@@ -346,7 +346,7 @@ impl<CB> AudioDevice<CB> {
346346
pub fn get_status(&self) -> AudioStatus {
347347
unsafe {
348348
let status = ll::SDL_GetAudioDeviceStatus(self.device_id.id());
349-
FromPrimitive::from_int(status as int).unwrap()
349+
FromPrimitive::from_int(status as isize).unwrap()
350350
}
351351
}
352352

src/sdl2/cpuinfo.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
pub use sys::cpuinfo as ll;
22

3-
pub const CACHELINESIZE: int = 128;
3+
pub const CACHELINESIZE: isize = 128;
44

5-
pub fn get_cpu_count() -> int {
6-
unsafe { ll::SDL_GetCPUCount() as int }
5+
pub fn get_cpu_count() -> isize {
6+
unsafe { ll::SDL_GetCPUCount() as isize }
77
}
88

9-
pub fn get_cpu_cache_line_size() -> int {
10-
unsafe { ll::SDL_GetCPUCacheLineSize() as int}
9+
pub fn get_cpu_cache_line_size() -> isize {
10+
unsafe { ll::SDL_GetCPUCacheLineSize() as isize}
1111
}
1212

1313
pub fn has_rdtsc() -> bool {
@@ -50,6 +50,6 @@ pub fn has_avx() -> bool {
5050
unsafe { ll::SDL_HasAVX() == 1 }
5151
}
5252

53-
pub fn get_system_ram() -> int {
54-
unsafe { ll::SDL_GetSystemRAM() as int }
53+
pub fn get_system_ram() -> isize {
54+
unsafe { ll::SDL_GetSystemRAM() as isize }
5555
}

0 commit comments

Comments
 (0)