-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use the strict access API #135
Conversation
This PR completely breaks compilation of MKVToolNix. I'm still evaluating if I can convert all of that to only using the strict API. In the meantime, please take a look at this new warning that
Thanks. |
Another issue that needs a fix:
|
And while we're at it, please add a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've successfully converted MKVToolNix to using only the strict API stuff (a lot via the provided macros to still compile with old library versions which don't provide all the required public functions directly, but sometimes via indirections such as Generic()
).
What I'd like to see before merging are the things I've already pointed out:
- Fix the undefined behavior the compiler warns about
- Resolve the ambiguity between the
Context()
function inEbmlElement
and theContext
member variable inEbmlMaster
(e.g. by renaming the function toGetContext()
which would be more in line with the otherGet…()
functions) - Provide proper functions for all
operator…
conversion operator functions
3b36adc
to
c9d3dc0
Compare
Rebased onto current |
I'm working on changes on top of this branch that address the points I made. |
OK, not sure when I'll have time to work on this, so feel free to make any progress. There are some macro helpers that are useful to switch from strict to non-strict, so you probably use that for the time being so your code compile with both variants. |
I've just pushed a handful of commits that implement everything I wanted. Please review when you find the time. I'd also like to push a cosmetics commit fixing indentation (we had this at 2 spaces at one point, but now it's becoming a really bad mixture of 2, 4 and other amounts of spaces again), but that'll make the diff way less obvious. Therefore I'm holding off on it until we get this PR merged. |
We might be able to add some more constexpr in there.
All the members become private. This requires libmatroska to merge Matroska-Org/libmatroska#95
Also removes the EBML_CONCRETE_DUMMY_CLASS macro as it's only used by EbmlDummy anyway.
…bmlCallbacks This was already possible by using the operator EbmlCallbacks(), but that isn't really idiomatic C++ style. The operator is kept for backwards compatibility.
This was already possible by using the operator EbmlId(), but that isn't really idiomatic C++ style. The operator is kept for backwards compatibility.
b5ba400
to
5caec5d
Compare
The changes look fine and it does build with |
Trying to build MKVToolNix with this branch & the latest
This is due to the function not having an implementation anymore. Easily fixed by replacing the declaration with: static const EbmlId & ClassId() { return DummyRawId; }; Otherwise I'm still fine with the changes. Thanks! |
Thanks for testing (after this long there was invitably things that might break). It should work with the latest push. |
Works, thanks! |
So far the code was built without the define. But since we can change the API for 2.0 we should switch to a stricter API that makes things less public.
This requires libmatroska to merge Matroska-Org/libmatroska#95
We might be able to add some
constexpr
here and there despite using methods.