Skip to content
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

Make BDA::write an instance method in the StaticHeader implementation #1579

Closed
mulkieran opened this issue Jul 8, 2019 · 0 comments · Fixed by #1581
Closed

Make BDA::write an instance method in the StaticHeader implementation #1579

mulkieran opened this issue Jul 8, 2019 · 0 comments · Fixed by #1581
Assignees
Labels
sub-issue issue that has a parent

Comments

@mulkieran
Copy link
Member

mulkieran commented Jul 8, 2019

Note that BDA::write doesn't write a BDA, but only the signature blocks in the static header which means that it really is in the wrong implementation.

There are two steps to this task:

  • Move the method to the StaticHeader implementation and fix up the call sites. Fix up the method header, which uses "BDA" when it should properly use "signature block". There may be mistaken inline comments as well that confuse the BDA with the signature block.
  • Make the method an instance method. That is, it should take a reference to self as an argument, it should not take a buffer as an argument, and it should construct the buffer it needs to write within the method body. The advantage of this is that the method StaticHeader::write created in the previous step can only write well-formed sigblocks to the designated locations, i.e., the program can not write arbitrary bytes to these spots. Fix up all call sites.

Related: #1573.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sub-issue issue that has a parent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants