Selaa lähdekoodia

When copying structs, some compilers (e.g. MSVC for ARM) will use an
implicit call to memcpy(), which can result in an undefined reference.
Use CopyMem() to duplicate struct data instead.
NB: This patch also removes trailing whitespaces in event.c

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 vuotta sitten
vanhempi
commit
b5b6a81af0
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      lib/event.c

+ 4 - 4
lib/event.c

@@ -53,8 +53,8 @@ LibCreateProtocolNotifyEvent (
     Status = uefi_call_wrapper(
     Status = uefi_call_wrapper(
 		    BS->RegisterProtocolNotify,
 		    BS->RegisterProtocolNotify,
 			3,
 			3,
-                    ProtocolGuid, 
-                    Event, 
+                    ProtocolGuid,
+                    Event,
                     Registration
                     Registration
                     );
                     );
     if ( EFI_ERROR( Status ) ) return NULL ;
     if ( EFI_ERROR( Status ) ) return NULL ;
@@ -94,7 +94,7 @@ WaitForSingleEvent (
             //
             //
 
 
             uefi_call_wrapper(BS->SetTimer, 3, TimerEvent, TimerRelative, Timeout);
             uefi_call_wrapper(BS->SetTimer, 3, TimerEvent, TimerRelative, Timeout);
-            
+
             //
             //
             // Wait for the original event or the timer
             // Wait for the original event or the timer
             //
             //
@@ -149,6 +149,6 @@ WaitForEventWithTimeout (
             }
             }
         }
         }
     } while (Timeout > 0);
     } while (Timeout > 0);
-    *Key = TimeoutKey;
+    CopyMem(Key, &TimeoutKey, sizeof(EFI_INPUT_KEY));
 }
 }