]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
1. Use MemoryAllocationLib to replace boot services memory services functions in...
[mirror_edk2.git] / EdkModulePkg / Universal / UserInterface / SetupBrowser / Dxe / Boolean.c
index 122da065a9723501f75c54376489d1c9a5ccef20..138725d7be7be3af47f1e28a540ab097f26d8992 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. 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
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2007, Intel Corporation\r
+All rights reserved. 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
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
@@ -49,7 +49,7 @@ Arguments:
 \r
 Returns:\r
 \r
-  NONE \r
+  NONE\r
 \r
 --*/\r
 {\r
@@ -76,13 +76,14 @@ Returns:
     //\r
     // Free The Old Stack\r
     //\r
-    gBS->FreePool (mBooleanEvaluationStack);\r
+    FreePool (mBooleanEvaluationStack);\r
   }\r
 \r
   mBooleanEvaluationStack     = NewStack;\r
   mBooleanEvaluationStackEnd  = NewStack + StackSizeInBoolean;\r
 }\r
 \r
+STATIC\r
 VOID\r
 InitializeBooleanEvaluator (\r
   VOID\r
@@ -95,11 +96,11 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  NONE \r
+  NONE\r
 \r
 Returns:\r
 \r
-  NONE \r
+  NONE\r
 \r
 --*/\r
 {\r
@@ -176,6 +177,7 @@ Returns:
   return ReturnValue;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 GrowBooleanExpression (\r
   IN      EFI_INCONSISTENCY_DATA  *InconsistentTags,\r
@@ -199,7 +201,7 @@ GrowBooleanExpression (
     //\r
     // Free The Old buffer\r
     //\r
-    gBS->FreePool (*BooleanExpression);\r
+    FreePool (*BooleanExpression);\r
   } else {\r
     //\r
     // Copy data into new buffer\r
@@ -212,6 +214,7 @@ GrowBooleanExpression (
   return EFI_SUCCESS;\r
 }\r
 \r
+STATIC\r
 VOID\r
 CreateBooleanExpression (\r
   IN  EFI_FILE_FORM_TAGS    *FileFormTags,\r
@@ -311,6 +314,7 @@ NextEntry:
   GrowBooleanExpression (&FakeInconsistentTags, BooleanExpression, BooleanExpressionLength);\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 BooleanVariableWorker (\r
   IN     CHAR16                   *VariableName,\r
@@ -369,6 +373,7 @@ Returns:
   return Status;\r
 }\r
 \r
+STATIC\r
 UINT8\r
 PredicateIfrType (\r
   IN  EFI_INCONSISTENCY_DATA      *Iterator\r
@@ -416,6 +421,7 @@ Returns:
   return 0x2;\r
 }\r
 \r
+STATIC\r
 VOID\r
 PostOrderEvaluate (\r
   IN      EFI_FILE_FORM_TAGS          *FileFormTags,\r
@@ -478,7 +484,7 @@ Returns:
 \r
     Width = (*PIterator)->Width;\r
 \r
-    // \r
+    //\r
     //  Because INVALID_OFFSET_VALUE - 1 is reserved for TRUE or FALSE, omit them.\r
     //\r
     if ((*PIterator)->QuestionId1 != INVALID_OFFSET_VALUE &&\r
@@ -492,7 +498,7 @@ Returns:
           MapValue = (UINT8) *MapBuffer;\r
         }\r
 \r
-        gBS->FreePool (MapBuffer);\r
+        FreePool (MapBuffer);\r
       }\r
 \r
       if (MapBuffer2 != NULL) {\r
@@ -502,16 +508,16 @@ Returns:
           MapValue2 = (UINT8) *MapBuffer2;\r
         }\r
 \r
-        gBS->FreePool (MapBuffer2);\r
+        FreePool (MapBuffer2);\r
       }\r
     }\r
 \r
     switch ((*PIterator)->Operand) {\r
     case EFI_IFR_EQ_VAR_VAL_OP:\r
       UnicodeValueToString (\r
-        VariableName, \r
-        FALSE, \r
-        (UINTN) (*PIterator)->QuestionId1, \r
+        VariableName,\r
+        FALSE,\r
+        (UINTN) (*PIterator)->QuestionId1,\r
         (sizeof (VariableName) / sizeof (VariableName[0])) - 1\r
         );\r
 \r
@@ -616,7 +622,7 @@ Returns:
       break;\r
     case EFI_IFR_NOT_OP:\r
       Operator  = PopBool (StackPtr);\r
-      PushBool (StackPtr, !Operator);\r
+      PushBool (StackPtr, (BOOLEAN) (!Operator));\r
       break;\r
 \r
     case EFI_IFR_SUPPRESS_IF_OP:\r
@@ -721,7 +727,7 @@ Returns:
       return Operator;\r
     }\r
 \r
-    // \r
+    //\r
     //  Because INVALID_OFFSET_VALUE - 1 is reserved for TRUE or FALSE, omit them.\r
     //\r
     if (Iterator->QuestionId1 != INVALID_OFFSET_VALUE &&\r
@@ -735,7 +741,7 @@ Returns:
           MapValue = (UINT8) *MapBuffer;\r
         }\r
 \r
-        gBS->FreePool (MapBuffer);\r
+        FreePool (MapBuffer);\r
       }\r
 \r
       if (MapBuffer2 != NULL) {\r
@@ -745,7 +751,7 @@ Returns:
           MapValue2 = (UINT8) *MapBuffer2;\r
         }\r
 \r
-        gBS->FreePool (MapBuffer2);\r
+        FreePool (MapBuffer2);\r
       }\r
     }\r
 \r
@@ -808,9 +814,9 @@ Returns:
       }\r
 \r
       UnicodeValueToString (\r
-        VariableName, \r
-        FALSE, \r
-        (UINTN) Iterator->QuestionId1, \r
+        VariableName,\r
+        FALSE,\r
+        (UINTN) Iterator->QuestionId1,\r
         (sizeof (VariableName) / sizeof (VariableName[0])) - 1\r
         );\r
 \r
@@ -907,7 +913,7 @@ Returns:
             MapValue = (UINT8) *MapBuffer;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer);\r
+          FreePool (MapBuffer);\r
         }\r
 \r
         if (MapBuffer2 != NULL) {\r
@@ -917,7 +923,7 @@ Returns:
             MapValue2 = (UINT8) *MapBuffer2;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer2);\r
+          FreePool (MapBuffer2);\r
         }\r
       }\r
 \r
@@ -941,9 +947,9 @@ Returns:
       //\r
       case EFI_IFR_EQ_VAR_VAL_OP:\r
         UnicodeValueToString (\r
-          VariableName, \r
-          FALSE, \r
-          (UINTN) Iterator->QuestionId1, \r
+          VariableName,\r
+          FALSE,\r
+          (UINTN) Iterator->QuestionId1,\r
           (sizeof (VariableName) / sizeof (VariableName[0])) - 1\r
           );\r
 \r
@@ -1043,7 +1049,7 @@ Returns:
             MapValue = (UINT8) *MapBuffer;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer);\r
+          FreePool (MapBuffer);\r
         }\r
 \r
         if (MapBuffer2 != NULL) {\r
@@ -1053,7 +1059,7 @@ Returns:
             MapValue2 = (UINT8) *MapBuffer2;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer2);\r
+          FreePool (MapBuffer2);\r
         }\r
       }\r
 \r
@@ -1077,9 +1083,9 @@ Returns:
       //\r
       case EFI_IFR_EQ_VAR_VAL_OP:\r
         UnicodeValueToString (\r
-          VariableName, \r
-          FALSE, \r
-          (UINTN) Iterator->QuestionId1, \r
+          VariableName,\r
+          FALSE,\r
+          (UINTN) Iterator->QuestionId1,\r
           (sizeof (VariableName) / sizeof (VariableName[0])) - 1\r
           );\r
 \r
@@ -1199,7 +1205,7 @@ Returns:
             MapValue = (UINT8) *MapBuffer;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer);\r
+          FreePool (MapBuffer);\r
         }\r
 \r
         if (MapBuffer2 != NULL) {\r
@@ -1209,7 +1215,7 @@ Returns:
             MapValue2 = (UINT8) *MapBuffer2;\r
           }\r
 \r
-          gBS->FreePool (MapBuffer2);\r
+          FreePool (MapBuffer2);\r
         }\r
       }\r
 \r
@@ -1225,9 +1231,9 @@ Returns:
       //\r
       case EFI_IFR_EQ_VAR_VAL_OP:\r
         UnicodeValueToString (\r
-          VariableName, \r
-          FALSE, \r
-          (UINTN) Iterator->QuestionId1, \r
+          VariableName,\r
+          FALSE,\r
+          (UINTN) Iterator->QuestionId1,\r
           (sizeof (VariableName) / sizeof (VariableName[0])) - 1\r
           );\r
 \r
@@ -1289,7 +1295,7 @@ Returns:
         PushBool (&StackPtr, Operator);\r
       }\r
       break;\r
-    \r
+\r
     case EFI_IFR_TRUE_OP:\r
       //\r
       // To check whether Ifr is legacy. Once every boolean expression.\r
@@ -1350,11 +1356,12 @@ Returns:
         return Operator;\r
       }\r
 \r
-      return FALSE;\r
+      goto Done;\r
     }\r
 \r
     Iterator++;\r
   }\r
 \r
+Done:\r
   return FALSE;\r
 }\r