Remove restrict
(for the most part)
#2145
Merged
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.
A lot of "restricts" were sprinkled throughout the code, for the most part completely unnecessary because it didn't even involve performance-sensitive code. C++ does not have the "restrict" keyword, and the work-around for that was #defining it away, which breaks C++ code using "restrict" as an identifier. In short, a bit of a mess.
This removes the vast majority, including in particular all in the API and thus eliminating any need for a C++-specific workaround. The only cases that remain are in the (de)serializers because:
This PR sits on top of #2124, mainly because of laziness. The two PRs are not entirely independent (because of the serializer), but this PR can easily be changed to apply to master if this one gets the green light but the other one does not (yet?). The changes exclusive to this PR are all in a single commit, so it is pretty easy to review the restrict part without having to wade through unrelated changes.
Fixes #2140