]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrError.cpp
Sync BaseTools Branch (version r2149) to EDKII main trunk.
[mirror_edk2.git] / BaseTools / Source / C / VfrCompile / VfrError.cpp
index b24cc725f047274ba7f2791548b0f572f7762ef4..b0f9197e36334084fa6248900f291b1f942ade4d 100644 (file)
@@ -2,8 +2,8 @@
   \r
   VfrCompiler error handler.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2004 - 2011, 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
@@ -34,6 +34,7 @@ static SVFR_ERROR_HANDLE VFR_ERROR_HANDLE_TABLE [] = {
   { VFR_RETURN_VARSTOREID_REDEFINED, ": varstore id already defined" },\r
   { VFR_RETURN_UNDEFINED, ": undefined" },\r
   { VFR_RETURN_VAR_NOTDEFINED_BY_QUESTION, ": some variable has not defined by a question"},\r
+  { VFR_RETURN_VARSTORE_DATATYPE_REDEFINED_ERROR, ": Data Structure is defined by more than one varstores, it can't be referred as varstore, only varstore name could be used."},\r
   { VFR_RETURN_GET_EFIVARSTORE_ERROR, ": get efi varstore error"},\r
   { VFR_RETURN_EFIVARSTORE_USE_ERROR, ": can not use the efi varstore like this" },\r
   { VFR_RETURN_EFIVARSTORE_SIZE_ERROR, ": unsupport efi varstore size should be <= 8 bytes" },\r
@@ -135,7 +136,6 @@ CVfrErrorHandle::ParseFileScopeRecord (
   IN UINT32    WholeScopeLine\r
   )\r
 {\r
-  CHAR8               *FullPathName = NULL;\r
   SVfrFileScopeRecord *pNode        = NULL;\r
 \r
   if (Record == NULL) {\r
@@ -195,15 +195,19 @@ VOID
 CVfrErrorHandle::PrintMsg (\r
   IN UINT32               LineNum,\r
   IN CHAR8                *TokName,\r
-  IN CHAR8                *MsgType,\r
-  IN CHAR8                *ErrorMsg\r
+  IN CONST CHAR8          *MsgType,\r
+  IN CONST CHAR8          *ErrorMsg\r
   )\r
 {\r
   CHAR8                  *FileName = NULL;\r
   UINT32                 FileLine;\r
-\r
+  \r
+  if (strncmp ("Warning", MsgType, strlen ("Warning")) == 0) {\r
+    VerboseMsg ((CHAR8 *) ErrorMsg);\r
+    return;\r
+  }\r
   GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
-  Error (FileName, FileLine, 0x3000, TokName, "\t%s\n", ErrorMsg);\r
+  Error (FileName, FileLine, 0x3000, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) ErrorMsg);\r
 }\r
 \r
 UINT8\r
@@ -216,7 +220,7 @@ CVfrErrorHandle::HandleError (
   UINT32                 Index;\r
   CHAR8                  *FileName = NULL;\r
   UINT32                 FileLine;\r
-  CHAR8                  *ErrorMsg = NULL;\r
+  CONST CHAR8            *ErrorMsg = NULL;\r
 \r
   if (mVfrErrorHandleTable == NULL) {\r
     return 1;\r
@@ -231,7 +235,7 @@ CVfrErrorHandle::HandleError (
 \r
   if (ErrorMsg != NULL) {\r
     GetFileNameLineNum (LineNum, &FileName, &FileLine);\r
-    Error (FileName, FileLine, 0x3000, TokName, "\t%s\n", ErrorMsg);\r
+    Error (FileName, FileLine, 0x3000, TokName, (CHAR8 *) "\t%s\n", (CHAR8 *) ErrorMsg);\r
     return 1;\r
   } else {\r
     return 0;\r