Enhance Writer class with GetEndianness, improve type safety, and in-memory swaps - #4
Merged
Conversation
Collaborator
Author
|
merging. changes all look good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduces several improvements and fixes focused on code safety, maintainability, and API flexibility.
Changes
Build System and Code Safety Enhancements:
CMakeLists.txtto enforce higher code quality and catch more potential issues at compile time. These flags are applied to all main targets (processing,interface,esfa). [1] [2] [3]API Improvements and Flexibility:
ParseAssetandExportAssetmethods to theProcessorclass, allowing direct parsing from and exporting to arbitrary streams, not just files. This increases flexibility for asset handling. [1] [2] [3] [4]Type Safety and Consistency:
BitConvertermethods to usesize_tfor offsets instead ofint32_t, and replaced C-style casts withstatic_castfor improved type safety and clarity. Also made the floating-point conversion static assertions more accurate.Readermethods to usestatic_castandreinterpret_castfor type conversions, and ensured consistent use of buffer sizes and types, reducing the risk of undefined behavior. [1] [2] [3] [4] [5] [6]Minor Refactoring and Cleanups:
AssetMetafor safer and more convenient usage.FileStreamfor code cleanliness.GetEndiannessmethod toWriterfor symmetry withReader.