1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 01:12:39 +01:00

Codechange: replace char* with std::string_view

This commit is contained in:
Rubidium
2025-04-27 18:31:42 +02:00
committed by rubidium42
parent e1859df1c0
commit 49ef3eee13
25 changed files with 53 additions and 49 deletions

View File

@@ -74,7 +74,7 @@ int RecursiveCommandCounter::_counter = 0;
* the #CommandFlag::Auto, #CommandFlag::Offline and #CommandFlag::Server values.
*/
struct CommandInfo {
const char *name; ///< A human readable name for the procedure
std::string_view name; ///< A human readable name for the procedure
CommandFlags flags; ///< The (command) flags to that apply to this command
CommandType type; ///< The type of command.
};
@@ -129,7 +129,7 @@ CommandFlags GetCommandFlags(Commands cmd)
* @param cmd The integer value of the command
* @return The name for this command
*/
const char *GetCommandName(Commands cmd)
std::string_view GetCommandName(Commands cmd)
{
assert(IsValidCommand(cmd));