diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-13 10:46:02 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-13 10:46:02 +0000 |
commit | 52fb4d3d133883c6e0e8b8ee8a7af590a920f5eb (patch) | |
tree | 0a0dd2d07bd3541d6e577f41c7a9b113a7ead022 /EdkCompatibilityPkg/Compatibility | |
parent | 0a16169be8fcade376d291fd70371e262b2592ee (diff) | |
download | edk2-platforms-52fb4d3d133883c6e0e8b8ee8a7af590a920f5eb.tar.xz |
Refine some code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10873 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c | 2 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c index dda168607f..95f7b08d01 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c @@ -717,7 +717,7 @@ F2UCreateNumericOpCode ( // We need to create a default value.
//
ZeroMem (&UOpcodeDefault, sizeof (UOpcodeDefault));
- UOpcodeDefault.Header.Length = sizeof (UOpcodeDefault);
+ UOpcodeDefault.Header.Length = (UINT8) sizeof (UOpcodeDefault);
UOpcodeDefault.Header.OpCode = EFI_IFR_DEFAULT_OP;
UOpcodeDefault.DefaultId = 0;
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c index 3d39a9e1b6..4c4411fabb 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c @@ -813,7 +813,7 @@ ParseOpCodes ( CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.MinValue, sizeof (UINT16));
CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.MaxValue, sizeof (UINT16));
CopyMem (&CurrentStatement->Step, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u16.Step, sizeof (UINT16));
- CurrentStatement->StorageWidth = sizeof (UINT16);
+ CurrentStatement->StorageWidth = (UINT16) sizeof (UINT16);
Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
break;
@@ -821,7 +821,7 @@ ParseOpCodes ( CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.MinValue, sizeof (UINT32));
CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.MaxValue, sizeof (UINT32));
CopyMem (&CurrentStatement->Step, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u32.Step, sizeof (UINT32));
- CurrentStatement->StorageWidth = sizeof (UINT32);
+ CurrentStatement->StorageWidth = (UINT16) sizeof (UINT32);
Value->Type = EFI_IFR_TYPE_NUM_SIZE_32;
break;
@@ -829,7 +829,7 @@ ParseOpCodes ( CopyMem (&CurrentStatement->Minimum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.MinValue, sizeof (UINT64));
CopyMem (&CurrentStatement->Maximum, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.MaxValue, sizeof (UINT64));
CopyMem (&CurrentStatement->Step, &((EFI_IFR_NUMERIC *) OpCodeData)->data.u64.Step, sizeof (UINT64));
- CurrentStatement->StorageWidth = sizeof (UINT64);
+ CurrentStatement->StorageWidth = (UINT16) sizeof (UINT64);
Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
break;
@@ -866,7 +866,7 @@ ParseOpCodes ( ASSERT (CurrentStatement != NULL);
CurrentStatement->Flags = ((EFI_IFR_CHECKBOX *) OpCodeData)->Flags;
- CurrentStatement->StorageWidth = sizeof (BOOLEAN);
+ CurrentStatement->StorageWidth = (UINT16) sizeof (BOOLEAN);
CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_BOOLEAN;
break;
|