mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
patterns/zlib: Cast bitfield enums to integers before doing math with them
This commit is contained in:
@@ -47,11 +47,11 @@ bitfield Header {
|
||||
fn validate_hdr_checksum(Header hdr) {
|
||||
// Reassemble as a 2-byte big endian value
|
||||
u16 value = (
|
||||
(hdr.method << 8) +
|
||||
(u8(hdr.method) << 8) +
|
||||
(hdr.info << 12) +
|
||||
(hdr.fcheck << 0) +
|
||||
(hdr.fdict << 5) +
|
||||
(hdr.flevel << 6)
|
||||
(u8(hdr.flevel) << 6)
|
||||
);
|
||||
|
||||
if (value % 31 == 0) {
|
||||
|
||||
Reference in New Issue
Block a user