-
Notifications
You must be signed in to change notification settings - Fork 55
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 structs and unions adhere to C++ standard #101
Open
gostefan
wants to merge
8
commits into
jklimke:master
Choose a base branch
from
gostefan:fixUnion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Sep 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 38ba039 - Browse repository at this point
Copy the full SHA 38ba039View commit details
Commits on Sep 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for fe685cb - Browse repository at this point
Copy the full SHA fe685cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for aace344 - Browse repository at this point
Copy the full SHA aace344View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7886fc - Browse repository at this point
Copy the full SHA a7886fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for f40dc71 - Browse repository at this point
Copy the full SHA f40dc71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 02af448 - Browse repository at this point
Copy the full SHA 02af448View commit details -
The setup before this commit violates the C++ standard. If two classes with non-standard constructors and/or destructors are in a union their constructors and/or destructors have to be called explicitly when switching between the value types. Using a union is also unsafe as it's illegal to access the "wrong" of the two members. But the API doesn't have a way to tell which member is the active. The new solution doesn't use unions but allows clients to safely access even the wrong value.
Configuration menu - View commit details
-
Copy full SHA for 0ff5c51 - Browse repository at this point
Copy the full SHA 0ff5c51View commit details -
Fix undefined behavior in union.
Accessing non-active members in unions is undefined behavior. Additionally the C++ Standard doesn't support anonymous structs. [1] This puts the current implementation of TVec3 and TVec4 square into undefined behavior territory. Removing the unions and anonymous structs is easy and fixes all problematic paths. [1]: https://stackoverflow.com/questions/2253878/why-does-c-disallow-anonymous-structs
Configuration menu - View commit details
-
Copy full SHA for f4a1fab - Browse repository at this point
Copy the full SHA f4a1fabView commit details
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.