fix(fs/iso9660): Correct improper cast for Rock Ridge flags #3348
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.
Improve Rock Ridge flag access in ISO9660 parser
Description
This commit refactors the way Rock Ridge flags are accessed in the ISO9660 parser. Previously, the code used a cast on entry->u.data to check for GRUB_ISO9660_RR_DOT and GRUB_ISO9660_RR_DOTDOT flags. This approach was marked with a FIXME comment due to its unsafe and unclear nature. The updated implementation accesses the flags through entry->u.version, eliminating the need for casting and improving code clarity.
Motivation
The original cast on entry->u.data was not only flagged as problematic but also introduced potential risks in terms of type safety and maintainability. By switching to entry->u.version, the code now adheres to a cleaner and more correct method of accessing Rock Ridge flags. This change enhances readability, aligns with best practices, and resolves the longstanding FIXME in the codebase.