BaseTools: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Liming Gao
2018-07-05 17:40:04 +08:00
parent 39456d00f3
commit f7496d7173
289 changed files with 10647 additions and 10647 deletions

View File

@@ -1,15 +1,15 @@
/** @file
Defines and prototypes for the UEFI VFR compiler internal use.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _EFIVFR_H_

View File

@@ -1,15 +1,15 @@
/** @file
VfrCompiler main class and main function.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -24,7 +24,7 @@ PACKAGE_DATA gCBuffer;
PACKAGE_DATA gRBuffer;
CVfrStringDB gCVfrStringDB;
VOID
VOID
CVfrCompiler::DebugError (
IN CHAR8 *FileName,
IN UINT32 LineNumber,
@@ -32,7 +32,7 @@ CVfrCompiler::DebugError (
IN CONST CHAR8 *Text,
IN CONST CHAR8 *MsgFmt,
...
)
)
{
va_list List;
va_start (List, MsgFmt);
@@ -58,7 +58,7 @@ CVfrCompiler::IS_RUN_STATUS (
VOID
CVfrCompiler::OptionInitialization (
IN INT32 Argc,
IN INT32 Argc,
IN CHAR8 **Argv
)
{
@@ -86,7 +86,7 @@ CVfrCompiler::OptionInitialization (
mOptions.AutoDefault = FALSE;
mOptions.CheckDefault = FALSE;
memset (&mOptions.OverrideClassGuid, 0, sizeof (EFI_GUID));
if (Argc == 1) {
Usage ();
SET_RUN_STATUS (STATUS_DEAD);
@@ -108,7 +108,7 @@ CVfrCompiler::OptionInitialization (
} else if (stricmp(Argv[Index], "-i") == 0) {
Index++;
if ((Index >= Argc) || (Argv[Index][0] == '-')) {
DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument");
DebugError (NULL, 0, 1001, "Missing option", "-i missing path argument");
goto Fail;
}
@@ -126,7 +126,7 @@ CVfrCompiler::OptionInitialization (
goto Fail;
}
strcpy (mOptions.OutputDirectory, Argv[Index]);
CHAR8 lastChar = mOptions.OutputDirectory[strlen(mOptions.OutputDirectory) - 1];
if ((lastChar != '/') && (lastChar != '\\')) {
if (strchr(mOptions.OutputDirectory, '/') != NULL) {
@@ -253,7 +253,7 @@ Fail:
if (mOptions.IncludePaths != NULL) {
delete mOptions.IncludePaths;
mOptions.IncludePaths = NULL;
}
}
if (mOptions.CPreprocessorOptions != NULL) {
delete mOptions.CPreprocessorOptions;
mOptions.CPreprocessorOptions = NULL;
@@ -473,7 +473,7 @@ CVfrCompiler::SetRecordListFileName (
}
CVfrCompiler::CVfrCompiler (
IN INT32 Argc,
IN INT32 Argc,
IN CHAR8 **Argv
)
{
@@ -543,14 +543,14 @@ CVfrCompiler::~CVfrCompiler (
SET_RUN_STATUS(STATUS_DEAD);
}
VOID
VOID
CVfrCompiler::Usage (
VOID
)
{
UINT32 Index;
CONST CHAR8 *Help[] = {
" ",
" ",
"VfrCompile version " VFR_COMPILER_VERSION "Build " __BUILD_VERSION,
"Copyright (c) 2004-2016 Intel Corporation. All rights reserved.",
" ",
@@ -585,7 +585,7 @@ CVfrCompiler::Usage (
}
}
VOID
VOID
CVfrCompiler::Version (
VOID
)
@@ -623,8 +623,8 @@ CVfrCompiler::PreProcess (
}
fclose (pVfrFile);
CmdLen = strlen (mPreProcessCmd) + strlen (mPreProcessOpt) +
strlen (mOptions.VfrFileName) + strlen (mOptions.PreprocessorOutputFileName);
CmdLen = strlen (mPreProcessCmd) + strlen (mPreProcessOpt) +
strlen (mOptions.VfrFileName) + strlen (mOptions.PreprocessorOutputFileName);
if (mOptions.CPreprocessorOptions != NULL) {
CmdLen += strlen (mOptions.CPreprocessorOptions);
}
@@ -756,7 +756,7 @@ CVfrCompiler::AdjustBin (
// Get Package Data and IfrRecord Data
//
gCFormPkg.BuildPkg (gCBuffer);
gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
//
// Compare Form and Record data
@@ -799,7 +799,7 @@ CVfrCompiler::AdjustBin (
//
// Re get the IfrRecord Buffer.
//
gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
gCIfrRecordInfoDB.IfrRecordOutput (gRBuffer);
}
return;
@@ -858,7 +858,7 @@ CVfrCompiler::GenCFile (
if (!IS_RUN_STATUS(STATUS_GENBINARY)) {
goto Fail;
}
if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {
if ((pFile = fopen (LongFilePath (mOptions.COutputFileName), "w")) == NULL) {
DebugError (NULL, 0, 0001, "Error opening output C file", "%s", mOptions.COutputFileName);
@@ -869,7 +869,7 @@ CVfrCompiler::GenCFile (
fprintf (pFile, "%s\n", gSourceFileHeader[Index]);
}
if (mOptions.CompatibleMode) {
if (mOptions.CompatibleMode) {
gCVfrBufferConfig.OutputCFile (pFile, mOptions.VfrBaseFileName);
}
@@ -926,7 +926,7 @@ CVfrCompiler::GenRecordListFile (
gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, LineNo);
}
}
fprintf (pOutFile, "\n//\n// All Opcode Record List \n//\n");
gCIfrRecordInfoDB.IfrRecordOutput (pOutFile, 0);
gCVfrVarDataTypeDB.Dump(pOutFile);
@@ -943,7 +943,7 @@ Err1:
int
main (
IN int Argc,
IN int Argc,
IN char **Argv
)
{
@@ -951,7 +951,7 @@ main (
SetPrintLevel(WARNING_LOG_LEVEL);
CVfrCompiler Compiler(Argc, Argv);
Compiler.PreProcess();
Compiler.Compile();
Compiler.AdjustBin();
@@ -967,7 +967,7 @@ main (
if (gCBuffer.Buffer != NULL) {
delete[] gCBuffer.Buffer;
}
if (gRBuffer.Buffer != NULL) {
delete[] gRBuffer.Buffer;
}

View File

@@ -1,15 +1,15 @@
/** @file
VfrCompiler internal defintions.
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/

View File

@@ -1,15 +1,15 @@
/** @file
VfrCompiler error handler.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -112,7 +112,7 @@ CVfrErrorHandle::SetInputFile (
}
SVfrFileScopeRecord::SVfrFileScopeRecord (
IN CHAR8 *Record,
IN CHAR8 *Record,
IN UINT32 LineNum
)
{
@@ -153,7 +153,7 @@ SVfrFileScopeRecord::~SVfrFileScopeRecord (
VOID
CVfrErrorHandle::ParseFileScopeRecord (
IN CHAR8 *Record,
IN CHAR8 *Record,
IN UINT32 WholeScopeLine
)
{
@@ -222,7 +222,7 @@ CVfrErrorHandle::PrintMsg (
{
CHAR8 *FileName = NULL;
UINT32 FileLine;
if (strncmp ("Warning", MsgType, strlen ("Warning")) == 0) {
VerboseMsg ((CHAR8 *) ErrorMsg);
return;

View File

@@ -1,15 +1,15 @@
/** @file
VfrCompiler Error definition
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/

View File

@@ -1,15 +1,15 @@
/** @file
The definition of CFormPkg's member function
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -22,9 +22,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*/
SPendingAssign::SPendingAssign (
IN CHAR8 *Key,
IN VOID *Addr,
IN UINT32 Len,
IN CHAR8 *Key,
IN VOID *Addr,
IN UINT32 Len,
IN UINT32 LineNo,
IN CONST CHAR8 *Msg
)
@@ -69,7 +69,7 @@ SPendingAssign::~SPendingAssign (
VOID
SPendingAssign::SetAddrAndLen (
IN VOID *Addr,
IN VOID *Addr,
IN UINT32 LineNo
)
{
@@ -79,7 +79,7 @@ SPendingAssign::SetAddrAndLen (
VOID
SPendingAssign::AssignValue (
IN VOID *Addr,
IN VOID *Addr,
IN UINT32 Len
)
{
@@ -255,7 +255,7 @@ CFormPkg::Close (
UINT32
CFormPkg::Read (
IN CHAR8 *Buffer,
IN CHAR8 *Buffer,
IN UINT32 Size
)
{
@@ -309,7 +309,7 @@ CFormPkg::BuildPkg (
OUT PACKAGE_DATA &TBuffer
)
{
CHAR8 *Temp;
UINT32 Size;
CHAR8 Buffer[1024];
@@ -357,7 +357,7 @@ CFormPkg::BuildPkg (
}
fwrite (PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER), 1, Output);
delete PkgHdr;
if (PkgData == NULL) {
Open ();
while ((Size = Read (Buffer, 1024)) != 0) {
@@ -427,7 +427,7 @@ UINT32 gAdjustOpcodeOffset = 0;
BOOLEAN gNeedAdjustOpcode = FALSE;
UINT32 gAdjustOpcodeLen = 0;
EFI_VFR_RETURN_CODE
EFI_VFR_RETURN_CODE
CFormPkg::GenCFile (
IN CHAR8 *BaseName,
IN FILE *pFile,
@@ -454,24 +454,24 @@ CFormPkg::GenCFile (
// For framework vfr file, the extension framework header will be added.
//
if (VfrCompatibleMode) {
fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n");
PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n");
PkgLength = 3;
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT16));
} else {
fprintf (pFile, " // ARRAY LENGTH\n");
PkgLength = PkgHdr->Length + sizeof (UINT32);
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
}
fprintf (pFile, " // FRAMEWORK PACKAGE HEADER Length\n");
PkgLength = PkgHdr->Length + sizeof (UINT32) + 2;
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
fprintf (pFile, "\n\n // FRAMEWORK PACKAGE HEADER Type\n");
PkgLength = 3;
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT16));
} else {
fprintf (pFile, " // ARRAY LENGTH\n");
PkgLength = PkgHdr->Length + sizeof (UINT32);
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)&PkgLength, sizeof (UINT32));
}
fprintf (pFile, "\n\n // PACKAGE HEADER\n");
_WRITE_PKG_LINE(pFile, BYTES_PRE_LINE, " ", (CHAR8 *)PkgHdr, sizeof (EFI_HII_PACKAGE_HEADER));
PkgLength = sizeof (EFI_HII_PACKAGE_HEADER);
fprintf (pFile, "\n\n // PACKAGE DATA\n");
if (PkgData == NULL) {
Open ();
while ((ReadSize = Read ((CHAR8 *)Buffer, BYTES_PRE_LINE * 8)) != 0) {
@@ -503,8 +503,8 @@ CFormPkg::GenCFile (
EFI_VFR_RETURN_CODE
CFormPkg::AssignPending (
IN CHAR8 *Key,
IN VOID *ValAddr,
IN CHAR8 *Key,
IN VOID *ValAddr,
IN UINT32 ValLen,
IN UINT32 LineNo,
IN CONST CHAR8 *Msg
@@ -524,8 +524,8 @@ CFormPkg::AssignPending (
VOID
CFormPkg::DoPendingAssign (
IN CHAR8 *Key,
IN VOID *ValAddr,
IN CHAR8 *Key,
IN VOID *ValAddr,
IN UINT32 ValLen
)
{
@@ -845,14 +845,14 @@ CFormPkg::DeclarePendingQuestion (
CIfrDisableIf DIObj;
DIObj.SetLineNo (LineNo);
*InsertOpcodeAddr = DIObj.GetObjBinAddr<CHAR8>();
//TrueOpcode
CIfrTrue TObj (LineNo);
// Declare Numeric qeustion for each undefined question.
for (pNode = PendingAssignList; pNode != NULL; pNode = pNode->mNext) {
if (pNode->mFlag == PENDING) {
EFI_VARSTORE_INFO Info;
EFI_VARSTORE_INFO Info;
EFI_QUESTION_ID QId = EFI_QUESTION_ID_INVALID;
//
// Register this question, assume it is normal question, not date or time question
@@ -863,7 +863,7 @@ CFormPkg::DeclarePendingQuestion (
gCVfrErrorHandle.HandleError (ReturnCode, pNode->mLineNo, pNode->mKey);
return ReturnCode;
}
#ifdef VFREXP_DEBUG
printf ("Undefined Question name is %s and Id is 0x%x\n", VarStr, QId);
#endif
@@ -883,7 +883,7 @@ CFormPkg::DeclarePendingQuestion (
gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");
return ReturnCode;
}
VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId);
VarStoreType = lCVfrDataStorage.GetVarStoreType (Info.mVarStoreId);
if (*VarStr == '\0' && ArrayIdx != INVALID_ARRAY_INDEX) {
ReturnCode = lCVfrDataStorage.GetNameVarStoreInfo (&Info, ArrayIdx);
@@ -1149,7 +1149,7 @@ CIfrRecordInfoDB::IfrRecordOutput (
)
{
CHAR8 *Temp;
SIfrRecord *pNode;
SIfrRecord *pNode;
if (TBuffer.Buffer != NULL) {
delete[] TBuffer.Buffer;
@@ -1161,18 +1161,18 @@ CIfrRecordInfoDB::IfrRecordOutput (
if (mSwitch == FALSE) {
return;
}
}
for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
TBuffer.Size += pNode->mBinBufLen;
}
if (TBuffer.Size != 0) {
TBuffer.Buffer = new CHAR8[TBuffer.Size];
} else {
return;
}
Temp = TBuffer.Buffer;
for (pNode = mIfrRecordListHead; pNode != NULL; pNode = pNode->mNext) {
@@ -1182,8 +1182,8 @@ CIfrRecordInfoDB::IfrRecordOutput (
}
}
return;
}
return;
}
VOID
CIfrRecordInfoDB::IfrRecordOutput (
@@ -1217,7 +1217,7 @@ CIfrRecordInfoDB::IfrRecordOutput (
fprintf (File, "\n");
}
}
if (LineNo == 0) {
fprintf (File, "\nTotal Size of all record is 0x%08X\n", TotalSize);
}
@@ -1264,7 +1264,7 @@ CIfrRecordInfoDB::CheckIdOpCode (
default:
return FALSE;
}
}
}
EFI_QUESTION_ID
CIfrRecordInfoDB::GetOpcodeQuestionId (
@@ -1272,9 +1272,9 @@ CIfrRecordInfoDB::GetOpcodeQuestionId (
)
{
EFI_IFR_QUESTION_HEADER *QuestionHead;
QuestionHead = (EFI_IFR_QUESTION_HEADER *) (OpHead + 1);
return QuestionHead->QuestionId;
}
@@ -1458,7 +1458,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
QuestionScope = 0;
while (pNode != NULL) {
OpHead = (EFI_IFR_OP_HEADER *) pNode->mIfrBinBuf;
//
// make sure the inconsistent opcode in question scope
//
@@ -1468,7 +1468,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
QuestionScope --;
}
}
if (CheckQuestionOpCode (OpHead->OpCode)) {
QuestionScope = 1;
}
@@ -1481,7 +1481,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
//
//
// Count inconsistent opcode Scope
// Count inconsistent opcode Scope
//
StackCount = OpHead->Scope;
QuestionId = EFI_QUESTION_ID_INVALID;
@@ -1499,7 +1499,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
//
// by IdEqual opcode to get QuestionId
//
if (QuestionId == EFI_QUESTION_ID_INVALID &&
if (QuestionId == EFI_QUESTION_ID_INVALID &&
CheckIdOpCode (tOpHead->OpCode)) {
QuestionId = *(EFI_QUESTION_ID *) (tOpHead + 1);
}
@@ -1517,13 +1517,13 @@ CIfrRecordInfoDB::IfrRecordAdjust (
// extract inconsistent opcode list
// pNode is Incosistent opcode, tNode is End Opcode
//
//
// insert inconsistent opcode list into the right question scope by questionid
//
for (uNode = mIfrRecordListHead; uNode != NULL; uNode = uNode->mNext) {
tOpHead = (EFI_IFR_OP_HEADER *) uNode->mIfrBinBuf;
if (CheckQuestionOpCode (tOpHead->OpCode) &&
if (CheckQuestionOpCode (tOpHead->OpCode) &&
(QuestionId == GetOpcodeQuestionId (tOpHead))) {
break;
}
@@ -1538,7 +1538,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
//
OpHead->OpCode = EFI_IFR_NO_SUBMIT_IF_OP;
}
//
// skip the default storage for Date and Time
//
@@ -1565,7 +1565,7 @@ CIfrRecordInfoDB::IfrRecordAdjust (
Status = VFR_RETURN_MISMATCHED;
break;
}
} else if (OpHead->OpCode == EFI_IFR_VARSTORE_OP ||
} else if (OpHead->OpCode == EFI_IFR_VARSTORE_OP ||
OpHead->OpCode == EFI_IFR_VARSTORE_EFI_OP) {
//
// for new added group of varstore opcode
@@ -1573,9 +1573,9 @@ CIfrRecordInfoDB::IfrRecordAdjust (
tNode = pNode;
while (tNode->mNext != NULL) {
tOpHead = (EFI_IFR_OP_HEADER *) tNode->mNext->mIfrBinBuf;
if (tOpHead->OpCode != EFI_IFR_VARSTORE_OP &&
if (tOpHead->OpCode != EFI_IFR_VARSTORE_OP &&
tOpHead->OpCode != EFI_IFR_VARSTORE_EFI_OP) {
break;
break;
}
tNode = tNode->mNext;
}
@@ -1583,22 +1583,22 @@ CIfrRecordInfoDB::IfrRecordAdjust (
if (tNode->mNext == NULL) {
//
// invalid IfrCode, IfrCode end by EndOpCode
//
//
gCVfrErrorHandle.PrintMsg (0, NULL, "Error", "No found End Opcode in the end");
Status = VFR_RETURN_MISMATCHED;
break;
}
if (tOpHead->OpCode != EFI_IFR_END_OP) {
//
// not new added varstore, which are not needed to be adjust.
//
preNode = tNode;
pNode = tNode->mNext;
continue;
continue;
} else {
//
// move new added varstore opcode to the position befor form opcode
// move new added varstore opcode to the position befor form opcode
// varstore opcode between pNode and tNode
//
@@ -1639,9 +1639,9 @@ CIfrRecordInfoDB::IfrRecordAdjust (
// next node
//
preNode = pNode;
pNode = pNode->mNext;
pNode = pNode->mNext;
}
//
// Update Ifr Opcode Offset
//
@@ -2238,7 +2238,7 @@ CIfrObj::_EMIT_PENDING_OBJ (
)
{
CHAR8 *ObjBinBuf = NULL;
//
// do nothing
//
@@ -2254,7 +2254,7 @@ CIfrObj::_EMIT_PENDING_OBJ (
if (ObjBinBuf != NULL) {
memmove (ObjBinBuf, mObjBinBuf, mObjBinLen);
}
//
// update bin buffer to package data buffer
//
@@ -2262,7 +2262,7 @@ CIfrObj::_EMIT_PENDING_OBJ (
delete[] mObjBinBuf;
mObjBinBuf = ObjBinBuf;
}
mDelayEmit = FALSE;
}

View File

@@ -1,15 +1,15 @@
/** @file
The definition of CFormPkg's member function
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -273,7 +273,7 @@ public:
virtual ~CIfrObj(VOID);
VOID _EMIT_PENDING_OBJ (VOID);
inline VOID SetLineNo (IN UINT32 LineNo) {
mLineNo = LineNo;
}
@@ -421,7 +421,7 @@ public:
public:
CIfrQuestionHeader (
IN EFI_IFR_QUESTION_HEADER *StartAddr,
IN EFI_IFR_QUESTION_HEADER *StartAddr,
IN UINT8 Flags = EFI_IFR_QUESTION_FLAG_DEFAULT
) : CIfrStatementHeader (QH2SH(StartAddr)) {
mHeader = StartAddr;
@@ -452,7 +452,7 @@ public:
if (_FLAG_TEST_AND_CLEAR (Flags, EFI_IFR_FLAG_CALLBACK)) {
mHeader->Flags |= EFI_IFR_FLAG_CALLBACK;
}
//
// ignore NVAccessFlag
//
@@ -1055,7 +1055,7 @@ private:
public:
CIfrGet (
IN UINT32 LineNo
IN UINT32 LineNo
) : CIfrObj (EFI_IFR_GET_OP),
CIfrOpHeader (EFI_IFR_GET_OP, &(GetObjBinAddr<EFI_IFR_GET>())->Header), mGet(GetObjBinAddr<EFI_IFR_GET>()) {
SetLineNo (LineNo);
@@ -2071,8 +2071,8 @@ public:
mEqIdVList->ListLength = 0;
mEqIdVList->ValueList[0] = 0;
}
VOID UpdateIfrBuffer (
VOID UpdateIfrBuffer (
) {
_EMIT_PENDING_OBJ();
mEqIdVList = GetObjBinAddr<EFI_IFR_EQ_ID_VAL_LIST>();
@@ -2607,7 +2607,7 @@ public:
class CIfrMap : public CIfrObj, public CIfrOpHeader{
public:
CIfrMap (
IN UINT32 LineNo
IN UINT32 LineNo
) : CIfrObj (EFI_IFR_MAP_OP),
CIfrOpHeader (EFI_IFR_MAP_OP, &(GetObjBinAddr<EFI_IFR_MAP>())->Header) {
SetLineNo (LineNo);

View File

@@ -1,15 +1,15 @@
/** @file
Vfr common library functions.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -72,9 +72,9 @@ CVfrBinaryOutput::WriteEnd (
}
SConfigInfo::SConfigInfo (
IN UINT8 Type,
IN UINT16 Offset,
IN UINT32 Width,
IN UINT8 Type,
IN UINT16 Offset,
IN UINT32 Width,
IN EFI_IFR_TYPE_VALUE Value
)
{
@@ -553,7 +553,7 @@ _STR2U32 (
//
// BUG: does not handle overflow here
//
(IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
(IsHex == TRUE) ? (Value <<= 4) : (Value *= 10);
if ((IsHex == TRUE) && (c >= 'a') && (c <= 'f')) {
Value += (c - 'a' + 10);
@@ -764,7 +764,7 @@ CVfrVarDataTypeDB::GetFieldOffset (
if (Field == NULL) {
return VFR_RETURN_FATAL_ERROR;
}
//
// Framework Vfr file Array Index is from 1.
// But Uefi Vfr file Array Index is from 0.
@@ -779,7 +779,7 @@ CVfrVarDataTypeDB::GetFieldOffset (
if ((ArrayIdx != INVALID_ARRAY_INDEX) && ((Field->mArrayNum == 0) || (Field->mArrayNum <= ArrayIdx))) {
return VFR_RETURN_ERROR_ARRARY_NUM;
}
//
// Be compatible with the current usage
// If ArraryIdx is not specified, the first one is used.
@@ -983,7 +983,7 @@ CVfrVarDataTypeDB::~CVfrVarDataTypeDB (
pType->mMembers = pType->mMembers->mNext;
delete pField;
}
delete pType;
delete pType;
}
while (mPackStack != NULL) {
@@ -1505,10 +1505,10 @@ CVfrVarDataTypeDB::Dump (
fprintf (File, "\t\tstruct %s {\n", pTNode->mTypeName);
for (pFNode = pTNode->mMembers; pFNode != NULL; pFNode = pFNode->mNext) {
if (pFNode->mArrayNum > 0) {
fprintf (File, "\t\t\t+%08d[%08x] %s[%d] <%s>\n", pFNode->mOffset, pFNode->mOffset,
fprintf (File, "\t\t\t+%08d[%08x] %s[%d] <%s>\n", pFNode->mOffset, pFNode->mOffset,
pFNode->mFieldName, pFNode->mArrayNum, pFNode->mFieldType->mTypeName);
} else {
fprintf (File, "\t\t\t+%08d[%08x] %s <%s>\n", pFNode->mOffset, pFNode->mOffset,
fprintf (File, "\t\t\t+%08d[%08x] %s <%s>\n", pFNode->mOffset, pFNode->mOffset,
pFNode->mFieldName, pFNode->mFieldType->mTypeName);
}
}
@@ -1536,7 +1536,7 @@ CVfrVarDataTypeDB::ParserDB (
printf ("\t\t\t%s\t%s\n", pFNode->mFieldType->mTypeName, pFNode->mFieldName);
}
printf ("\t\t};\n");
printf ("---------------------------------------------------------------\n");
printf ("---------------------------------------------------------------\n");
}
printf ("***************************************************************\n");
}
@@ -1688,7 +1688,7 @@ CVfrDataStorage::GetFreeVarStoreId (
)
{
UINT32 Index, Mask, Offset;
//
// Assign the different ID range for the different type VarStore to support Framework Vfr
//
@@ -1770,7 +1770,7 @@ CVfrDataStorage::DeclareNameVarStoreBegin (
if (GetVarStoreId (StoreName, &TmpVarStoreId) == VFR_RETURN_SUCCESS) {
return VFR_RETURN_REDEFINED;
}
if (VarStoreId == EFI_VARSTORE_ID_INVALID) {
VarStoreId = GetFreeVarStoreId (EFI_VFR_VARSTORE_NAME);
} else {
@@ -1828,10 +1828,10 @@ CVfrDataStorage::DeclareNameVarStoreEnd (
return VFR_RETURN_SUCCESS;
}
EFI_VFR_RETURN_CODE
EFI_VFR_RETURN_CODE
CVfrDataStorage::DeclareEfiVarStore (
IN CHAR8 *StoreName,
IN EFI_GUID *Guid,
IN CHAR8 *StoreName,
IN EFI_GUID *Guid,
IN EFI_STRING_ID NameStrId,
IN UINT32 VarSize,
IN BOOLEAN Flag
@@ -1863,10 +1863,10 @@ CVfrDataStorage::DeclareEfiVarStore (
return VFR_RETURN_SUCCESS;
}
EFI_VFR_RETURN_CODE
EFI_VFR_RETURN_CODE
CVfrDataStorage::DeclareBufferVarStore (
IN CHAR8 *StoreName,
IN EFI_GUID *Guid,
IN CHAR8 *StoreName,
IN EFI_GUID *Guid,
IN CVfrVarDataTypeDB *DataTypeDB,
IN CHAR8 *TypeName,
IN EFI_VARSTORE_ID VarStoreId,
@@ -1911,7 +1911,7 @@ CVfrDataStorage::DeclareBufferVarStore (
return VFR_RETURN_SUCCESS;
}
EFI_VFR_RETURN_CODE
EFI_VFR_RETURN_CODE
CVfrDataStorage::GetVarStoreByDataType (
IN CHAR8 *DataTypeName,
OUT SVfrVarStorageNode **VarNode,
@@ -1920,7 +1920,7 @@ CVfrDataStorage::GetVarStoreByDataType (
{
SVfrVarStorageNode *pNode;
SVfrVarStorageNode *MatchNode;
//
// Framework VFR uses Data type name as varstore name, so don't need check again.
//
@@ -1950,7 +1950,7 @@ CVfrDataStorage::GetVarStoreByDataType (
}
}
}
if (MatchNode == NULL) {
return VFR_RETURN_UNDEFINED;
}
@@ -1959,7 +1959,7 @@ CVfrDataStorage::GetVarStoreByDataType (
return VFR_RETURN_SUCCESS;
}
EFI_VARSTORE_ID
EFI_VARSTORE_ID
CVfrDataStorage::CheckGuidField (
IN SVfrVarStorageNode *pNode,
IN EFI_GUID *StoreGuid,
@@ -1999,7 +1999,7 @@ CVfrDataStorage::CheckGuidField (
}
/**
Base on the input store name and guid to find the varstore id.
Base on the input store name and guid to find the varstore id.
If both name and guid are inputed, base on the name and guid to
found the varstore. If only name inputed, base on the name to
@@ -2007,10 +2007,10 @@ CVfrDataStorage::CheckGuidField (
has the same name. If only has found one varstore, return this
varstore; if more than one varstore has same name, return varstore
name redefined error. If no varstore found by varstore name, call
function GetVarStoreByDataType and use inputed varstore name as
function GetVarStoreByDataType and use inputed varstore name as
data type name to search.
**/
EFI_VFR_RETURN_CODE
EFI_VFR_RETURN_CODE
CVfrDataStorage::GetVarStoreId (
IN CHAR8 *StoreName,
OUT EFI_VARSTORE_ID *VarStoreId,
@@ -2058,14 +2058,14 @@ CVfrDataStorage::GetVarStoreId (
*VarStoreId = EFI_VARSTORE_ID_INVALID;
//
// Assume that Data strucutre name is used as StoreName, and check again.
// Assume that Data strucutre name is used as StoreName, and check again.
//
ReturnCode = GetVarStoreByDataType (StoreName, &pNode, StoreGuid);
if (pNode != NULL) {
mCurrVarStorageNode = pNode;
*VarStoreId = pNode->mVarStoreId;
}
return ReturnCode;
}
@@ -2169,7 +2169,7 @@ CVfrDataStorage::GetVarStoreGuid (
EFI_VFR_RETURN_CODE
CVfrDataStorage::GetVarStoreName (
IN EFI_VARSTORE_ID VarStoreId,
IN EFI_VARSTORE_ID VarStoreId,
OUT CHAR8 **VarStoreName
)
{
@@ -2294,7 +2294,7 @@ CVfrDataStorage::GetNameVarStoreInfo (
if (mCurrVarStorageNode == NULL) {
return VFR_RETURN_GET_NVVARSTORE_ERROR;
}
//
// Framework Vfr file Index is from 1, but Uefi Vfr file Index is from 0.
//
@@ -2312,8 +2312,8 @@ CVfrDataStorage::GetNameVarStoreInfo (
SVfrDefaultStoreNode::SVfrDefaultStoreNode (
IN EFI_IFR_DEFAULTSTORE *ObjBinAddr,
IN CHAR8 *RefName,
IN EFI_STRING_ID DefaultStoreNameId,
IN CHAR8 *RefName,
IN EFI_STRING_ID DefaultStoreNameId,
IN UINT16 DefaultId
)
{
@@ -2391,7 +2391,7 @@ CVfrDefaultStore::RegisterDefaultStore (
}
/*
* assign new reference name or new default store name id only if
* assign new reference name or new default store name id only if
* the original is invalid
*/
EFI_VFR_RETURN_CODE
@@ -2507,7 +2507,7 @@ CVfrDefaultStore::BufferVarStoreAltConfigAdd (
goto WriteError;
}
}
gCVfrBufferConfig.Close ();
return VFR_RETURN_SUCCESS;
@@ -2649,7 +2649,7 @@ EFI_VARSTORE_INFO::operator == (
)
{
if ((mVarStoreId == Info->mVarStoreId) &&
(mInfo.mVarName == Info->mInfo.mVarName) &&
(mInfo.mVarName == Info->mInfo.mVarName) &&
(mInfo.mVarOffset == Info->mInfo.mVarOffset) &&
(mVarType == Info->mVarType) &&
(mVarTotalSize == Info->mVarTotalSize) &&
@@ -2832,7 +2832,7 @@ CVfrQuestionDB::ResetInit(
// Question ID 0 is reserved.
mFreeQIdBitMap[0] = 0x80000000;
mQuestionList = NULL;
mQuestionList = NULL;
}
VOID
@@ -3242,7 +3242,7 @@ Err:
}
}
VOID
VOID
CVfrQuestionDB::RegisterRefQuestion (
IN CHAR8 *Name,
IN CHAR8 *BaseVarId,
@@ -3331,15 +3331,15 @@ CVfrQuestionDB::RegisterRefQuestion (
pNode[0]->mQuestionId = QuestionId;
pNode[1]->mQuestionId = QuestionId;
pNode[2]->mQuestionId = QuestionId;
pNode[3]->mQuestionId = QuestionId;
pNode[3]->mQuestionId = QuestionId;
pNode[0]->mQtype = QUESTION_REF;
pNode[1]->mQtype = QUESTION_REF;
pNode[2]->mQtype = QUESTION_REF;
pNode[3]->mQtype = QUESTION_REF;
pNode[3]->mQtype = QUESTION_REF;
pNode[0]->mNext = pNode[1];
pNode[1]->mNext = pNode[2];
pNode[2]->mNext = pNode[3];
pNode[3]->mNext = mQuestionList;
pNode[3]->mNext = mQuestionList;
mQuestionList = pNode[0];
gCFormPkg.DoPendingAssign (VarIdStr[0], (VOID *)&QuestionId, sizeof(EFI_QUESTION_ID));
@@ -3368,15 +3368,15 @@ CVfrQuestionDB::UpdateQuestionId (
)
{
SVfrQuestionNode *pNode = NULL;
if (QId == NewQId) {
// don't update
return VFR_RETURN_SUCCESS;
}
//
// For Framework Vfr, don't check question ID conflict.
//
//
if (!VfrCompatibleMode && ChekQuestionIdFree (NewQId) == FALSE) {
return VFR_RETURN_REDEFINED;
}
@@ -3432,7 +3432,7 @@ CVfrQuestionDB::GetQuestionId (
if (strcmp (pNode->mVarIdStr, VarIdStr) != 0) {
continue;
}
}
}
QuestionId = pNode->mQuestionId;
BitMask = pNode->mBitMask;
@@ -3499,7 +3499,7 @@ CVfrStringDB::~CVfrStringDB ()
}
VOID
VOID
CVfrStringDB::SetStringFileName(IN CHAR8 *StringFileName)
{
UINT32 FileLen = 0;
@@ -3524,7 +3524,7 @@ CVfrStringDB::SetStringFileName(IN CHAR8 *StringFileName)
/**
Returns TRUE or FALSE whether SupportedLanguages contains the best matching language
Returns TRUE or FALSE whether SupportedLanguages contains the best matching language
from a set of supported languages.
@param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that
@@ -3587,13 +3587,13 @@ CVfrStringDB::GetBestLanguage (
}
//
// Trim Language from the right to the next '-' character
// Trim Language from the right to the next '-' character
//
for (LanguageLength--; LanguageLength > 0 && Language[LanguageLength] != '-'; LanguageLength--);
}
//
// No matches were found
// No matches were found
//
return FALSE;
}
@@ -3617,7 +3617,7 @@ CVfrStringDB::GetVarStoreNameFormStringId (
CHAR8 LineBuf[EFI_IFR_MAX_LENGTH];
UINT8 BlockType;
EFI_HII_STRING_PACKAGE_HDR *PkgHeader;
if (mStringFileName == NULL) {
return NULL;
}

View File

@@ -1,15 +1,15 @@
/** @file
Vfr common library functions.
Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -229,7 +229,7 @@ public:
VOID Dump(IN FILE *);
//
// First the declared
// First the declared
//
CHAR8 *mFirstNewDataTypeName;
#ifdef CVFR_VARDATATYPEDB_DEBUG
@@ -270,7 +270,7 @@ struct SVfrVarStorageNode {
SVfrDataType *mDataType;
// NameValue Storage
struct {
struct {
EFI_STRING_ID *mNameTable;
UINT32 mTableSize;
} mNameSpace;
@@ -333,15 +333,15 @@ private:
BOOLEAN ChekVarStoreIdFree (IN EFI_VARSTORE_ID);
VOID MarkVarStoreIdUsed (IN EFI_VARSTORE_ID);
VOID MarkVarStoreIdUnused (IN EFI_VARSTORE_ID);
EFI_VARSTORE_ID CheckGuidField (IN SVfrVarStorageNode *,
IN EFI_GUID *,
IN BOOLEAN *,
EFI_VARSTORE_ID CheckGuidField (IN SVfrVarStorageNode *,
IN EFI_GUID *,
IN BOOLEAN *,
OUT EFI_VFR_RETURN_CODE *);
public:
CVfrDataStorage ();
~CVfrDataStorage ();
SVfrVarStorageNode * GetBufferVarStoreList () {
return mBufferVarStoreList;
}
@@ -422,13 +422,13 @@ public:
VOID RegisterNewDateQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterOldTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterNewTimeQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterRefQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
VOID RegisterRefQuestion (IN CHAR8 *, IN CHAR8 *, IN OUT EFI_QUESTION_ID &);
EFI_VFR_RETURN_CODE UpdateQuestionId (IN EFI_QUESTION_ID, IN EFI_QUESTION_ID);
VOID GetQuestionId (IN CHAR8 *, IN CHAR8 *, OUT EFI_QUESTION_ID &, OUT UINT32 &, OUT EFI_QUESION_TYPE *QType = NULL);
EFI_VFR_RETURN_CODE FindQuestion (IN EFI_QUESTION_ID);
EFI_VFR_RETURN_CODE FindQuestion (IN CHAR8 *);
VOID PrintAllQuestion (IN VOID);
VOID ResetInit (IN VOID);
VOID ResetInit (IN VOID);
VOID SetCompatibleMode (IN BOOLEAN Mode) {
VfrCompatibleMode = Mode;
@@ -523,7 +523,7 @@ private:
UINT32 GetUnicodeStringTextSize (
IN UINT8 *StringSrc
);
BOOLEAN GetBestLanguage (
IN CONST CHAR8 *SupportedLanguages,
IN CHAR8 *Language