Quellcode durchsuchen

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

Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>
Nigel Croxon vor 9 Jahren
Ursprung
Commit
76206d9ebf
6 geänderte Dateien mit 7 neuen und 8 gelöschten Zeilen
  1. 1 3
      apps/drv0.c
  2. 1 1
      apps/drv0_use.c
  3. 1 2
      apps/route80h.c
  4. 1 0
      apps/t2.c
  5. 1 0
      apps/t4.c
  6. 2 2
      apps/t7.c

+ 1 - 3
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);

+ 1 - 1
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);

+ 1 - 2
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;

+ 1 - 0
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");
 

+ 1 - 0
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);

+ 2 - 2
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;
 }