]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/GenFw.c
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / GenFw / GenFw.c
index 00c9ff35b1c3728a6de693dc974d6de7975edd65..7976bec60a4b3c04e01e3521c7a27a60f69b6510 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Converts a pe32+ image to an FW, Te image type, or other specific image.\r
 \r
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
@@ -169,7 +169,7 @@ Returns:
   //\r
   // Copyright declaration\r
   //\r
-  fprintf (stdout, "Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -242,7 +242,7 @@ Returns:
                         If it is combined with other action options, the later\n\\r
                         input action option will override the previous one.\n");\r
   fprintf (stdout, "  -a NUM, --align NUM   NUM is one HEX or DEC format alignment value.\n\\r
-                        This option is only used together with -j option.\n");  \r
+                        This option is only used together with -j option.\n");\r
   fprintf (stdout, "  -p NUM, --pad NUM     NUM is one HEX or DEC format padding value.\n\\r
                         This option is only used together with -j option.\n");\r
   fprintf (stdout, "  --keepexceptiontable  Don't clear exception table.\n\\r
@@ -490,7 +490,7 @@ SetHiiResourceHeader (
         }\r
 \r
         //\r
-        // Now it ought to be resource Data and update its OffsetToData value \r
+        // Now it ought to be resource Data and update its OffsetToData value\r
         //\r
         if (!ResourceDirectoryEntry->u2.s.DataIsDirectory) {\r
           ResourceDataEntry = (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (HiiBinData + ResourceDirectoryEntry->u2.OffsetToData);\r
@@ -501,7 +501,7 @@ SetHiiResourceHeader (
     }\r
     ResourceDirectoryEntry++;\r
   }\r
-  \r
+\r
   return;\r
 }\r
 \r
@@ -530,7 +530,7 @@ GetPeCoffHeader (
       return NULL;\r
     }\r
   }\r
-  \r
+\r
   return PeHdr;\r
 }\r
 \r
@@ -555,7 +555,7 @@ PeCoffConvertImageToXip (
   if (PeHdr == NULL) {\r
     return;\r
   }\r
-  \r
+\r
   if (PeHdr->Pe32.OptionalHeader.SectionAlignment != PeHdr->Pe32.OptionalHeader.FileAlignment) {\r
     //\r
     // The only reason to expand zero fill sections is to make them compatible with XIP images.\r
@@ -672,7 +672,7 @@ PeCoffConvertImageToXip (
 \r
 UINT8 *\r
 CreateHiiResouceSectionHeader (\r
-  UINT32 *pSectionHeaderSize, \r
+  UINT32 *pSectionHeaderSize,\r
   UINT32 HiiDataSize\r
   )\r
 /*++\r
@@ -705,8 +705,8 @@ Returns:
   // Calculate the total size for the resource header (include Type, Name and Language)\r
   // then allocate memory for the resource header.\r
   //\r
-  HiiSectionHeaderSize = 3 * (sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY)) \r
-                          + 3 * (sizeof (UINT16) + 3 * sizeof (CHAR16)) \r
+  HiiSectionHeaderSize = 3 * (sizeof (EFI_IMAGE_RESOURCE_DIRECTORY) + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY))\r
+                          + 3 * (sizeof (UINT16) + 3 * sizeof (CHAR16))\r
                           + sizeof (EFI_IMAGE_RESOURCE_DATA_ENTRY);\r
   HiiSectionHeader = malloc (HiiSectionHeaderSize);\r
   if (HiiSectionHeader == NULL) {\r
@@ -717,7 +717,7 @@ Returns:
 \r
   HiiSectionOffset = 0;\r
   //\r
-  // Create Type entry \r
+  // Create Type entry\r
   //\r
   ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (HiiSectionHeader + HiiSectionOffset);\r
   HiiSectionOffset += sizeof (EFI_IMAGE_RESOURCE_DIRECTORY);\r
@@ -877,7 +877,7 @@ Returns:
 \r
   if (ImageContext.RelocationsStripped) {\r
     Error (NULL, 0, 3000, "Invalid", "The input PeImage %s has no relocation to be fixed up", FileName);\r
-    return Status;    \r
+    return Status;\r
   }\r
 \r
   //\r
@@ -890,8 +890,8 @@ Returns:
   //\r
   SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (\r
     (UINTN) ImgHdr +\r
-    sizeof (UINT32) + \r
-    sizeof (EFI_IMAGE_FILE_HEADER) +  \r
+    sizeof (UINT32) +\r
+    sizeof (EFI_IMAGE_FILE_HEADER) +\r
     ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader\r
     );\r
 \r
@@ -957,7 +957,7 @@ Returns:
 \r
   if (ImageContext.RelocationsStripped) {\r
     Error (NULL, 0, 3000, "Invalid", "The input PeImage %s has no relocation to be fixed up", FileName);\r
-    return Status;    \r
+    return Status;\r
   }\r
 \r
   //\r
@@ -996,15 +996,15 @@ Returns:
   //\r
   SectionHeader = (EFI_IMAGE_SECTION_HEADER *) (\r
     (UINTN) ImgHdr +\r
-    sizeof (UINT32) + \r
-    sizeof (EFI_IMAGE_FILE_HEADER) +  \r
+    sizeof (UINT32) +\r
+    sizeof (EFI_IMAGE_FILE_HEADER) +\r
     ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader\r
     );\r
 \r
   for (Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index ++, SectionHeader ++) {\r
     CopyMem (\r
-      FileBuffer + SectionHeader->PointerToRawData, \r
-      (VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress), \r
+      FileBuffer + SectionHeader->PointerToRawData,\r
+      (VOID*) (UINTN) (ImageContext.ImageAddress + SectionHeader->VirtualAddress),\r
       SectionHeader->SizeOfRawData\r
       );\r
   }\r
@@ -2186,7 +2186,7 @@ Returns:
         goto Finish;\r
       }\r
     }\r
-    \r
+\r
     if (NegativeAddr) {\r
       //\r
       // Set Base Address to a negative value.\r
@@ -2534,7 +2534,7 @@ Returns:
     (TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress == 0) && \\r
     (TEImageHeader.DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size == 0)) {\r
       //\r
-      // PeImage can be loaded into memory, but it has no relocation section. \r
+      // PeImage can be loaded into memory, but it has no relocation section.\r
       // Fix TeImage Header to set VA of relocation data directory to not zero, the size is still zero.\r
       //\r
       if (Optional32 != NULL) {\r
@@ -2716,7 +2716,7 @@ Finish:
       }\r
     }\r
   }\r
-  \r
+\r
   if (InputFileBuffer != NULL) {\r
     free (InputFileBuffer);\r
   }\r
@@ -2735,7 +2735,7 @@ Finish:
     ReportFileName = (CHAR8 *) malloc (FileLen + 1);\r
     if (ReportFileName != NULL) {\r
       strcpy (ReportFileName, OutImageName);\r
-      strcpy (ReportFileName + (FileLen - 4), ".txt"); \r
+      strcpy (ReportFileName + (FileLen - 4), ".txt");\r
       ReportFile = fopen (LongFilePath (ReportFileName), "w+");\r
       if (ReportFile != NULL) {\r
         fprintf (ReportFile, "MODULE_SIZE = %u\n", (unsigned) mImageSize);\r
@@ -2789,7 +2789,7 @@ Returns:
   EFI_IMAGE_SECTION_HEADER        *SectionHeader;\r
   EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;\r
   EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY *RsdsEntry;\r
-  UINT32                          *NewTimeStamp;  \r
+  UINT32                          *NewTimeStamp;\r
 \r
   //\r
   // Init variable.\r
@@ -2968,7 +2968,7 @@ Returns:
   EFI_IMAGE_OPTIONAL_HEADER64     *Optional64Hdr;\r
   EFI_IMAGE_SECTION_HEADER        *SectionHeader;\r
   UINT32                          *NewTimeStamp;\r
-  \r
+\r
   //\r
   // Init variable.\r
   //\r