-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pad_size_to for struct types #250
base: master
Are you sure you want to change the base?
Conversation
7cfe67d
to
e86e9e6
Compare
e86e9e6
to
7bf2ee1
Compare
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? |
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. |
A volunteer is needed to handle the enum case. |
pad_size_to
on a struct should be able to reference import, temp variables, and generated fields.Added
StructGenerator::wrap_pad_size
and smaller BinWrite implementation3 new unit tests that check reading, one for write