]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c
MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiOnUefiHiiThunk / UefiIfrParser.c
index d425c364a8ccfa2f125eca05a380a4d9fd61a74f..105c3b53e1bc410433e5546d8c01558829be8d51 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Parser for IFR binary encoding.\r
 \r
-Copyright (c) 2008 - 2010, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2008 - 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -97,7 +97,7 @@ DestoryOneOfOptionMap (
   Initialize Statement header members.\r
 \r
   @param  OpCodeData             Pointer of the raw OpCode data.\r
-  @param  FormSet                Pointer of the current FormSe.\r
+  @param  FormSet                Pointer of the current FormSet.\r
   @param  Form                   Pointer of the current Form.\r
 \r
   @return The Statement.\r
@@ -805,7 +805,7 @@ ParseOpCodes (
         CurrentStatement->Minimum = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.MinValue;\r
         CurrentStatement->Maximum = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.MaxValue;\r
         CurrentStatement->Step    = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.Step;\r
-        CurrentStatement->StorageWidth = sizeof (UINT8);\r
+        CurrentStatement->StorageWidth = (UINT16) sizeof (UINT8);\r
         Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;\r
         break;\r
 \r
@@ -813,7 +813,7 @@ ParseOpCodes (
         CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.MinValue, sizeof (UINT16));\r
         CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.MaxValue, sizeof (UINT16));\r
         CopyMem (&CurrentStatement->Step,    &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.Step,     sizeof (UINT16));\r
-        CurrentStatement->StorageWidth = sizeof (UINT16);\r
+        CurrentStatement->StorageWidth = (UINT16) sizeof (UINT16);\r
         Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;\r
         break;\r
 \r
@@ -821,7 +821,7 @@ ParseOpCodes (
         CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.MinValue, sizeof (UINT32));\r
         CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.MaxValue, sizeof (UINT32));\r
         CopyMem (&CurrentStatement->Step,    &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.Step,     sizeof (UINT32));\r
-        CurrentStatement->StorageWidth = sizeof (UINT32);\r
+        CurrentStatement->StorageWidth = (UINT16) sizeof (UINT32);\r
         Value->Type = EFI_IFR_TYPE_NUM_SIZE_32;\r
         break;\r
 \r
@@ -829,7 +829,7 @@ ParseOpCodes (
         CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.MinValue, sizeof (UINT64));\r
         CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.MaxValue, sizeof (UINT64));\r
         CopyMem (&CurrentStatement->Step,    &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.Step,     sizeof (UINT64));\r
-        CurrentStatement->StorageWidth = sizeof (UINT64);\r
+        CurrentStatement->StorageWidth = (UINT16) sizeof (UINT64);\r
         Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;\r
         break;\r
 \r
@@ -866,7 +866,7 @@ ParseOpCodes (
       ASSERT (CurrentStatement != NULL);\r
 \r
       CurrentStatement->Flags = ((EFI_IFR_CHECKBOX *) OpCodeData)->Flags;\r
-      CurrentStatement->StorageWidth = sizeof (BOOLEAN);\r
+      CurrentStatement->StorageWidth = (UINT16) sizeof (BOOLEAN);\r
       CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_BOOLEAN;\r
 \r
       break;\r
@@ -1024,10 +1024,12 @@ ParseOpCodes (
 \r
       case EFI_IFR_FORM_OP:\r
       case EFI_IFR_FORM_MAP_OP:\r
+        ASSERT (CurrentForm != NULL);\r
         ImageId = &CurrentForm->ImageId;\r
         break;\r
 \r
       case EFI_IFR_ONE_OF_OPTION_OP:\r
+        ASSERT (CurrentOption != NULL);\r
         ImageId = &CurrentOption->ImageId;\r
         break;\r
 \r