diff --git a/crates/libs/bindgen/src/winmd/blob.rs b/crates/libs/bindgen/src/winmd/blob.rs index 4ec52140bc..53181950c5 100644 --- a/crates/libs/bindgen/src/winmd/blob.rs +++ b/crates/libs/bindgen/src/winmd/blob.rs @@ -30,8 +30,8 @@ impl Blob { } else { ( (((self[0] & 0x1F) as usize) << 24) - | (self[1] as usize) << 16 - | (self[2] as usize) << 8 + | ((self[1] as usize) << 16) + | ((self[2] as usize) << 8) | self[3] as usize, 4, ) diff --git a/crates/libs/bindgen/src/winmd/file.rs b/crates/libs/bindgen/src/winmd/file.rs index 45e7878c9f..7c707c83fb 100644 --- a/crates/libs/bindgen/src/winmd/file.rs +++ b/crates/libs/bindgen/src/winmd/file.rs @@ -142,8 +142,8 @@ impl File { let heap_sizes = result.bytes.copy_as::(tables_data.0 + 6)?; let string_index_size = if (heap_sizes & 1) == 1 { 4 } else { 2 }; - let guid_index_size = if (heap_sizes >> 1 & 1) == 1 { 4 } else { 2 }; - let blob_index_size = if (heap_sizes >> 2 & 1) == 1 { 4 } else { 2 }; + let guid_index_size = if ((heap_sizes >> 1) & 1) == 1 { 4 } else { 2 }; + let blob_index_size = if ((heap_sizes >> 2) & 1) == 1 { 4 } else { 2 }; let valid_bits = result.bytes.copy_as::(tables_data.0 + 8)?; view = tables_data.0 + 24; @@ -174,7 +174,7 @@ impl File { let mut unused_module = Table::default(); for i in 0..64 { - if (valid_bits >> i & 1) == 0 { + if ((valid_bits >> i) & 1) == 0 { continue; } diff --git a/crates/libs/core/src/guid.rs b/crates/libs/core/src/guid.rs index 08df7b4dc8..6b08a9fd9b 100644 --- a/crates/libs/core/src/guid.rs +++ b/crates/libs/core/src/guid.rs @@ -48,8 +48,8 @@ impl GUID { pub const fn from_u128(uuid: u128) -> Self { Self { data1: (uuid >> 96) as u32, - data2: (uuid >> 80 & 0xffff) as u16, - data3: (uuid >> 64 & 0xffff) as u16, + data2: ((uuid >> 80) & 0xffff) as u16, + data3: ((uuid >> 64) & 0xffff) as u16, data4: (uuid as u64).to_be_bytes(), } } diff --git a/crates/libs/core/src/imp/sha1.rs b/crates/libs/core/src/imp/sha1.rs index 72210e1368..80236ec203 100644 --- a/crates/libs/core/src/imp/sha1.rs +++ b/crates/libs/core/src/imp/sha1.rs @@ -110,11 +110,11 @@ impl ConstBuffer { .push(b'-') .push_hex_u16(guid.data3) .push(b'-') - .push_hex_u16((guid.data4[0] as u16) << 8 | guid.data4[1] as u16) + .push_hex_u16(((guid.data4[0] as u16) << 8) | guid.data4[1] as u16) .push(b'-') - .push_hex_u16((guid.data4[2] as u16) << 8 | guid.data4[3] as u16) - .push_hex_u16((guid.data4[4] as u16) << 8 | guid.data4[5] as u16) - .push_hex_u16((guid.data4[6] as u16) << 8 | guid.data4[7] as u16) + .push_hex_u16(((guid.data4[2] as u16) << 8) | guid.data4[3] as u16) + .push_hex_u16(((guid.data4[4] as u16) << 8) | guid.data4[5] as u16) + .push_hex_u16(((guid.data4[6] as u16) << 8) | guid.data4[7] as u16) .push(b'}') } }