]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcExecute.c
1) Add type cast for better coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcExecute.c
index 07e2f0a9f7fcdf0ca7038a2f07bf388068359c53..433eea250f7f5e0d650584bcee3dc59e1c0a39ac 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Contains code that implements the virtual machine.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1827,6 +1827,7 @@ ExecuteBREAK (
   UINT64      U64EbcEntryPoint;\r
   INT32       Offset;\r
 \r
+  Thunk = NULL;\r
   Operands = GETOPERANDS (VmPtr);\r
   switch (Operands) {\r
   //\r
@@ -2546,9 +2547,9 @@ ExecuteMOVsnw (
   //\r
   // Get the data from the source.\r
   //\r
-  Op2 = (UINT64) (VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
+  Op2 = (UINT64)(INT64)(INTN)(VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
   if (OPERAND2_INDIRECT (Operands)) {\r
-    Op2 = (UINT64) VmReadMemN (VmPtr, (UINTN) Op2);\r
+    Op2 = (UINT64)(INT64)(INTN)VmReadMemN (VmPtr, (UINTN) Op2);\r
   }\r
   //\r
   // Now write back the result.\r
@@ -2639,9 +2640,9 @@ ExecuteMOVsnd (
   //\r
   // Get the data from the source.\r
   //\r
-  Op2 = (UINT64) (VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
+  Op2 = (UINT64)(INT64)(INTN)(INT64)(VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
   if (OPERAND2_INDIRECT (Operands)) {\r
-    Op2 = (UINT64) VmReadMemN (VmPtr, (UINTN) Op2);\r
+    Op2 = (UINT64)(INT64)(INTN)(INT64)VmReadMemN (VmPtr, (UINTN) Op2);\r
   }\r
   //\r
   // Now write back the result.\r
@@ -3268,7 +3269,7 @@ ExecuteCMP (
   if (Flag != 0) {\r
     VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
   } else {\r
-    VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+    VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
   }\r
   //\r
   // Advance the IP\r
@@ -3447,7 +3448,7 @@ ExecuteCMPI (
   if (Flag != 0) {\r
     VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
   } else {\r
-    VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+    VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
   }\r
   //\r
   // Advance the IP\r