From d7811ff5e9e076b045914d6279c83c05b4104798 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 2 Jul 2024 18:00:41 +0200 Subject: [PATCH] patterns: Replaced old bitfield order attributes with new ones Fixes #265 --- includes/type/byte.pat | 3 ++- patterns/elf.hexpat | 4 ++-- patterns/fs.hexpat | 4 ++-- patterns/usb.hexpat | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/type/byte.pat b/includes/type/byte.pat index 1682e96..930fa46 100644 --- a/includes/type/byte.pat +++ b/includes/type/byte.pat @@ -1,6 +1,7 @@ #pragma once import std.io; +import std.core; /*! Types to display single bytes using various different representations @@ -20,7 +21,7 @@ namespace auto type { bit5 : 1; bit6 : 1; bit7 : 1; - } [[format("type::impl::format_bits"), right_to_left]]; + } [[format("type::impl::format_bits"), bitfield_order(std::core::BitfieldOrder::LeastToMostSignificant, 8)]]; /** Type visualizing the value of the two nibbles diff --git a/patterns/elf.hexpat b/patterns/elf.hexpat index be89e6b..4765706 100644 --- a/patterns/elf.hexpat +++ b/patterns/elf.hexpat @@ -498,12 +498,12 @@ bitfield SHF { bitfield ELF32_R_INFO { SYM : 8; TYPE : 8; -} [[left_to_right]]; +} [[bitfield_order(BitfieldOrder::MostToLeastSignificant, 16)]]; bitfield ELF64_R_INFO { SYM : 32; TYPE : 32; -} [[left_to_right]]; +} [[bitfield_order(BitfieldOrder::MostToLeastSignificant, 64)]]; bitfield PF { X : 1; diff --git a/patterns/fs.hexpat b/patterns/fs.hexpat index 6b3a169..e787e36 100644 --- a/patterns/fs.hexpat +++ b/patterns/fs.hexpat @@ -52,7 +52,7 @@ namespace fat32 { lastLogical : 1; padding : 1; number : 5; - } [[left_to_right]]; + } [[bitfield_order(BitfieldOrder::MostToLeastSignificant, 8)]]; enum EntryStatus : u8 { Regular = 0x00, @@ -73,7 +73,7 @@ namespace fat32 { subdirectory : 1; archive : 1; padding : 2; - } [[right_to_left]]; + } [[bitfield_order(BitfieldOrder::LeastToMostSignificant, 8)]]; struct DirEntry { char fileName[8]; diff --git a/patterns/usb.hexpat b/patterns/usb.hexpat index ddb87c5..36e1080 100644 --- a/patterns/usb.hexpat +++ b/patterns/usb.hexpat @@ -231,7 +231,7 @@ struct DeviceQualifierDescriptor { bitfield OTGAttributes { SRPSupport : 1; HNPSupport : 1; -} [[right_to_left]]; +} [[bitfield_order(BitfieldOrder::LeastToMostSignificant, 2)]]; struct OTGDescriptor { OTGAttributes bmAttributes;