Skip to content

Commit 571df58

Browse files
committed
cleanup: Also mark reserved fields as Padding
Some were already done, more were missing
1 parent f5b7e18 commit 571df58

File tree

42 files changed

+176
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+176
-176
lines changed

src/fuchsia/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ s! {
321321

322322
pub struct sockaddr_vm {
323323
pub svm_family: sa_family_t,
324-
pub svm_reserved1: c_ushort,
324+
svm_reserved1: Padding<c_ushort>,
325325
pub svm_port: crate::in_port_t,
326326
pub svm_cid: c_uint,
327327
pub svm_zero: [u8; 4],
@@ -890,7 +890,7 @@ s! {
890890
pub totalhigh: c_ulong,
891891
pub freehigh: c_ulong,
892892
pub mem_unit: c_uint,
893-
pub __reserved: [c_char; 256],
893+
__reserved: Padding<[c_char; 256]>,
894894
}
895895

896896
pub struct sockaddr_un {

src/new/apple/xnu/mach/i386/_structs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ s! {
4646
}
4747

4848
pub struct __darwin_x86_float_state64 {
49-
pub __fpu_reserved: [c_int; 2],
49+
__fpu_reserved: Padding<[c_int; 2]>,
5050
__fpu_fcw: c_short,
5151
__fpu_fsw: c_short,
5252
pub __fpu_ftw: u8,
@@ -87,6 +87,6 @@ s! {
8787
// FIXME(apple): this field is actually [u8; 96], but defining it with a bigger type allows
8888
// us to auto-implement traits for it since the length of the array is less than 32
8989
__fpu_rsrv4: [u32; 24],
90-
pub __fpu_reserved1: c_int,
90+
__fpu_reserved1: Padding<c_int>,
9191
}
9292
}

src/unix/aix/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ s! {
317317

318318
pub struct xutsname {
319319
pub nid: c_uint,
320-
pub reserved: c_int,
320+
reserved: Padding<c_int>,
321321
pub longnid: c_ulonglong,
322322
}
323323

@@ -368,7 +368,7 @@ s! {
368368
pub struct sched_param {
369369
pub sched_priority: c_int,
370370
pub sched_policy: c_int,
371-
pub sched_reserved: [c_int; 6],
371+
sched_reserved: Padding<[c_int; 6]>,
372372
}
373373

374374
pub struct stack_t {
@@ -423,8 +423,8 @@ s! {
423423
pub ut_exit: exit_status,
424424
pub ut_host: [c_char; 256],
425425
__dbl_word_pad: Padding<c_int>,
426-
pub __reservedA: [c_int; 2],
427-
pub __reservedV: [c_int; 6],
426+
__reservedA: Padding<[c_int; 2]>,
427+
__reservedV: Padding<[c_int; 6]>,
428428
}
429429

430430
pub struct regmatch_t {
@@ -465,8 +465,8 @@ s! {
465465
pub shm_extshm: c_int,
466466
pub shm_pagesize: crate::int64_t,
467467
pub shm_lba: crate::uint64_t,
468-
pub shm_reserved0: crate::int64_t,
469-
pub shm_reserved1: crate::int64_t,
468+
shm_reserved0: Padding<crate::int64_t>,
469+
shm_reserved1: Padding<crate::int64_t>,
470470
}
471471

472472
pub struct stat64 {
@@ -488,7 +488,7 @@ s! {
488488
pub st_vfs: c_uint,
489489
pub st_type: c_uint,
490490
pub st_gen: c_uint,
491-
pub st_reserved: [c_uint; 10],
491+
st_reserved: Padding<[c_uint; 10]>,
492492
pub st_size: off64_t,
493493
}
494494

@@ -508,7 +508,7 @@ s! {
508508
pub cgid: crate::gid_t,
509509
pub mode: mode_t,
510510
pub seq: c_ushort,
511-
pub __reserved: c_ushort,
511+
__reserved: Padding<c_ushort>,
512512
pub key: key_t,
513513
}
514514

@@ -552,7 +552,7 @@ s! {
552552
pub events: c_short,
553553
pub fd: c_int,
554554
pub u: __poll_ctl_ext_u,
555-
pub reserved64: [u64; 6],
555+
reserved64: Padding<[u64; 6]>,
556556
}
557557
}
558558

src/unix/aix/powerpc64.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ s! {
7777
pub st_vfs: c_uint,
7878
pub st_type: c_uint,
7979
pub st_gen: c_uint,
80-
pub st_reserved: [c_uint; 9],
80+
st_reserved: Padding<[c_uint; 9]>,
8181
pub st_padto_ll: c_uint,
8282
pub st_size: off_t,
8383
}
@@ -117,7 +117,7 @@ s! {
117117
pub aio_word2: c_int,
118118
pub aio_fp: c_int,
119119
pub aio_handle: *mut aiocb,
120-
pub aio_reserved: [c_uint; 2],
120+
aio_reserved: Padding<[c_uint; 2]>,
121121
pub aio_sigev_tid: c_long,
122122
}
123123

@@ -191,7 +191,7 @@ s! {
191191
pub __ukeys: [c_uint; 2],
192192
pub __vsx: crate::__vsx_context_t,
193193
pub __tm: crate::__tm_context_t,
194-
pub __reserved: [c_char; 1860],
194+
__reserved: Padding<[c_char; 1860]>,
195195
pub __extctx_magic: c_int,
196196
}
197197

@@ -216,8 +216,8 @@ s! {
216216
pub ut_tv: crate::timeval,
217217
pub ut_host: [c_char; 256],
218218
__dbl_word_pad: Padding<c_int>,
219-
pub __reservedA: [c_int; 2],
220-
pub __reservedV: [c_int; 6],
219+
__reservedA: Padding<[c_int; 2]>,
220+
__reservedV: Padding<[c_int; 6]>,
221221
}
222222

223223
pub struct pthread_spinlock_t {

src/unix/bsd/apple/b32/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ s! {
3333
pub ifi_lastchange: crate::timeval,
3434
pub ifi_unused2: u32,
3535
pub ifi_hwassist: u32,
36-
pub ifi_reserved1: u32,
37-
pub ifi_reserved2: u32,
36+
ifi_reserved1: Padding<u32>,
37+
ifi_reserved2: Padding<u32>,
3838
}
3939

4040
pub struct bpf_hdr {

src/unix/bsd/apple/b64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ s! {
3636
pub ifi_lastchange: timeval32,
3737
pub ifi_unused2: u32,
3838
pub ifi_hwassist: u32,
39-
pub ifi_reserved1: u32,
40-
pub ifi_reserved2: u32,
39+
ifi_reserved1: Padding<u32>,
40+
ifi_reserved2: Padding<u32>,
4141
}
4242

4343
pub struct bpf_hdr {

src/unix/bsd/apple/b64/x86_64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ s! {
1010
// FIXME(1.0): This should not implement `PartialEq`
1111
#[allow(unpredictable_function_pointer_comparisons)]
1212
pub struct malloc_zone_t {
13-
_reserved1: *mut c_void,
14-
_reserved2: *mut c_void,
13+
_reserved1: Padding<*mut c_void>,
14+
_reserved2: Padding<*mut c_void>,
1515
pub size:
1616
Option<unsafe extern "C" fn(zone: *mut malloc_zone_t, ptr: *const c_void) -> size_t>,
1717
pub malloc:

src/unix/bsd/apple/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ s! {
334334

335335
pub struct fpunchhole_t {
336336
pub fp_flags: c_uint, /* unused */
337-
pub reserved: c_uint, /* (to maintain 8-byte alignment) */
337+
reserved: Padding<c_uint>, /* (to maintain 8-byte alignment) */
338338
pub fp_offset: off_t, /* IN: start of the region */
339339
pub fp_length: off_t, /* IN: size of the region */
340340
}
@@ -346,7 +346,7 @@ s! {
346346

347347
pub struct fspecread_t {
348348
pub fsr_flags: c_uint,
349-
pub reserved: c_uint,
349+
reserved: Padding<c_uint>,
350350
pub fsr_offset: off_t,
351351
pub fsr_length: off_t,
352352
}
@@ -485,7 +485,7 @@ s! {
485485
pub rtm_addrs: c_int,
486486
pub rtm_refcnt: i32,
487487
pub rtm_parentflags: c_int,
488-
pub rtm_reserved: c_int,
488+
rtm_reserved: Padding<c_int>,
489489
pub rtm_use: c_int,
490490
pub rtm_inits: u32,
491491
pub rtm_rmx: rt_metrics,
@@ -669,7 +669,7 @@ s! {
669669
pub ss_sysaddr: u16,
670670
pub sc_id: u32,
671671
pub sc_unit: u32,
672-
pub sc_reserved: [u32; 5],
672+
sc_reserved: Padding<[u32; 5]>,
673673
}
674674

675675
pub struct in_pktinfo {
@@ -1015,7 +1015,7 @@ s! {
10151015

10161016
pub struct attrlist {
10171017
pub bitmapcount: c_ushort,
1018-
pub reserved: u16,
1018+
reserved: Padding<u16>,
10191019
pub commonattr: attrgroup_t,
10201020
pub volattr: attrgroup_t,
10211021
pub dirattr: attrgroup_t,
@@ -1285,7 +1285,7 @@ s! {
12851285
pub f_mntonname: [c_char; 1024],
12861286
pub f_mntfromname: [c_char; 1024],
12871287
pub f_flags_ext: u32,
1288-
pub f_reserved: [u32; 7],
1288+
f_reserved: Padding<[u32; 7]>,
12891289
}
12901290

12911291
pub struct dirent {
@@ -1484,7 +1484,7 @@ s! {
14841484
pub struct sockaddr_vm {
14851485
pub svm_len: c_uchar,
14861486
pub svm_family: crate::sa_family_t,
1487-
pub svm_reserved1: c_ushort,
1487+
svm_reserved1: Padding<c_ushort>,
14881488
pub svm_port: c_uint,
14891489
pub svm_cid: c_uint,
14901490
}

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ s! {
101101
pub time_low: u32,
102102
pub time_mid: u16,
103103
pub time_hi_and_version: u16,
104-
pub clock_seq_hi_and_reserved: u8,
104+
clock_seq_hi_and_reserved: Padding<u8>,
105105
pub clock_seq_low: u8,
106106
pub node: [u8; 6],
107107
}

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ s! {
361361
pub time_low: u32,
362362
pub time_mid: u16,
363363
pub time_hi_and_version: u16,
364-
pub clock_seq_hi_and_reserved: u8,
364+
clock_seq_hi_and_reserved: Padding<u8>,
365365
pub clock_seq_low: u8,
366366
pub node: [u8; _UUID_NODE_LEN],
367367
}
@@ -488,8 +488,8 @@ s! {
488488
pub ksw_used: u_int,
489489
pub ksw_total: u_int,
490490
pub ksw_flags: c_int,
491-
pub ksw_reserved1: u_int,
492-
pub ksw_reserved2: u_int,
491+
ksw_reserved1: Padding<u_int>,
492+
ksw_reserved2: Padding<u_int>,
493493
}
494494

495495
pub struct nlist {

0 commit comments

Comments
 (0)