Skip to content

Commit 1791046

Browse files
committed
Use isize/usize
1 parent a6b8521 commit 1791046

File tree

14 files changed

+226
-293
lines changed

14 files changed

+226
-293
lines changed

src/lib.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! Crate docs
1212
13-
#![allow(bad_style, raw_pointer_derive)]
13+
#![allow(bad_style, raw_pointer_derive, improper_ctypes)]
1414
#![cfg_attr(dox, feature(no_core, lang_items))]
1515
#![cfg_attr(dox, no_core)]
1616
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@ -77,6 +77,25 @@ pub type uint16_t = u16;
7777
pub type uint32_t = u32;
7878
pub type uint64_t = u64;
7979

80+
pub type c_schar = i8;
81+
pub type c_uchar = u8;
82+
pub type c_short = i16;
83+
pub type c_ushort = u16;
84+
pub type c_int = i32;
85+
pub type c_uint = u32;
86+
pub type c_float = f32;
87+
pub type c_double = f64;
88+
pub type c_longlong = i64;
89+
pub type c_ulonglong = u64;
90+
pub type intmax_t = i64;
91+
pub type uintmax_t = u64;
92+
93+
pub type size_t = usize;
94+
pub type ptrdiff_t = isize;
95+
pub type intptr_t = isize;
96+
pub type uintptr_t = usize;
97+
pub type ssize_t = isize;
98+
8099
pub enum FILE {}
81100
pub enum fpos_t {}
82101
pub enum DIR {}

src/unix/bsd/apple/b32.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
33
pub type c_long = i32;
44
pub type c_ulong = u32;
5-
pub type size_t = u32;
6-
pub type ptrdiff_t = i32;
7-
pub type intptr_t = i32;
8-
pub type uintptr_t = u32;
95

106
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
117
pub const __PTHREAD_COND_SIZE__: usize = 24;

src/unix/bsd/apple/b64.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
33
pub type c_long = i64;
44
pub type c_ulong = u64;
5-
pub type size_t = u64;
6-
pub type ptrdiff_t = i64;
7-
pub type intptr_t = i64;
8-
pub type uintptr_t = u64;
95

106
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
117
pub const __PTHREAD_COND_SIZE__: usize = 40;

src/unix/bsd/apple/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub type suseconds_t = i32;
88
pub type dev_t = i32;
99
pub type ino_t = u64;
1010
pub type mode_t = u16;
11-
pub type ssize_t = c_long;
1211
pub type nlink_t = u16;
1312
pub type blksize_t = i32;
1413
pub type rlim_t = u64;

src/unix/bsd/freebsdlike/x86.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
pub type c_long = i32;
22
pub type c_ulong = u32;
3-
pub type size_t = u32;
4-
pub type ptrdiff_t = i32;
53
pub type time_t = i32;
64
pub type suseconds_t = i32;
7-
pub type intptr_t = i32;
8-
pub type uintptr_t = u32;
9-
pub type ssize_t = i32;
105

116
s! {
127
pub struct stat {

src/unix/bsd/freebsdlike/x86_64.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
pub type c_long = i64;
22
pub type c_ulong = u64;
3-
pub type size_t = u64;
4-
pub type ptrdiff_t = i64;
53
pub type time_t = i64;
64
pub type suseconds_t = i64;
7-
pub type intptr_t = i64;
8-
pub type uintptr_t = u64;
9-
pub type ssize_t = i64;
105

116
s! {
127
pub struct stat {

src/unix/bsd/openbsdlike/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
pub type c_long = i64;
22
pub type c_ulong = u64;
3-
pub type size_t = u64;
4-
pub type ptrdiff_t = i64;
53
pub type clock_t = i64;
64
pub type time_t = i64;
75
pub type suseconds_t = i64;
8-
pub type intptr_t = i64;
9-
pub type uintptr_t = u64;
106
pub type dev_t = i32;
117
pub type mode_t = u32;
12-
pub type ssize_t = c_long;
138
pub type nlink_t = uint32_t;
149
pub type blksize_t = uint32_t;
1510
pub type ino_t = uint64_t;

0 commit comments

Comments
 (0)