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_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);

View File

@ -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);

View File

@ -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;

View File

@ -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");

View File

@ -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);

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);
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;
}