]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenCrc32/GenCrc32.c
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / GenCrc32 / GenCrc32.c
index 515358794bc078fe563147052e8acbec7c432a03..369f4affa917ba52905556199a2591998c6aef8a 100644 (file)
@@ -1,14 +1,14 @@
 /** @file\r
 Calculate Crc32 value and Verify Crc32 value for input data.\r
 \r
-Copyright (c) 2007 - 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
-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) 2007 - 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
+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
 **/\r
 \r
@@ -27,7 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define CRC32_NULL              0\r
 #define CRC32_ENCODE            1\r
-#define CRC32_DECODE            2 \r
+#define CRC32_DECODE            2\r
 \r
 VOID\r
 Version (\r
@@ -76,11 +76,11 @@ Returns:
   // Summary usage\r
   //\r
   fprintf (stdout, "Usage: GenCrc32 -e|-d [options] <input_file>\n\n");\r
-  \r
+\r
   //\r
   // Copyright declaration\r
-  // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.\n\n");\r
+  //\r
+  fprintf (stdout, "Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -100,7 +100,7 @@ Returns:
   fprintf (stdout, "  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\\r
                         Output file name\n");\r
   fprintf (stdout, "  --sfo                 Reserved for future use\n");\r
-  \r
+\r
 }\r
 \r
 int\r
@@ -135,7 +135,7 @@ Returns:
   UINT32                  Crc32Value;\r
   FILE                    *InFile;\r
   FILE                    *OutFile;\r
-  \r
+\r
   //\r
   // Init local variables\r
   //\r
@@ -165,12 +165,12 @@ Returns:
 \r
   if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {\r
     Usage ();\r
-    return STATUS_SUCCESS;    \r
+    return STATUS_SUCCESS;\r
   }\r
 \r
   if (stricmp (argv[0], "--version") == 0) {\r
     Version ();\r
-    return STATUS_SUCCESS;    \r
+    return STATUS_SUCCESS;\r
   }\r
 \r
   while (argc > 0) {\r
@@ -182,21 +182,21 @@ Returns:
       OutputFileName = argv[1];\r
       argc -= 2;\r
       argv += 2;\r
-      continue; \r
+      continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-e") == 0) || (stricmp (argv[0], "--encode") == 0)) {\r
       FileAction     = CRC32_ENCODE;\r
       argc --;\r
       argv ++;\r
-      continue; \r
+      continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--decode") == 0)) {\r
       FileAction     = CRC32_DECODE;\r
       argc --;\r
       argv ++;\r
-      continue; \r
+      continue;\r
     }\r
 \r
     if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {\r
@@ -246,7 +246,7 @@ Returns:
   }\r
 \r
   VerboseMsg ("%s tool start.", UTILITY_NAME);\r
-  \r
+\r
   //\r
   // Check Input parameters\r
   //\r
@@ -258,7 +258,7 @@ Returns:
   } else if (FileAction == CRC32_DECODE) {\r
     VerboseMsg ("File will be decoded by Crc32");\r
   }\r
-  \r
+\r
   if (InputFileName == NULL) {\r
     Error (NULL, 0, 1001, "Missing option", "Input files are not specified");\r
     goto Finish;\r
@@ -272,7 +272,7 @@ Returns:
   } else {\r
     VerboseMsg ("Output file name is %s", OutputFileName);\r
   }\r
-  \r
+\r
   //\r
   // Open Input file and read file data.\r
   //\r
@@ -285,18 +285,18 @@ Returns:
   fseek (InFile, 0, SEEK_END);\r
   FileSize = ftell (InFile);\r
   fseek (InFile, 0, SEEK_SET);\r
-  \r
+\r
   FileBuffer = (UINT8 *) malloc (FileSize);\r
   if (FileBuffer == NULL) {\r
     Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated!");\r
     fclose (InFile);\r
     goto Finish;\r
   }\r
-  \r
+\r
   fread (FileBuffer, 1, FileSize, InFile);\r
   fclose (InFile);\r
   VerboseMsg ("the size of the input file is %u bytes", (unsigned) FileSize);\r
-  \r
+\r
   //\r
   // Open output file\r
   //\r
@@ -305,7 +305,7 @@ Returns:
     Error (NULL, 0, 0001, "Error opening file", OutputFileName);\r
     goto Finish;\r
   }\r
-  \r
+\r
   //\r
   // Calculate Crc32 value\r
   //\r
@@ -352,16 +352,16 @@ Finish:
   if (FileBuffer != NULL) {\r
     free (FileBuffer);\r
   }\r
-  \r
+\r
   if (OutFile != NULL) {\r
     fclose (OutFile);\r
   }\r
-  \r
+\r
   VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());\r
 \r
   return GetUtilityStatus ();\r
 }\r
 \r
-  \r
-  \r
-  \r
+\r
+\r
+\r