Skip to content

assorted const fixes#7282

Open
Goober5000 wants to merge 1 commit intoscp-fs2open:masterfrom
Goober5000:const_char_lookup
Open

assorted const fixes#7282
Goober5000 wants to merge 1 commit intoscp-fs2open:masterfrom
Goober5000:const_char_lookup

Conversation

@Goober5000
Copy link
Contributor

@Goober5000 Goober5000 commented Mar 12, 2026

  1. Change ai_profile_lookup and multi_xfer_lookup to use const char *, since all the other lookup functions do
  2. Remove several unneeded const_casts, some of which are now made possible by the non-const data() overload in C++17
  3. Change campaign_link to use const char*
  4. Use better string management in test::FSTestFixture::init_cmdline()

@Goober5000 Goober5000 added the cleanup A modification or rewrite of code to make it more understandable or easier to maintain. label Mar 12, 2026
1. Change `ai_profile_lookup` and `multi_xfer_lookup` to use `const char *`, since all the other lookup functions do
2. Remove several unneeded `const_cast`s, some of which are now made possible by the non-const `data()` overload in C++17
3. Change `campaign_link` to use `const char*`
4. Use better string management in `test::FSTestFixture::init_cmdline()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant