From 410ccda1c7d98c56f34c14ff7e99dbe0ed7c97f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 13 Jun 2023 21:08:59 +0200 Subject: [PATCH] Move templated `str_copy` next to basic function The functions were only separated because we previously had a large `extern "C"` block. --- src/base/system.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/base/system.h b/src/base/system.h index 7ec1b2ee9..e4482f71f 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -1227,6 +1227,23 @@ void str_append(char (&dst)[N], const char *src) */ int str_copy(char *dst, const char *src, int dst_size); +/** + * Copies a string to a fixed-size array of chars. + * + * @ingroup Strings + * + * @param dst Array that shall receive the string. + * @param src String to be copied. + * + * @remark The strings are treated as zero-terminated strings. + * @remark Guarantees that dst string will contain zero-termination. + */ +template +void str_copy(char (&dst)[N], const char *src) +{ + str_copy(dst, src, N); +} + /** * Truncates a utf8 encoded string to a given length. * @@ -2797,23 +2814,6 @@ bool shell_unregister_application(const char *executable, bool *updated); void shell_update(); #endif -/** - * Copies a string to a fixed-size array of chars. - * - * @ingroup Strings - * - * @param dst Array that shall receive the string. - * @param src String to be copied. - * - * @remark The strings are treated as zero-terminated strings. - * @remark Guarantees that dst string will contain zero-termination. - */ -template -void str_copy(char (&dst)[N], const char *src) -{ - str_copy(dst, src, N); -} - template<> struct std::hash {