diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-10 01:04:00 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-10 01:04:00 +0000 |
commit | e009609938f0cd2b14f0300aa385a63f777631be (patch) | |
tree | f726a3a198d16f14f7f48c48b1d85c86eec284fb /EdkCompatibilityPkg/Compatibility | |
parent | 18bd7f34e9024d9e5348f2db1106fbd457e9b38c (diff) | |
download | edk2-platforms-e009609938f0cd2b14f0300aa385a63f777631be.tar.xz |
Refine some code to make the code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10863 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c | 16 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c index 42cb9b55ff..dda168607f 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c @@ -193,7 +193,7 @@ F2UCreateTextOpCode ( ZeroMem (&UTextOpCode, sizeof(UTextOpCode));
UTextOpCode.Header.OpCode = EFI_IFR_TEXT_OP;
- UTextOpCode.Header.Length = sizeof (EFI_IFR_TEXT);
+ UTextOpCode.Header.Length = (UINT8) sizeof (EFI_IFR_TEXT);
UTextOpCode.Statement.Help = FwOpcode->Help;
@@ -229,7 +229,7 @@ F2UCreateReferenceOpCode ( ZeroMem (&UOpcode, sizeof(UOpcode));
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_REF_OP;
UOpcode.Question.Header.Prompt = FwOpcode->Prompt;
@@ -269,7 +269,7 @@ F2UCreateOneOfOptionOpCode ( ZeroMem (&UOpcode, sizeof(UOpcode));
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
UOpcode.Option = FwOpcode->Option;
@@ -374,7 +374,7 @@ F2UCreateOneOfOpCode ( ZeroMem (&UOpcode, sizeof(UOpcode));
*OpcodeCount = 0;
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_ONE_OF_OP;
UOpcode.Header.Scope = 1;
@@ -491,7 +491,7 @@ F2UCreateOrderedListOpCode ( ZeroMem (&UOpcode, sizeof(UOpcode));
*OpcodeCount = 0;
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
UOpcode.Header.Scope = 1;
@@ -587,7 +587,7 @@ F2UCreateCheckBoxOpCode ( ZeroMem (&UOpcode, sizeof(UOpcode));
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_CHECKBOX_OP;
UOpcode.Question.Header.Prompt = FwOpcode->Prompt;
@@ -667,7 +667,7 @@ F2UCreateNumericOpCode ( UOpcode.Question.QuestionId = FwOpcode->Key;
}
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_NUMERIC_OP;
//
// We need to create a nested default value for the UEFI Numeric Opcode.
@@ -786,7 +786,7 @@ F2UCreateStringOpCode ( UOpcode.Question.QuestionId = FwOpcode->Key;
}
- UOpcode.Header.Length = sizeof(UOpcode);
+ UOpcode.Header.Length = (UINT8) sizeof (UOpcode);
UOpcode.Header.OpCode = EFI_IFR_STRING_OP;
UOpcode.Question.Header.Prompt = FwOpcode->Prompt;
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c index 26af99142e..3d39a9e1b6 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c @@ -805,7 +805,7 @@ ParseOpCodes ( CurrentStatement->Minimum = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.MinValue;
CurrentStatement->Maximum = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.MaxValue;
CurrentStatement->Step = ((EFI_IFR_NUMERIC *) OpCodeData)->data.u8.Step;
- CurrentStatement->StorageWidth = sizeof (UINT8);
+ CurrentStatement->StorageWidth = (UINT16) sizeof (UINT8);
Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
break;
|