Add pad_size_to for struct types - #250
Open
czaloj wants to merge 5 commits into
Open
Conversation
csnover
force-pushed
the
struct_pad_size
branch
from
March 30, 2024 06:45
7cfe67d to
e86e9e6
Compare
csnover
force-pushed
the
struct_pad_size
branch
from
March 30, 2024 06:49
e86e9e6 to
7bf2ee1
Compare
Collaborator
|
I tried to update this PR to include enum but don’t have the bandwidth. It is confusing only to apply this to struct when enum is the same thing. Any chance you can make this change? |
Collaborator
|
Other feedback based on my trying to include enum: Being able to use a field from inside a struct to define the struct size is convenient for formats where the object size is stored that way, but also somewhat problematic because it violates some notion of scoping rules. As a result, code has to be emitted from a place where the field variables are available and can’t be done just once somewhere closer to |
|
Any update on this? This functionality would be very useful in making the definitions a lot clearer. |
Collaborator
|
A volunteer is needed to handle the enum case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pad_size_toon a struct should be able to reference import, temp variables, and generated fields.Added
StructGenerator::wrap_pad_sizeand smaller BinWrite implementation3 new unit tests that check reading, one for write