RobLoach / RobLoach/raylib-libretro
Games DB: return const pointers from read-only view/query accessors
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 38
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Surfaced by a games-DB design review (adversarially verified against source). Cosmetic/defensive, low severity.
LibretroGamesFilteredEntry() and LibretroGamesSystem() (include/raylib-libretro-games.h) hand out non-const pointers into internal cvector storage; the only consumer (the menu) just reads them. Returning const LibretroGameEntry* / const LibretroGameSystem* documents the borrow and matches the file’s sibling accessors, which already return const (LibretroGamesFilteredLabel, LibretroGamesContentDir, the system-string getters). Update the three menu locals to const; nothing mutates, so nothing breaks. Not a bug fix — local const-consistency only.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in include/raylib-libretro-games.h and compare LibretroGamesFilteredEntry() and LibretroGamesSystem() with the sibling const accessors. Inspect their menu call sites and update the three locals to const; done means the accessors return const pointers and the menu remains read-only and builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100