]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/String.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / String.c
index d5a7488a79d39ee2201560dc8146881e805451e0..aeda47430f7203c5c2f82756ad125a3a59655955 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for EFI_HII_STRING_PROTOCOL.\r
 \r
 \r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -236,7 +236,7 @@ GetStringFontInfo (
 /**\r
   Parse all string blocks to find a String block specified by StringId.\r
   If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
-  within this string package and backup its information. If LastStringId is \r
+  within this string package and backup its information. If LastStringId is\r
   specified, the string id of last string block will also be output.\r
   If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
 \r
@@ -524,7 +524,7 @@ FindStringBlock (
         // Since string package tool set FontId initially to 0 and increases it\r
         // progressively by one, StringPackage->FondId always represents an unique\r
         // and available FontId.\r
-        //        \r
+        //\r
         StringPackage->FontId++;\r
 \r
         FreePool (FontInfo);\r
@@ -574,7 +574,7 @@ FindStringBlock (
         *StartStringId  = CurrentStringId;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Get last string ID\r
   //\r
@@ -681,7 +681,7 @@ GetStringWorker (
   }\r
 \r
   //\r
-  // Get the string font. The FontId 0 is the default font for those string blocks which \r
+  // Get the string font. The FontId 0 is the default font for those string blocks which\r
   // do not specify a font identifier. If default font is not specified, return NULL.\r
   //\r
   if (StringFontInfo != NULL) {\r
@@ -706,17 +706,17 @@ GetStringWorker (
 \r
 /**\r
   If GetStringBlock find the StringId's string is not saved in the exist string block,\r
-  this function will create the UCS2 string block to save the string; also split the \r
+  this function will create the UCS2 string block to save the string; also split the\r
   skip block into two or one skip block.\r
 \r
   This is a internal function.\r
-  \r
+\r
   @param  StringPackage           Hii string package instance.\r
   @param  StartStringId           The first id in the skip block which StringId in the block.\r
   @param  StringId                The string's id, which is unique within\r
-                                  PackageList.  \r
-  @param  BlockType               Output the block type of found string block.  \r
-  @param  StringBlockAddr         Output the block address of found string block.  \r
+                                  PackageList.\r
+  @param  BlockType               Output the block type of found string block.\r
+  @param  StringBlockAddr         Output the block address of found string block.\r
   @param  FontBlock               whether this string block has font info.\r
 \r
   @retval EFI_SUCCESS            The string font is outputted successfully.\r
@@ -735,7 +735,7 @@ InsertLackStringBlock (
 {\r
   UINT8                                *BlockPtr;\r
   UINT8                                *StringBlock;\r
-  UINT32                               SkipLen;    \r
+  UINT32                               SkipLen;\r
   UINT32                               OldBlockSize;\r
   UINT32                               NewBlockSize;\r
   UINT32                               FrontSkipNum;\r
@@ -746,7 +746,7 @@ InsertLackStringBlock (
   FrontSkipNum  = 0;\r
   SkipLen       = 0;\r
   OldStringAddr = *StringBlockAddr;\r
-  \r
+\r
   ASSERT (*BlockType == EFI_HII_SIBT_SKIP1 || *BlockType == EFI_HII_SIBT_SKIP2);\r
   //\r
   // Old skip block size.\r
@@ -757,7 +757,7 @@ InsertLackStringBlock (
   } else {\r
     SkipLen = sizeof (EFI_HII_SIBT_SKIP2_BLOCK);\r
     IdCount = *(UINT16*)(OldStringAddr + sizeof (EFI_HII_STRING_BLOCK));\r
-  } \r
+  }\r
 \r
   //\r
   // New create UCS or UCS2 block size.\r
@@ -801,7 +801,7 @@ InsertLackStringBlock (
   //\r
   // Copy old block in front of skip block.\r
   //\r
-  CopyMem (StringBlock, StringPackage->StringBlock, OldStringAddr - StringPackage->StringBlock);  \r
+  CopyMem (StringBlock, StringPackage->StringBlock, OldStringAddr - StringPackage->StringBlock);\r
   BlockPtr = StringBlock + (OldStringAddr - StringPackage->StringBlock);\r
 \r
   if (FrontSkipNum > 0) {\r
@@ -838,7 +838,7 @@ InsertLackStringBlock (
   //\r
   // Append a EFI_HII_SIBT_END block to the end.\r
   //\r
-  CopyMem (BlockPtr, OldStringAddr + SkipLen, OldBlockSize - (OldStringAddr - StringPackage->StringBlock) - SkipLen);  \r
+  CopyMem (BlockPtr, OldStringAddr + SkipLen, OldBlockSize - (OldStringAddr - StringPackage->StringBlock) - SkipLen);\r
 \r
   if (FontBlock) {\r
     *BlockType = EFI_HII_SIBT_STRING_UCS2_FONT;\r
@@ -918,9 +918,9 @@ SetStringWorker (
              &StartStringId\r
              );\r
   if (EFI_ERROR (Status) && (BlockType == EFI_HII_SIBT_SKIP1 || BlockType == EFI_HII_SIBT_SKIP2)) {\r
-    Status = InsertLackStringBlock(StringPackage, \r
-                          StartStringId, \r
-                          StringId, \r
+    Status = InsertLackStringBlock(StringPackage,\r
+                          StartStringId,\r
+                          StringId,\r
                           &BlockType,\r
                           &StringBlockAddr,\r
                           (BOOLEAN)(StringFontInfo != NULL)\r
@@ -947,11 +947,11 @@ SetStringWorker (
       return EFI_INVALID_PARAMETER;\r
     } else {\r
       Referred = ReferFontInfoLocally (\r
-                   Private, \r
-                   StringPackage, \r
-                   StringPackage->FontId, \r
-                   FALSE, \r
-                   GlobalFont, \r
+                   Private,\r
+                   StringPackage,\r
+                   StringPackage->FontId,\r
+                   FALSE,\r
+                   GlobalFont,\r
                    &LocalFont\r
                    );\r
       if (!Referred) {\r
@@ -962,7 +962,7 @@ SetStringWorker (
     // Update the FontId of the specified string block to input font info.\r
     //\r
     switch (BlockType) {\r
-    case EFI_HII_SIBT_STRING_SCSU_FONT:  \r
+    case EFI_HII_SIBT_STRING_SCSU_FONT:\r
     case EFI_HII_SIBT_STRINGS_SCSU_FONT:\r
     case EFI_HII_SIBT_STRING_UCS2_FONT:\r
     case EFI_HII_SIBT_STRINGS_UCS2_FONT:\r
@@ -973,7 +973,7 @@ SetStringWorker (
       // When modify the font info of these blocks, the block type should be updated\r
       // to contain font info thus the whole structure should be revised.\r
       // It is recommended to use tool to modify the block type not in the code.\r
-      //      \r
+      //\r
       return EFI_UNSUPPORTED;\r
     }\r
   }\r
@@ -1004,7 +1004,7 @@ SetStringWorker (
     }\r
     *BlockPtr++ = 0;\r
 \r
-    \r
+\r
     TmpSize = OldBlockSize - (StringTextPtr - StringPackage->StringBlock) - AsciiStrSize ((CHAR8 *) StringTextPtr);\r
     CopyMem (\r
       BlockPtr,\r
@@ -1107,9 +1107,9 @@ SetStringWorker (
 \r
 /**\r
   This function adds the string String to the group of strings owned by PackageList, with the\r
-  specified font information StringFontInfo and returns a new string id. \r
-  The new string identifier is guaranteed to be unique within the package list. \r
-  That new string identifier is reserved for all languages in the package list. \r
+  specified font information StringFontInfo and returns a new string id.\r
+  The new string identifier is guaranteed to be unique within the package list.\r
+  That new string identifier is reserved for all languages in the package list.\r
 \r
 \r
   @param  This                   A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
@@ -1341,7 +1341,7 @@ HiiNewString (
     // Calculate the length of the string blocks, including string block to record\r
     // printable language full name and EFI_HII_SIBT_END_BLOCK.\r
     //\r
-    Ucs2BlockSize = (UINT32) (StrSize ((CHAR16 *) LanguageName) + \r
+    Ucs2BlockSize = (UINT32) (StrSize ((CHAR16 *) LanguageName) +\r
                               (*StringId - 1) * sizeof (EFI_HII_SIBT_STRING_UCS2_BLOCK) - sizeof (CHAR16));\r
 \r
     BlockSize     = Ucs2BlockSize + sizeof (EFI_HII_SIBT_END_BLOCK);\r
@@ -1519,7 +1519,7 @@ HiiNewString (
       PackageListNode->PackageListHdr.PackageLength += FontBlockSize + Ucs2FontBlockSize;\r
 \r
       //\r
-      // Increase the FontId to make it unique since we already add \r
+      // Increase the FontId to make it unique since we already add\r
       // a EFI_HII_SIBT_FONT block to this string package.\r
       //\r
       StringPackage->FontId++;\r
@@ -1671,16 +1671,16 @@ HiiGetString (
       //\r
       // Second search: to match the StringId in other available languages if exist.\r
       //\r
-      for (Link =  PackageListNode->StringPkgHdr.ForwardLink; \r
+      for (Link =  PackageListNode->StringPkgHdr.ForwardLink;\r
            Link != &PackageListNode->StringPkgHdr;\r
            Link =  Link->ForwardLink\r
           ) {\r
-      StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);      \r
+      StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);\r
       Status = GetStringWorker (Private, StringPackage, StringId, NULL, NULL, NULL);\r
       if (!EFI_ERROR (Status)) {\r
         return EFI_INVALID_LANGUAGE;\r
       }\r
-    }    \r
+    }\r
   }\r
 \r
   return EFI_NOT_FOUND;\r
@@ -1940,7 +1940,7 @@ HiiGetSecondaryLanguages (
 \r
   Private    = HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  PackageListNode = NULL;     \r
+  PackageListNode = NULL;\r
   for (Link = Private->DatabaseList.ForwardLink; Link != &Private->DatabaseList; Link = Link->ForwardLink) {\r
     DatabaseRecord  = CR (Link, HII_DATABASE_RECORD, DatabaseEntry, HII_DATABASE_RECORD_SIGNATURE);\r
     if (DatabaseRecord->Handle == PackageList) {\r
@@ -1951,7 +1951,7 @@ HiiGetSecondaryLanguages (
     if (PackageListNode == NULL) {\r
       return EFI_NOT_FOUND;\r
     }\r
-      \r
+\r
     Languages  = NULL;\r
     ResultSize = 0;\r
     for (Link1 = PackageListNode->StringPkgHdr.ForwardLink;\r