From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/15] efi_loader: rename utf16_strlen, utf16_strnlen
Date: Sun, 26 Aug 2018 19:52:11 +0200 [thread overview]
Message-ID: <af67e13a-e82c-fa48-b5b1-d80190e87679@suse.de> (raw)
In-Reply-To: <20180811152820.26817-3-xypron.glpk@gmx.de>
On 11.08.18 17:28, Heinrich Schuchardt wrote:
> The function names utf16_strlen() and utf16_strnlen() are misnomers.
> The functions do not count utf-16 characters but non-zero words.
> So let's rename them to u16_strlen and u16_strnlen().
>
> In utf16_dup() avoid assignment in if clause.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> include/charset.h | 28 +++++++++++-----------------
> lib/charset.c | 10 +++++++---
> lib/efi_loader/efi_bootmgr.c | 2 +-
> lib/efi_loader/efi_console.c | 2 +-
> lib/efi_loader/efi_file.c | 2 +-
> lib/efi_loader/efi_variable.c | 2 +-
> lib/vsprintf.c | 2 +-
> 7 files changed, 23 insertions(+), 25 deletions(-)
>
> diff --git a/include/charset.h b/include/charset.h
> index 11832cbd12..2307559890 100644
> --- a/include/charset.h
> +++ b/include/charset.h
> @@ -13,29 +13,23 @@
> #define MAX_UTF8_PER_UTF16 3
>
> /**
> - * utf16_strlen() - Get the length of an utf16 string
> + * u16_strlen - count non-zero words
This really just implements wcslen() now, right?
> *
> - * Returns the number of 16 bit characters in an utf16 string, not
> - * including the terminating NULL character.
> - *
> - * @in the string to measure
> - * @return the string length
> + * @in: utf-16 string
Is "in" really a utf-16 string? Probably rather a null-terminated string
of words.
> + * ReturnValue: number of non-zero words.
> + * This is not the number of utf-16 letters!
> */
> -size_t utf16_strlen(const uint16_t *in);
> +size_t u16_strlen(const u16 *in);
>
> /**
> - * utf16_strnlen() - Get the length of a fixed-size utf16 string.
> - *
> - * Returns the number of 16 bit characters in an utf16 string,
> - * not including the terminating NULL character, but at most
> - * 'count' number of characters. In doing this, utf16_strnlen()
> - * looks at only the first 'count' characters.
> + * u16_strlen - count non-zero words
This really just implements wcsnlen() now, right?
> *
> - * @in the string to measure
> - * @count the maximum number of characters to count
> - * @return the string length, up to a maximum of 'count'
> + * @in: utf-16 string
Same comment here.
Alex
next prev parent reply other threads:[~2018-08-26 17:52 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-11 15:28 [U-Boot] [PATCH 00/15] efi_loader: EFI_UNICODE_COLLATION_PROTOCOL Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 01/15] lib: build charset.o only if needed Heinrich Schuchardt
2018-08-26 17:45 ` Alexander Graf
2018-08-26 18:06 ` Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 02/15] efi_loader: rename utf16_strlen, utf16_strnlen Heinrich Schuchardt
2018-08-26 17:52 ` Alexander Graf [this message]
2018-08-26 18:21 ` Heinrich Schuchardt
2018-08-26 18:33 ` Alexander Graf
2018-08-26 19:36 ` Heinrich Schuchardt
2018-08-26 21:57 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 03/15] lib: charset: utility functions for Unicode Heinrich Schuchardt
2018-08-26 17:59 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 04/15] test: unit tests for Unicode functions Heinrich Schuchardt
2018-08-26 18:02 ` Alexander Graf
2018-08-26 18:27 ` Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 05/15] lib: vsprintf: correct printing of Unicode strings Heinrich Schuchardt
2018-08-26 18:05 ` Alexander Graf
2018-08-26 18:34 ` Heinrich Schuchardt
2018-08-26 22:01 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 06/15] test: test printing Unicode Heinrich Schuchardt
2018-08-26 18:06 ` Alexander Graf
2018-08-26 18:36 ` Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 07/15] efi_loader: remove limit on variable length Heinrich Schuchardt
2018-08-26 18:13 ` Alexander Graf
2018-08-26 18:40 ` Heinrich Schuchardt
2018-08-26 22:04 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 08/15] efi_loader: don't use unlimited stack as buffer Heinrich Schuchardt
2018-08-26 18:16 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 09/15] efi_loader: buffer size for load options Heinrich Schuchardt
2018-08-26 18:17 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 10/15] lib: charset: remove obsolete functions Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 11/15] efi_loader: capitalization table Heinrich Schuchardt
2018-08-26 18:22 ` Alexander Graf
2018-08-26 19:00 ` Heinrich Schuchardt
2018-08-26 22:06 ` Alexander Graf
2018-08-27 8:30 ` Mike FABIAN
2018-08-27 8:37 ` Alexander Graf
2018-08-30 2:51 ` Simon Glass
2018-08-30 6:41 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 12/15] lib: charset: upper/lower case conversion Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 13/15] test: tests for utf_to_lower() utf_to_upper() Heinrich Schuchardt
2018-08-11 15:28 ` [U-Boot] [PATCH 14/15] efi_loader: EFI_UNICODE_COLLATION_PROTOCOL Heinrich Schuchardt
2018-08-26 18:31 ` Alexander Graf
2018-08-11 15:28 ` [U-Boot] [PATCH 15/15] efi_selftest: EFI_UNICODE_COLLATION_PROTOCOL Heinrich Schuchardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=af67e13a-e82c-fa48-b5b1-d80190e87679@suse.de \
--to=agraf@suse.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.