Use a magic value other than 42

Shifting a literal (which is an int when a suffix is not present)
generates a warning because the only possible result is 0, and the
programmer probably didn't intend to do that.

Change the shift to a value less than 32. The test exhibiting the
warning wasn't aiming to test integer promotion rules, so I've opted
to change the constant.
This commit is contained in:
John VanEnk
2020-01-23 22:25:53 -08:00
committed by Emilio Cobos Álvarez
parent 8a5662b4a7
commit e8ff3f9b61
+3 -3
View File
@@ -1,7 +1,7 @@
pub const LEN: i32 = 42;
pub const LEN: i32 = 22;
pub type NamedLenArray = [i32; LEN];
pub type ValuedLenArray = [i32; 42];
pub type ValuedLenArray = [i32; 22];
#[repr(u8)]
pub enum AbsoluteFontWeight {
@@ -14,7 +14,7 @@ pub enum AbsoluteFontWeight {
pub extern "C" fn root(x: NamedLenArray, y: ValuedLenArray, z: AbsoluteFontWeight) { }
#[no_mangle]
pub const X: i64 = 42 << 42;
pub const X: i64 = 22 << 22;
#[no_mangle]
pub const Y: i64 = X + X;