summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-04-02 12:46:58 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-04-15 12:26:20 +0300
commit0121282d1aa449a037445a212e4fac53e2164893 (patch)
tree0ba072fadaffa94a75b6a4d85ead358c6823fd16 /include
parentfe869e11c71a9a7e8f069426c594556aa3181507 (diff)
downloadu-boot-0121282d1aa449a037445a212e4fac53e2164893.tar.xz
lib: convert u16_strlen() into a macro
The function u16_strlen() can be implemented as call to u16_strnlen(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'include')
-rw-r--r--include/charset.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/include/charset.h b/include/charset.h
index b93d023092..38908e08f0 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -201,18 +201,6 @@ int u16_strncmp(const u16 *s1, const u16 *s2, size_t n);
#define u16_strcmp(s1, s2) u16_strncmp((s1), (s2), SIZE_MAX)
/**
- * u16_strlen - count non-zero words
- *
- * This function matches wsclen() if the -fshort-wchar compiler flag is set.
- * In the EFI context we explicitly need a function handling u16 strings.
- *
- * @in: null terminated u16 string
- * Return: number of non-zero words.
- * This is not the number of utf-16 letters!
- */
-size_t u16_strlen(const void *in);
-
-/**
* u16_strsize() - count size of u16 string in bytes including the null
* character
*
@@ -237,6 +225,20 @@ size_t u16_strsize(const void *in);
size_t u16_strnlen(const u16 *in, size_t count);
/**
+ * u16_strlen - count non-zero words
+ *
+ * This function matches wsclen() if the -fshort-wchar compiler flag is set.
+ * In the EFI context we explicitly need a function handling u16 strings.
+ *
+ * @in: null terminated u16 string
+ * Return: number of non-zero words.
+ * This is not the number of utf-16 letters!
+ */
+size_t u16_strlen(const void *in);
+
+#define u16_strlen(in) u16_strnlen(in, SIZE_MAX)
+
+/**
* u16_strcpy() - copy u16 string
*
* Copy u16 string pointed to by src, including terminating null word, to