]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/SimpleFileParsing.c
Sync tool code to BuildTools project r1783.
[mirror_edk2.git] / BaseTools / Source / C / Common / SimpleFileParsing.c
index 52ec1291933c4cedc39adaf84cbe567893ec5f4d..68cdc630c153e05ad747e01242a66389258021c9 100644 (file)
@@ -328,7 +328,7 @@ Notes:
   }\r
 \r
   if ((Len = t_strcmp (mGlobals.SourceFile.FileBufferPtr, Str)) > 0) {\r
-    if (isalnum (mGlobals.SourceFile.FileBufferPtr[Len])) {\r
+    if (isalnum ((int)mGlobals.SourceFile.FileBufferPtr[Len])) {\r
       return FALSE;\r
     }\r
 \r
@@ -536,33 +536,33 @@ Returns:
 \r
 --*/\r
 {\r
-  UINT32 Val;\r
+  unsigned Val;\r
 \r
   SkipWhiteSpace (&mGlobals.SourceFile);\r
   if (EndOfFile (&mGlobals.SourceFile)) {\r
     return FALSE;\r
   }\r
 \r
-  if (isdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+  if (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
     //\r
     // Check for hex value\r
     //\r
     if ((mGlobals.SourceFile.FileBufferPtr[0] == T_CHAR_0) && (mGlobals.SourceFile.FileBufferPtr[1] == T_CHAR_LC_X)) {\r
-      if (!isxdigit (mGlobals.SourceFile.FileBufferPtr[2])) {\r
+      if (!isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[2])) {\r
         return FALSE;\r
       }\r
 \r
       mGlobals.SourceFile.FileBufferPtr += 2;\r
       sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", &Val);\r
-      *Value = Val;\r
-      while (isxdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+      *Value = (UINT32) Val;\r
+      while (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
         mGlobals.SourceFile.FileBufferPtr++;\r
       }\r
 \r
       return TRUE;\r
     } else {\r
       *Value = atoi (mGlobals.SourceFile.FileBufferPtr);\r
-      while (isdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+      while (isdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
         mGlobals.SourceFile.FileBufferPtr++;\r
       }\r
 \r
@@ -634,7 +634,7 @@ Returns:
   // depth.\r
   //\r
   if (mGlobals.VerboseFile) {\r
-    fprintf (stdout, "%*cProcessing file '%s'\n", (INT32)NestDepth * 2, ' ', SourceFile->FileName);\r
+    fprintf (stdout, "%*cProcessing file '%s'\n", (int)NestDepth * 2, ' ', SourceFile->FileName);\r
     fprintf (stdout, "Parent source file = '%s'\n", ParentSourceFile->FileName);\r
   }\r
 \r
@@ -642,7 +642,7 @@ Returns:
   // Make sure we didn't exceed our maximum nesting depth\r
   //\r
   if (NestDepth > MAX_NEST_DEPTH) {\r
-    Error (NULL, 0, 3001, "Not Supported", "%s exceeeds max nesting depth (%d)", SourceFile->FileName, NestDepth);\r
+    Error (NULL, 0, 3001, "Not Supported", "%s exceeeds max nesting depth (%u)", SourceFile->FileName, (unsigned) NestDepth);\r
     Status = STATUS_ERROR;\r
     goto Finish;\r
   }\r
@@ -698,7 +698,7 @@ Returns:
   fseek (SourceFile->Fptr, 0, SEEK_END);\r
   SourceFile->FileSize = ftell (SourceFile->Fptr);\r
   if (mGlobals.VerboseFile) {\r
-    printf ("FileSize = %d (0x%X)\n", (INT32)SourceFile->FileSize, (UINT32)SourceFile->FileSize);\r
+    printf ("FileSize = %u (0x%X)\n", (unsigned) SourceFile->FileSize, (unsigned) SourceFile->FileSize);\r
   }\r
 \r
   fseek (SourceFile->Fptr, 0, SEEK_SET);\r
@@ -819,7 +819,7 @@ Returns:
     }\r
 \r
     printf ("'\n");\r
-    printf ("FileSize = %d (0x%X)\n", (INT32)SourceFile->FileSize, (UINT32)SourceFile->FileSize);\r
+    printf ("FileSize = %u (0x%X)\n", (unsigned)SourceFile->FileSize, (unsigned)SourceFile->FileSize);\r
     RewindFile (SourceFile);\r
   }\r
 }\r
@@ -1239,7 +1239,7 @@ GetHexChars (
   UINT32  Len;\r
   Len = 0;\r
   while (!EndOfFile (&mGlobals.SourceFile) && (BufferLen > 0)) {\r
-    if (isxdigit (mGlobals.SourceFile.FileBufferPtr[0])) {\r
+    if (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) {\r
       *Buffer = mGlobals.SourceFile.FileBufferPtr[0];\r
       Buffer++;\r
       Len++;\r
@@ -1282,7 +1282,7 @@ Returns:
 \r
 --*/\r
 {\r
-  UINT32        Value32;\r
+  unsigned      Value32;\r
   UINT32        Index;\r
   FILE_POSITION FPos;\r
   CHAR8         TempString[20];\r