]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrError.cpp
BaseTools: resolve initialization order errors in VfrFormPkg.h
[mirror_edk2.git] / BaseTools / Source / C / VfrCompile / VfrError.cpp
index b5167e515d9fd3219e7811ac32743b7f82d022da..2366fac5a760bb6565cd72b96f4effb91d3b466e 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler error handler.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2017, 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
@@ -46,6 +46,7 @@ static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
   { VFR_RETURN_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},\r
   { VFR_RETURN_CONSTANT_ONLY, ": only constant is allowed in the expression"},\r
   { VFR_RETURN_VARSTORE_NAME_REDEFINED_ERROR, ": Varstore name is defined by more than one varstores, it can't be referred as varstore, only varstore strucure name could be used."},\r
+  { VFR_RETURN_BIT_WIDTH_ERROR, ": bit width must be <= sizeof (type) * 8 and the max width can not > 32" },\r
   { VFR_RETURN_CODEUNDEFINED, ": undefined Error Code" }\r
 };\r
 \r
@@ -53,6 +54,7 @@ static SVFR_WARNING_HANDLE VFR_WARNING_HANDLE_TABLE [] = {
   { VFR_WARNING_DEFAULT_VALUE_REDEFINED, ": default value re-defined with different value"},\r
   { VFR_WARNING_STRING_TO_UINT_OVERFLOW, ": String to UINT* Overflow"},\r
   { VFR_WARNING_ACTION_WITH_TEXT_TWO, ": Action opcode should not have TextTwo part"},\r
+  { VFR_WARNING_OBSOLETED_FRAMEWORK_OPCODE, ": Not recommend to use obsoleted framework opcode"},\r
   { VFR_WARNING_CODEUNDEFINED, ": undefined Warning Code" }\r
 };\r
 \r
@@ -65,6 +67,7 @@ CVfrErrorHandle::CVfrErrorHandle (
   mScopeRecordListTail   = NULL;\r
   mVfrErrorHandleTable   = VFR_ERROR_HANDLE_TABLE;\r
   mVfrWarningHandleTable = VFR_WARNING_HANDLE_TABLE;\r
+  mWarningAsError        = FALSE;\r
 }\r
 \r
 CVfrErrorHandle::~CVfrErrorHandle (\r
@@ -144,7 +147,7 @@ SVfrFileScopeRecord::~SVfrFileScopeRecord (
   )\r
 {\r
   if (mFileName != NULL) {\r
-    delete mFileName;\r
+    delete[] mFileName;\r
   }\r
 }\r
 \r
@@ -279,7 +282,7 @@ CVfrErrorHandle::HandleWarning (
   GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
 \r
   if (mWarningAsError) {\r
-    Error (FileName, FileLine, 0x2220, "warning treated as error", NULL);\r
+    Error (FileName, FileLine, 0x2220, (CHAR8 *) "warning treated as error", NULL);\r
   }\r
 \r
   for (Index = 0; mVfrWarningHandleTable[Index].mWarningCode != VFR_WARNING_CODEUNDEFINED; Index++) {\r