From a614aa1985d60519de120660cc7379c69690a3bd Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 31 Jan 2020 19:20:34 +0900 Subject: [PATCH 1/2] sd-boot: fix warning about comparison is always true --- src/boot/efi/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index da743dcb9f..b44f051d95 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -189,7 +189,7 @@ static INTN utf8_to_16(CHAR8 *stra, CHAR16 *c) { UINTN len; UINTN i; - if (stra[0] < 0x80) + if (!(stra[0] & 0x80)) len = 1; else if ((stra[0] & 0xe0) == 0xc0) len = 2; From efda8aebcb0e3731ba56fa11499f318a50ea4e30 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 31 Jan 2020 19:21:11 +0900 Subject: [PATCH 2/2] sd-boot: fix -Wpointer-sign warning --- src/boot/efi/boot.c | 4 ++-- src/boot/efi/stub.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c index 18304138e7..99938c547a 100644 --- a/src/boot/efi/boot.c +++ b/src/boot/efi/boot.c @@ -1893,8 +1893,8 @@ static VOID config_entry_add_linux( UINTN bufsize = sizeof buf; EFI_FILE_INFO *f; CHAR8 *sections[] = { - (UINT8 *)".osrel", - (UINT8 *)".cmdline", + (CHAR8 *)".osrel", + (CHAR8 *)".cmdline", NULL }; UINTN offs[ELEMENTSOF(sections)-1] = {}; diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 6a10cafff0..02aab1ec7f 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -22,10 +22,10 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { UINTN size; BOOLEAN secure = FALSE; CHAR8 *sections[] = { - (UINT8 *)".cmdline", - (UINT8 *)".linux", - (UINT8 *)".initrd", - (UINT8 *)".splash", + (CHAR8 *)".cmdline", + (CHAR8 *)".linux", + (CHAR8 *)".initrd", + (CHAR8 *)".splash", NULL }; UINTN addrs[ELEMENTSOF(sections)-1] = {};