From 3f2b39e3f8352b978cd8cc3cb81112fc47579b44 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 4 May 2025 08:24:50 +0200 Subject: [PATCH] Codechange: replace char* where out-of-date --- src/network/network_client.cpp | 2 +- src/saveload/saveload.h | 2 +- src/sortlist_type.h | 2 +- src/string.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 2382cb6a70..618a499211 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -1278,7 +1278,7 @@ bool NetworkValidateClientName(std::string &client_name) * Convenience method for NetworkValidateClientName on _settings_client.network.client_name. * It trims the client name and checks whether it is empty. When it is empty * an error message is shown to the GUI user. - * See \c NetworkValidateClientName(char*) for details about the functionality. + * See \c NetworkValidateClientName(std::string&) for details about the functionality. * @return True iff the client name is valid. */ bool NetworkValidateOurClientName() diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index d5ba763ed1..1c896392de 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -657,7 +657,7 @@ enum VarTypes : uint16_t { SLE_VAR_NULL = 9 << 4, ///< useful to write zeros in savegame. SLE_VAR_STR = 12 << 4, ///< string pointer SLE_VAR_STRQ = 13 << 4, ///< string pointer enclosed in quotes - SLE_VAR_NAME = 14 << 4, ///< old custom name to be converted to a char pointer + SLE_VAR_NAME = 14 << 4, ///< old custom name to be converted to a string pointer /* 1 more possible memory-primitives */ /* Shortcut values */ diff --git a/src/sortlist_type.h b/src/sortlist_type.h index 68fad3fffc..9ac1eebb47 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -39,7 +39,7 @@ struct Filtering { * @tparam P Tyoe of data passed as additional parameter to the sort function. * @tparam F Type of data fed as additional value to the filter function. @see FilterFunction */ -template +template class GUIList : public std::vector { public: using SortFunction = std::conditional_t, bool (const T&, const T&), bool (const T&, const T&, const P)>; ///< Signature of sort function. diff --git a/src/string.cpp b/src/string.cpp index ba35223567..16441e802f 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -5,7 +5,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file string.cpp Handling of C-type strings (char*). */ +/** @file string.cpp Handling of strings (std::string/std::string_view). */ #include "stdafx.h" #include "debug.h"