]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/ThunkProtocolList: Fix VS build failure
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 23 Aug 2018 05:01:06 +0000 (13:01 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 27 Aug 2018 07:20:47 +0000 (15:20 +0800)
VS compiler complains converting UINTN to UINT16 causes data lost.
Add typecast to fix the build failure.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Andrdw Fish <afish@apple.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
EmulatorPkg/Library/ThunkProtocolList/ThunkProtocolList.c

index b2daa2bef5cc4757de53ead34941f8868e7859ca..9fa9e25e9454400ccdf599e73537bb9afdeba29d 100644 (file)
@@ -2,7 +2,7 @@
   Emulator Thunk to abstract OS services from pure EFI code\r
 \r
   Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
-  Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -82,7 +82,7 @@ AddThunkProtocol (
     Private->EmuBusDriver       = EmuBusDriver;\r
 \r
     CopyMem (&Private->Data, ThunkIo, sizeof (EMU_IO_THUNK_PROTOCOL));\r
-    Private->Data.Instance      = Instance++;\r
+    Private->Data.Instance      = (UINT16)Instance++;\r
     Private->Data.ConfigString  = StartString;\r
 \r
     InsertTailList (&mThunkList, &Private->Link);\r