WerWolv / WerWolv/PatternLanguage
bitfield_order and le/be prefixes do nothing on bitfields
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 275
- Forks
- 75
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 10
Description
tested on imhex revision https://github.com/WerWolv/ImHex/commit/c6045c7044668b5d9b6442aad837f888d4ba4933
bin file: 00 00 FE 00 00 FE 00 00
pattern:
import std.core;
bitfield DDSCaps2 {
front: 9;
Cubemap: 1;
CubemapPositiveX: 1;
CubemapNegativeX: 1;
CubemapPositiveY: 1;
CubemapNegativeY: 1;
CubemapPositiveZ: 1;
CubemapNegativeZ: 1;
back: 16;
};
DDSCaps2 ltms[2] @ 0 [[bitfield_order(std::core::BitfieldOrder::LeastToMostSignificant, 32)]];
DDSCaps2 mtls[2] @ 0 [[bitfield_order(std::core::BitfieldOrder::MostToLeastSignificant, 32)]];
be DDSCaps2 big[2] @ 0;
le DDSCaps2 little[2] @ 0;
the values are always the same.
the expected outcome is one of two outcomes, either:
- back becomes 65024 on BE
- bitfield layout gets reversed
neither happens.
the former is necessary for fundamental bitset usage, the latter is necessary for flag enums (such as in this case where DDSCaps2 is a flag enum.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied bitfield pattern with the provided binary data on the referenced ImHex revision, then trace handling of bitfield_order and the le/be prefixes in the Pattern Language implementation. Done means these annotations produce the expected byte order or reversed bitfield layout, with the DDSCaps2 values differing as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100