Skip to content

Commit a29b577

Browse files
3v1n0tgross35
authored andcommitted
cleanup: Set unused fields as private Padding
(backport <rust-lang#4922>) (cherry picked from commit 0cfa0b2)
1 parent 0b474fb commit a29b577

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/unix/aix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ s! {
442442
pub re_esub: [*mut c_void; 24],
443443
pub re_map: *mut c_uchar,
444444
pub __maxsub: c_int,
445-
pub __unused: [*mut c_void; 34],
445+
__unused: Padding<[*mut c_void; 34]>,
446446
}
447447

448448
pub struct rlimit64 {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,14 @@ s! {
417417
pub ut_line: [c_char; 32],
418418
pub ut_host: [c_char; 256],
419419

420-
pub ut_unused: [u8; 16],
420+
ut_unused: Padding<[u8; 16]>,
421421
pub ut_session: u16,
422422
pub ut_type: u16,
423423
pub ut_pid: crate::pid_t,
424424
ut_exit: exit_status,
425425
ut_ss: crate::sockaddr_storage,
426426
pub ut_tv: crate::timeval,
427-
pub ut_unused2: [u8; 16],
427+
ut_unused2: Padding<[u8; 16]>,
428428
}
429429

430430
pub struct lastlogx {

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ s! {
359359
}
360360

361361
pub struct uucred {
362-
pub cr_unused: c_ushort,
362+
cr_unused: Padding<c_ushort>,
363363
pub cr_uid: crate::uid_t,
364364
pub cr_gid: crate::gid_t,
365365
pub cr_ngroups: c_short,

src/unix/hurd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3330,8 +3330,8 @@ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
33303330
__shpid: 0,
33313331
__type: PTHREAD_MUTEX_TIMED as c_int,
33323332
__flags: 0,
3333-
__reserved1: 0,
3334-
__reserved2: 0,
3333+
__reserved1: Padding::uninit(),
3334+
__reserved2: Padding::uninit(),
33353335
};
33363336
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
33373337
__lock: __PTHREAD_SPIN_LOCK_INITIALIZER,

0 commit comments

Comments
 (0)