1
0
Fork 0

Codechange: replace char* where out-of-date

pull/14206/head
Rubidium 2025-05-04 08:24:50 +02:00 committed by rubidium42
parent d697280493
commit 3f2b39e3f8
4 changed files with 4 additions and 4 deletions

View File

@ -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()

View File

@ -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 */

View File

@ -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 <typename T, typename P = std::nullptr_t, typename F = const char*>
template <typename T, typename P = std::nullptr_t, typename F = std::string_view>
class GUIList : public std::vector<T> {
public:
using SortFunction = std::conditional_t<std::is_same_v<P, std::nullptr_t>, bool (const T&, const T&), bool (const T&, const T&, const P)>; ///< Signature of sort function.

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
/** @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"