Skip to content

Commit 5a68b6a

Browse files
committed
Cast unsigned literals to signed integers.
This makes it explicity that we know the literals are to large and will result in a negative number. This gets rid of a warning in 1.9.0 and younger versions, as well as an error when using the constants as discrimintants of #[repr(i32)] enumerations in older versions.
1 parent 16f3a8e commit 5a68b6a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/unix/notbsd/linux/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,13 @@ pub const LOG_NFACILITIES: ::c_int = 24;
468468

469469
pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
470470

471-
pub const RB_AUTOBOOT: ::c_int = 0x01234567;
472-
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123;
473-
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdef;
474-
pub const RB_DISABLE_CAD: ::c_int = 0;
475-
pub const RB_POWER_OFF: ::c_int = 0x4321fedc;
476-
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2;
477-
pub const RB_KEXEC: ::c_int = 0x45584543;
471+
pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
472+
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
473+
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
474+
pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
475+
pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
476+
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
477+
pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
478478

479479
f! {
480480
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {

0 commit comments

Comments
 (0)