From 76206d9ebf8a1683aeaa4c5be8d0d731478c2b4b Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Thu, 3 Mar 2016 16:55:26 -0500 Subject: [PATCH] This -Wall -Wextra thing actually caught a real bug. Signed-off-by: Nigel Croxon --- apps/drv0.c | 4 +--- apps/drv0_use.c | 2 +- apps/route80h.c | 3 +-- apps/t2.c | 1 + apps/t4.c | 1 + apps/t7.c | 4 ++-- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/drv0.c b/apps/drv0.c index 126e8e7..3e376bb 100644 --- a/apps/drv0.c +++ b/apps/drv0.c @@ -105,7 +105,6 @@ static EFI_STATUS EFI_FUNCTION Drv0SayHello( - IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, IN const CHAR16 *HelloWho ) { @@ -122,7 +121,6 @@ static EFI_STATUS EFI_FUNCTION Drv0GetNumberOfHello( - IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This, OUT UINTN *NumberOfHello ) { @@ -166,7 +164,7 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SysTab) /* Grab handle to this image: we'll attach our proto instance to it */ Status = uefi_call_wrapper(BS->OpenProtocol, 6, ImageHandle, &LoadedImageProtocol, - &LoadedImage, ImageHandle, + NULL, ImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(Status)) { Print(L"Could not open loaded image protocol: %d\n", Status); diff --git a/apps/drv0_use.c b/apps/drv0_use.c index f7c5869..8a06d91 100644 --- a/apps/drv0_use.c +++ b/apps/drv0_use.c @@ -23,7 +23,7 @@ PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) { Status = uefi_call_wrapper(BS->OpenProtocol, 6, DrvHandle, &GnuEfiAppsDrv0ProtocolGuid, - &drv, + NULL, DrvHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); diff --git a/apps/route80h.c b/apps/route80h.c index 21ea2d5..b0b142f 100644 --- a/apps/route80h.c +++ b/apps/route80h.c @@ -68,8 +68,7 @@ static EFI_STATUS find_pci_device(uint16_t vendor_id, uint16_t device_id, { EFI_STATUS rc; EFI_HANDLE *Handles; - UINTN NoHandles; - int i; + UINTN NoHandles, i; if (!pciio) return EFI_INVALID_PARAMETER; diff --git a/apps/t2.c b/apps/t2.c index 6a5d016..6a09c42 100644 --- a/apps/t2.c +++ b/apps/t2.c @@ -6,6 +6,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) { SIMPLE_TEXT_OUTPUT_INTERFACE *conout; + InitializeLib(image, systab); conout = systab->ConOut; uefi_call_wrapper(conout->OutputString, 2, conout, L"Hello World!\n\r"); diff --git a/apps/t4.c b/apps/t4.c index 664048d..b8487ec 100644 --- a/apps/t4.c +++ b/apps/t4.c @@ -6,6 +6,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab) { UINTN index; + InitializeLib(image, systab); uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"Hello application started\r\n"); uefi_call_wrapper(systab->ConOut->OutputString, 2, systab->ConOut, L"\r\n\r\n\r\nHit any key to exit\r\n"); uefi_call_wrapper(systab->BootServices->WaitForEvent, 3, 1, &systab->ConIn->WaitForKey, &index); diff --git a/apps/t7.c b/apps/t7.c index a1df818..f02aaee 100644 --- a/apps/t7.c +++ b/apps/t7.c @@ -18,8 +18,8 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key); - Print(L"ScanCode: %xh UnicodeChar: %xh\n", - efi_input_key.ScanCode, efi_input_key.UnicodeChar); + Print(L"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n", + efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status); return EFI_SUCCESS; }