]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFfs/GenFfs.c
Sync basetools' source and binary files with r1707 of the basetools project.
[mirror_edk2.git] / BaseTools / Source / C / GenFfs / GenFfs.c
index e8cd09e947600a8a7c08b0246e7f1ad5267df1e5..12a3b2f18cb2eeb7f5b4856832346b64f33333a6 100644 (file)
@@ -322,7 +322,7 @@ Returns:
     FileSize = ftell (InFile);\r
     fseek (InFile, 0, SEEK_SET);\r
     DebugMsg (NULL, 0, 9, "Input section files", \r
-              "the input section name is %s and the size is %d bytes", InputFileName[Index], FileSize); \r
+              "the input section name is %s and the size is %u bytes", InputFileName[Index], (unsigned) FileSize); \r
 \r
     //\r
     // Check this section is Te/Pe section, and Calculate the numbers of Te/Pe section.\r
@@ -374,7 +374,7 @@ Returns:
         SectHeader->Size[2] = (UINT8) ((Offset & 0xff0000) >> 16);\r
       }\r
       DebugMsg (NULL, 0, 9, "Pad raw section for section data alignment", \r
-                "Pad Raw section size is %d", Offset);\r
+                "Pad Raw section size is %u", (unsigned) Offset);\r
 \r
       Size = Size + Offset;\r
     }\r
@@ -409,7 +409,7 @@ Returns:
 \r
 int\r
 main (\r
-  INT32 argc,\r
+  int   argc,\r
   CHAR8 *argv[]\r
   )\r
 /*++\r
@@ -679,7 +679,7 @@ Returns:
         goto Finish;\r
       }\r
       if (LogLevel > 9) {\r
-        Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", LogLevel);\r
+        Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);\r
         goto Finish;\r
       }\r
       SetPrintLevel (LogLevel);\r
@@ -719,7 +719,7 @@ Returns:
   VerboseMsg ("Fv File type is %s", mFfsFileType [FfsFiletype]);\r
   VerboseMsg ("Output file name is %s", OutputFileName);\r
   VerboseMsg ("FFS File Guid is %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", \r
-                FileGuid.Data1,\r
+                (unsigned) FileGuid.Data1,\r
                 FileGuid.Data2,\r
                 FileGuid.Data3,\r
                 FileGuid.Data4[0],\r
@@ -744,7 +744,7 @@ Returns:
       //\r
       InputFileAlign[Index] = 1;\r
     }\r
-    VerboseMsg ("the %dth input section name is %s and section alignment is %d", Index, InputFileName[Index], InputFileAlign[Index]);\r
+    VerboseMsg ("the %dth input section name is %s and section alignment is %u", Index, InputFileName[Index], (unsigned) InputFileAlign[Index]);\r
   }\r
   \r
   //\r
@@ -763,7 +763,7 @@ Returns:
   if ((FfsFiletype == EFI_FV_FILETYPE_SECURITY_CORE || \r
       FfsFiletype == EFI_FV_FILETYPE_PEI_CORE ||\r
       FfsFiletype == EFI_FV_FILETYPE_DXE_CORE) && (PeSectionNum != 1)) {\r
-    Error (NULL, 0, 2000, "Invalid parameter", "Fv File type %s must have one and only one Pe or Te section, but %d Pe/Te section are input", mFfsFileType [FfsFiletype], PeSectionNum);\r
+    Error (NULL, 0, 2000, "Invalid parameter", "Fv File type %s must have one and only one Pe or Te section, but %u Pe/Te section are input", mFfsFileType [FfsFiletype], PeSectionNum);\r
     goto Finish;\r
   }\r
   \r
@@ -810,7 +810,7 @@ Returns:
   //\r
   // Update FFS Alignment based on the max alignment required by input section files \r
   //\r
-  VerboseMsg ("the max alignment of all input sections is %d", MaxAlignment); \r
+  VerboseMsg ("the max alignment of all input sections is %u", (unsigned) MaxAlignment); \r
   for (Index = 0; Index < sizeof (mFfsValidAlign) / sizeof (UINT32) - 1; Index ++) {\r
     if ((MaxAlignment > mFfsValidAlign [Index]) && (MaxAlignment <= mFfsValidAlign [Index + 1])) {\r
       break;\r
@@ -819,14 +819,14 @@ Returns:
   if (FfsAlign < Index) {\r
     FfsAlign = Index;\r
   }\r
-  VerboseMsg ("the alignment of the genreated FFS file is %d", mFfsValidAlign [FfsAlign + 1]);  \r
-  FfsFileHeader.Attributes = FfsAttrib | (FfsAlign << 3);\r
+  VerboseMsg ("the alignment of the generated FFS file is %u", (unsigned) mFfsValidAlign [FfsAlign + 1]);  \r
+  FfsFileHeader.Attributes = (EFI_FFS_FILE_ATTRIBUTES) (FfsAttrib | (FfsAlign << 3));\r
   \r
   //\r
   // Now FileSize includes the EFI_FFS_FILE_HEADER\r
   //\r
   FileSize += sizeof (EFI_FFS_FILE_HEADER);\r
-  VerboseMsg ("the size of the genreated FFS file is %d bytes", FileSize);\r
+  VerboseMsg ("the size of the generated FFS file is %u bytes", (unsigned) FileSize);\r
   FfsFileHeader.Size[0]  = (UINT8) (FileSize & 0xFF);\r
   FfsFileHeader.Size[1]  = (UINT8) ((FileSize & 0xFF00) >> 8);\r
   FfsFileHeader.Size[2]  = (UINT8) ((FileSize & 0xFF0000) >> 16);\r