This -Wall -Wextra thing actually caught a real bug.

Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
This commit is contained in:
Nigel Croxon 2016-03-03 16:55:26 -05:00
parent ab6c6ef7f3
commit 76206d9ebf
6 changed files with 7 additions and 8 deletions

View File

@ -105,7 +105,6 @@ static
EFI_STATUS EFI_STATUS
EFI_FUNCTION EFI_FUNCTION
Drv0SayHello( Drv0SayHello(
IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This,
IN const CHAR16 *HelloWho IN const CHAR16 *HelloWho
) )
{ {
@ -122,7 +121,6 @@ static
EFI_STATUS EFI_STATUS
EFI_FUNCTION EFI_FUNCTION
Drv0GetNumberOfHello( Drv0GetNumberOfHello(
IN struct _GNU_EFI_APPS_DRV0_PROTOCOL *This,
OUT UINTN *NumberOfHello 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 */ /* Grab handle to this image: we'll attach our proto instance to it */
Status = uefi_call_wrapper(BS->OpenProtocol, 6, Status = uefi_call_wrapper(BS->OpenProtocol, 6,
ImageHandle, &LoadedImageProtocol, ImageHandle, &LoadedImageProtocol,
&LoadedImage, ImageHandle, NULL, ImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Print(L"Could not open loaded image protocol: %d\n", Status); Print(L"Could not open loaded image protocol: %d\n", Status);

View File

@ -23,7 +23,7 @@ PlayWithGnuEfiAppsDrv0Protocol(IN EFI_HANDLE DrvHandle) {
Status = uefi_call_wrapper(BS->OpenProtocol, 6, Status = uefi_call_wrapper(BS->OpenProtocol, 6,
DrvHandle, DrvHandle,
&GnuEfiAppsDrv0ProtocolGuid, &GnuEfiAppsDrv0ProtocolGuid,
&drv, NULL,
DrvHandle, DrvHandle,
NULL, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL); EFI_OPEN_PROTOCOL_GET_PROTOCOL);

View File

@ -68,8 +68,7 @@ static EFI_STATUS find_pci_device(uint16_t vendor_id, uint16_t device_id,
{ {
EFI_STATUS rc; EFI_STATUS rc;
EFI_HANDLE *Handles; EFI_HANDLE *Handles;
UINTN NoHandles; UINTN NoHandles, i;
int i;
if (!pciio) if (!pciio)
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;

View File

@ -6,6 +6,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{ {
SIMPLE_TEXT_OUTPUT_INTERFACE *conout; SIMPLE_TEXT_OUTPUT_INTERFACE *conout;
InitializeLib(image, systab);
conout = systab->ConOut; conout = systab->ConOut;
uefi_call_wrapper(conout->OutputString, 2, conout, L"Hello World!\n\r"); uefi_call_wrapper(conout->OutputString, 2, conout, L"Hello World!\n\r");

View File

@ -6,6 +6,7 @@ efi_main (EFI_HANDLE *image, EFI_SYSTEM_TABLE *systab)
{ {
UINTN index; 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"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->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); uefi_call_wrapper(systab->BootServices->WaitForEvent, 3, 1, &systab->ConIn->WaitForKey, &index);

View File

@ -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); efi_status = uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2, ST->ConIn, &efi_input_key);
Print(L"ScanCode: %xh UnicodeChar: %xh\n", Print(L"ScanCode: %xh UnicodeChar: %xh CallRtStatus: %x\n",
efi_input_key.ScanCode, efi_input_key.UnicodeChar); efi_input_key.ScanCode, efi_input_key.UnicodeChar, efi_status);
return EFI_SUCCESS; return EFI_SUCCESS;
} }