diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-02 08:40:56 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-02 08:40:56 +0200 |
commit | ef53d52b01967d1b126ca629bb74fd1b633dcf0c (patch) | |
tree | 82aed16d55350285cc115ab8de78042b752c7009 /src | |
parent | efi: include endian.h to handle endian correctly (diff) | |
download | systemd-ef53d52b01967d1b126ca629bb74fd1b633dcf0c.tar.xz systemd-ef53d52b01967d1b126ca629bb74fd1b633dcf0c.zip |
efi: add const qualifier to string utils
Diffstat (limited to '')
-rw-r--r-- | src/boot/efi/util.c | 10 | ||||
-rw-r--r-- | src/boot/efi/util.h | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index 0061e03eba..c6aa7954bc 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -245,7 +245,7 @@ VOID efivar_set_time_usec(const EFI_GUID *vendor, CHAR16 *name, UINT64 usec) { efivar_set(vendor, name, str, 0); } -static INTN utf8_to_16(CHAR8 *stra, CHAR16 *c) { +static INTN utf8_to_16(const CHAR8 *stra, CHAR16 *c) { CHAR16 unichar; UINTN len; @@ -296,7 +296,7 @@ static INTN utf8_to_16(CHAR8 *stra, CHAR16 *c) { return len; } -CHAR16 *stra_to_str(CHAR8 *stra) { +CHAR16 *stra_to_str(const CHAR8 *stra) { UINTN strlen; UINTN len; UINTN i; @@ -324,7 +324,7 @@ CHAR16 *stra_to_str(CHAR8 *stra) { return str; } -CHAR16 *stra_to_path(CHAR8 *stra) { +CHAR16 *stra_to_path(const CHAR8 *stra) { CHAR16 *str; UINTN strlen; UINTN len; @@ -361,10 +361,10 @@ CHAR16 *stra_to_path(CHAR8 *stra) { return str; } -CHAR8 *strchra(CHAR8 *s, CHAR8 c) { +CHAR8 *strchra(const CHAR8 *s, CHAR8 c) { do { if (*s == c) - return s; + return (CHAR8*) s; } while (*s++); return NULL; } diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index f3c97186e8..fc7377c0f7 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -32,9 +32,9 @@ EFI_STATUS efivar_get_uint32_le(const EFI_GUID *vendor, const CHAR16 *name, UINT EFI_STATUS efivar_get_uint64_le(const EFI_GUID *vendor, const CHAR16 *name, UINT64 *ret); EFI_STATUS efivar_get_boolean_u8(const EFI_GUID *vendor, const CHAR16 *name, BOOLEAN *ret); -CHAR8 *strchra(CHAR8 *s, CHAR8 c); -CHAR16 *stra_to_path(CHAR8 *stra); -CHAR16 *stra_to_str(CHAR8 *stra); +CHAR8 *strchra(const CHAR8 *s, CHAR8 c); +CHAR16 *stra_to_path(const CHAR8 *stra); +CHAR16 *stra_to_str(const CHAR8 *stra); EFI_STATUS file_read(EFI_FILE_HANDLE dir, const CHAR16 *name, UINTN off, UINTN size, CHAR8 **content, UINTN *content_size); |